adp-web-components 0.0.89 → 0.0.91
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.
- package/dist/cjs/activation-icon-DEYW0itX.js +16 -0
- package/dist/cjs/cn-BHnqYtun.js +2597 -0
- package/dist/cjs/contact-us-form.cjs.entry.js +11 -22
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +287 -347
- package/dist/cjs/empty-table-icon-PdTX6gpI.js +16 -0
- package/dist/cjs/flexible-container.cjs.entry.js +131 -0
- package/dist/cjs/form-dialog_8.cjs.entry.js +44 -100
- package/dist/cjs/{get-local-language-e539cfdc.js → get-local-language-AedNCS4v.js} +375 -332
- package/dist/cjs/{index-a8de3655.js → index-BjyafrBw.js} +525 -288
- package/dist/cjs/information-table.cjs.entry.js +43 -0
- package/dist/cjs/loader.cjs.js +3 -6
- package/dist/cjs/loading-spinner.cjs.entry.js +6 -10
- package/dist/cjs/material-card-Cd0L1Get.js +43 -0
- package/dist/cjs/part-lookup.cjs.entry.js +39 -25
- package/dist/cjs/service-booking-form.cjs.entry.js +10 -21
- package/dist/cjs/shift-accordion.cjs.entry.js +29 -0
- package/dist/cjs/shift-components.cjs.js +7 -8
- package/dist/cjs/shift-slider.cjs.entry.js +70 -0
- package/dist/cjs/shift-tab-content.cjs.entry.js +42 -0
- package/dist/cjs/shift-tabs_2.cjs.entry.js +332 -0
- package/dist/cjs/{type-3d22f1fc.js → type-A-Wi_ktA.js} +50 -1
- package/dist/cjs/{type-3183db65.js → type-Dm3JBAef.js} +32 -123
- package/dist/cjs/{type-c576b922.js → type-ooYU2cCM.js} +4 -4
- package/dist/cjs/vehicle-accessories_6.cjs.entry.js +1206 -0
- package/dist/cjs/vehicle-info-layout-Dp2Po_uc.js +16 -0
- package/dist/cjs/vehicle-lookup.cjs.entry.js +62 -49
- package/dist/cjs/vin-extractor.cjs.entry.js +24 -34
- package/dist/collection/collection-manifest.json +19 -13
- package/dist/collection/components/components/card-content.js +7 -0
- package/dist/collection/components/components/flexible-container.css +1 -0
- package/dist/collection/components/components/flexible-container.js +315 -0
- package/dist/collection/components/components/information-table.css +1 -0
- package/dist/collection/components/components/information-table.js +180 -0
- package/dist/collection/components/components/loading-spinner.css +1 -1
- package/dist/collection/components/components/loading-spinner.js +4 -5
- package/dist/collection/components/components/material-card.js +34 -0
- package/dist/collection/components/{vehicle-lookup/service-history.css → components/shift-accordion.css} +1 -1
- package/dist/collection/components/components/shift-accordion.js +102 -0
- package/dist/collection/components/components/shift-slider.css +1 -0
- package/dist/collection/components/components/shift-slider.js +95 -0
- package/dist/collection/components/components/shift-tab-content.css +1 -0
- package/dist/collection/components/components/shift-tab-content.js +98 -0
- package/dist/collection/components/components/shift-tabs.css +1 -0
- package/dist/collection/components/components/shift-tabs.js +140 -0
- package/dist/collection/components/form-elements/form-dialog.css +1 -1
- package/dist/collection/components/form-elements/form-dialog.js +16 -12
- package/dist/collection/components/form-elements/form-input.css +1 -1
- package/dist/collection/components/form-elements/form-input.js +45 -29
- package/dist/collection/components/form-elements/form-select.css +1 -1
- package/dist/collection/components/form-elements/form-select.js +57 -41
- package/dist/collection/components/form-elements/form-shadow-input.css +1 -1
- package/dist/collection/components/form-elements/form-shadow-input.js +11 -9
- package/dist/collection/components/form-elements/form-structure-error.css +1 -1
- package/dist/collection/components/form-elements/form-structure-error.js +7 -5
- package/dist/collection/components/form-elements/form-structure.css +1 -1
- package/dist/collection/components/form-elements/form-structure.js +32 -16
- package/dist/collection/components/form-elements/form-submit.css +1 -1
- package/dist/collection/components/form-elements/form-submit.js +18 -10
- package/dist/collection/components/form-elements/form-text-area.css +1 -1
- package/dist/collection/components/form-elements/form-text-area.js +36 -23
- package/dist/collection/components/forms/contact-us/element-mapper.js +1 -1
- package/dist/collection/components/forms/contact-us/form.css +1 -1
- package/dist/collection/components/forms/contact-us-form.js +39 -24
- package/dist/collection/components/forms/service-booking/element-mapper.js +1 -1
- package/dist/collection/components/forms/service-booking-form.js +39 -24
- package/dist/collection/components/part-lookup/components/dead-stock-item.js +15 -0
- package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +179 -188
- package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +221 -236
- package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +194 -234
- package/dist/collection/components/part-lookup/part-lookup.css +1 -1
- package/dist/collection/components/part-lookup/part-lookup.js +152 -66
- package/dist/collection/components/vehicle-lookup/components/CardsContainer.js +5 -5
- package/dist/collection/components/vehicle-lookup/components/StatusCard.js +4 -4
- package/dist/collection/components/vehicle-lookup/components/claimable-item-popover.js +73 -0
- package/dist/collection/components/vehicle-lookup/components/claimable-item.js +27 -0
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +170 -197
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -0
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.js +826 -0
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -0
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.js +542 -0
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +171 -98
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -0
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.js +384 -0
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -0
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.js +390 -0
- package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +145 -181
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -0
- package/dist/collection/components/vehicle-lookup/{warranty-details.js → vehicle-warranty-details.js} +315 -277
- package/dist/collection/components/vin-extractor/vin-extractor.js +72 -42
- package/dist/collection/{global/lib/image-expansion.js → features/image-viewer/image-viewer-logic.js} +15 -11
- package/dist/collection/features/image-viewer/image-viewer.js +9 -0
- package/dist/collection/features/image-viewer/index.js +7 -0
- package/dist/collection/{global/lib → features/multi-lingual}/get-local-language.js +16 -10
- package/dist/collection/features/multi-lingual/index.js +7 -0
- package/dist/collection/features/multi-lingual/interface.js +1 -0
- package/dist/collection/{global/types/locale.js → features/multi-lingual/types.js} +6 -0
- package/dist/collection/features/part-lookup-components/index.js +7 -0
- package/dist/collection/features/part-lookup-components/interface.js +1 -0
- package/dist/collection/features/part-lookup-components/part-lookup-api-integration.js +84 -0
- package/dist/collection/features/part-lookup-components/types.js +1 -0
- package/dist/collection/features/vehicle-info-layout/index.js +6 -0
- package/dist/collection/features/vehicle-info-layout/interface.js +1 -0
- package/dist/collection/features/vehicle-info-layout/vehicle-info-layout.js +7 -0
- package/dist/collection/features/vehicle-lookup-component/index.js +7 -0
- package/dist/collection/features/vehicle-lookup-component/interface.js +1 -0
- package/dist/collection/features/vehicle-lookup-component/types.js +17 -0
- package/dist/collection/features/vehicle-lookup-component/vehicle-lookup-api-integration.js +87 -0
- package/dist/collection/global/assets/activation-icon.js +6 -0
- package/dist/collection/global/assets/add-icon.js +6 -0
- package/dist/collection/global/assets/alert-icon.js +6 -0
- package/dist/collection/global/assets/arrow-up-icon.js +6 -0
- package/dist/collection/global/assets/attach-icon.js +6 -0
- package/dist/collection/global/assets/check-icon.js +6 -0
- package/dist/collection/global/assets/empty-table-icon.js +6 -0
- package/dist/collection/global/assets/form-submit-svg.js +6 -0
- package/dist/collection/global/assets/print-icon.js +6 -0
- package/dist/collection/global/assets/triangle-icon.js +6 -0
- package/dist/collection/global/lib/children-with-tag.js +24 -0
- package/dist/collection/global/lib/container-has-tag.js +28 -0
- package/dist/collection/global/lib/parents-with-tag.js +22 -0
- package/dist/collection/global/lib/scroll-into-container-view.js +16 -0
- package/dist/collection/global/types/generated/part/branch-dead-stock-dto.js +1 -0
- package/dist/collection/global/types/generated/part/dead-stock-dto.js +1 -0
- package/dist/collection/global/types/generated/part/hs-code-dto.js +1 -0
- package/dist/collection/global/types/generated/part/part-lookup-dto.js +1 -0
- package/dist/collection/global/types/generated/part/part-price-dto.js +1 -0
- package/dist/collection/global/types/generated/part/price-dto.js +1 -0
- package/dist/collection/global/types/generated/part/stock-part-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/accessory-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/paint-thickness-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/paint-thickness-image-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/paint-thickness-part-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/ssc-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/ssc-labor-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/ssc-part-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-broker-sale-information.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-identifiers-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-labor-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-lookup-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-part-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-sale-information.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-service-history-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-service-item-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-service-item-group.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-specification-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-variant-info-dto.js +1 -0
- package/dist/collection/global/types/generated/vehicle-lookup/vehicle-warranty-dto.js +1 -0
- package/dist/collection/locale-mapper.js +3 -3
- package/dist/collection/locales/partLookup/manufacturer/type.js +3 -3
- package/dist/collection/locales/vehicleLookup/{dynamicClaim → claimableItems}/type.js +10 -6
- package/dist/collection/locales/vehicleLookup/warranty/type.js +1 -0
- package/dist/collection/locales/vehicleLookup/wrapper-type.js +2 -2
- package/dist/collection/templates/part-lookup/mock-data.js +99 -16
- package/dist/collection/templates/vehicle-lookup/mock-data.js +228 -191
- package/dist/collection/templates/vehicle-lookup/warranty-mock-data.js +45 -27
- package/dist/components/contact-us-form.js +1 -1
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/flexible-container.d.ts +11 -0
- package/dist/components/flexible-container.js +5 -0
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.js +1 -1
- package/dist/components/form-structure-error.js +1 -1
- package/dist/components/form-structure.js +1 -1
- package/dist/components/form-submit.js +1 -1
- package/dist/components/form-text-area.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{paint-thickness.d.ts → information-table.d.ts} +4 -4
- package/dist/components/information-table.js +5 -0
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/p-B1fdQNyr.js +5 -0
- package/dist/components/p-BK16Cn81.js +5 -0
- package/dist/components/p-BkfCVIF9.js +5 -0
- package/dist/components/p-BsHunqQT.js +5 -0
- package/dist/components/p-BwUMwWdE.js +5 -0
- package/dist/components/p-C4zpDhOi.js +5 -0
- package/dist/components/p-CHE0gMDU.js +5 -0
- package/dist/components/p-CRB_syll.js +5 -0
- package/dist/components/p-CV6-hCEd.js +5 -0
- package/dist/components/p-CYfVWbdE.js +5 -0
- package/dist/components/{p-c981ee34.js → p-CYs-Cfbz.js} +1 -1
- package/dist/components/p-Ce4X3l8Z.js +5 -0
- package/dist/components/p-CffGxxO4.js +5 -0
- package/dist/components/p-CgP_rdz5.js +5 -0
- package/dist/components/p-CmuF1zVa.js +5 -0
- package/dist/components/p-DPxUsrGL.js +5 -0
- package/dist/components/p-DSIG_p-W.js +5 -0
- package/dist/components/p-DXHFdZX_.js +5 -0
- package/dist/components/p-Dkva9a7P.js +5 -0
- package/dist/components/p-DrFf_ORZ.js +5 -0
- package/dist/components/p-DsfktPnM.js +5 -0
- package/dist/components/p-DyWp9Iox.js +5 -0
- package/dist/components/p-Fudjizxb.js +5 -0
- package/dist/components/p-P3fAKtye.js +5 -0
- package/dist/components/p-QtVWfPMe.js +5 -0
- package/dist/components/p-THNpWs_W.js +5 -0
- package/dist/components/p-gwgMa4kM.js +5 -0
- package/dist/components/p-iCYlD4i9.js +5 -0
- package/dist/components/p-kp6CyIhI.js +5 -0
- package/dist/components/p-nBbuIowK.js +5 -0
- package/dist/components/p-piZ41_ho.js +5 -0
- package/dist/components/p-qw7FLuM-.js +5 -0
- package/dist/components/p-vhsj8wEw.js +5 -0
- package/dist/components/p-zDS3r6-j.js +5 -0
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-booking-form.js +1 -1
- package/dist/components/{service-history.d.ts → shift-accordion.d.ts} +4 -4
- package/dist/components/shift-accordion.js +5 -0
- package/dist/components/{dynamic-claim.d.ts → shift-slider.d.ts} +4 -4
- package/dist/components/shift-slider.js +5 -0
- package/dist/components/{warranty-details.d.ts → shift-tab-content.d.ts} +4 -4
- package/dist/components/shift-tab-content.js +5 -0
- package/dist/components/{dynamic-redeem.d.ts → shift-tabs.d.ts} +4 -4
- package/dist/components/shift-tabs.js +5 -0
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-claimable-items.d.ts +11 -0
- package/dist/components/vehicle-claimable-items.js +5 -0
- package/dist/components/vehicle-item-claim-form.d.ts +11 -0
- package/dist/components/vehicle-item-claim-form.js +5 -0
- package/dist/components/vehicle-lookup.js +1 -1
- package/dist/components/vehicle-paint-thickness.d.ts +11 -0
- package/dist/components/vehicle-paint-thickness.js +5 -0
- package/dist/components/vehicle-service-history.d.ts +11 -0
- package/dist/components/vehicle-service-history.js +5 -0
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/vehicle-warranty-details.d.ts +11 -0
- package/dist/components/vehicle-warranty-details.js +5 -0
- package/dist/components/vin-extractor.js +1 -1
- package/dist/esm/activation-icon-7GJaxZ20.js +14 -0
- package/dist/esm/cn-BK16Cn81.js +2595 -0
- package/dist/esm/contact-us-form.entry.js +11 -20
- package/dist/esm/dead-stock-lookup_3.entry.js +287 -345
- package/dist/esm/empty-table-icon-DvQk12N9.js +14 -0
- package/dist/esm/flexible-container.entry.js +129 -0
- package/dist/esm/form-dialog_8.entry.js +44 -98
- package/dist/esm/{get-local-language-e286080a.js → get-local-language-DuHpVAu5.js} +376 -333
- package/dist/esm/{index-3a623f7c.js → index-CikEOqe0.js} +524 -268
- package/dist/esm/information-table.entry.js +41 -0
- package/dist/esm/loader.js +3 -4
- package/dist/esm/loading-spinner.entry.js +6 -8
- package/dist/esm/material-card-DiAl-884.js +40 -0
- package/dist/esm/part-lookup.entry.js +39 -23
- package/dist/esm/service-booking-form.entry.js +10 -19
- package/dist/esm/shift-accordion.entry.js +27 -0
- package/dist/esm/shift-components.js +5 -5
- package/dist/esm/shift-slider.entry.js +68 -0
- package/dist/esm/shift-tab-content.entry.js +40 -0
- package/dist/esm/shift-tabs_2.entry.js +329 -0
- package/dist/esm/{type-68307857.js → type-B6613elJ.js} +32 -123
- package/dist/esm/{type-1d1a2052.js → type-CFBDfJID.js} +5 -5
- package/dist/esm/type-CnAEgqjH.js +82 -0
- package/dist/esm/vehicle-accessories_6.entry.js +1199 -0
- package/dist/esm/vehicle-info-layout-CNGGKAia.js +14 -0
- package/dist/esm/vehicle-lookup.entry.js +62 -47
- package/dist/esm/vin-extractor.entry.js +24 -32
- package/dist/locales/errors/ru.json +10 -10
- package/dist/locales/partLookup/deadStock/ru.json +3 -3
- package/dist/locales/partLookup/distributor/ru.json +14 -14
- package/dist/locales/partLookup/manufacturer/ar.json +3 -3
- package/dist/locales/partLookup/manufacturer/en.json +3 -3
- package/dist/locales/partLookup/manufacturer/ku.json +3 -3
- package/dist/locales/partLookup/manufacturer/ru.json +15 -15
- package/dist/locales/partLookup/manufacturer/type.ts +3 -3
- package/dist/locales/vehicleLookup/accessories/ru.json +6 -6
- package/dist/locales/vehicleLookup/{dynamicClaim → claimableItems}/ar.json +7 -3
- package/dist/locales/vehicleLookup/{dynamicClaim → claimableItems}/en.json +5 -1
- package/dist/locales/vehicleLookup/{dynamicClaim → claimableItems}/ku.json +7 -3
- package/dist/locales/vehicleLookup/{dynamicClaim → claimableItems}/ru.json +11 -7
- package/dist/locales/vehicleLookup/{dynamicClaim → claimableItems}/type.ts +11 -7
- package/dist/locales/vehicleLookup/paintThickness/ru.json +7 -7
- package/dist/locales/vehicleLookup/serviceHistory/ru.json +8 -8
- package/dist/locales/vehicleLookup/specification/ru.json +8 -8
- package/dist/locales/vehicleLookup/warranty/ar.json +1 -0
- package/dist/locales/vehicleLookup/warranty/en.json +1 -0
- package/dist/locales/vehicleLookup/warranty/ku.json +1 -0
- package/dist/locales/vehicleLookup/warranty/ru.json +17 -16
- package/dist/locales/vehicleLookup/warranty/type.ts +1 -0
- package/dist/locales/vehicleLookup/wrapper-type.ts +2 -2
- package/dist/shift-components/p-010b5793.entry.js +5 -0
- package/dist/shift-components/p-03483842.entry.js +5 -0
- package/dist/shift-components/p-0a55771f.entry.js +5 -0
- package/dist/shift-components/p-0c8bbdd0.entry.js +5 -0
- package/dist/shift-components/p-20bdbcb5.entry.js +5 -0
- package/dist/shift-components/p-238f5df0.entry.js +5 -0
- package/dist/shift-components/p-42218765.entry.js +5 -0
- package/dist/shift-components/p-526a4ff7.entry.js +5 -0
- package/dist/shift-components/p-701e3fb0.entry.js +5 -0
- package/dist/shift-components/p-7225e52b.entry.js +5 -0
- package/dist/shift-components/p-BK16Cn81.js +5 -0
- package/dist/shift-components/p-BSpTbUWi.js +5 -0
- package/dist/shift-components/p-CC-dsMaG.js +5 -0
- package/dist/shift-components/p-CikEOqe0.js +6 -0
- package/dist/shift-components/p-CsAICJSF.js +5 -0
- package/dist/shift-components/p-CxstRFDI.js +5 -0
- package/dist/shift-components/p-DF2jCW4D.js +5 -0
- package/dist/shift-components/p-DdH9nNoC.js +5 -0
- package/dist/shift-components/p-Wtw8qj6x.js +5 -0
- package/dist/shift-components/p-a76db330.entry.js +5 -0
- package/dist/shift-components/p-d46b0857.entry.js +5 -0
- package/dist/shift-components/p-d843769d.entry.js +5 -0
- package/dist/shift-components/p-ebc23eef.entry.js +5 -0
- package/dist/shift-components/p-ef9ad340.entry.js +5 -0
- package/dist/shift-components/p-fyqwD4fB.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/components/card-content.d.ts +10 -0
- package/dist/types/components/components/flexible-container.d.ts +27 -0
- package/dist/types/components/components/information-table.d.ts +22 -0
- package/dist/types/components/components/material-card.d.ts +16 -0
- package/dist/types/components/components/shift-accordion.d.ts +13 -0
- package/dist/types/components/components/shift-slider.d.ts +11 -0
- package/dist/types/components/components/shift-tab-content.d.ts +12 -0
- package/dist/types/components/components/shift-tabs.d.ts +12 -0
- package/dist/types/components/form-elements/form-dialog.d.ts +1 -2
- package/dist/types/components/form-elements/form-input.d.ts +1 -2
- package/dist/types/components/form-elements/form-select.d.ts +1 -2
- package/dist/types/components/form-elements/form-structure-error.d.ts +1 -2
- package/dist/types/components/form-elements/form-structure.d.ts +2 -3
- package/dist/types/components/form-elements/form-submit.d.ts +1 -1
- package/dist/types/components/form-elements/form-text-area.d.ts +1 -1
- package/dist/types/components/forms/contact-us-form.d.ts +1 -1
- package/dist/types/components/forms/service-booking-form.d.ts +1 -1
- package/dist/types/components/part-lookup/components/dead-stock-item.d.ts +14 -0
- package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +26 -24
- package/dist/types/components/part-lookup/distributor-lookup.d.ts +25 -26
- package/dist/types/components/part-lookup/manufacturer-lookup.d.ts +25 -27
- package/dist/types/components/part-lookup/part-lookup.d.ts +17 -12
- package/dist/types/components/vehicle-lookup/components/CardsContainer.d.ts +5 -4
- package/dist/types/components/vehicle-lookup/components/StatusCard.d.ts +4 -2
- package/dist/types/components/vehicle-lookup/components/claimable-item-popover.d.ts +17 -0
- package/dist/types/components/vehicle-lookup/components/claimable-item.d.ts +12 -0
- package/dist/types/components/vehicle-lookup/vehicle-accessories.d.ts +25 -29
- package/dist/types/components/vehicle-lookup/vehicle-claimable-items.d.ts +72 -0
- package/dist/types/components/vehicle-lookup/vehicle-item-claim-form.d.ts +54 -0
- package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +27 -24
- package/dist/types/components/vehicle-lookup/vehicle-paint-thickness.d.ts +35 -0
- package/dist/types/components/vehicle-lookup/vehicle-service-history.d.ts +32 -0
- package/dist/types/components/vehicle-lookup/vehicle-specification.d.ts +22 -23
- package/dist/types/components/vehicle-lookup/{warranty-details.d.ts → vehicle-warranty-details.d.ts} +28 -31
- package/dist/types/components/vin-extractor/vin-extractor.d.ts +2 -2
- package/dist/types/components.d.ts +1068 -219
- package/dist/types/features/image-viewer/image-viewer-logic.d.ts +3 -0
- package/dist/types/features/image-viewer/image-viewer.d.ts +7 -0
- package/dist/types/features/image-viewer/index.d.ts +3 -0
- package/dist/types/features/image-viewer/interface.d.ts +5 -0
- package/dist/types/features/multi-lingual/get-local-language.d.ts +4 -0
- package/dist/types/features/multi-lingual/index.d.ts +3 -0
- package/dist/types/features/multi-lingual/interface.d.ts +8 -0
- package/dist/types/{global/lib/get-local-language.d.ts → features/multi-lingual/types.d.ts} +17 -6
- package/dist/types/features/part-lookup-components/index.d.ts +3 -0
- package/dist/types/features/part-lookup-components/interface.d.ts +25 -0
- package/dist/types/features/part-lookup-components/part-lookup-api-integration.d.ts +14 -0
- package/dist/types/features/part-lookup-components/types.d.ts +3 -0
- package/dist/types/features/vehicle-info-layout/index.d.ts +2 -0
- package/dist/types/features/vehicle-info-layout/interface.d.ts +3 -0
- package/dist/types/features/vehicle-info-layout/vehicle-info-layout.d.ts +11 -0
- package/dist/types/features/vehicle-lookup-component/index.d.ts +3 -0
- package/dist/types/features/vehicle-lookup-component/interface.d.ts +24 -0
- package/dist/types/features/vehicle-lookup-component/types.d.ts +17 -0
- package/dist/types/features/vehicle-lookup-component/vehicle-lookup-api-integration.d.ts +15 -0
- package/dist/types/global/assets/activation-icon.d.ts +6 -0
- package/dist/types/global/assets/add-icon.d.ts +6 -0
- package/dist/types/global/assets/alert-icon.d.ts +6 -0
- package/dist/types/global/assets/arrow-up-icon.d.ts +6 -0
- package/dist/types/global/assets/attach-icon.d.ts +6 -0
- package/dist/types/global/assets/check-icon.d.ts +6 -0
- package/dist/types/global/assets/empty-table-icon.d.ts +6 -0
- package/dist/types/global/assets/form-submit-svg.d.ts +6 -0
- package/dist/types/global/assets/print-icon.d.ts +6 -0
- package/dist/types/global/assets/triangle-icon.d.ts +6 -0
- package/dist/types/global/lib/children-with-tag.d.ts +1 -0
- package/dist/types/global/lib/container-has-tag.d.ts +1 -0
- package/dist/types/global/lib/parents-with-tag.d.ts +1 -0
- package/dist/types/global/lib/recaptcha.d.ts +1 -1
- package/dist/types/global/lib/scroll-into-container-view.d.ts +1 -0
- package/dist/types/global/types/components.d.ts +0 -1
- package/dist/types/global/types/forms.d.ts +1 -1
- package/dist/types/global/types/generated/part/branch-dead-stock-dto.d.ts +5 -0
- package/dist/types/global/types/generated/part/dead-stock-dto.d.ts +6 -0
- package/dist/types/global/types/generated/part/hs-code-dto.d.ts +5 -0
- package/dist/types/global/types/generated/part/part-lookup-dto.d.ts +27 -0
- package/dist/types/global/types/generated/part/part-price-dto.d.ts +10 -0
- package/dist/types/global/types/generated/part/price-dto.d.ts +6 -0
- package/dist/types/global/types/generated/part/stock-part-dto.d.ts +5 -0
- package/dist/types/global/types/generated/vehicle-lookup/accessory-dto.d.ts +5 -0
- package/dist/types/global/types/generated/vehicle-lookup/paint-thickness-dto.d.ts +6 -0
- package/dist/types/global/types/generated/vehicle-lookup/paint-thickness-image-dto.d.ts +4 -0
- package/dist/types/global/types/generated/vehicle-lookup/paint-thickness-part-dto.d.ts +5 -0
- package/dist/types/global/types/generated/vehicle-lookup/ssc-dto.d.ts +10 -0
- package/dist/types/global/types/generated/vehicle-lookup/ssc-labor-dto.d.ts +5 -0
- package/dist/types/global/types/generated/vehicle-lookup/ssc-part-dto.d.ts +5 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-broker-sale-information.d.ts +7 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-identifiers-dto.d.ts +9 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-labor-dto.d.ts +6 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-lookup-dto.d.ts +27 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-part-dto.d.ts +6 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-sale-information.d.ts +16 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-service-history-dto.d.ts +16 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-service-item-dto.d.ts +34 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-service-item-group.d.ts +6 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-specification-dto.d.ts +22 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-variant-info-dto.d.ts +5 -0
- package/dist/types/global/types/generated/vehicle-lookup/vehicle-warranty-dto.d.ts +8 -0
- package/dist/types/locale-mapper.d.ts +2 -2
- package/dist/types/locales/partLookup/distributor/type.d.ts +2 -2
- package/dist/types/locales/partLookup/manufacturer/type.d.ts +6 -6
- package/dist/types/locales/partLookup/wrapper-type.d.ts +8 -8
- package/dist/types/locales/vehicleLookup/accessories/type.d.ts +4 -4
- package/dist/types/locales/vehicleLookup/{dynamicClaim → claimableItems}/type.d.ts +32 -16
- package/dist/types/locales/vehicleLookup/paintThickness/type.d.ts +4 -4
- package/dist/types/locales/vehicleLookup/serviceHistory/type.d.ts +4 -4
- package/dist/types/locales/vehicleLookup/warranty/type.d.ts +2 -0
- package/dist/types/locales/vehicleLookup/wrapper-type.d.ts +56 -46
- package/dist/types/stencil-public-runtime.d.ts +23 -1
- package/package.json +9 -8
- package/LICENSE +0 -21
- package/dist/cjs/app-globals-4aa8f46f.js +0 -46
- package/dist/cjs/cn-f559f9e5.js +0 -2588
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +0 -1224
- package/dist/cjs/dynamic-redeem.cjs.entry.js +0 -210
- package/dist/cjs/type-87edb16d.js +0 -53
- package/dist/collection/components/vehicle-lookup/components/SSCTable.js +0 -18
- package/dist/collection/components/vehicle-lookup/dynamic-claim.css +0 -1
- package/dist/collection/components/vehicle-lookup/dynamic-claim.js +0 -756
- package/dist/collection/components/vehicle-lookup/dynamic-redeem.css +0 -1
- package/dist/collection/components/vehicle-lookup/dynamic-redeem.js +0 -444
- package/dist/collection/components/vehicle-lookup/paint-thickness.css +0 -1
- package/dist/collection/components/vehicle-lookup/paint-thickness.js +0 -414
- package/dist/collection/components/vehicle-lookup/service-history.js +0 -397
- package/dist/collection/components/vehicle-lookup/warranty-details.css +0 -1
- package/dist/collection/global/api/partInformation.js +0 -32
- package/dist/collection/global/api/vehicleInformation.js +0 -48
- package/dist/collection/global/types/vehicle-information.js +0 -5
- package/dist/collection/templates/vehicle-lookup/vehicle-lookup.js +0 -285
- package/dist/components/dynamic-claim.js +0 -5
- package/dist/components/dynamic-redeem.js +0 -5
- package/dist/components/p-00a27a58.js +0 -5
- package/dist/components/p-0aea36b4.js +0 -5
- package/dist/components/p-0fa9085a.js +0 -5
- package/dist/components/p-1c45c079.js +0 -5
- package/dist/components/p-28cf4dbe.js +0 -5
- package/dist/components/p-29a57e34.js +0 -5
- package/dist/components/p-2c893802.js +0 -5
- package/dist/components/p-3a216a1c.js +0 -5
- package/dist/components/p-48a28736.js +0 -5
- package/dist/components/p-48a9b8e5.js +0 -5
- package/dist/components/p-4ddb3435.js +0 -5
- package/dist/components/p-5709db05.js +0 -5
- package/dist/components/p-5afcb14f.js +0 -5
- package/dist/components/p-7a1dd4fc.js +0 -5
- package/dist/components/p-7d3dd7c2.js +0 -5
- package/dist/components/p-8b1d90d7.js +0 -5
- package/dist/components/p-8cd53e18.js +0 -5
- package/dist/components/p-98d9e7ab.js +0 -5
- package/dist/components/p-aacd560d.js +0 -5
- package/dist/components/p-c4f620e9.js +0 -5
- package/dist/components/p-ca0bda87.js +0 -5
- package/dist/components/p-d3f029ed.js +0 -5
- package/dist/components/p-dfb3925b.js +0 -5
- package/dist/components/p-ec493f9b.js +0 -5
- package/dist/components/p-f437e795.js +0 -5
- package/dist/components/p-fab97ac7.js +0 -5
- package/dist/components/p-ffad35ad.js +0 -5
- package/dist/components/paint-thickness.js +0 -5
- package/dist/components/service-history.js +0 -5
- package/dist/components/warranty-details.js +0 -5
- package/dist/esm/app-globals-68faa233.js +0 -44
- package/dist/esm/cn-cc419b94.js +0 -2586
- package/dist/esm/dynamic-claim_6.entry.js +0 -1215
- package/dist/esm/dynamic-redeem.entry.js +0 -206
- package/dist/esm/type-885c56ae.js +0 -34
- package/dist/esm/type-dc3e60a4.js +0 -50
- package/dist/shift-components/p-025b3a45.entry.js +0 -5
- package/dist/shift-components/p-07ee30c6.js +0 -5
- package/dist/shift-components/p-232a8be0.entry.js +0 -5
- package/dist/shift-components/p-40e52936.entry.js +0 -5
- package/dist/shift-components/p-446d908d.js +0 -5
- package/dist/shift-components/p-50d68cc4.entry.js +0 -5
- package/dist/shift-components/p-67d3532e.js +0 -5
- package/dist/shift-components/p-69f1a7ff.entry.js +0 -5
- package/dist/shift-components/p-6b3651bd.js +0 -5
- package/dist/shift-components/p-6ec0650f.js +0 -5
- package/dist/shift-components/p-83b755da.entry.js +0 -5
- package/dist/shift-components/p-90bf4148.entry.js +0 -5
- package/dist/shift-components/p-9474a4da.js +0 -6
- package/dist/shift-components/p-98d9e7ab.js +0 -5
- package/dist/shift-components/p-997b9bfb.entry.js +0 -5
- package/dist/shift-components/p-9e11eb3e.entry.js +0 -5
- package/dist/shift-components/p-ab79b6e8.entry.js +0 -5
- package/dist/shift-components/p-c802d527.js +0 -5
- package/dist/types/components/vehicle-lookup/components/SSCTable.d.ts +0 -9
- package/dist/types/components/vehicle-lookup/dynamic-claim.d.ts +0 -65
- package/dist/types/components/vehicle-lookup/dynamic-redeem.d.ts +0 -48
- package/dist/types/components/vehicle-lookup/paint-thickness.d.ts +0 -39
- package/dist/types/components/vehicle-lookup/service-history.d.ts +0 -34
- package/dist/types/global/api/partInformation.d.ts +0 -19
- package/dist/types/global/api/vehicleInformation.d.ts +0 -33
- package/dist/types/global/lib/image-expansion.d.ts +0 -9
- package/dist/types/global/types/locale.d.ts +0 -11
- package/dist/types/global/types/part-information.d.ts +0 -53
- package/dist/types/global/types/vehicle-information.d.ts +0 -182
- package/loader/package.json +0 -11
- package/readme.md +0 -15
- /package/dist/cjs/{loader-baf2418b.js → loader-jtAYWeFG.js} +0 -0
- /package/dist/cjs/{validate-vin-32e95695.js → validate-vin-CJDIXpJO.js} +0 -0
- /package/dist/collection/{global/types/part-information.js → features/image-viewer/interface.js} +0 -0
- /package/dist/collection/{components/vehicle-lookup → global}/assets/activationRequired.svg +0 -0
- /package/dist/collection/{components/vehicle-lookup → global}/assets/cancelled.svg +0 -0
- /package/dist/collection/{components/vehicle-lookup → global}/assets/check.svg +0 -0
- /package/dist/collection/{components/vehicle-lookup → global}/assets/expired.svg +0 -0
- /package/dist/collection/{components/vehicle-lookup → global}/assets/pending.svg +0 -0
- /package/dist/collection/{components/vehicle-lookup → global}/assets/processed.svg +0 -0
- /package/dist/collection/{components/vehicle-lookup → global}/assets/x-mark.svg +0 -0
- /package/dist/components/{p-a21e2e2e.js → p-C-EQDloC.js} +0 -0
- /package/dist/components/{p-383b4ddf.js → p-CUREVASG.js} +0 -0
- /package/dist/esm/{loader-027b88af.js → loader-C-EQDloC.js} +0 -0
- /package/dist/esm/{validate-vin-f4d23a44.js → validate-vin-CUREVASG.js} +0 -0
- /package/dist/shift-components/{p-a21e2e2e.js → p-C-EQDloC.js} +0 -0
- /package/dist/shift-components/{p-383b4ddf.js → p-CUREVASG.js} +0 -0
|
@@ -1,1224 +0,0 @@
|
|
|
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-a8de3655.js');
|
|
10
|
-
const cn = require('./cn-f559f9e5.js');
|
|
11
|
-
const getLocalLanguage = require('./get-local-language-e539cfdc.js');
|
|
12
|
-
const type = require('./type-87edb16d.js');
|
|
13
|
-
const type$1 = require('./type-3d22f1fc.js');
|
|
14
|
-
const loader = require('./loader-baf2418b.js');
|
|
15
|
-
|
|
16
|
-
const expiredSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9ImJsYWNrIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiAxNkw4IDgiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiA4TDggMTYiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgPC9nPgo8L3N2Zz4=';
|
|
17
|
-
|
|
18
|
-
const pendingSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhMWExYTEiIHN0cm9rZT0iI2ExYTFhMSIgLz4KICAgICAgICA8cmVjdCB4PSI5LjUiIHk9IjgiIHdpZHRoPSIyIiBoZWlnaHQ9IjgiIGZpbGw9IiNhMWExYTEiIC8+CiAgICAgICAgPHJlY3QgeD0iMTIuNSIgeT0iOCIgd2lkdGg9IjIiIGhlaWdodD0iOCIgZmlsbD0iI2ExYTFhMSIgLz4KICAgIDwvZz4KPC9zdmc+';
|
|
19
|
-
|
|
20
|
-
const cancelledSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhODAwMDAiIHN0cm9rZT0iI2E4MDAwMCIgLz4KICAgICAgICA8cGF0aCBkPSJNMTggMThMNiA2IiBzdHJva2Utd2lkdGg9IjEuMiIgc3Ryb2tlPSIjYTgwMDAwIiAvPgogICAgPC9nPgo8L3N2Zz4=';
|
|
21
|
-
|
|
22
|
-
const processedSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiMzMDcxYTkiIHN0cm9rZT0iIzMwNzFhOSIgLz4KICAgICAgICA8cGF0aCBkPSJNOC41IDExTDExLjM5MzkgMTMuODkzOUMxMS40NTI1IDEzLjk1MjUgMTEuNTQ3NSAxMy45NTI1IDExLjYwNjEgMTMuODkzOUwxOS41IDYiIHN0cm9rZT0iIzMwNzFhOSIKICAgICAgICAgICAgc3Ryb2tlLXdpZHRoPSIxLjIiIC8+CiAgICA8L2c+Cjwvc3ZnPg==';
|
|
23
|
-
|
|
24
|
-
const activationRequiredSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9InJnYigxNTgsIDE1OCwgMTU4KSIKICAgIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1sb2FkZXIiPgogICAgPHBhdGggZD0iTTEyIDJ2NCIgLz4KICAgIDxwYXRoIGQ9Im0xNi4yIDcuOCAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTE4IDEyaDQiIC8+CiAgICA8cGF0aCBkPSJtMTYuMiAxNi4yIDIuOSAyLjkiIC8+CiAgICA8cGF0aCBkPSJNMTIgMTh2NCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgMTkuMSAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTIgMTJoNCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgNC45IDIuOSAyLjkiIC8+Cjwvc3ZnPgo=';
|
|
25
|
-
|
|
26
|
-
const vehicleRequestHeaders = {
|
|
27
|
-
cityId: 'City-Id',
|
|
28
|
-
userId: 'User-Id',
|
|
29
|
-
companyId: 'Company-Id',
|
|
30
|
-
customerName: 'Customer-Name',
|
|
31
|
-
customerPhone: 'Customer-Phone',
|
|
32
|
-
customerEmail: 'Customer-Email',
|
|
33
|
-
companyBranchId: 'Company-Branch-Id',
|
|
34
|
-
cityIntegrationId: 'City-Integration-Id',
|
|
35
|
-
brandIntegrationId: 'Brand-Integration-Id',
|
|
36
|
-
companyIntegrationId: 'Company-Integration-Id',
|
|
37
|
-
companyBranchIntegrationId: 'Company-Branch-Integration-Id',
|
|
38
|
-
};
|
|
39
|
-
const getVehicleInformation = async (component, generalProps, headers = {}) => {
|
|
40
|
-
const { notAvailableMessage, mockData, vin, scopedTimeoutRef, middlewareCallback } = generalProps;
|
|
41
|
-
const { isDev, baseUrl, queryString, abortController, networkTimeoutRef, loadedResponse } = component;
|
|
42
|
-
const handleResult = (newVehicleInformation) => {
|
|
43
|
-
if (networkTimeoutRef === scopedTimeoutRef) {
|
|
44
|
-
if (!newVehicleInformation && vin)
|
|
45
|
-
throw new Error(notAvailableMessage || 'wrongResponseFormat');
|
|
46
|
-
if (loadedResponse)
|
|
47
|
-
loadedResponse(newVehicleInformation);
|
|
48
|
-
if (middlewareCallback)
|
|
49
|
-
middlewareCallback(newVehicleInformation);
|
|
50
|
-
return newVehicleInformation;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
if (isDev) {
|
|
54
|
-
const newData = mockData[vin];
|
|
55
|
-
return handleResult(newData);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
if (!baseUrl)
|
|
59
|
-
throw new Error('noBaseUrl');
|
|
60
|
-
const componentHeaders = Object.assign({}, headers);
|
|
61
|
-
Object.entries(vehicleRequestHeaders).forEach(([componentHeaderKey, headerField]) => {
|
|
62
|
-
if (component[componentHeaderKey])
|
|
63
|
-
componentHeaders[headerField] = component[componentHeaderKey];
|
|
64
|
-
});
|
|
65
|
-
const response = await fetch(`${baseUrl}${vin}?${queryString}`, { signal: abortController.signal, headers: componentHeaders });
|
|
66
|
-
const newData = (await response.json());
|
|
67
|
-
return handleResult(newData);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
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;flex-direction:row;overflow-x:scroll;padding:125px 30px;transition:.5s ease}.dynamic-claim-body.has-footer-box{padding:100px 30px 150px}.dynamic-claim-activation-box,.dynamic-claim-success-box{bottom:40px;left:50%;margin-left:-45%;position:absolute;width:90%}.idle .dynamic-claim-body,.loading .dynamic-claim-body{pointer-events:none}.dynamic-claim-wrapper ::-webkit-scrollbar{height:10px;width:10px}.dynamic-claim-wrapper ::-webkit-scrollbar-track{background:#f6f6f6;border-radius:5px;border-top:1px solid #dcdcdc;border-top-left-radius:0;border-top-right-radius:0}.idle .dynamic-claim-body::-webkit-scrollbar-thumb,.loading .dynamic-claim-body::-webkit-scrollbar-thumb{background:transparent}.dynamic-claim-wrapper ::-webkit-scrollbar-thumb{background:#c5c5c5;border-radius:10px}.dynamic-claim-wrapper ::-webkit-scrollbar-thumb:hover{background:#a1a1a1}.dynamic-claim-progress-lane,.loading-lane{align-items:center;background-color:#f2f2f2;border:1px solid #ddd;border-radius:10px;display:flex;flex:1;flex-direction:row;height:10px;justify-content:space-around;position:relative}.idle .dynamic-claim-progress-lane,.loading .dynamic-claim-progress-lane{background-color:transparent;border:1px solid transparent}.loading-lane{position:absolute;visibility:hidden;width:calc(100% - 60px)}.loading .loading-lane{visibility:visible}.dynamic-claim-progress-bar{background-image:linear-gradient(180deg,#428bca,#3071a9);border:1px solid #ddd;border-radius:10px;height:10px;left:0;position:absolute;transition:all;transition-duration:.5s;transition-timing-function:ease-in-out;width:0;z-index:0}.idle .dynamic-claim-progress-bar,.loading .dynamic-claim-progress-bar{opacity:0;width:0!important}.dynamic-claim-item{align-items:center;display:flex;flex-direction:column;font-size:14px;gap:5px;min-width:250px}.popup-position-ref{bottom:0;display:flex;height:0;justify-content:center;position:absolute;width:0}.popup-container{position:fixed;z-index:100}.dynamic-claim-item-popup-info{background-color:#f9f9f9;border:1px solid #ddd;border-radius:5px;color:#282828;opacity:0;padding:20px;transition:.4s;visibility:hidden;width:auto}.dynamic-claim-item-popup-info-triangle.show,.dynamic-claim-item-popup-info.show{opacity:1;visibility:visible}.dynamic-claim-item-popup-info table{border-collapse:collapse;width:100%}.dynamic-claim-item-popup-info table td,.dynamic-claim-item-popup-info table th{border-bottom:1px solid #ddd;padding:10px;padding-inline-end:50px;text-align:start;white-space:nowrap}.dynamic-claim-item-popup-info table td{font-weight:400}.dynamic-claim-item-popup-info .claim-button{justify-content:center;margin:15px auto auto;width:80%}.dynamic-claim-item-popup-info-triangle{display:flex;justify-content:center;opacity:0;position:relative;transform:translateY(-9px);transition:.4s;visibility:hidden;width:100%;z-index:101}.dynamic-claim-item-popup-info-triangle-up{border-bottom:10px solid #ddd}.dynamic-claim-item-popup-info-triangle-up,.dynamic-claim-item-popup-info-triangle-up2{border-left:10px solid transparent;border-right:10px solid transparent;height:0;position:absolute;width:0}.dynamic-claim-item-popup-info-triangle-up2{border-bottom:10px solid #f9f9f9;margin-top:1px}.dynamic-claim-item-header{align-items:center;cursor:pointer;display:flex;flex-direction:column;height:3em;line-height:1em;padding:10px 0;position:relative;transition:.4s}.dynamic-claim-item-header.load-animation{animation:item-header-fade-in .65s ease forwards}@keyframes item-header-fade-in{0%{opacity:0;transform:translateY(-5px) scale(70%)}to{opacity:1;transform:translateY(0) scale(100%)}}.dynamic-claim-item-header span{font-weight:700}.dynamic-claim-item-header img{transition:.4s}.dynamic-claim-item-header:hover>img{transform:rotate(1turn) scale(125%)}.idle .dynamic-claim-item-header,.loading .dynamic-claim-item-header{opacity:0;transform:translateY(-5px) scale(70%)}.dynamic-claim-item-footer{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;height:4.5em;line-height:1.5em;margin:0;overflow:hidden;padding:0 20px;text-align:center;text-overflow:ellipsis;transition:.4s}.dynamic-claim-item-footer.load-animation{animation:item-footer-fade-in .65s ease forwards}@keyframes item-footer-fade-in{0%{opacity:0;transform:translateY(5px) scale(70%);visibility:hidden}to{opacity:1;transform:translateY(0) scale(100%);visibility:visible}}.idle .dynamic-claim-item-footer,.loading .dynamic-claim-item-footer{opacity:0;transform:translateY(5px) scale(70%);visibility:hidden}.dynamic-claim-item-circle{background-color:#a1a1a1;border:5px double #ececec;border-radius:50%;height:18px;transition:.4s;width:18px;z-index:1}.dynamic-claim-item-circle.load-animation{animation:item-circle-fade-in .65s ease forwards}@keyframes item-circle-fade-in{0%{opacity:0;transform:scale(150%);visibility:hidden}to{opacity:1;transform:scale(100%);visibility:visible}}.idle .dynamic-claim-item-circle,.loading .dynamic-claim-item-circle{opacity:0;transform:scale(150%);visibility:hidden}.dynamic-claim-item.processed .dynamic-claim-item-circle{background-color:#3071a9}.dynamic-claim-item.processed .dynamic-claim-item-header{color:#3071a9}.dynamic-claim-item.expired .dynamic-claim-item-circle{background-color:#282828}.dynamic-claim-item.expired .dynamic-claim-item-headaer{color:#282828}.dynamic-claim-item.cancelled .dynamic-claim-item-circle{background-color:#a80000}.dynamic-claim-item.cancelled .dynamic-claim-item-header{color:#a80000}.dynamic-claim-item.pending .dynamic-claim-item-circle{background-color:#00a300}.dynamic-claim-item.pending .dynamic-claim-item-header{color:#00a300}.dynamic-claim-item.activationRequired .dynamic-claim-item-header{color:#9e9e9e}.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 path{transition:.2s}.claim-button:hover path{fill:#2ecc71}.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}.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}.warning-card{background:#fcf8e3;border-color:#faebcc!important;color:#8a6d3b}.activation-panel{opacity:0}.activation-panel.visible{animation:activation-panel-fade-in .75s ease forwards}.activation-panel.visible.loading{animation:activation-panel-fade-out .75s ease forwards}@keyframes activation-panel-fade-in{0%{opacity:0;transform:translateY(-5px) scale(70%);visibility:hidden}to{opacity:1;transform:translateY(0) scale(100%);visibility:visible}}@keyframes activation-panel-fade-out{to{opacity:0;transform:translateY(-5px) scale(70%);visibility:hidden}0%{opacity:1;transform:translateY(0) scale(100%);visibility:visible}}.static{position:static}.w-full{width:100%}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.gap-2{gap:.5rem}.font-semibold{font-weight:600}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.m-\\[3px\\]{margin:3px}.my-4{margin-bottom:1rem;margin-top:1rem}.ml-1{margin-left:.25rem}.border-separate{border-collapse:separate}.list-disc{list-style-type:disc}.gap-1{gap:.25rem}";
|
|
72
|
-
const DynamicClaimStyle0 = dynamicClaimCss;
|
|
73
|
-
|
|
74
|
-
let mockData$5 = {};
|
|
75
|
-
const icons = {
|
|
76
|
-
expired: expiredSvg,
|
|
77
|
-
pending: pendingSvg,
|
|
78
|
-
processed: processedSvg,
|
|
79
|
-
cancelled: cancelledSvg,
|
|
80
|
-
activationRequired: activationRequiredSvg,
|
|
81
|
-
};
|
|
82
|
-
const DynamicClaim = class {
|
|
83
|
-
constructor(hostRef) {
|
|
84
|
-
index.registerInstance(this, hostRef);
|
|
85
|
-
this.pendingItemHighlighted = false;
|
|
86
|
-
this.onMouseLeave = () => {
|
|
87
|
-
clearTimeout(this.timeoutRef);
|
|
88
|
-
this.popupClasses = '';
|
|
89
|
-
this.timeoutRef = setTimeout(() => {
|
|
90
|
-
this.activePopupIndex = null;
|
|
91
|
-
}, 400);
|
|
92
|
-
};
|
|
93
|
-
this.onMouseEnter = (dynamicClaimItemHeader, idx) => {
|
|
94
|
-
clearTimeout(this.timeoutRef);
|
|
95
|
-
this.activePopupIndex = idx;
|
|
96
|
-
this.timeoutRef = setTimeout(() => {
|
|
97
|
-
const positionRef = dynamicClaimItemHeader.querySelector('.popup-position-ref');
|
|
98
|
-
this.popupPositionRef = positionRef;
|
|
99
|
-
this.calculatePopupPos(this.el.shadowRoot);
|
|
100
|
-
this.popupClasses = 'show';
|
|
101
|
-
}, 50);
|
|
102
|
-
};
|
|
103
|
-
this.baseUrl = undefined;
|
|
104
|
-
this.isDev = false;
|
|
105
|
-
this.queryString = '';
|
|
106
|
-
this.claimEndPoint = 'api/vehicle/swift-claim';
|
|
107
|
-
this.headers = {};
|
|
108
|
-
this.language = 'en';
|
|
109
|
-
this.errorCallback = undefined;
|
|
110
|
-
this.loadingStateChange = undefined;
|
|
111
|
-
this.loadedResponse = undefined;
|
|
112
|
-
this.activate = undefined;
|
|
113
|
-
this.print = undefined;
|
|
114
|
-
this.sharedLocales = getLocalLanguage.sharedLocalesSchema.getDefault();
|
|
115
|
-
this.locale = type.dynamicClaimSchema.getDefault();
|
|
116
|
-
this.isIdle = true;
|
|
117
|
-
this.popupClasses = '';
|
|
118
|
-
this.isLoading = false;
|
|
119
|
-
this.showPrintBox = false;
|
|
120
|
-
this.lastSuccessfullClaimResponse = null;
|
|
121
|
-
this.externalVin = null;
|
|
122
|
-
this.errorMessage = null;
|
|
123
|
-
this.activePopupIndex = null;
|
|
124
|
-
this.vehicleInformation = undefined;
|
|
125
|
-
}
|
|
126
|
-
async componentWillLoad() {
|
|
127
|
-
await this.changeLanguage(this.language);
|
|
128
|
-
}
|
|
129
|
-
async changeLanguage(newLanguage) {
|
|
130
|
-
const localeResponses = await Promise.all([getLocalLanguage.getLocaleLanguage(newLanguage, 'vehicleLookup.dynamicClaim', type.dynamicClaimSchema), getLocalLanguage.getSharedLocal(newLanguage)]);
|
|
131
|
-
this.locale = localeResponses[0];
|
|
132
|
-
this.sharedLocales = localeResponses[1];
|
|
133
|
-
}
|
|
134
|
-
async componentDidLoad() {
|
|
135
|
-
this.dynamicClaimBody = this.el.shadowRoot.querySelector('.dynamic-claim-body');
|
|
136
|
-
this.dynamicRedeem = this.el.shadowRoot.getElementById('dynamic-redeem');
|
|
137
|
-
this.dynamicClaimProgressBar = this.el.shadowRoot.querySelector('.dynamic-claim-progress-bar');
|
|
138
|
-
}
|
|
139
|
-
async setMockData(newMockData) {
|
|
140
|
-
mockData$5 = newMockData;
|
|
141
|
-
}
|
|
142
|
-
async setData(newData, headers = {}) {
|
|
143
|
-
clearTimeout(this.networkTimeoutRef);
|
|
144
|
-
if (this.abortController)
|
|
145
|
-
this.abortController.abort();
|
|
146
|
-
this.abortController = new AbortController();
|
|
147
|
-
let scopedTimeoutRef;
|
|
148
|
-
const isVinRequest = typeof newData === 'string';
|
|
149
|
-
const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
|
|
150
|
-
this.externalVin = vin;
|
|
151
|
-
try {
|
|
152
|
-
if (!vin || vin.trim().length === 0) {
|
|
153
|
-
this.isIdle = true;
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
this.isLoading = true;
|
|
157
|
-
this.showPrintBox = false;
|
|
158
|
-
this.isIdle = false;
|
|
159
|
-
await new Promise(r => {
|
|
160
|
-
scopedTimeoutRef = setTimeout(r, 1000);
|
|
161
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
162
|
-
});
|
|
163
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$5 }, headers) : newData;
|
|
164
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
165
|
-
if (!vehicleResponse)
|
|
166
|
-
throw new Error('wrongResponseFormat');
|
|
167
|
-
if (!Array.isArray(vehicleResponse.serviceItems))
|
|
168
|
-
throw new Error('noServiceAvailable');
|
|
169
|
-
this.vehicleInformation = vehicleResponse;
|
|
170
|
-
}
|
|
171
|
-
this.errorMessage = null;
|
|
172
|
-
this.isLoading = false;
|
|
173
|
-
}
|
|
174
|
-
catch (error) {
|
|
175
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
176
|
-
return;
|
|
177
|
-
if (this.errorCallback)
|
|
178
|
-
this.errorCallback(error.message);
|
|
179
|
-
console.error(error);
|
|
180
|
-
this.setErrorMessage(error.message);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
async setErrorMessage(message) {
|
|
184
|
-
this.isIdle = false;
|
|
185
|
-
this.isLoading = false;
|
|
186
|
-
this.vehicleInformation = null;
|
|
187
|
-
this.errorMessage = message;
|
|
188
|
-
}
|
|
189
|
-
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
190
|
-
await this.setData(requestedVin, headers);
|
|
191
|
-
}
|
|
192
|
-
onLoadingChange(newValue) {
|
|
193
|
-
if (this.loadingStateChange)
|
|
194
|
-
this.loadingStateChange(newValue);
|
|
195
|
-
this.setLoadingUi(newValue);
|
|
196
|
-
}
|
|
197
|
-
async setLoadingUi(isLoading) {
|
|
198
|
-
if (!isLoading) {
|
|
199
|
-
this.dynamicClaimProgressBar.style.width = '0';
|
|
200
|
-
await new Promise(r => setTimeout(r, 200));
|
|
201
|
-
this.updateProgressBar();
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
updateProgressBar() {
|
|
205
|
-
var _a;
|
|
206
|
-
const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
|
|
207
|
-
if (serviceItems.filter(x => x.status === 'pending').length === 0) {
|
|
208
|
-
if (serviceItems.length === 0 || serviceItems.filter(x => x.status === 'activationRequired').length === serviceItems.length)
|
|
209
|
-
this.dynamicClaimProgressBar.style.width = '0%';
|
|
210
|
-
else
|
|
211
|
-
this.dynamicClaimProgressBar.style.width = '100%';
|
|
212
|
-
this.dynamicClaimBody.scrollTo({
|
|
213
|
-
left: this.dynamicClaimBody.scrollWidth,
|
|
214
|
-
behavior: 'smooth',
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
const firstPendingItem = serviceItems.find(x => x.status === 'pending');
|
|
219
|
-
const firstPendingItemIndex = serviceItems.indexOf(firstPendingItem) + 1;
|
|
220
|
-
const firstPendingItemRef = this.dynamicClaimBody.getElementsByClassName('dynamic-claim-item')[firstPendingItemIndex - 1];
|
|
221
|
-
this.dynamicClaimProgressBar.style.width = (firstPendingItemIndex / serviceItems.length - 1 / (serviceItems.length * 2)) * 100 + '%';
|
|
222
|
-
this.dynamicClaimBody.scrollTo({
|
|
223
|
-
left: firstPendingItemRef.offsetLeft - firstPendingItemRef.clientWidth * 3,
|
|
224
|
-
behavior: 'smooth',
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
resetProgressBar() {
|
|
229
|
-
setTimeout(() => {
|
|
230
|
-
this.updateProgressBar();
|
|
231
|
-
}, 100);
|
|
232
|
-
}
|
|
233
|
-
windowScrollListener(newValue) {
|
|
234
|
-
if (newValue) {
|
|
235
|
-
this.scrollListenerRef = () => this.calculatePopupPos(this.el.shadowRoot);
|
|
236
|
-
window.addEventListener('scroll', this.scrollListenerRef);
|
|
237
|
-
this.dynamicClaimBody.addEventListener('scroll', this.scrollListenerRef);
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
window.removeEventListener('scroll', this.scrollListenerRef);
|
|
241
|
-
this.dynamicClaimBody.removeEventListener('scroll', this.scrollListenerRef);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
calculatePopupPos(root) {
|
|
245
|
-
const popupPositionRef = root.querySelector('.popup-position-ref');
|
|
246
|
-
let { x, y } = popupPositionRef.getBoundingClientRect();
|
|
247
|
-
const popupContainer = popupPositionRef.querySelector('.popup-container');
|
|
248
|
-
const { width } = popupContainer.getBoundingClientRect();
|
|
249
|
-
const popupInfo = popupContainer.querySelector('.dynamic-claim-item-popup-info');
|
|
250
|
-
const windowWidth = window.innerWidth; // Get the viewport's width
|
|
251
|
-
popupContainer.style.top = `${y}px`;
|
|
252
|
-
popupContainer.style.left = `${x - width / 2}px`;
|
|
253
|
-
const offsetFromLeft = x - width / 2; // Distance from left side of the viewport
|
|
254
|
-
const offsetFromRight = windowWidth - (x + width / 2); // Distance from right side of the viewport
|
|
255
|
-
let movingNeeded = 0;
|
|
256
|
-
let horizontalMargin = 16;
|
|
257
|
-
if (offsetFromRight < horizontalMargin)
|
|
258
|
-
movingNeeded = offsetFromRight - horizontalMargin;
|
|
259
|
-
else if (offsetFromLeft < horizontalMargin)
|
|
260
|
-
movingNeeded = Math.abs(offsetFromLeft - horizontalMargin);
|
|
261
|
-
popupInfo.style.transform = `translateX(${movingNeeded}px)`;
|
|
262
|
-
}
|
|
263
|
-
removeLoadAnimationClass(event) {
|
|
264
|
-
const component = event.target;
|
|
265
|
-
component.classList.remove('load-animation');
|
|
266
|
-
}
|
|
267
|
-
async completeClaim(response) {
|
|
268
|
-
var _a;
|
|
269
|
-
const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
|
|
270
|
-
const item = this.cachedClaimItem;
|
|
271
|
-
const serviceDataClone = JSON.parse(JSON.stringify(serviceItems));
|
|
272
|
-
const index = serviceItems.indexOf(item);
|
|
273
|
-
const pendingItemsBefore = serviceDataClone.slice(0, index).filter(x => x.status === 'pending');
|
|
274
|
-
serviceDataClone[index].claimable = false;
|
|
275
|
-
serviceDataClone[index].status = 'processed';
|
|
276
|
-
pendingItemsBefore.forEach(function (otherItem) {
|
|
277
|
-
otherItem.status = 'cancelled';
|
|
278
|
-
});
|
|
279
|
-
this.pendingItemHighlighted = false;
|
|
280
|
-
const vehicleDataClone = JSON.parse(JSON.stringify(this.vehicleInformation));
|
|
281
|
-
vehicleDataClone.serviceItems = serviceDataClone;
|
|
282
|
-
this.vehicleInformation = JSON.parse(JSON.stringify(vehicleDataClone));
|
|
283
|
-
this.showPrintBox = true;
|
|
284
|
-
this.lastSuccessfullClaimResponse = response;
|
|
285
|
-
}
|
|
286
|
-
async claim(item) {
|
|
287
|
-
var _a;
|
|
288
|
-
const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
|
|
289
|
-
const vinDataClone = JSON.parse(JSON.stringify(serviceItems));
|
|
290
|
-
const index = serviceItems.indexOf(item);
|
|
291
|
-
//Find other items before this item that have status 'pending'
|
|
292
|
-
let pendingItemsBefore = vinDataClone.slice(0, index).filter(x => x.status === 'pending');
|
|
293
|
-
this.cachedClaimItem = item;
|
|
294
|
-
if (item.maximumMileage === null) {
|
|
295
|
-
pendingItemsBefore = [];
|
|
296
|
-
}
|
|
297
|
-
this.onMouseLeave();
|
|
298
|
-
this.openRedeem(item, pendingItemsBefore);
|
|
299
|
-
}
|
|
300
|
-
async handleClaiming() {
|
|
301
|
-
if (this.isDev) {
|
|
302
|
-
this.dynamicRedeem.handleClaiming = async (payload) => {
|
|
303
|
-
await new Promise(r => setTimeout(r, 500));
|
|
304
|
-
console.log(Object.assign(Object.assign({}, payload), { vin: this.vehicleInformation.vin, saleInformation: this.vehicleInformation.saleInformation, serviceItem: this.dynamicRedeem.item, cancelledServiceItems: this.dynamicRedeem.canceledItems }));
|
|
305
|
-
this.dynamicRedeem.quite();
|
|
306
|
-
this.completeClaim({ Success: true, ID: '11223344', PrintURL: 'http://localhost/test/print/1122' });
|
|
307
|
-
this.dynamicRedeem.handleClaiming = null;
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
this.dynamicRedeem.handleClaiming = async (payload) => {
|
|
312
|
-
try {
|
|
313
|
-
const response = await fetch(this.claimEndPoint, {
|
|
314
|
-
method: 'POST',
|
|
315
|
-
headers: Object.assign({ 'Content-Type': 'application/json' }, this.headers),
|
|
316
|
-
body: JSON.stringify(Object.assign(Object.assign({}, payload), { vin: this.vehicleInformation.vin, saleInformation: this.vehicleInformation.saleInformation, serviceItem: this.dynamicRedeem.item, cancelledServiceItems: this.dynamicRedeem.canceledItems })),
|
|
317
|
-
});
|
|
318
|
-
const data = await response.json();
|
|
319
|
-
if (!data.Success) {
|
|
320
|
-
alert(data.Message);
|
|
321
|
-
this.dynamicRedeem.quite();
|
|
322
|
-
this.dynamicRedeem.handleClaiming = null;
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
this.dynamicRedeem.quite();
|
|
326
|
-
this.completeClaim(data);
|
|
327
|
-
this.dynamicRedeem.handleClaiming = null;
|
|
328
|
-
}
|
|
329
|
-
catch (error) {
|
|
330
|
-
console.error(error);
|
|
331
|
-
alert(this.sharedLocales.errors.requestFailedPleaseTryAgainLater);
|
|
332
|
-
this.dynamicRedeem.quite();
|
|
333
|
-
this.dynamicRedeem.handleClaiming = null;
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
openRedeem(item, oldItems) {
|
|
339
|
-
var _a, _b, _c, _d, _e;
|
|
340
|
-
const vehicleInformation = this.vehicleInformation;
|
|
341
|
-
this.dynamicRedeem.vin = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.vin;
|
|
342
|
-
this.dynamicRedeem.item = item;
|
|
343
|
-
this.dynamicRedeem.canceledItems = oldItems;
|
|
344
|
-
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)
|
|
345
|
-
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;
|
|
346
|
-
else
|
|
347
|
-
this.dynamicRedeem.unInvoicedByBrokerName = null;
|
|
348
|
-
this.handleClaiming();
|
|
349
|
-
}
|
|
350
|
-
createPopup(item) {
|
|
351
|
-
const texts = this.locale;
|
|
352
|
-
return (index.h("div", { dir: this.sharedLocales.direction, 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, texts.serviceType), index.h("td", null, item.type.charAt(0).toUpperCase() + item.type.slice(1))), index.h("tr", null, index.h("th", null, texts.activationDate), index.h("td", null, item.activatedAt)), index.h("tr", null, index.h("th", null, texts.expireDate), index.h("td", null, item.expiresAt)), index.h("tr", null, index.h("th", null, texts.claimAt), index.h("td", null, item.claimDate)), index.h("tr", null, index.h("th", null, texts.claimingCompany), index.h("td", null, item.companyName)), index.h("tr", null, index.h("th", null, texts.invoiceNumber), index.h("td", null, item.invoiceNumber)), index.h("tr", null, index.h("th", null, texts.jobNumber), index.h("td", null, item.jobNumber)), index.h("tr", null, index.h("th", null, texts.packageCode), index.h("td", null, item.packageCode)))), item.claimable && (index.h("button", { onClick: () => this.claim(item), class: "claim-button dynamic-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, texts.claim)))))));
|
|
353
|
-
}
|
|
354
|
-
render() {
|
|
355
|
-
var _a, _b;
|
|
356
|
-
const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
|
|
357
|
-
const texts = this.locale;
|
|
358
|
-
console.log(this.errorMessage);
|
|
359
|
-
return (index.h(index.Host, { key: '9d13955aa4b86915d66dd148cdb792b77e160913' }, index.h("dynamic-redeem", { key: 'ae4347ecb2dff9d356d54e5f74b1e41a8f913dd3', locale: texts.dynamicRedeem, language: this.language, id: "dynamic-redeem" }), index.h("div", { key: '7b34dcde293f0afd4c725218043aa7553cb21849', class: cn.cn('dynamic-claim-wrapper', { loading: this.isLoading, idle: this.isIdle }) }, index.h("div", { key: 'bfe97aa0f5e0493e0a601be6225d71b50bbbf3f3', class: "dynamic-claim-header" }, index.h("strong", { key: '454d564a081455faee7610b57d481668c18b389a', onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-header-vin load-animation" }, this.errorMessage && (index.h("span", { key: '221069a9f75b249a3ca5713bee0346d1a86c3ffc', dir: this.sharedLocales.direction, style: { color: 'red' } }, this.sharedLocales.errors[this.errorMessage] || this.sharedLocales.errors.wildCard)), !this.errorMessage && ((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin))), index.h("div", { key: '6efeeb51330123a005b9acf77ccb71370a9e6bff', class: cn.cn('dynamic-claim-body', {
|
|
360
|
-
'has-footer-box': (this.vehicleInformation && this.vehicleInformation.serviceItems.filter(x => x.status === 'activationRequired').length > 0) || this.showPrintBox,
|
|
361
|
-
}) }, index.h("div", { key: '28186523f43fa68978cb54225b9645144c001bd4', class: "loading-lane" }, index.h("div", { key: 'ba4eaad729d14b0bb7a3691a7518728be013c2bf', class: "dynamic-claim-loading-slider" }, index.h("div", { key: 'a7946a63258105cddd7d81d1bd70c8997a07d772', class: "dynamic-claim-loading-slider-line" }), index.h("div", { key: 'd93a6212bddef490710dd276f61007b6d66992f1', class: "dynamic-claim-loading-slider-subline dynamic-claim-inc" }), index.h("div", { key: 'a5998fd503962f6f118dc108ca6f85944ff4ef65', class: "dynamic-claim-loading-slider-subline dynamic-claim-dec" }))), index.h("div", { key: 'dabf1a5e38b198610c87b6f3be2b61dce87f42fe', class: "dynamic-claim-progress-lane" }, serviceItems.map((item, idx) => {
|
|
362
|
-
let statusClass = '';
|
|
363
|
-
if (item.status === 'pending') {
|
|
364
|
-
if (serviceItems.findIndex(i => i.status === 'pending') === idx)
|
|
365
|
-
statusClass = item.status;
|
|
366
|
-
}
|
|
367
|
-
else
|
|
368
|
-
statusClass = item.status;
|
|
369
|
-
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, texts[item.status]), 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)));
|
|
370
|
-
}), index.h("div", { key: 'f8c7002b1d01169d6e2f843d6f6681186f4094c0', class: "dynamic-claim-progress-bar" })), index.h("div", { key: '4cb3e451478987c1023744c7d8e706d7ee2a02b7', class: "dynamic-claim-activation-box", style: { zIndex: this.vehicleInformation && this.vehicleInformation.serviceItems.filter(x => x.status === 'activationRequired').length > 0 ? '1' : '-1' } }, index.h("div", { key: 'e5d0d01794b6830135c7c36c627205b4b97e8cbe', class: cn.cn('card warning-card span-entire-1st-row activation-panel', {
|
|
371
|
-
loading: this.isLoading,
|
|
372
|
-
visible: this.vehicleInformation && this.vehicleInformation.serviceItems.filter(x => x.status === 'activationRequired').length > 0,
|
|
373
|
-
}), onAnimationEnd: this.removeLoadAnimationClass }, index.h("p", { key: 'd1cb715325d3f209638898568cb95a8bde2f22bd', class: "no-padding flex gap-2" }, index.h("span", { key: '122a1cddc7392061fc37a561ac5761d7642f33f1', class: "font-semibold" }, texts.warrantyAndServicesNotActivated)), index.h("button", { key: 'f8e1ed23714f265b7774b2fded1f7477a4d5928f', onClick: () => {
|
|
374
|
-
if (this.activate) {
|
|
375
|
-
this.activate(this.vehicleInformation);
|
|
376
|
-
}
|
|
377
|
-
}, class: "claim-button dynamic-claim-button" }, index.h("svg", { key: 'e9e0b81f8374ece0bc8154f1e8af4fae0b9169e3', width: "30px", height: "30px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("g", { key: '676da398fa2160888a1785506eaa2e8e7a1784e3', "stroke-width": "0" }), index.h("g", { key: 'b93acbb3fcfd8f3ac3988974fc1943db9768af57', "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", { key: 'd92ee117a6f155e3657f9714ddeeeadba69e8165' }, index.h("circle", { key: '4cd80893c63809ecd986231b5dbf856745627c50', cx: "12", cy: "12", r: "8", "fill-opacity": "0.24" }), index.h("path", { key: '070d17ec2429d1402771c7ada512b18484dca781', 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", { key: 'c3101c31243bf0747c427b8f878f82c929db91a8' }, texts.activateNow)))), index.h("div", { key: '249f76c045f13253ed897a2bee6e397f7addb993', class: "dynamic-claim-activation-box", style: { zIndex: this.showPrintBox ? '1' : '-1' } }, index.h("div", { key: '7af7150afa558d6aae6c3b08a5a07fa931cb55b4', class: cn.cn('card warning-card span-entire-1st-row activation-panel', {
|
|
378
|
-
loading: this.isLoading,
|
|
379
|
-
visible: this.showPrintBox,
|
|
380
|
-
}), onAnimationEnd: this.removeLoadAnimationClass }, index.h("p", { key: '4c7f311229649da0959474402970a460101159ae', class: "no-padding flex gap-2" }, index.h("span", { key: 'adb1a993318639db4e977199a7640fb18a2d661c', class: "font-semibold" }, texts.successFulClaimMessage)), index.h("button", { key: '1d8337d2a8f2d0682043c5f0aeee4cd5ef54918c', onClick: () => {
|
|
381
|
-
if (this.print) {
|
|
382
|
-
this.print(this.lastSuccessfullClaimResponse);
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
if (this.lastSuccessfullClaimResponse.PrintURL) {
|
|
386
|
-
window.open(this.lastSuccessfullClaimResponse.PrintURL, '_blank').focus();
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}, class: "claim-button dynamic-claim-button" }, index.h("svg", { key: '341e91c89f3082b4b70d75aa9b64bf9955f2435f', width: "30px", height: "30px", viewBox: "-5 -5 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '538c5154a85b853e18a7b28314278088a8ba4ac9', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M17 7H7V6h10v1zm0 12H7v-6h10v6zm2-12V3H5v4H1v8.996C1 17.103 1.897 18 3.004 18H5v3h14v-3h1.996A2.004 2.004 0 0 0 23 15.996V7h-4z", fill: "rgb(252, 248, 227)" })), index.h("span", { key: '31aca8b5e9722bcd1e9349f954b6320ea62cd388' }, texts.print))))))));
|
|
390
|
-
}
|
|
391
|
-
get el() { return index.getElement(this); }
|
|
392
|
-
static get watchers() { return {
|
|
393
|
-
"language": ["changeLanguage"],
|
|
394
|
-
"isLoading": ["onLoadingChange"],
|
|
395
|
-
"vehicleInformation": ["resetProgressBar"],
|
|
396
|
-
"popupClasses": ["windowScrollListener"]
|
|
397
|
-
}; }
|
|
398
|
-
};
|
|
399
|
-
DynamicClaim.style = DynamicClaimStyle0;
|
|
400
|
-
|
|
401
|
-
function openImageViewer(context, target, imageSrc) {
|
|
402
|
-
if (context.expandedImage === imageSrc)
|
|
403
|
-
return;
|
|
404
|
-
context.originalImage = target;
|
|
405
|
-
const expandedImageRef = context.el.shadowRoot.getElementById('expanded-image');
|
|
406
|
-
expandedImageRef.src = target.src;
|
|
407
|
-
document.addEventListener('keydown', context.closeImageListener);
|
|
408
|
-
const rect = target.getBoundingClientRect();
|
|
409
|
-
document.body.style.overflow = 'hidden';
|
|
410
|
-
Object.assign(expandedImageRef.style, {
|
|
411
|
-
top: `${rect.top}px`,
|
|
412
|
-
pointerEvents: 'auto',
|
|
413
|
-
left: `${rect.left}px`,
|
|
414
|
-
transitionDuration: '0s',
|
|
415
|
-
width: `${rect.width}px`,
|
|
416
|
-
height: `${rect.height}px`,
|
|
417
|
-
});
|
|
418
|
-
setTimeout(() => {
|
|
419
|
-
const naturalWidth = target.naturalWidth;
|
|
420
|
-
const naturalHeight = target.naturalHeight;
|
|
421
|
-
const maxWidth = window.innerWidth - 160;
|
|
422
|
-
const maxHeight = window.innerHeight - 32;
|
|
423
|
-
const aspectRatio = naturalWidth / naturalHeight;
|
|
424
|
-
let width, height;
|
|
425
|
-
if (maxWidth / aspectRatio <= maxHeight) {
|
|
426
|
-
width = maxWidth;
|
|
427
|
-
height = maxWidth / aspectRatio;
|
|
428
|
-
}
|
|
429
|
-
else {
|
|
430
|
-
height = maxHeight;
|
|
431
|
-
width = maxHeight * aspectRatio;
|
|
432
|
-
}
|
|
433
|
-
expandedImageRef.style.transitionDuration = '0.3s';
|
|
434
|
-
Object.assign(expandedImageRef.style, {
|
|
435
|
-
opacity: '1',
|
|
436
|
-
width: `${width}px`,
|
|
437
|
-
height: `${height}px`,
|
|
438
|
-
top: `${(window.innerHeight - height) / 2}px`,
|
|
439
|
-
left: `${(window.innerWidth - width) / 2}px`,
|
|
440
|
-
});
|
|
441
|
-
context.expandedImage = imageSrc;
|
|
442
|
-
}, 200);
|
|
443
|
-
}
|
|
444
|
-
function closeImageViewer(context, event) {
|
|
445
|
-
if (event && event.key !== 'Escape')
|
|
446
|
-
return;
|
|
447
|
-
document.removeEventListener('keydown', context.closeImageListener);
|
|
448
|
-
const expandedImageRef = context.el.shadowRoot.getElementById('expanded-image');
|
|
449
|
-
const rect = context.originalImage.getBoundingClientRect();
|
|
450
|
-
Object.assign(expandedImageRef.style, {
|
|
451
|
-
top: `${rect.top}px`,
|
|
452
|
-
pointerEvents: 'none',
|
|
453
|
-
left: `${rect.left}px`,
|
|
454
|
-
width: `${rect.width}px`,
|
|
455
|
-
height: `${rect.height}px`,
|
|
456
|
-
transitionDuration: '0.3s',
|
|
457
|
-
});
|
|
458
|
-
setTimeout(() => {
|
|
459
|
-
expandedImageRef.src = '';
|
|
460
|
-
expandedImageRef.style.opacity = '0';
|
|
461
|
-
expandedImageRef.style.transitionDuration = '0s';
|
|
462
|
-
}, 300);
|
|
463
|
-
document.body.style.overflow = '';
|
|
464
|
-
context.expandedImage = null;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
const eyeSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIgogICAgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWV5ZSI+CiAgICA8cGF0aCBkPSJNMi4wNjIgMTIuMzQ4YTEgMSAwIDAgMSAwLS42OTYgMTAuNzUgMTAuNzUgMCAwIDEgMTkuODc2IDAgMSAxIDAgMCAxIDAgLjY5NiAxMC43NSAxMC43NSAwIDAgMS0xOS44NzYgMCIgLz4KICAgIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjMiIC8+Cjwvc3ZnPg==';
|
|
468
|
-
|
|
469
|
-
const paintThicknessCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.left-0{left:0}.z-10{z-index:10}.z-40{z-index:40}.float-right{float:right}.mr-\\[16px\\]{margin-right:16px}.mt-\\[16px\\]{margin-top:16px}.size-12{height:3rem;width:3rem}.size-full{height:100%;width:100%}.h-1{height:.25rem}.h-\\[100dvh\\]{height:100dvh}.h-\\[150px\\]{height:150px}.h-\\[50px\\]{height:50px}.w-12{width:3rem}.w-\\[100dvw\\]{width:100dvw}.w-auto{width:auto}.min-w-\\[100px\\]{min-width:100px}.-rotate-45{--tw-rotate:-45deg}.-rotate-45,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.cursor-pointer{cursor:pointer}.flex-wrap{flex-wrap:wrap}.gap-\\[16px\\]{gap:16px}.gap-\\[4px\\]{gap:4px}.gap-\\[8px\\]{gap:8px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.\\!border-none{border-style:none!important}.bg-black\\/40{background-color:rgba(0,0,0,.4)}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity,1))}.p-\\[12px\\]{padding:12px}.p-\\[6px\\]{padding:6px}.px-\\[15px\\]{padding-left:15px;padding-right:15px}.px-\\[24px\\]{padding-left:24px;padding-right:24px}.px-\\[30px\\]{padding-left:30px;padding-right:30px}.py-\\[15px\\]{padding-bottom:15px;padding-top:15px}.font-semibold{font-weight:600}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-100{opacity:1}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.delay-200{transition-delay:.2s}.duration-100{transition-duration:.1s}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:opacity-100:hover{opacity:1}.\\[\\&_div\\]\\:hover\\:\\!opacity-100:hover div{opacity:1!important}.\\[\\&_img\\]\\:hover\\:shadow-lg:hover img{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
|
|
470
|
-
const PaintThicknessStyle0 = paintThicknessCss;
|
|
471
|
-
|
|
472
|
-
let mockData$4 = {};
|
|
473
|
-
const PaintThickness = class {
|
|
474
|
-
constructor(hostRef) {
|
|
475
|
-
index.registerInstance(this, hostRef);
|
|
476
|
-
this.closeImageListener = (event) => {
|
|
477
|
-
this.closeImage(event);
|
|
478
|
-
};
|
|
479
|
-
this.openImage = (target, imageSrc) => {
|
|
480
|
-
openImageViewer(this, target, imageSrc);
|
|
481
|
-
};
|
|
482
|
-
this.closeImage = (event) => {
|
|
483
|
-
closeImageViewer(this, event);
|
|
484
|
-
};
|
|
485
|
-
this.baseUrl = '';
|
|
486
|
-
this.isDev = false;
|
|
487
|
-
this.queryString = '';
|
|
488
|
-
this.language = 'en';
|
|
489
|
-
this.errorCallback = undefined;
|
|
490
|
-
this.loadingStateChange = undefined;
|
|
491
|
-
this.loadedResponse = undefined;
|
|
492
|
-
this.sharedLocales = getLocalLanguage.sharedLocalesSchema.getDefault();
|
|
493
|
-
this.locale = type$1.paintThicknessSchema.getDefault();
|
|
494
|
-
this.state = 'idle';
|
|
495
|
-
this.externalVin = null;
|
|
496
|
-
this.expandedImage = null;
|
|
497
|
-
this.errorMessage = null;
|
|
498
|
-
this.vehicleInformation = undefined;
|
|
499
|
-
}
|
|
500
|
-
async componentWillLoad() {
|
|
501
|
-
await this.changeLanguage(this.language);
|
|
502
|
-
}
|
|
503
|
-
async changeLanguage(newLanguage) {
|
|
504
|
-
const localeResponses = await Promise.all([getLocalLanguage.getLocaleLanguage(newLanguage, 'vehicleLookup.paintThickness', type$1.paintThicknessSchema), getLocalLanguage.getSharedLocal(newLanguage)]);
|
|
505
|
-
this.locale = localeResponses[0];
|
|
506
|
-
this.sharedLocales = localeResponses[1];
|
|
507
|
-
}
|
|
508
|
-
handleSettingData(response) {
|
|
509
|
-
if (!response.paintThickness)
|
|
510
|
-
response.paintThickness = { imageGroups: [], parts: [] };
|
|
511
|
-
if (!response.paintThickness.parts || !Array.isArray(response.paintThickness.parts))
|
|
512
|
-
response.paintThickness.parts = [];
|
|
513
|
-
if (!response.paintThickness.imageGroups || !Array.isArray(response.paintThickness.imageGroups))
|
|
514
|
-
response.paintThickness.imageGroups = [];
|
|
515
|
-
this.vehicleInformation = response;
|
|
516
|
-
}
|
|
517
|
-
async setData(newData, headers = {}) {
|
|
518
|
-
clearTimeout(this.networkTimeoutRef);
|
|
519
|
-
if (this.abortController)
|
|
520
|
-
this.abortController.abort();
|
|
521
|
-
this.abortController = new AbortController();
|
|
522
|
-
let scopedTimeoutRef;
|
|
523
|
-
const isVinRequest = typeof newData === 'string';
|
|
524
|
-
const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
|
|
525
|
-
this.externalVin = vin;
|
|
526
|
-
try {
|
|
527
|
-
if (!vin || vin.trim().length === 0) {
|
|
528
|
-
this.state = 'idle';
|
|
529
|
-
return;
|
|
530
|
-
}
|
|
531
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
532
|
-
this.state = (this.state + '-loading');
|
|
533
|
-
}
|
|
534
|
-
else
|
|
535
|
-
this.state = 'loading';
|
|
536
|
-
await new Promise(r => {
|
|
537
|
-
scopedTimeoutRef = setTimeout(r, 700);
|
|
538
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
539
|
-
});
|
|
540
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$4 }, headers) : newData;
|
|
541
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
542
|
-
if (!vehicleResponse)
|
|
543
|
-
throw new Error('wrongResponseFormat');
|
|
544
|
-
this.handleSettingData(vehicleResponse);
|
|
545
|
-
}
|
|
546
|
-
this.errorMessage = null;
|
|
547
|
-
this.state = 'data';
|
|
548
|
-
}
|
|
549
|
-
catch (error) {
|
|
550
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
551
|
-
return;
|
|
552
|
-
if (this.errorCallback)
|
|
553
|
-
this.errorCallback(error.message);
|
|
554
|
-
console.error(error);
|
|
555
|
-
this.setErrorMessage(error.message);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
async setErrorMessage(message) {
|
|
559
|
-
this.state = 'error';
|
|
560
|
-
this.vehicleInformation = null;
|
|
561
|
-
this.errorMessage = message;
|
|
562
|
-
}
|
|
563
|
-
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
564
|
-
await this.setData(requestedVin, headers);
|
|
565
|
-
}
|
|
566
|
-
async loadingListener() {
|
|
567
|
-
if (this.loadingStateChange)
|
|
568
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
569
|
-
}
|
|
570
|
-
async setMockData(newMockData) {
|
|
571
|
-
mockData$4 = newMockData;
|
|
572
|
-
}
|
|
573
|
-
render() {
|
|
574
|
-
var _a, _b;
|
|
575
|
-
const texts = this.locale;
|
|
576
|
-
const { imageGroups, parts } = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.paintThickness : { imageGroups: [], parts: [] };
|
|
577
|
-
return (index.h(index.Host, { key: '5cf6027c08c9c5a8c4de538b21f2c326ea833ada' }, index.h("div", { key: '5236eb6c195132999d5d0d10998438cd5fe3d860', dir: this.sharedLocales.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: 'e0fd50defb44a210d4d506c60de0837af738e059' }, index.h("loading-spinner", { key: '023b451e2ec4820432133ca81ec8ce41738577c6', isLoading: this.state.includes('loading') }), index.h("div", { key: 'b4039f92553e97f84c84b2b343119a82eb6d33c3', class: cn.cn('transition-all !duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, index.h("div", { key: '27f471f599de69c000e7e72a636754683611bcdb', class: cn.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) && (index.h("div", { key: 'a0b40d877bcef9d481e36542f1ca55b9de54f134', class: "py-[16px] min-h-[100px] flex items-center" }, index.h("div", { key: '2ec7c16dfdd380c0633f88d791f0ccd652dc6905', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.sharedLocales.errors[this.errorMessage] || this.sharedLocales.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: 'd515c83a7c872a7f41876d616a76aee8c8759244', class: "flex mt-[12px] w-full max-h-[70dvh] overflow-hidden mx-auto rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: 'e5438160a2a723e00fb56329e7a4a262c65bb677', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.paintThickness), index.h("div", { key: '3e9b5cfa0f0030e61d9c7964a98b36410c8c5794', class: "h-0 overflow-auto flex-1" }, !parts.length && index.h("div", { key: '71e6473211447e656dd1676a5f6c2972558e5498', class: "h-[50px] px-[30px] flex items-center justify-center text-[18px]" }, texts.noData), !!parts.length && (index.h("table", { key: '29e1eb38df1415643f5ebb004399b63c85cae106', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: '35ad4d6c4842cc1c04b79ffda3535d27a4b9c350', class: "top-0 font-bold sticky bg-white" }, index.h("tr", { key: 'b90b810337112bb7309aa316dc9752966215e5b9' }, ['part', 'left', 'right'].map(title => (index.h("th", { key: title, class: "px-[15px] min-w-[100px] py-[15px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), index.h("tbody", { key: 'aee596b314c239e10b2f8c297e00012519eb00bb' }, parts.map((part, idx) => (index.h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: part.part }, ['part', 'left', 'right'].map(key => (index.h("td", { key: part.part + key, class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
578
|
-
'!border-none': idx === parts.length - 1,
|
|
579
|
-
}) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: 'ac3c37f44035acc79c42cf0c35b9b4503bbfbdfb' }, !imageGroups.length && index.h("div", { key: '30ae37f513121bb4b6c6c1d96662b0672196ee89', class: "h-[40px] px-[30px] flex text-red-500 items-center justify-center text-[18px]" }, texts.noImageGroups), !!imageGroups.length && (index.h("div", { key: '4ddadccfb0f2973033a4e05c6af575156605dbb4', class: "py-[16px] gap-[16px] justify-center flex flex-wrap px-[24px] w-full" }, imageGroups.map(imageGroup => (index.h("div", { class: "shrink-0 rounded-lg shadow-sm border overflow-hidden flex flex-col", key: imageGroup.name }, index.h("h1", { class: "text-center border-b bg-slate-200 font-semibold p-[6px]" }, imageGroup.name), index.h("div", { class: "flex p-[12px] gap-[8px]" }, imageGroup.images.map(image => (index.h("div", { class: "flex gap-[8px]", key: image }, index.h("button", { onClick: ({ target }) => this.openImage(target, image), class: "shrink-0 relative ring-0 outline-none w-fit mx-auto [&_img]:hover:shadow-lg [&_div]:hover:!opacity-100 cursor-pointer" }, index.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" }, index.h("img", { src: eyeSvg }), index.h("span", { class: "text-white" }, texts.expand)), index.h("img", { class: "w-auto h-[150px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: image }))))))))), index.h("div", { key: '3c760384222e35e6ccb5874d0f5eac00a75418a5', onClick: () => this.closeImage(), style: { backdropFilter: this.expandedImage ? 'blur(3px)' : 'blur(0px)' }, class: cn.cn('pointer-events-none w-[100dvw] h-[100dvh] fixed top-0 z-10 left-0 opacity-0 bg-black/40 transition-all duration-400', {
|
|
580
|
-
'pointer-events-auto opacity-100 delay-200': this.expandedImage,
|
|
581
|
-
}) }, index.h("button", { key: '98da1dba1744bda8d4add7df8e6c7b59248476c0', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, index.h("div", { key: 'bd5e413346012fa83b351435a2ceb0c707a78238', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), index.h("div", { key: '503cadb97679a46e94581d96436364b0c00e5800', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), index.h("img", { key: '5b623cfab2cff6ffe8242ded2c59b1ce6729f411', alt: "", id: "expanded-image", class: "fixed opacity-0 z-40 transition-all rounded-lg" }))))))))));
|
|
582
|
-
}
|
|
583
|
-
get el() { return index.getElement(this); }
|
|
584
|
-
static get watchers() { return {
|
|
585
|
-
"language": ["changeLanguage"],
|
|
586
|
-
"state": ["loadingListener"]
|
|
587
|
-
}; }
|
|
588
|
-
};
|
|
589
|
-
PaintThickness.style = PaintThicknessStyle0;
|
|
590
|
-
|
|
591
|
-
const serviceHistoryCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.\\!border-none{border-style:none!important}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}";
|
|
592
|
-
const ServiceHistoryStyle0 = serviceHistoryCss;
|
|
593
|
-
|
|
594
|
-
let mockData$3 = {};
|
|
595
|
-
const ServiceHistory = class {
|
|
596
|
-
constructor(hostRef) {
|
|
597
|
-
index.registerInstance(this, hostRef);
|
|
598
|
-
this.baseUrl = '';
|
|
599
|
-
this.isDev = false;
|
|
600
|
-
this.queryString = '';
|
|
601
|
-
this.language = 'en';
|
|
602
|
-
this.errorCallback = undefined;
|
|
603
|
-
this.loadingStateChange = undefined;
|
|
604
|
-
this.loadedResponse = undefined;
|
|
605
|
-
this.sharedLocales = getLocalLanguage.sharedLocalesSchema.getDefault();
|
|
606
|
-
this.locale = type$1.ServiceHistorySchema.getDefault();
|
|
607
|
-
this.state = 'idle';
|
|
608
|
-
this.externalVin = null;
|
|
609
|
-
this.errorMessage = null;
|
|
610
|
-
this.vehicleInformation = undefined;
|
|
611
|
-
}
|
|
612
|
-
async componentWillLoad() {
|
|
613
|
-
await this.changeLanguage(this.language);
|
|
614
|
-
}
|
|
615
|
-
async changeLanguage(newLanguage) {
|
|
616
|
-
const localeResponses = await Promise.all([getLocalLanguage.getLocaleLanguage(newLanguage, 'vehicleLookup.serviceHistory', type$1.ServiceHistorySchema), getLocalLanguage.getSharedLocal(newLanguage)]);
|
|
617
|
-
this.locale = localeResponses[0];
|
|
618
|
-
this.sharedLocales = localeResponses[1];
|
|
619
|
-
}
|
|
620
|
-
handleSettingData(response) {
|
|
621
|
-
if (response.serviceHistory === null)
|
|
622
|
-
response.serviceHistory = [];
|
|
623
|
-
this.vehicleInformation = response;
|
|
624
|
-
}
|
|
625
|
-
async setData(newData, headers = {}) {
|
|
626
|
-
clearTimeout(this.networkTimeoutRef);
|
|
627
|
-
if (this.abortController)
|
|
628
|
-
this.abortController.abort();
|
|
629
|
-
this.abortController = new AbortController();
|
|
630
|
-
let scopedTimeoutRef;
|
|
631
|
-
const isVinRequest = typeof newData === 'string';
|
|
632
|
-
const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
|
|
633
|
-
this.externalVin = vin;
|
|
634
|
-
try {
|
|
635
|
-
if (!vin || vin.trim().length === 0) {
|
|
636
|
-
this.state = 'idle';
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
640
|
-
this.state = (this.state + '-loading');
|
|
641
|
-
}
|
|
642
|
-
else
|
|
643
|
-
this.state = 'loading';
|
|
644
|
-
await new Promise(r => {
|
|
645
|
-
scopedTimeoutRef = setTimeout(r, 700);
|
|
646
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
647
|
-
});
|
|
648
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$3 }, headers) : newData;
|
|
649
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
650
|
-
if (!vehicleResponse)
|
|
651
|
-
throw new Error('wrongResponseFormat');
|
|
652
|
-
this.handleSettingData(vehicleResponse);
|
|
653
|
-
}
|
|
654
|
-
this.errorMessage = null;
|
|
655
|
-
this.state = 'data';
|
|
656
|
-
}
|
|
657
|
-
catch (error) {
|
|
658
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
659
|
-
return;
|
|
660
|
-
if (this.errorCallback)
|
|
661
|
-
this.errorCallback(error.message);
|
|
662
|
-
console.error(error);
|
|
663
|
-
this.setErrorMessage(error.message);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
async setErrorMessage(message) {
|
|
667
|
-
this.state = 'error';
|
|
668
|
-
this.vehicleInformation = null;
|
|
669
|
-
this.errorMessage = message;
|
|
670
|
-
}
|
|
671
|
-
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
672
|
-
await this.setData(requestedVin, headers);
|
|
673
|
-
}
|
|
674
|
-
async loadingListener() {
|
|
675
|
-
if (this.loadingStateChange)
|
|
676
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
677
|
-
}
|
|
678
|
-
async setMockData(newMockData) {
|
|
679
|
-
mockData$3 = newMockData;
|
|
680
|
-
}
|
|
681
|
-
render() {
|
|
682
|
-
var _a, _b, _c, _d;
|
|
683
|
-
const texts = this.locale;
|
|
684
|
-
return (index.h(index.Host, { key: '0e5939e4bf9499fb5fba4955ba7d29b500e80bac' }, index.h("div", { key: '79f984c463535cd9d735bae6e019b29cefd6c410', dir: this.sharedLocales.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '316b135a3461c16218870ce39f8eb5127c117019' }, index.h("loading-spinner", { key: '9edf4bec08074dab03b992db3bf8cd0a52602bed', isLoading: this.state.includes('loading') }), index.h("div", { key: '8c76a38dbecd12dbcd1b0693228b4bd73bd9a31f', class: cn.cn('transition-all !duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, index.h("div", { key: '227fc59ddbe406ad3c84603de34dd84098df1191', class: cn.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) && (index.h("div", { key: 'bd60d59ed2eabd00e7a84168754fd8c2b3c8f436', class: "py-[16px] min-h-[100px] flex items-center" }, index.h("div", { key: 'c285e25b09bb46072a6d9116c58f332ac70d26dd', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.sharedLocales.errors[this.errorMessage] || this.sharedLocales.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: '95f271f764bbf2b522906bd972374afdbeb02889', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '0b4bb7b42ff6fb09d8a4ef0167ff8ebe844005b5', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.serviceHistory), index.h("div", { key: 'a7c65d1ade154fac3184a8b04b0eb9eec7d008cc', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.serviceHistory.length) && index.h("div", { key: '934f95e3da47173cae129c058b99dd369582e81d', class: "h-[80px] flex items-center justify-center text-[18px]" }, texts.noData), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.serviceHistory.length) && (index.h("table", { key: 'e2e030e2efc868f1cd4a18ecb6206b7f48a722a8', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: 'd6caf86fd4ab924fc88767b7935080fc0535c9ad', class: "top-0 font-bold sticky bg-white" }, index.h("tr", { key: 'dd3998857469c723722a148434080d17fe449b2f' }, ['branch', 'dealer', 'invoiceNumber', 'date', 'serviceType', 'odometer'].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), index.h("tbody", { key: 'd4c08cfe577f353c57a85807983a8503ea3e3598' }, (_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.serviceHistory.map((service, idx) => (index.h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: service.invoiceNumber }, ['branchName', 'companyName', 'invoiceNumber', 'serviceDate', 'serviceType', 'mileage'].map(serviceType => {
|
|
685
|
-
var _a;
|
|
686
|
-
return (index.h("td", { key: service.invoiceNumber + serviceType, class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
687
|
-
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|
|
688
|
-
}) }, service[serviceType] || '...'));
|
|
689
|
-
})))))))))))))));
|
|
690
|
-
}
|
|
691
|
-
get el() { return index.getElement(this); }
|
|
692
|
-
static get watchers() { return {
|
|
693
|
-
"language": ["changeLanguage"],
|
|
694
|
-
"state": ["loadingListener"]
|
|
695
|
-
}; }
|
|
696
|
-
};
|
|
697
|
-
ServiceHistory.style = ServiceHistoryStyle0;
|
|
698
|
-
|
|
699
|
-
const vehicleAccessoriesCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.left-0{left:0}.z-40{z-index:40}.z-50{z-index:50}.float-right{float:right}.mr-\\[16px\\]{margin-right:16px}.mt-\\[16px\\]{margin-top:16px}.size-12{height:3rem;width:3rem}.size-full{height:100%;width:100%}.h-1{height:.25rem}.h-\\[100dvh\\]{height:100dvh}.h-auto{height:auto}.max-h-\\[133px\\]{max-height:133px}.w-12{width:3rem}.w-\\[100dvw\\]{width:100dvw}.w-auto{width:auto}.max-w-\\[133px\\]{max-width:133px}.-rotate-45{--tw-rotate:-45deg}.-rotate-45,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.cursor-pointer{cursor:pointer}.gap-\\[4px\\]{gap:4px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.\\!border-none{border-style:none!important}.bg-black\\/40{background-color:rgba(0,0,0,.4)}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-100{opacity:1}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.delay-200{transition-delay:.2s}.duration-100{transition-duration:.1s}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:opacity-100:hover{opacity:1}.\\[\\&_div\\]\\:hover\\:\\!opacity-100:hover div{opacity:1!important}.\\[\\&_img\\]\\:hover\\:shadow-lg:hover img{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
|
|
700
|
-
const VehicleAccessoriesStyle0 = vehicleAccessoriesCss;
|
|
701
|
-
|
|
702
|
-
let mockData$2 = {};
|
|
703
|
-
const VehicleAccessories = class {
|
|
704
|
-
constructor(hostRef) {
|
|
705
|
-
index.registerInstance(this, hostRef);
|
|
706
|
-
this.closeImageListener = (event) => {
|
|
707
|
-
this.closeImage(event);
|
|
708
|
-
};
|
|
709
|
-
this.openImage = (target, imageSrc) => {
|
|
710
|
-
openImageViewer(this, target, imageSrc);
|
|
711
|
-
};
|
|
712
|
-
this.closeImage = (event) => {
|
|
713
|
-
closeImageViewer(this, event);
|
|
714
|
-
};
|
|
715
|
-
this.baseUrl = '';
|
|
716
|
-
this.isDev = false;
|
|
717
|
-
this.queryString = '';
|
|
718
|
-
this.language = 'en';
|
|
719
|
-
this.errorCallback = undefined;
|
|
720
|
-
this.loadingStateChange = undefined;
|
|
721
|
-
this.loadedResponse = undefined;
|
|
722
|
-
this.sharedLocales = getLocalLanguage.sharedLocalesSchema.getDefault();
|
|
723
|
-
this.locale = type$1.accessoriesSchema.getDefault();
|
|
724
|
-
this.state = 'idle';
|
|
725
|
-
this.externalVin = null;
|
|
726
|
-
this.expandedImage = null;
|
|
727
|
-
this.errorMessage = null;
|
|
728
|
-
this.vehicleInformation = undefined;
|
|
729
|
-
}
|
|
730
|
-
async componentWillLoad() {
|
|
731
|
-
await this.changeLanguage(this.language);
|
|
732
|
-
}
|
|
733
|
-
async changeLanguage(newLanguage) {
|
|
734
|
-
const localeResponses = await Promise.all([getLocalLanguage.getLocaleLanguage(newLanguage, 'vehicleLookup.accessories', type$1.accessoriesSchema), getLocalLanguage.getSharedLocal(newLanguage)]);
|
|
735
|
-
this.locale = localeResponses[0];
|
|
736
|
-
this.sharedLocales = localeResponses[1];
|
|
737
|
-
}
|
|
738
|
-
handleSettingData(response) {
|
|
739
|
-
if (!response.accessories || !Array.isArray(response.accessories))
|
|
740
|
-
response.accessories = [];
|
|
741
|
-
this.vehicleInformation = response;
|
|
742
|
-
}
|
|
743
|
-
async setData(newData, headers = {}) {
|
|
744
|
-
clearTimeout(this.networkTimeoutRef);
|
|
745
|
-
if (this.abortController)
|
|
746
|
-
this.abortController.abort();
|
|
747
|
-
this.abortController = new AbortController();
|
|
748
|
-
let scopedTimeoutRef;
|
|
749
|
-
const isVinRequest = typeof newData === 'string';
|
|
750
|
-
const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
|
|
751
|
-
this.externalVin = vin;
|
|
752
|
-
try {
|
|
753
|
-
if (!vin || vin.trim().length === 0) {
|
|
754
|
-
this.state = 'idle';
|
|
755
|
-
return;
|
|
756
|
-
}
|
|
757
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
758
|
-
this.state = (this.state + '-loading');
|
|
759
|
-
}
|
|
760
|
-
else
|
|
761
|
-
this.state = 'loading';
|
|
762
|
-
await new Promise(r => {
|
|
763
|
-
scopedTimeoutRef = setTimeout(r, 700);
|
|
764
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
765
|
-
});
|
|
766
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$2 }, headers) : newData;
|
|
767
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
768
|
-
if (!vehicleResponse)
|
|
769
|
-
throw new Error('wrongResponseFormat');
|
|
770
|
-
this.handleSettingData(vehicleResponse);
|
|
771
|
-
}
|
|
772
|
-
this.errorMessage = null;
|
|
773
|
-
this.state = 'data';
|
|
774
|
-
}
|
|
775
|
-
catch (error) {
|
|
776
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
777
|
-
return;
|
|
778
|
-
if (this.errorCallback)
|
|
779
|
-
this.errorCallback(error.message);
|
|
780
|
-
console.error(error);
|
|
781
|
-
this.setErrorMessage(error.message);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
async setErrorMessage(message) {
|
|
785
|
-
this.state = 'error';
|
|
786
|
-
this.vehicleInformation = null;
|
|
787
|
-
this.errorMessage = message;
|
|
788
|
-
}
|
|
789
|
-
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
790
|
-
await this.setData(requestedVin, headers);
|
|
791
|
-
}
|
|
792
|
-
async loadingListener() {
|
|
793
|
-
if (this.loadingStateChange)
|
|
794
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
795
|
-
}
|
|
796
|
-
async setMockData(newMockData) {
|
|
797
|
-
mockData$2 = newMockData;
|
|
798
|
-
}
|
|
799
|
-
render() {
|
|
800
|
-
var _a, _b;
|
|
801
|
-
const texts = this.locale;
|
|
802
|
-
const accessories = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.accessories : [];
|
|
803
|
-
return (index.h(index.Host, { key: 'c1a22afb606c3f5f1e13f372d8873dc82691891e' }, index.h("div", { key: '4484f760be9023586d2e7be7dfe3e7ff673806da', dir: this.sharedLocales.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '6fef43a4d44e27334843b9e5670cfa01c55dd9a2' }, index.h("loading-spinner", { key: '53dda20b1a69f656cf47ba35cfeb9b192da1c7f5', isLoading: this.state.includes('loading') }), index.h("div", { key: 'f5a337c3f1ea3aae499432f3eac65aa3dd4d576a', class: cn.cn('transition-all !duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, index.h("div", { key: '74cdb956faaa42862c060904e52d86f1d8387a09', class: cn.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) && (index.h("div", { key: 'a9aecbeb70842a1d5961444509b9c0cb36127381', class: "py-[16px] min-h-[100px] flex items-center" }, index.h("div", { key: '3de34bf13be7868026db8036e1ebb51e527638af', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.sharedLocales.errors[this.errorMessage] || this.sharedLocales.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: '2629a2a39d53a693b73217131f7a8d5ef8363069', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '47b097bff995f4d56f13d71a16db8952bef35c80', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.vehicleAccessories), index.h("div", { key: 'e7cb6fcb748af38719f0edf1e926e60932f70e23', class: "h-0 overflow-auto flex-1" }, !accessories.length && index.h("div", { key: 'ca89d8caeeed0a267963d3d2d8b241db7e374775', class: "h-[80px] flex items-center justify-center text-[18px]" }, texts.noData), !!accessories.length && (index.h("table", { key: 'b823ff53dc2c280f7cf49852a4d2ff7db8aed7a6', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: '594ca9ba99664473b3718939be0739e2a0d1db17', class: "top-0 font-bold z-40 sticky bg-white" }, index.h("tr", { key: '49e7e07464a3f948da89a21d493261fc2c6ccc71' }, ['partNumber', 'description', 'image'].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), index.h("tbody", { key: '58813c83f80851e79e372d644b9b8e7d6598480a' }, accessories.map((accessory, idx) => {
|
|
804
|
-
var _a;
|
|
805
|
-
return (index.h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: accessory.partNumber }, ['partNumber', 'description'].map(key => {
|
|
806
|
-
var _a;
|
|
807
|
-
return (index.h("td", { key: accessory.partNumber + key, class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
808
|
-
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|
|
809
|
-
}) }, accessory[key] || '...'));
|
|
810
|
-
}), index.h("td", { class: cn.cn('px-[10px] py-[10px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
811
|
-
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|
|
812
|
-
}) }, index.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" }, index.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" }, index.h("img", { src: eyeSvg }), index.h("span", { class: "text-white" }, texts.expand)), index.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 })))));
|
|
813
|
-
})), index.h("div", { key: 'a0909409d4ac17f5a17338b5d3a458ad747162fe', onClick: () => this.closeImage(), style: { backdropFilter: this.expandedImage ? 'blur(3px)' : 'blur(0px)' }, class: cn.cn('pointer-events-none w-[100dvw] h-[100dvh] fixed top-0 z-50 left-0 opacity-0 bg-black/40 transition-all duration-400', {
|
|
814
|
-
'pointer-events-auto opacity-100 delay-200': this.expandedImage,
|
|
815
|
-
}) }, index.h("button", { key: '505386584691adcfcf51d1aacb66903b4e048975', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, index.h("div", { key: 'd3ae82760b267ff4647686dc2f27918c0e5fd83a', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), index.h("div", { key: '6154056e8df52072e56058eda94f757ccab4b9c5', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), index.h("img", { key: '395cd9ec25e11ec95484e84f56c9aff88fbcb724', alt: "", id: "expanded-image", class: "fixed opacity-0 z-50 transition-all rounded-lg" })))))))))));
|
|
816
|
-
}
|
|
817
|
-
get el() { return index.getElement(this); }
|
|
818
|
-
static get watchers() { return {
|
|
819
|
-
"language": ["changeLanguage"],
|
|
820
|
-
"state": ["loadingListener"]
|
|
821
|
-
}; }
|
|
822
|
-
};
|
|
823
|
-
VehicleAccessories.style = VehicleAccessoriesStyle0;
|
|
824
|
-
|
|
825
|
-
const vehicleSpecificationCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}";
|
|
826
|
-
const VehicleSpecificationStyle0 = vehicleSpecificationCss;
|
|
827
|
-
|
|
828
|
-
let mockData$1 = {};
|
|
829
|
-
const VehicleSpecification = class {
|
|
830
|
-
constructor(hostRef) {
|
|
831
|
-
index.registerInstance(this, hostRef);
|
|
832
|
-
this.baseUrl = '';
|
|
833
|
-
this.isDev = false;
|
|
834
|
-
this.queryString = '';
|
|
835
|
-
this.language = 'en';
|
|
836
|
-
this.errorCallback = undefined;
|
|
837
|
-
this.loadingStateChange = undefined;
|
|
838
|
-
this.loadedResponse = undefined;
|
|
839
|
-
this.sharedLocales = getLocalLanguage.sharedLocalesSchema.getDefault();
|
|
840
|
-
this.locale = type$1.specificationSchema.getDefault();
|
|
841
|
-
this.state = 'idle';
|
|
842
|
-
this.externalVin = null;
|
|
843
|
-
this.errorMessage = null;
|
|
844
|
-
this.vehicleInformation = undefined;
|
|
845
|
-
}
|
|
846
|
-
async componentWillLoad() {
|
|
847
|
-
await this.changeLanguage(this.language);
|
|
848
|
-
}
|
|
849
|
-
async changeLanguage(newLanguage) {
|
|
850
|
-
const localeResponses = await Promise.all([getLocalLanguage.getLocaleLanguage(newLanguage, 'vehicleLookup.specification', type$1.specificationSchema), getLocalLanguage.getSharedLocal(newLanguage)]);
|
|
851
|
-
this.locale = localeResponses[0];
|
|
852
|
-
this.sharedLocales = localeResponses[1];
|
|
853
|
-
}
|
|
854
|
-
async setData(newData, headers = {}) {
|
|
855
|
-
clearTimeout(this.networkTimeoutRef);
|
|
856
|
-
if (this.abortController)
|
|
857
|
-
this.abortController.abort();
|
|
858
|
-
this.abortController = new AbortController();
|
|
859
|
-
let scopedTimeoutRef;
|
|
860
|
-
const isVinRequest = typeof newData === 'string';
|
|
861
|
-
const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
|
|
862
|
-
this.externalVin = vin;
|
|
863
|
-
try {
|
|
864
|
-
if (!vin || vin.trim().length === 0) {
|
|
865
|
-
this.state = 'idle';
|
|
866
|
-
return;
|
|
867
|
-
}
|
|
868
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
869
|
-
this.state = (this.state + '-loading');
|
|
870
|
-
}
|
|
871
|
-
else
|
|
872
|
-
this.state = 'loading';
|
|
873
|
-
await new Promise(r => {
|
|
874
|
-
scopedTimeoutRef = setTimeout(r, 700);
|
|
875
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
876
|
-
});
|
|
877
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$1 }, headers) : newData;
|
|
878
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
879
|
-
if (!vehicleResponse)
|
|
880
|
-
throw new Error('wrongResponseFormat');
|
|
881
|
-
this.vehicleInformation = vehicleResponse;
|
|
882
|
-
}
|
|
883
|
-
this.errorMessage = null;
|
|
884
|
-
this.state = 'data';
|
|
885
|
-
}
|
|
886
|
-
catch (error) {
|
|
887
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
888
|
-
return;
|
|
889
|
-
if (this.errorCallback)
|
|
890
|
-
this.errorCallback(error.message);
|
|
891
|
-
console.error(error);
|
|
892
|
-
this.setErrorMessage(error.message);
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
async setErrorMessage(message) {
|
|
896
|
-
this.state = 'error';
|
|
897
|
-
this.vehicleInformation = null;
|
|
898
|
-
this.errorMessage = message;
|
|
899
|
-
}
|
|
900
|
-
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
901
|
-
await this.setData(requestedVin, headers);
|
|
902
|
-
}
|
|
903
|
-
async loadingListener() {
|
|
904
|
-
if (this.loadingStateChange)
|
|
905
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
906
|
-
}
|
|
907
|
-
async setMockData(newMockData) {
|
|
908
|
-
mockData$1 = newMockData;
|
|
909
|
-
}
|
|
910
|
-
render() {
|
|
911
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
912
|
-
const texts = this.locale;
|
|
913
|
-
let productionDate = null;
|
|
914
|
-
try {
|
|
915
|
-
if ((_b = (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vehicleSpecification) === null || _b === void 0 ? void 0 : _b.productionDate) {
|
|
916
|
-
const productionDateObj = new Date((_d = (_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.vehicleSpecification) === null || _d === void 0 ? void 0 : _d.productionDate);
|
|
917
|
-
productionDate = productionDateObj.toLocaleDateString(this.sharedLocales.language, {
|
|
918
|
-
year: 'numeric',
|
|
919
|
-
month: 'long',
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
catch (error) {
|
|
924
|
-
productionDate = null;
|
|
925
|
-
}
|
|
926
|
-
const getProductionDate = () => index.h("div", { key: '73697740fd118eabb9032e095f5fd2c583676684', class: "px-[10px] py-[20px] text-center whitespace-nowrap" }, productionDate);
|
|
927
|
-
return (index.h(index.Host, { key: 'f315fa7f2bc8ec5923f6bf7e4519a236b0b67bb4' }, index.h("div", { key: 'e8973c17b5966a966a6b0e69f1539799209e0dff', dir: this.sharedLocales.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '760977bf8f0d4ed49e794e8c46704da61a0cad70' }, index.h("loading-spinner", { key: 'f20d2747661dd752594766989ebcadcc235fb6a8', isLoading: this.state.includes('loading') }), index.h("div", { key: 'e8e167fe0c98c665d7df44c946abce1fc50b3f2f', class: cn.cn('transition-all !duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, index.h("div", { key: 'e99d6771b52c6adcb28052cef01d45fcc79f7008', class: cn.cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_e = this.vehicleInformation) === null || _e === void 0 ? void 0 : _e.vin), ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: '22bfff998bb790be07b7bb493c84cc0179a5a63f', class: "py-[16px] min-h-[100px] flex items-center" }, index.h("div", { key: 'b59524ce791207c8ad6605b61c431789914d070b', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.sharedLocales.errors[this.errorMessage] || this.sharedLocales.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: 'e8391cbd43705b5fc461af0c9394035f4e5734e0', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: 'a5d36861a83798590ed6095c726be2a045b5055b', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.vehicleSpecification), index.h("div", { key: '085c2fb10f1b8284a3281b2a61871916a3164211', class: "h-0 overflow-auto flex-1" }, !((_f = this.vehicleInformation) === null || _f === void 0 ? void 0 : _f.vehicleSpecification) && index.h("div", { key: 'b2ac41c2576cdce2d8e8e99046123902d6eb4b68', class: "h-[80px] flex items-center justify-center text-[18px]" }, texts.noData), !!((_g = this.vehicleInformation) === null || _g === void 0 ? void 0 : _g.vehicleSpecification) && (index.h("table", { key: '6a58a68e12f31dbebb692e3f8763303a6570a164', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: 'a66babf491edc6610f9512cee381f7db093d24b1', class: "top-0 font-bold sticky bg-white" }, index.h("tr", { key: '398f1f70e42a6ebf7202ee10e741a8c837be96c5' }, ['model', 'variant', 'katashiki', 'modelYear', ...(!!productionDate ? ['productionDate'] : []), 'sfx'].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), index.h("tbody", { key: 'aec5824281b29c5831c4397a5e3a8f09ce606042' }, index.h("tr", { key: '63c5a78c05968b5948460a2e6176ad9e79ecdd02' }, index.h("td", { key: '3d1471f47a3b6da8c5e24bfef30e3630e374d4c7', 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.vehicleVariantInfo) === null || _j === void 0 ? void 0 : _j.modelCode) || '...', " ", index.h("br", { key: '8d3fcac27a2895624b2efe2e401e8267e1d393fe', class: "my-2" }), ((_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.modelDesc) || '...'), index.h("td", { key: '906cd8cf29236e5f97f9c81d75b5a0df461bd403', class: "px-[10px] py-[20px] text-center whitespace-nowrap" }, ((_o = (_m = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _m === void 0 ? void 0 : _m.identifiers) === null || _o === void 0 ? void 0 : _o.variant) || '...', " ", index.h("br", { key: '501a988bc9a756ddaea0b82c6b87c3d9b1ff7c67' }), ((_q = (_p = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _p === void 0 ? void 0 : _p.vehicleSpecification) === null || _q === void 0 ? void 0 : _q.variantDesc) || '...'), ['identifiers.katashiki', 'vehicleVariantInfo.modelYear', ...(!!productionDate ? [getProductionDate] : []), 'vehicleVariantInfo.sfx'].map(infoPath => {
|
|
928
|
-
var _a;
|
|
929
|
-
if (typeof infoPath === 'function')
|
|
930
|
-
return infoPath();
|
|
931
|
-
const [place, field] = infoPath.split('.');
|
|
932
|
-
const targetPlace = (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a[place];
|
|
933
|
-
const cellValue = targetPlace && targetPlace[field] ? targetPlace[field].toString() : '';
|
|
934
|
-
return (index.h("td", { key: infoPath, class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, cellValue.trim() ? cellValue : '...'));
|
|
935
|
-
})))))))))))));
|
|
936
|
-
}
|
|
937
|
-
get el() { return index.getElement(this); }
|
|
938
|
-
static get watchers() { return {
|
|
939
|
-
"language": ["changeLanguage"],
|
|
940
|
-
"state": ["loadingListener"]
|
|
941
|
-
}; }
|
|
942
|
-
};
|
|
943
|
-
VehicleSpecification.style = VehicleSpecificationStyle0;
|
|
944
|
-
|
|
945
|
-
const xMarkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiM1ODE1MWMiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0xNzUgMTc1YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwbDQ3IDQ3IDQ3LTQ3YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwczkuNCAyNC42IDAgMzMuOWwtNDcgNDcgNDcgNDdjOS40IDkuNCA5LjQgMjQuNiAwIDMzLjlzLTI0LjYgOS40LTMzLjkgMGwtNDctNDctNDcgNDdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwcy05LjQtMjQuNiAwLTMzLjlsNDctNDctNDctNDdjLTkuNC05LjQtOS40LTI0LjYgMC0zMy45eiIgLz4KPC9zdmc+';
|
|
946
|
-
|
|
947
|
-
const checkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiMwYjM1MjEiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0zNjkgMjA5TDI0MSAzMzdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwbC02NC02NGMtOS40LTkuNC05LjQtMjQuNiAwLTMzLjlzMjQuNi05LjQgMzMuOSAwbDQ3IDQ3TDMzNSAxNzVjOS40LTkuNCAyNC42LTkuNCAzMy45IDBzOS40IDI0LjYgMCAzMy45eiIgLz4KPC9zdmc+';
|
|
948
|
-
|
|
949
|
-
function SSCTable({ ssc, warrantyLocale }) {
|
|
950
|
-
return (index.h("div", { class: "wrapper-table" },
|
|
951
|
-
index.h("div", { class: "header" }, warrantyLocale.sscCampings),
|
|
952
|
-
index.h("div", { class: "ssc-table-container" },
|
|
953
|
-
index.h("table", { class: "ssc-table" },
|
|
954
|
-
index.h("thead", null,
|
|
955
|
-
index.h("tr", null,
|
|
956
|
-
index.h("th", null, warrantyLocale.sscTableCode),
|
|
957
|
-
index.h("th", null, warrantyLocale.sscTableDescription),
|
|
958
|
-
index.h("th", null, warrantyLocale.sscTableRepairStatus),
|
|
959
|
-
index.h("th", null, warrantyLocale.sscTableOPCode),
|
|
960
|
-
index.h("th", null, warrantyLocale.sscTablePartNumber))),
|
|
961
|
-
index.h("tbody", null, ssc.map(sscItem => {
|
|
962
|
-
var _a, _b;
|
|
963
|
-
return (index.h("tr", { class: "transition", key: sscItem === null || sscItem === void 0 ? void 0 : sscItem.sscCode },
|
|
964
|
-
index.h("td", null, sscItem === null || sscItem === void 0 ? void 0 : sscItem.sscCode),
|
|
965
|
-
index.h("td", null, sscItem === null || sscItem === void 0 ? void 0 : sscItem.description),
|
|
966
|
-
index.h("td", null,
|
|
967
|
-
index.h("div", { class: "table-cell-container" },
|
|
968
|
-
index.h("img", { class: "table-status-icon", src: (sscItem === null || sscItem === void 0 ? void 0 : sscItem.repaired) ? checkSvg : xMarkSvg }),
|
|
969
|
-
" ", sscItem === null || sscItem === void 0 ? void 0 :
|
|
970
|
-
sscItem.repairDate)),
|
|
971
|
-
index.h("td", null,
|
|
972
|
-
index.h("div", { class: "table-cell-container table-cell-labors-container" }, !!((_a = sscItem === null || sscItem === void 0 ? void 0 : sscItem.labors) === null || _a === void 0 ? void 0 : _a.length)
|
|
973
|
-
? sscItem === null || sscItem === void 0 ? void 0 : sscItem.labors.map(labor => (index.h("div", { key: labor === null || labor === void 0 ? void 0 : labor.laborCode, class: "success" }, labor === null || labor === void 0 ? void 0 : labor.laborCode)))
|
|
974
|
-
: '...')),
|
|
975
|
-
index.h("td", null,
|
|
976
|
-
index.h("div", { class: "table-cell-container table-cell-parts-container" }, !!((_b = sscItem === null || sscItem === void 0 ? void 0 : sscItem.parts) === null || _b === void 0 ? void 0 : _b.length)
|
|
977
|
-
? sscItem === null || sscItem === void 0 ? void 0 : sscItem.parts.map(part => (index.h("div", { key: part === null || part === void 0 ? void 0 : part.partNumber, class: (part === null || part === void 0 ? void 0 : part.isAvailable) ? 'success' : 'reject' }, part === null || part === void 0 ? void 0 : part.partNumber)))
|
|
978
|
-
: '...'))));
|
|
979
|
-
}))))));
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
function StatusCard({ desc, className, fromDesc, toDesc, from, to, state = 'idle', icon = true }) {
|
|
983
|
-
return (index.h("div", { class: cn.cn('card', className, `${state}-card`) },
|
|
984
|
-
icon && state === 'reject' && index.h("img", { src: xMarkSvg }),
|
|
985
|
-
icon && state === 'warning' && index.h("img", { src: xMarkSvg }),
|
|
986
|
-
icon && state === 'success' && index.h("img", { src: checkSvg }),
|
|
987
|
-
from && (index.h("p", { class: "no-padding flex gap-2" },
|
|
988
|
-
index.h("span", { class: "font-semibold" },
|
|
989
|
-
fromDesc,
|
|
990
|
-
":"),
|
|
991
|
-
" ",
|
|
992
|
-
desc)),
|
|
993
|
-
to && (index.h("p", { class: "no-padding flex gap-2" },
|
|
994
|
-
index.h("span", { class: "font-semibold" },
|
|
995
|
-
toDesc,
|
|
996
|
-
":"),
|
|
997
|
-
" ",
|
|
998
|
-
desc)),
|
|
999
|
-
!from && !to && index.h("p", { class: state === 'idle' ? 'no-padding' : '' }, desc)));
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
function CardsContainer({ vehicleInformation, isAuthorized, unInvoicedByBrokerName, warrantyLocale }) {
|
|
1003
|
-
var _a, _b, _c, _d;
|
|
1004
|
-
return (index.h("div", { class: "warranty-tags mx-auto pt-3" },
|
|
1005
|
-
index.h("div", { class: "card warning-card span-entire-1st-row" },
|
|
1006
|
-
index.h("p", { class: "no-padding flex gap-2" },
|
|
1007
|
-
index.h("span", { class: "font-semibold" }, "Dealer:"),
|
|
1008
|
-
" ", (_a = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _a === void 0 ? void 0 :
|
|
1009
|
-
_a.companyName,
|
|
1010
|
-
" (", (_b = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _b === void 0 ? void 0 :
|
|
1011
|
-
_b.countryName,
|
|
1012
|
-
")")),
|
|
1013
|
-
index.h(StatusCard, { state: isAuthorized ? 'success' : 'reject', desc: isAuthorized ? warrantyLocale.authorized : warrantyLocale.unauthorized }),
|
|
1014
|
-
index.h(StatusCard, { state: (vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty.hasActiveWarranty) ? 'success' : 'reject', desc: (vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty.hasActiveWarranty) ? warrantyLocale.activeWarranty : warrantyLocale.notActiveWarranty }),
|
|
1015
|
-
unInvoicedByBrokerName && index.h(StatusCard, { className: "span-entire-2nd-row", state: "warning", icon: true, desc: warrantyLocale.notInvoiced + unInvoicedByBrokerName }),
|
|
1016
|
-
(vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty.warrantyStartDate) && (index.h(StatusCard, { state: ((_c = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _c === void 0 ? void 0 : _c.hasActiveWarranty) ? 'success' : 'reject', icon: false, from: true, fromDesc: warrantyLocale.from, desc: vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty.warrantyStartDate })),
|
|
1017
|
-
(vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty.warrantyEndDate) && (index.h(StatusCard, { state: ((_d = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _d === void 0 ? void 0 : _d.hasActiveWarranty) ? 'success' : 'reject', icon: false, to: true, toDesc: warrantyLocale.to, desc: vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty.warrantyEndDate }))));
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
const warrantyDetailsCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.collapse{visibility:collapse}.absolute{left:0;position:absolute;top:0}.relative{position:relative}.sticky{position:sticky}.mx-auto{margin-left:auto;margin-right:auto}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-0{height:0!important;height:0}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.flex-wrap{flex-wrap:wrap}.border{border-width:1px}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-1{padding-right:4px}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.font-semibold{font-weight:600}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition:all;transition-duration:.3s}.duration-1000{transition-duration:1s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.success-card{background:#d0e7de;background-color:#d0e7de;border-color:#a2d0bb!important;border-color:#a2d0bb;color:#0b3521}.reject-card{background:#f7d7d8;background-color:#f7d7d8;border-color:#f2aeb5!important;border-color:#f2aeb5;color:#58151c}:host{all:initial!important;display:block}*{font-family:Arial}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fade-in{animation:fadeIn .3s ease-in forwards;opacity:0}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-out{animation:fadeIn .3s ease-in forwards;opacity:1}.loading-spinner{align-items:center;display:flex;height:100%;justify-content:center;pointer-events:none;transition:all;transition-duration:.1s;width:100%}.loading-spinner img{height:40px;width:40px}.warranty{overflow:hidden;position:relative;transition:all;transition-duration:.3s}.hide{opacity:0}.card{border:1px solid;border-radius:6px;flex-shrink:0;gap:8px;padding:8px 12px}.card,.card p{align-items:center;display:flex}.card p{flex:1 1 0%;font-size:16px;height:25px;margin:0;padding-left:50px}.card p.no-padding{padding-left:4px}.card img{height:25px;width:25px}.recaptcha-response{border:1px solid;border-radius:8px;font-size:20px;margin:16px auto 0;padding:8px 16px;width:-moz-fit-content;width:fit-content}.warning-card{background:#fcf8e3;border-color:#faebcc!important;color:#8a6d3b}.span-entire-1st-row{grid-column:1/3;grid-row:1/3}.span-entire-2nd-row{grid-column:1/3;grid-row:2/3}.warranty-tags{display:grid;gap:12px;grid-template-columns:1fr 1fr;max-width:1000px}.pt-3,.py-3{padding-top:12px}.pb-3,.py-3{padding-bottom:12px}.pt-4,.py-4{padding-top:16px}.pb-4,.py-4{padding-bottom:16px}.max-w-500{max-width:500px}.mt-4,.my-4{margin-bottom:16px;margin-top:16px}.warranty *{box-sizing:border-box}.wrapper-table{border:1px solid #d6d8dc;border-radius:4px;display:flex;flex-direction:column;margin-top:12px;max-height:70vh;overflow:hidden}.ssc-table-container{flex:1 1 0%;height:0;overflow:auto}.wrapper-table .header{align-items:center;background:#e1e3e5;color:#383c43;display:flex;flex-shrink:0;font-size:18px;height:40px;justify-content:center;width:100%}.ssc-table{border-collapse:collapse;overflow:auto;position:relative;width:100%}.ssc-table thead{background-color:#fff;font-weight:700;position:sticky;top:0}.ssc-table td,.ssc-table th{border-bottom:1px solid #d6d8dc;padding:10px 20px;text-align:center;transition:all;transition-duration:.3s;white-space:nowrap}.ssc-table tr:hover{background:#f4f4f4}.ssc-table tr:last-child td{border:none}.table-cell-container{align-items:center;display:flex;gap:8px;justify-content:center;width:100%}.table-cell-labors-container,.table-cell-parts-container{flex-wrap:wrap}.table-cell-labors-container div,.table-cell-parts-container div{border-radius:4px;font-size:14px;padding:4px 8px}.table-cell-labors-container div.success,.table-cell-parts-container div.success{background:#d0e7de}.table-cell-labors-container div.reject,.table-cell-parts-container div.reject{background:#f7d7d8}.table-status-icon{height:20px;width:20px}.warranty-vin{font-size:20px;padding-top:4px;text-align:center}.recaptcha-container{display:flex;justify-content:center;overflow:hidden}.static{position:static}.w-full{width:100%}.top-0{top:0}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.table{display:table}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}";
|
|
1021
|
-
const WarrantyDetailsStyle0 = warrantyDetailsCss;
|
|
1022
|
-
|
|
1023
|
-
let mockData = {};
|
|
1024
|
-
const WarrantyDetails = class {
|
|
1025
|
-
constructor(hostRef) {
|
|
1026
|
-
index.registerInstance(this, hostRef);
|
|
1027
|
-
this.baseUrl = '';
|
|
1028
|
-
this.isDev = false;
|
|
1029
|
-
this.showSsc = false;
|
|
1030
|
-
this.queryString = '';
|
|
1031
|
-
this.recaptchaKey = '';
|
|
1032
|
-
this.language = 'en';
|
|
1033
|
-
this.showWarranty = false;
|
|
1034
|
-
this.unauthorizedSscLookupBaseUrl = '';
|
|
1035
|
-
this.unauthorizedSscLookupQueryString = '';
|
|
1036
|
-
this.cityId = null;
|
|
1037
|
-
this.cityIntegrationId = null;
|
|
1038
|
-
this.companyId = null;
|
|
1039
|
-
this.companyIntegrationId = null;
|
|
1040
|
-
this.companyBranchId = null;
|
|
1041
|
-
this.companyBranchIntegrationId = null;
|
|
1042
|
-
this.userId = null;
|
|
1043
|
-
this.brandIntegrationId = null;
|
|
1044
|
-
this.customerName = null;
|
|
1045
|
-
this.customerPhone = null;
|
|
1046
|
-
this.customerEmail = null;
|
|
1047
|
-
this.errorCallback = undefined;
|
|
1048
|
-
this.loadingStateChange = undefined;
|
|
1049
|
-
this.loadedResponse = undefined;
|
|
1050
|
-
this.state = 'idle';
|
|
1051
|
-
this.externalVin = null;
|
|
1052
|
-
this.showRecaptcha = false;
|
|
1053
|
-
this.errorMessage = null;
|
|
1054
|
-
this.unInvoicedByBrokerName = null;
|
|
1055
|
-
this.vehicleInformation = undefined;
|
|
1056
|
-
this.checkingUnauthorizedSSC = false;
|
|
1057
|
-
this.recaptchaRes = null;
|
|
1058
|
-
this.headers = {};
|
|
1059
|
-
this.sharedLocales = getLocalLanguage.sharedLocalesSchema.getDefault();
|
|
1060
|
-
this.locale = type$1.warrantySchema.getDefault();
|
|
1061
|
-
}
|
|
1062
|
-
async componentWillLoad() {
|
|
1063
|
-
await this.changeLanguage(this.language);
|
|
1064
|
-
}
|
|
1065
|
-
async changeLanguage(newLanguage) {
|
|
1066
|
-
const localeResponses = await Promise.all([getLocalLanguage.getLocaleLanguage(newLanguage, 'vehicleLookup.warranty', type$1.warrantySchema), getLocalLanguage.getSharedLocal(newLanguage)]);
|
|
1067
|
-
this.locale = localeResponses[0];
|
|
1068
|
-
this.sharedLocales = localeResponses[1];
|
|
1069
|
-
}
|
|
1070
|
-
handleSettingData(response) {
|
|
1071
|
-
var _a, _b, _c;
|
|
1072
|
-
if (response.warranty === null)
|
|
1073
|
-
response.warranty = {
|
|
1074
|
-
warrantyEndDate: '',
|
|
1075
|
-
warrantyStartDate: '',
|
|
1076
|
-
hasActiveWarranty: false,
|
|
1077
|
-
hasExtendedWarranty: false,
|
|
1078
|
-
extendedWarrantyEndDate: '',
|
|
1079
|
-
extendedWarrantyStartDate: '',
|
|
1080
|
-
};
|
|
1081
|
-
if (response.ssc === null)
|
|
1082
|
-
response.ssc = [];
|
|
1083
|
-
this.unInvoicedByBrokerName = null;
|
|
1084
|
-
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)
|
|
1085
|
-
this.unInvoicedByBrokerName = response.saleInformation.broker.brokerName;
|
|
1086
|
-
this.vehicleInformation = response;
|
|
1087
|
-
}
|
|
1088
|
-
async handleInitializingRecaptcha(vin, scopedTimeoutRef) {
|
|
1089
|
-
var _a;
|
|
1090
|
-
if (((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.isAuthorized) === false && this.showSsc && this.recaptchaKey !== '') {
|
|
1091
|
-
grecaptcha.reset();
|
|
1092
|
-
await new Promise(r => setTimeout(r, 400));
|
|
1093
|
-
this.recaptchaIntervalRef = setInterval(async () => {
|
|
1094
|
-
var _a;
|
|
1095
|
-
const recaptchaResponse = grecaptcha.getResponse();
|
|
1096
|
-
if (recaptchaResponse) {
|
|
1097
|
-
clearInterval(this.recaptchaIntervalRef);
|
|
1098
|
-
if (this.isDev) {
|
|
1099
|
-
this.checkingUnauthorizedSSC = true;
|
|
1100
|
-
this.showRecaptcha = false;
|
|
1101
|
-
await new Promise(r => setTimeout(r, 3000));
|
|
1102
|
-
this.checkingUnauthorizedSSC = false;
|
|
1103
|
-
const hasPendingSSC = Math.random() < 0.5 ? false : true;
|
|
1104
|
-
this.recaptchaRes = {
|
|
1105
|
-
hasSSC: hasPendingSSC,
|
|
1106
|
-
message: hasPendingSSC ? 'pendingSSC' : 'noPendingSSC',
|
|
1107
|
-
};
|
|
1108
|
-
}
|
|
1109
|
-
else {
|
|
1110
|
-
this.checkingUnauthorizedSSC = true;
|
|
1111
|
-
this.showRecaptcha = false;
|
|
1112
|
-
///
|
|
1113
|
-
const response = await fetch(`${this.unauthorizedSscLookupBaseUrl}${vin}/${(_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.sscLogId}?${this.unauthorizedSscLookupQueryString}`, {
|
|
1114
|
-
signal: this.abortController.signal,
|
|
1115
|
-
headers: Object.assign(Object.assign({}, this.headers), { 'Ssc-Recaptcha-Token': recaptchaResponse }),
|
|
1116
|
-
});
|
|
1117
|
-
const vinResponse = await response.json();
|
|
1118
|
-
if (vinResponse && this.networkTimeoutRef === scopedTimeoutRef) {
|
|
1119
|
-
this.checkingUnauthorizedSSC = false;
|
|
1120
|
-
const hasPendingSSC = vinResponse.sscLookupStatus === 1;
|
|
1121
|
-
this.recaptchaRes = {
|
|
1122
|
-
hasSSC: hasPendingSSC,
|
|
1123
|
-
message: hasPendingSSC ? 'pendingSSC' : 'noPendingSSC',
|
|
1124
|
-
};
|
|
1125
|
-
}
|
|
1126
|
-
else
|
|
1127
|
-
throw new Error('wrongResponseFormat');
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
}, 500);
|
|
1131
|
-
this.showRecaptcha = true;
|
|
1132
|
-
}
|
|
1133
|
-
else {
|
|
1134
|
-
this.showRecaptcha = false;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
async setData(newData, headers = {}) {
|
|
1138
|
-
this.recaptchaRes = null;
|
|
1139
|
-
this.headers = headers;
|
|
1140
|
-
clearTimeout(this.networkTimeoutRef);
|
|
1141
|
-
clearInterval(this.recaptchaIntervalRef);
|
|
1142
|
-
if (this.abortController)
|
|
1143
|
-
this.abortController.abort();
|
|
1144
|
-
this.abortController = new AbortController();
|
|
1145
|
-
let scopedTimeoutRef;
|
|
1146
|
-
const isVinRequest = typeof newData === 'string';
|
|
1147
|
-
const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
|
|
1148
|
-
this.externalVin = vin;
|
|
1149
|
-
try {
|
|
1150
|
-
if (!vin || vin.trim().length === 0) {
|
|
1151
|
-
this.state = 'idle';
|
|
1152
|
-
return;
|
|
1153
|
-
}
|
|
1154
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
1155
|
-
this.state = (this.state + '-loading');
|
|
1156
|
-
}
|
|
1157
|
-
else
|
|
1158
|
-
this.state = 'loading';
|
|
1159
|
-
await new Promise(r => {
|
|
1160
|
-
scopedTimeoutRef = setTimeout(r, 600);
|
|
1161
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
1162
|
-
});
|
|
1163
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
1164
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
1165
|
-
if (!vehicleResponse)
|
|
1166
|
-
throw new Error('wrongResponseFormat');
|
|
1167
|
-
this.handleSettingData(vehicleResponse);
|
|
1168
|
-
this.handleInitializingRecaptcha(vin, scopedTimeoutRef);
|
|
1169
|
-
}
|
|
1170
|
-
this.errorMessage = null;
|
|
1171
|
-
this.state = 'data';
|
|
1172
|
-
}
|
|
1173
|
-
catch (error) {
|
|
1174
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
1175
|
-
return;
|
|
1176
|
-
if (this.errorCallback)
|
|
1177
|
-
this.errorCallback(error.message);
|
|
1178
|
-
console.error(error);
|
|
1179
|
-
this.setErrorMessage(error.message);
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
async setErrorMessage(message) {
|
|
1183
|
-
this.state = 'error';
|
|
1184
|
-
this.vehicleInformation = null;
|
|
1185
|
-
this.errorMessage = message;
|
|
1186
|
-
}
|
|
1187
|
-
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
1188
|
-
await this.setData(requestedVin, headers);
|
|
1189
|
-
}
|
|
1190
|
-
async componentDidLoad() {
|
|
1191
|
-
if (this.recaptchaKey !== '') {
|
|
1192
|
-
const script = document.createElement('script');
|
|
1193
|
-
script.src = 'https://www.google.com/recaptcha/api.js';
|
|
1194
|
-
script.async = true;
|
|
1195
|
-
script.defer = true;
|
|
1196
|
-
script.onload = () => console.log('reCAPTCHA script loaded');
|
|
1197
|
-
document.head.appendChild(script);
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
async setMockData(newMockData) {
|
|
1201
|
-
mockData = newMockData;
|
|
1202
|
-
}
|
|
1203
|
-
async loadingListener() {
|
|
1204
|
-
if (this.loadingStateChange)
|
|
1205
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
1206
|
-
}
|
|
1207
|
-
render() {
|
|
1208
|
-
var _a, _b, _c, _d, _e;
|
|
1209
|
-
return (index.h(index.Host, { key: '51f18b7dcd531e62890f8770b6a3c101582732da' }, index.h("div", { key: 'e760f59c7504b93af3d0c32fb07b0c886d6a25b7', dir: this.sharedLocales.direction, class: "min-h-[100px] warranty" }, index.h("div", { key: 'f1b3d4eef18eed1f434d1c6c54943f2dcb131bd2' }, index.h("loading-spinner", { key: '7d3f893081ca0a424aa840ba678d5ff95f18581f', isLoading: this.state.includes('loading') }), index.h("div", { key: '33c7acd0a4846711c090037b578735f7dd5d7ee4', class: "transition-all !duration-700", style: { transform: this.state.includes('loading') || this.state === 'idle' ? 'scale(0)' : 'scale(1)', opacity: this.state.includes('loading') ? '0' : '1' } }, (this.showSsc || this.showWarranty) && (index.h("div", { key: 'bd5d2cbd5b00aa3be39ff1f19d8c7f7c8eaffffd', 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) && (index.h("div", { key: '5dcd1811c88742d148876856a10cebdf025b97ff', class: "py-[16px] min-h-[100px] flex items-center" }, index.h("div", { key: 'bb73dcd45785a10ce2751852fa2c54b239067289', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.sharedLocales.errors[this.errorMessage] || this.sharedLocales.errors.wildCard))), this.showWarranty && ['data', 'data-loading'].includes(this.state) && (index.h(CardsContainer, { key: '911af0bee5d12c62426e03c8daaf69299b1cd49e', warrantyLocale: this.locale, isAuthorized: (_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.isAuthorized, unInvoicedByBrokerName: this.unInvoicedByBrokerName, vehicleInformation: this.vehicleInformation })), index.h("div", { key: '1a6c36ff17c97a39ab66cd2cf00ce6b98976dacd', style: Object.assign({}, (this.showRecaptcha ? { height: 'auto', padding: '16px 16px 0px 16px' } : { height: '0px' })), class: "recaptcha-container" }, index.h("slot", { key: 'a901bf3e9d5c6f64faa3be9a2af118f19a1b3864' })), ['data', 'data-loading'].includes(this.state) && this.recaptchaRes && (index.h("div", { key: 'b2d5463ff37fc3aaaa66fdf72a9bcc9dd6d42130', class: cn.cn('recaptcha-response', !this.recaptchaRes.hasSSC ? 'success-card' : 'reject-card ') }, this.locale[this.recaptchaRes.message])), this.checkingUnauthorizedSSC && (index.h("div", { key: '4fd0c52ea3644a6d5b0eea751b1c1856c64ee378', class: "loading-spinner", style: { marginTop: '20px', flexDirection: 'column' } }, index.h("div", { key: '5ea2534d0b9525cb1cbf71ebc365c62abb7a529f' }, index.h("strong", { key: 'c8b3810b3a44b8e56e02a28db96563c8f7febcb8' }, this.locale.checkingTMC)), index.h("img", { key: '068cfa85856df2395e80435ed0c596fc9c34e442', class: "spin", src: loader.loaderSvg }))), this.showSsc && ['data', 'data-loading'].includes(this.state) && ((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.ssc) !== null && !!((_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.ssc.length) && (index.h(SSCTable, { key: '4f1f66dfde513e2d30deb5f6e2ff58c5a11867e3', warrantyLocale: this.locale, ssc: (_e = this.vehicleInformation) === null || _e === void 0 ? void 0 : _e.ssc })))))));
|
|
1210
|
-
}
|
|
1211
|
-
get el() { return index.getElement(this); }
|
|
1212
|
-
static get watchers() { return {
|
|
1213
|
-
"language": ["changeLanguage"],
|
|
1214
|
-
"state": ["loadingListener"]
|
|
1215
|
-
}; }
|
|
1216
|
-
};
|
|
1217
|
-
WarrantyDetails.style = WarrantyDetailsStyle0;
|
|
1218
|
-
|
|
1219
|
-
exports.dynamic_claim = DynamicClaim;
|
|
1220
|
-
exports.paint_thickness = PaintThickness;
|
|
1221
|
-
exports.service_history = ServiceHistory;
|
|
1222
|
-
exports.vehicle_accessories = VehicleAccessories;
|
|
1223
|
-
exports.vehicle_specification = VehicleSpecification;
|
|
1224
|
-
exports.warranty_details = WarrantyDetails;
|