@mychoice/mychoice-sdk-modules 2.2.18 → 2.2.20
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/index.js +57 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/insurances/car/pages/vehicle/sections/AccidentBenefitsModal.d.ts +1 -0
- package/dist/esm/index.js +57 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/insurances/car/pages/vehicle/sections/AccidentBenefitsModal.d.ts +1 -0
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -756,6 +756,7 @@ const BlockCarConditionInfo = () => {
|
|
|
756
756
|
const { discountState, dispatchDiscountState } = useStoreFormCarDiscount();
|
|
757
757
|
const { isAlbertaProvince } = useProvince();
|
|
758
758
|
const isTheBig = appType === AppTypes.TheBig;
|
|
759
|
+
const showPolicyStartOnVehiclePage = isTheBig || isMyChoiceLike(appType);
|
|
759
760
|
const { policyStartYear, policyStartMonth, policyStartDay } = discountState;
|
|
760
761
|
const defaultPolicyStartDate = {
|
|
761
762
|
year: policyStartYear,
|
|
@@ -871,7 +872,7 @@ const BlockCarConditionInfo = () => {
|
|
|
871
872
|
purchaseMonth || '',
|
|
872
873
|
purchaseYear || '',
|
|
873
874
|
], vehicleState.inValidation), error: vehicleState.inValidation, minDate: year ? `${Number(year) - 1}-01-01` : getFormattedDate('', 'yyyy-MM-dd'), maxDate: getFormattedDate('', 'yyyy-MM-dd') }), !(isAlbertaProvince && isTheBig) && (jsx(SwitchButtonBox, { items: carWinterTiresCheck, onChange: handleWinterTiresChange, name: "winterTires", defaultValue: getSelectedOption(carWinterTiresCheck, winterTires), description: "Snow. Ice. Freezing temperatures. Winter tires protect you from all these winter weather conditions, and more. It also protects your wallet. Investing in winter tires can save you $50 to $100 on your insurance.", title: "Does your car have winter tires?" })), jsx(SelectFormBox, { options: carKeepPlace, name: "parkingLocation", onChange: handleCarParkingLocationChange, defaultValue: getSelectedOption(carKeepPlace, parkingLocation), title: "Where do you keep your car overnight?", placeholder: "Select from the list", description: "For many of us, the answer is \u201Cat home.\u201D If you park your car in various locations throughout the year, then select the most frequently parking spot. Be honest\u2014some insurers will use your overnight parking location to calculate a quote, which could affect your claims in the future.", autoSelectIfValueIsOutOfOptions: false, error: !parkingLocation && vehicleState.inValidation, errorMessage: getErrorMessage(parkingLocation, vehicleState.inValidation) }), jsx(SwitchButtonBox, { items: carUsagePurpose, onChange: handleCarUsageChange, name: "primaryUse", defaultValue: getSelectedOption(carUsagePurpose, primaryUse) || carUsagePurpose[0].value, hintMessage: primaryUseHintMessage, description: "The way you use your vehicle is a primary factor that insurers use in your policy terms and fees, whether it be personal or business.\n \u2022 Personal is driving from work or school to home.\n \u2022 Business considers other uses like sales calls, pick-ups or deliveries, or other business errands.", title: "What do you mainly use your car for?" }), jsx(SelectFormBox, { options: firstDriveDistanceList, name: "distanceDaily", onChange: handleCarDailyDistanceChange, defaultValue: getSelectedOption(firstDriveDistanceList, distanceDaily), title: "How far is your 1-way commute to work or school?", placeholder: "Select", description: "The distance you drive to work or school would be an example of your daily commute. It is one of the most important factors when determining coverage options since it exposes you to traffic each day. The shorter your commute, the less risk you carry of an accident.", autoSelectIfValueIsOutOfOptions: false, error: !distanceDaily && vehicleState.inValidation, errorMessage: getErrorMessage(distanceDaily, vehicleState.inValidation) }), primaryUse === 'business' && (jsx(SelectFormBox, { options: dailyDriveBusinessDistanceList, name: "distanceBusiness", onChange: handleCarBusinessDailyDistanceChange, defaultValue: getSelectedOption(dailyDriveBusinessDistanceList, distanceBusiness), title: "How many kilometers are driven for business use each day?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !distanceBusiness && vehicleState.inValidation, errorMessage: getErrorMessage(distanceBusiness, vehicleState.inValidation) })), jsx(SelectFormBox, { options: yearlyDriveDistanceList, name: "distanceYearly", onChange: handleCarYearlyDistanceChange, defaultValue: getSelectedOption(yearlyDriveDistanceList, distanceYearly), title: "How many total kilometers are driven each year?", placeholder: "Select", hintMessage: distanceDaily ? `Based on your daily driven kilometers, we recommend
|
|
874
|
-
${numberWithCommas(getRecommendedRange(distanceDaily, primaryUse === VehiclePrimaryUseTypes.Business ? distanceBusiness : 1))} for your yearly driven kilometers` : '', autoSelectIfValueIsOutOfOptions: false, error: !distanceYearly && vehicleState.inValidation, errorMessage: getErrorMessage(distanceYearly, vehicleState.inValidation) }),
|
|
875
|
+
${numberWithCommas(getRecommendedRange(distanceDaily, primaryUse === VehiclePrimaryUseTypes.Business ? distanceBusiness : 1))} for your yearly driven kilometers` : '', autoSelectIfValueIsOutOfOptions: false, error: !distanceYearly && vehicleState.inValidation, errorMessage: getErrorMessage(distanceYearly, vehicleState.inValidation) }), showPolicyStartOnVehiclePage && (jsx(DateSelectFormBox, { name: "policyStart", dateNames: ['policyStartYear', 'policyStartMonth', 'policyStartDay'], onDateChange: handlePolicyStartDateChange, defaultValue: defaultPolicyStartDate, title: "What is the ideal start date for your new insurance policy?", description: "Select your preferred date for the beginning of your new insurance policy. For instance, you may set the start date for the day that your current insurance expires to ensure that you're continuously covered. Alternatively, select today's date for a quote or new policy.", minDate: addDaysToDate('', 1), maxDate: addDaysToDate('', 90), isDay: true }))] }));
|
|
875
876
|
};
|
|
876
877
|
|
|
877
878
|
const VehicleSectionMain = () => {
|
|
@@ -880,9 +881,13 @@ const VehicleSectionMain = () => {
|
|
|
880
881
|
return (jsxs("div", { className: `form-section top-section ${mychoiceCls}`, children: [mychoiceCls && jsx("h2", { className: "section-title", children: "Give us the scoop on your four-wheeled friend." }), jsx(BlockCarInfo, {}), jsx(BlockCarConditionInfo, {})] }));
|
|
881
882
|
};
|
|
882
883
|
|
|
883
|
-
const AccidentBenefitsModal = ({ selectedCoverages, onApply, onCancel, }) => {
|
|
884
|
-
const
|
|
884
|
+
const AccidentBenefitsModal = ({ selectedCoverages, onApply, onCancel, selectAllByDefault = false, }) => {
|
|
885
|
+
const { appConfigState: { appType } } = useStoreAppConfig();
|
|
886
|
+
const isMyChoice = isMyChoiceLike(appType);
|
|
885
887
|
const allValues = accidentBenefitsOptionalOptions.map((o) => o.value);
|
|
888
|
+
const [localSelected, setLocalSelected] = useState(selectedCoverages.length > 0
|
|
889
|
+
? [...selectedCoverages]
|
|
890
|
+
: (selectAllByDefault ? [...allValues] : []));
|
|
886
891
|
const allSelected = allValues.every((v) => localSelected.includes(v));
|
|
887
892
|
const handleToggle = (value) => {
|
|
888
893
|
setLocalSelected((prev) => prev.includes(value) ? prev.filter((v) => v !== value) : [...prev, value]);
|
|
@@ -895,17 +900,44 @@ const AccidentBenefitsModal = ({ selectedCoverages, onApply, onCancel, }) => {
|
|
|
895
900
|
setLocalSelected([...allValues]);
|
|
896
901
|
}
|
|
897
902
|
};
|
|
898
|
-
return (jsx("div", { className: "ab-modal-overlay", onClick: onCancel, children: jsxs("div", { className: "ab-modal", onClick: (e) => e.stopPropagation(), children: [jsxs("div", { className: "ab-modal-header", children: [jsx("h3", { children: "Accident Benefits" }), jsx("p", { className: "ab-modal-subtitle", children: "Standard Coverage + Self-Selected Optional Enhancements" }), jsx("p", { className: "ab-modal-body-text", children: "Base coverage with flexibility to select additional benefits" })] }), jsxs("div", { className: "ab-modal-content", children: [jsxs("div", { className: "ab-modal-standard-block ab-modal-standard-block--included", children: [jsxs("div", { className: "ab-modal-standard-included-header", children: [jsx("input", { type: "checkbox", checked: true, disabled: true, readOnly: true, className: "ab-modal-standard-locked-checkbox" }), jsx("h4", { children:
|
|
903
|
+
return (jsx("div", { className: "ab-modal-overlay", onClick: onCancel, children: jsxs("div", { className: "ab-modal", onClick: (e) => e.stopPropagation(), children: [jsxs("div", { className: "ab-modal-header", children: [jsx("h3", { children: "Accident Benefits" }), jsx("p", { className: "ab-modal-subtitle", children: "Standard Coverage + Self-Selected Optional Enhancements" }), jsx("p", { className: "ab-modal-body-text", children: "Base coverage with flexibility to select additional benefits" })] }), jsxs("div", { className: "ab-modal-content", children: [jsxs("div", { className: "ab-modal-standard-block ab-modal-standard-block--included", children: [jsxs("div", { className: "ab-modal-standard-included-header", children: [jsx("input", { type: "checkbox", checked: true, disabled: true, readOnly: true, className: "ab-modal-standard-locked-checkbox" }), jsx("h4", { children: isMyChoice ? 'All Coverages Included by Default' : 'Standard Benefits — Included' })] }), !isMyChoice && (jsx("p", { className: "ab-modal-standard-subtitle", children: "Medical, Rehabilitation, and Attendant Care" })), jsx("p", { className: "ab-modal-standard-description", children: isMyChoice ? (jsxs(Fragment, { children: ["Our standard quote automatically includes all optional accident benefits at their minimum coverage limits. We strongly recommend keeping all coverages selected to ensure the most complete protection \u2014 opting out could leave you without critical support when you need it most. For example, deselecting Income Replacement means no weekly payments if an injury prevents you from working, and removing Caregiver Replacement leaves no financial support for dependents in your care.", jsx("br", {}), jsx("br", {}), "Please speak with a broker partner to discuss higher limits or learn more about how each benefit protects you."] })) : ('Covers medical expenses, therapy and personal care for injuries from an accident, including doctor visits and physiotherapy.') })] }), jsxs("div", { className: "ab-modal-optional-block", children: [jsxs("label", { className: "ab-modal-select-all", children: [jsx("input", { type: "checkbox", checked: allSelected, onChange: handleSelectAll }), jsx("span", { children: "Select All Additional Benefits" })] }), jsx("div", { className: "ab-modal-options", children: accidentBenefitsOptionalOptions.map((option) => (jsxs("label", { className: "ab-modal-option", children: [jsx("input", { type: "checkbox", checked: localSelected.includes(option.value), onChange: () => handleToggle(option.value) }), jsxs("div", { className: "ab-modal-option-text", children: [jsx("strong", { children: option.name }), jsx("span", { children: option.description })] })] }, option.value))) }), jsxs("div", { className: "ab-modal-minimum-notice", children: [jsx("strong", { children: "Minimum Limits Apply" }), jsx("p", { children: "All optional benefits selected below will be quoted at their minimum coverage limits. Please speak with your broker if you wish to discuss higher limits." })] })] })] }), jsxs("div", { className: "ab-modal-actions", children: [jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-cancel", onClick: onCancel, children: "Cancel" }), jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-apply", onClick: () => onApply(localSelected), children: "Apply" })] })] }) }));
|
|
899
904
|
};
|
|
900
905
|
|
|
906
|
+
const allAccidentBenefitsCoverageValues = accidentBenefitsOptionalOptions.map((option) => option.value);
|
|
901
907
|
const VehicleSectionAccidentBenefits = () => {
|
|
902
908
|
const { vehicleState, dispatchVehicleState } = useStoreFormCarVehicle();
|
|
903
909
|
const { accidentbenefits } = vehicleState.items[vehicleState.activeIndex];
|
|
904
910
|
const { appConfigState: { appType }, } = useStoreAppConfig();
|
|
905
|
-
const
|
|
911
|
+
const isMyChoice = isMyChoiceLike(appType);
|
|
912
|
+
const mychoiceCls = isMyChoice ? 'mychoice' : '';
|
|
906
913
|
const { isAbReformActive } = useAbReform();
|
|
907
914
|
const [modalOpen, setModalOpen] = useState(false);
|
|
908
|
-
|
|
915
|
+
useEffect(() => {
|
|
916
|
+
if (!isAbReformActive || !isMyChoice || accidentbenefits.abAcknowledged) {
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
919
|
+
const isUnset = accidentbenefits.baseCoverage === 'minimum_required'
|
|
920
|
+
&& accidentbenefits.additionalCoverages.length === 0;
|
|
921
|
+
if (!isUnset) {
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
dispatchVehicleState({
|
|
925
|
+
type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAdditionalCoveragesSet,
|
|
926
|
+
payload: { additionalCoverages: [...allAccidentBenefitsCoverageValues] },
|
|
927
|
+
});
|
|
928
|
+
dispatchVehicleState({
|
|
929
|
+
type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsBaseCoverageSelect,
|
|
930
|
+
payload: { baseCoverage: 'med_rehab_cat_1m' },
|
|
931
|
+
});
|
|
932
|
+
}, [
|
|
933
|
+
isAbReformActive,
|
|
934
|
+
isMyChoice,
|
|
935
|
+
accidentbenefits.abAcknowledged,
|
|
936
|
+
accidentbenefits.baseCoverage,
|
|
937
|
+
accidentbenefits.additionalCoverages.length,
|
|
938
|
+
dispatchVehicleState,
|
|
939
|
+
]);
|
|
940
|
+
if (!isAbReformActive)
|
|
909
941
|
return null;
|
|
910
942
|
const handleApply = (selected) => {
|
|
911
943
|
dispatchVehicleState({
|
|
@@ -930,7 +962,13 @@ const VehicleSectionAccidentBenefits = () => {
|
|
|
930
962
|
setModalOpen(false);
|
|
931
963
|
};
|
|
932
964
|
const hasError = !accidentbenefits.abAcknowledged && vehicleState.inValidation;
|
|
933
|
-
return (jsxs("div", { id: "abAcknowledged", className: `form-section ab-section ${mychoiceCls}`, children: [jsx(LabelFormBox, { name: "accident-benefits", title: "Accident Benefits" }), jsxs("div", { className: "ab-notice-banner", children: [jsx("strong", { children: "Changes to Your Accident Benefits Selections (Effective July 1, 2026)" }), jsx("p", { children:
|
|
965
|
+
return (jsxs("div", { id: "abAcknowledged", className: `form-section ab-section ${mychoiceCls}`, children: [jsx(LabelFormBox, { name: "accident-benefits", title: "Accident Benefits" }), jsxs("div", { className: "ab-notice-banner", children: [jsx("strong", { children: "Changes to Your Accident Benefits Selections (Effective July 1, 2026)" }), jsx("p", { children: isMyChoice
|
|
966
|
+
? 'As of July 1, 2026, significant changes have been made to the Accident Benefits coverage in Ontario. Many benefits that were previously included are now optional. Our standard quote automatically includes all optional accident benefits at their minimum coverage limits.'
|
|
967
|
+
: 'As of July 1, 2026, significant changes have been made to the Accident Benefits coverage in Ontario. Many benefits that were previously included are now optional and must be selected based on your individual needs.' })] }), jsxs("div", { className: `ab-option-selector${hasError ? ' ab-option-selector--error' : ''}`, role: "button", tabIndex: 0, onClick: () => setModalOpen(true), onKeyDown: (e) => e.key === 'Enter' && setModalOpen(true), children: [jsxs("div", { className: "ab-option-selector-content", children: [jsx("strong", { children: isMyChoice
|
|
968
|
+
? 'Standard Mandatory Accident Benefits + Optional Enhancements'
|
|
969
|
+
: 'Standard Mandatory Accident Benefits + Self-Selected Optional Enhancements' }), jsx("p", { children: isMyChoice
|
|
970
|
+
? 'Maximum coverage with flexibility to remove additional benefits.'
|
|
971
|
+
: 'Base coverage with flexibility to select additional benefits' }), jsx("p", { className: "ab-option-selector-hint", children: "Selecting this option will open a window displaying all available optional Accident Benefits, which you may individually select based on your needs. Each selected benefit will be quoted at its minimum limit." })] }), jsx("span", { className: "ab-option-selector-arrow", children: "\u203A" })] }), modalOpen && (jsx(AccidentBenefitsModal, { selectedCoverages: accidentbenefits.additionalCoverages, onApply: handleApply, onCancel: () => setModalOpen(false), selectAllByDefault: isMyChoice }))] }));
|
|
934
972
|
};
|
|
935
973
|
|
|
936
974
|
const VehicleSectionCoverage = () => {
|
|
@@ -1457,7 +1495,7 @@ you had insurance. If this is correct, please continue with the form.`);
|
|
|
1457
1495
|
};
|
|
1458
1496
|
return (jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsxs("div", { className: "box-container", children: [jsx(DateSelectFormBox, { name: "listedYear", dateNames: ['listedYear', 'listedMonth'], onDateChange: handleListedDateChange, defaultValue: defaultListedDate, disabled: !listed, title: `When was ${firstName || driverNameDefault} first listed as a driver on a Canadian or US insurance policy?`, description: "The selection indicates what year the main driver was first listed on a Canadian or US insurance policy. If you do not remember your age, it is acceptable to provide a best estimate for the purposes of the policy or quote.", errorMessage: listed
|
|
1459
1497
|
? getDateErrorMessage(['01', listedMonth, listedYear], driverState.inValidation)
|
|
1460
|
-
: '', error: driverState.inValidation, hintMessage: hintMessage, minDate: getMinDate(birthDate, firstLicenceAge) }), jsx(CheckboxForm, { name: "listed", label: "Never listed on an insurance policy", onChange: handleListedChange, defaultValue: !listed })] }), listed && (jsxs("div", { className: "box-container", children: [jsx(SelectFormBox, { name: "insuredDate", onChange: handleInsuredPeriodChange, options: getPeriodOptions(listedYear, listedMonth), defaultValue: insuredDate, disabled: !insured, title: `How long has ${firstName || driverNameDefault} been with their current insurance provider?`, description: "It is common for insurers to provide loyalty rewards or discounts for valued customers. Loyalty is a positive trait in the industry, and most insurance companies will want to provide some incentive for continued customer relationships through tangible policy rewards.", errorMessage: insured ? getErrorMessage(insuredDate, driverState.inValidation) : '', error: !insuredDate && driverState.inValidation }), jsx(CheckboxForm, { name: "insured", label: "Not currently insured", onChange: handleInsuredChange, defaultValue: !insured })] })), !isTheBig && (jsx(DateSelectFormBox, { name: "policyStart", dateNames: ['policyStartYear', 'policyStartMonth', 'policyStartDay'], onDateChange: handlePolicyStartDateChange, defaultValue: defaultPolicyStartDate, title: "What is the ideal start date for your new insurance policy?", description: "Select your preferred date for the beginning of your new insurance policy. For instance, you may set the start date for the day that your current insurance expires to ensure that you\u2019re continuously covered. Alternatively, select today's date for a quote or new policy.", errorMessage: getDateErrorMessage([policyStartDay || '', policyStartMonth || '', policyStartYear || ''], driverState.inValidation), error: driverState.inValidation, minDate: addDaysToDate('', 1), maxDate: addDaysToDate('', 60), isDay: true }))] }));
|
|
1498
|
+
: '', error: driverState.inValidation, hintMessage: hintMessage, minDate: getMinDate(birthDate, firstLicenceAge) }), jsx(CheckboxForm, { name: "listed", label: "Never listed on an insurance policy", onChange: handleListedChange, defaultValue: !listed })] }), listed && (jsxs("div", { className: "box-container", children: [jsx(SelectFormBox, { name: "insuredDate", onChange: handleInsuredPeriodChange, options: getPeriodOptions(listedYear, listedMonth), defaultValue: insuredDate, disabled: !insured, title: `How long has ${firstName || driverNameDefault} been with their current insurance provider?`, description: "It is common for insurers to provide loyalty rewards or discounts for valued customers. Loyalty is a positive trait in the industry, and most insurance companies will want to provide some incentive for continued customer relationships through tangible policy rewards.", errorMessage: insured ? getErrorMessage(insuredDate, driverState.inValidation) : '', error: !insuredDate && driverState.inValidation }), jsx(CheckboxForm, { name: "insured", label: "Not currently insured", onChange: handleInsuredChange, defaultValue: !insured })] })), !isTheBig && !isMyChoiceLike(appType) && (jsx(DateSelectFormBox, { name: "policyStart", dateNames: ['policyStartYear', 'policyStartMonth', 'policyStartDay'], onDateChange: handlePolicyStartDateChange, defaultValue: defaultPolicyStartDate, title: "What is the ideal start date for your new insurance policy?", description: "Select your preferred date for the beginning of your new insurance policy. For instance, you may set the start date for the day that your current insurance expires to ensure that you\u2019re continuously covered. Alternatively, select today's date for a quote or new policy.", errorMessage: getDateErrorMessage([policyStartDay || '', policyStartMonth || '', policyStartYear || ''], driverState.inValidation), error: driverState.inValidation, minDate: addDaysToDate('', 1), maxDate: addDaysToDate('', 60), isDay: true }))] }));
|
|
1461
1499
|
};
|
|
1462
1500
|
|
|
1463
1501
|
const SectionDriverCancellation = () => {
|
|
@@ -2133,12 +2171,18 @@ const SectionQuoteRecalc$1 = () => {
|
|
|
2133
2171
|
? 'Your premium has been recalculated. Your broker has been notified and will contact you to discuss your Accident Benefits selections.'
|
|
2134
2172
|
: 'Your premium has been recalculated.';
|
|
2135
2173
|
}
|
|
2136
|
-
return (jsxs("div", { className: "form-container", children: [jsx(TabVehicle, { readOnly: true }), jsxs("div", { className: `form-section edit-recalc-container ${mychoiceCls}`, children: [jsx(SelectFormBox, { options: coverageOptions, name: "comprehensive-coverage", onChange: handleComprehensiveChange, defaultValue: getSelectedOption(coverageOptions, comprehensive.coverage ? comprehensive.deductible : 0), title: "Comprehensive coverage", description: "This deductible is the amount of money that you will pay out of your own pocket if your vehicle is damaged in events not covered by collision coverage. This includes events such as falling or flying objects, vandalism, and theft. Your insurance company covers the cost of repair minus the deductible chosen.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: coverageOptions, name: "collision-coverage", onChange: handleCollisionChange, defaultValue: getSelectedOption(coverageOptions, collision.coverage ? collision.deductible : 0), title: "Collision coverage", description: "This deductible is the specific dollar amount you will pay out of your own pocket if your vehicle is damaged in an accident. Your insurance company covers the remaining amount.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: liabilityOptions, name: "liability-limit", onChange: handleLiabilityChange, defaultValue: getSelectedOption(liabilityOptions, liability.coverage ? liability.limit : 1000000), title: "Third Party Liability", description: "This protects you from lawsuits resulting from accidents causing bodily injury or death to others or property damage.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), isAbReformActive &&
|
|
2174
|
+
return (jsxs("div", { className: "form-container", children: [jsx(TabVehicle, { readOnly: true }), jsxs("div", { className: `form-section edit-recalc-container ${mychoiceCls}`, children: [jsx(SelectFormBox, { options: coverageOptions, name: "comprehensive-coverage", onChange: handleComprehensiveChange, defaultValue: getSelectedOption(coverageOptions, comprehensive.coverage ? comprehensive.deductible : 0), title: "Comprehensive coverage", description: "This deductible is the amount of money that you will pay out of your own pocket if your vehicle is damaged in events not covered by collision coverage. This includes events such as falling or flying objects, vandalism, and theft. Your insurance company covers the cost of repair minus the deductible chosen.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: coverageOptions, name: "collision-coverage", onChange: handleCollisionChange, defaultValue: getSelectedOption(coverageOptions, collision.coverage ? collision.deductible : 0), title: "Collision coverage", description: "This deductible is the specific dollar amount you will pay out of your own pocket if your vehicle is damaged in an accident. Your insurance company covers the remaining amount.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: liabilityOptions, name: "liability-limit", onChange: handleLiabilityChange, defaultValue: getSelectedOption(liabilityOptions, liability.coverage ? liability.limit : 1000000), title: "Third Party Liability", description: "This protects you from lawsuits resulting from accidents causing bodily injury or death to others or property damage.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), isAbReformActive && (jsxs("div", { className: "accident-benefits-container", children: [jsx(LabelFormBox, { name: "accident-benefits-recalc", title: "Accident Benefits" }), jsxs("div", { className: "ab-notice-banner", children: [jsx("strong", { children: "Changes to Your Accident Benefits Selections (Effective July 1, 2026)" }), jsx("p", { children: mychoiceCls === 'mychoice'
|
|
2175
|
+
? 'As of July 1, 2026, significant changes have been made to the Accident Benefits coverage in Ontario. Many benefits that were previously included are now optional. Our standard quote automatically includes all optional accident benefits at their minimum coverage limits.'
|
|
2176
|
+
: 'As of July 1, 2026, significant changes have been made to the Accident Benefits coverage in Ontario. Many benefits that were previously included are now optional and must be selected based on your individual needs.' })] }), jsxs("div", { className: "ab-option-selector", role: "button", tabIndex: 0, onClick: () => setModalOpen(true), onKeyDown: (event) => event.key === 'Enter' && setModalOpen(true), children: [jsxs("div", { className: "ab-option-selector-content", children: [jsx("strong", { children: mychoiceCls === 'mychoice'
|
|
2177
|
+
? 'Standard Mandatory Accident Benefits + Optional Enhancements'
|
|
2178
|
+
: 'Standard Mandatory Accident Benefits + Self-Selected Optional Enhancements' }), jsx("p", { children: mychoiceCls === 'mychoice'
|
|
2179
|
+
? 'Maximum coverage with flexibility to remove additional benefits.'
|
|
2180
|
+
: 'Base coverage with flexibility to select additional benefits' })] }), jsx("span", { className: "ab-option-selector-arrow", children: "\u203A" })] }), modalOpen && (jsx(AccidentBenefitsModal, { selectedCoverages: accidentbenefits.additionalCoverages, onApply: handleModalApply, onCancel: () => setModalOpen(false), selectAllByDefault: mychoiceCls === 'mychoice' }))] })), isAbReformActive && abPendingRecalc && !isRecalcSubmitted && (jsx("p", { className: "accident-benefits-recalc-pending", children: "Your Accident Benefits selections have been updated. Click Recalculate to update your premium." })), jsx(BlockSubmit$2, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} recalculate`, label: "Recalculate Quote", buttonSize: SizeTypes.Medium, isRecalc: true, onSubmitClick: () => {
|
|
2137
2181
|
recalcInitiatedRef.current = true;
|
|
2138
2182
|
setAbPendingRecalc(false);
|
|
2139
2183
|
emitAbPendingRecalc(false);
|
|
2140
2184
|
setIsRecalcSubmitted(false);
|
|
2141
|
-
} }), isAbReformActive &&
|
|
2185
|
+
} }), isAbReformActive && isRecalcSubmitted && (jsx("p", { className: "accident-benefits-recalc-message", children: recalcMessage })), isTheBig ? jsx(BlockEndorsements, {}) : jsx(BlockMCEndorsements, {})] })] }));
|
|
2142
2186
|
};
|
|
2143
2187
|
|
|
2144
2188
|
const lockEmoji$1 = '\u{1F512}';
|
|
@@ -2226,7 +2270,7 @@ const PageCarQuote = () => {
|
|
|
2226
2270
|
const navigate = useNavigate();
|
|
2227
2271
|
const [recalcFailed, setRecalcFailed] = useState(false);
|
|
2228
2272
|
const [abPendingRecalc, setAbPendingRecalc] = useState(false);
|
|
2229
|
-
const showAbRecalculateCta = abPendingRecalc &&
|
|
2273
|
+
const showAbRecalculateCta = abPendingRecalc && isAbReformActive;
|
|
2230
2274
|
const shouldGreyOutOffers = recalcFailed && !showAbRecalculateCta;
|
|
2231
2275
|
const prevRequestDateRef = useRef(undefined);
|
|
2232
2276
|
const lastSuccessfulItemsRef = useRef(undefined);
|
|
@@ -2294,7 +2338,7 @@ const PageCarQuote = () => {
|
|
|
2294
2338
|
saturdayHours: displayBestItem?.brokerProfile.hoursSaturday,
|
|
2295
2339
|
sundayHours: displayBestItem?.brokerProfile.hoursSunday,
|
|
2296
2340
|
weekdayHours: displayBestItem?.brokerProfile.hoursWorkdays,
|
|
2297
|
-
}, phoneNumber: formatPhoneObject(displayBestItem?.brokerProfile.phone ?? ''), redirectUrl: displayBestItem?.brokerProfile.redirectUrl || '', coverages: displayBestItem?.coverages, nonStandardCoverages: displayBestItem?.nonStandardCoverages, brokerIntegration: displayBestItem?.brokerIntegration, showRecalculateCta: showAbRecalculateCta, onRecalculateClick: handleRecalculateClick }) })) : (jsx(SplashScreen$2, {})) })) : (jsx(NoQuotesMessage, { type: "car" })) })), (!hasConfirmStep || appDeviceType !== DeviceTypes.Mobile) && (jsxs(Fragment, { children: [jsx(SectionQuoteEdit$2, {}), (isTheBig || !items[0]?.coverages) && jsx(SectionQuoteRecalc$1, {})] }))] }), appDeviceType !== DeviceTypes.Mobile && quoteState.showCallMessage && jsx(SplashScreen$2, {}), !quoteState.showCallMessage && (jsx(Fragment, { children: jsxs("div", { style: { position: 'relative', width: '100%' }, children: [isAbReformActive &&
|
|
2341
|
+
}, phoneNumber: formatPhoneObject(displayBestItem?.brokerProfile.phone ?? ''), redirectUrl: displayBestItem?.brokerProfile.redirectUrl || '', coverages: displayBestItem?.coverages, nonStandardCoverages: displayBestItem?.nonStandardCoverages, brokerIntegration: displayBestItem?.brokerIntegration, showRecalculateCta: showAbRecalculateCta, onRecalculateClick: handleRecalculateClick }) })) : (jsx(SplashScreen$2, {})) })) : (jsx(NoQuotesMessage, { type: "car" })) })), (!hasConfirmStep || appDeviceType !== DeviceTypes.Mobile) && (jsxs(Fragment, { children: [jsx(SectionQuoteEdit$2, {}), (isTheBig || !items[0]?.coverages) && jsx(SectionQuoteRecalc$1, {})] }))] }), appDeviceType !== DeviceTypes.Mobile && quoteState.showCallMessage && jsx(SplashScreen$2, {}), !quoteState.showCallMessage && (jsx(Fragment, { children: jsxs("div", { style: { position: 'relative', width: '100%' }, children: [isAbReformActive && (jsxs("div", { className: "ab-disclaimer", children: [jsx("strong", { children: "Important Disclaimer" }), jsxs("p", { children: ["Due to the changes to the Statutory Accident Benefit Coverage, effective July 1, 2026", ' ', jsx("a", { href: "https://www.fsrao.ca/industry/auto-insurance/changes-statutory-accident-benefits-coverage-ontario-july-1-2026#:~:text=July%201%2C%202026-,Changes%20in%20Statutory%20Accident%20Benefits%20coverage%20in%20Ontario%20on%20July,fits%20their%20needs%20and%20budgets.", target: "_blank", rel: "noreferrer noopener", children: "(Government of Ontario website)" }), ", please consider the individual circumstances for all drivers quoted before making your selections. Speak with your insurance broker if you have questions or need help understanding your options. Your Accident Benefits coverage selections will impact both your quoted premium and the coverage available to drivers on the quote."] })] })), hasConfirmStep && (jsxs(Fragment, { children: [jsx("div", { className: "offer-container", children: jsx(SectionConfirm, {}) }), appDeviceType === DeviceTypes.Mobile && (jsxs(Fragment, { children: [jsx(SectionQuoteEdit$2, {}), (isTheBig || !items[0]?.coverages) && jsx(SectionQuoteRecalc$1, {})] }))] })), jsx("div", { className: `offer-container ${hasConfirmStep ? 'blur' : ''} ${shouldGreyOutOffers ? 'greyed-out' : ''}`, children: !!(items?.length || recalcFailed) ? ((() => {
|
|
2298
2342
|
const bestQuote = displayItems?.[0];
|
|
2299
2343
|
const isContactOnlyIntegration = bestQuote?.brokerIntegration?.ux === 'contactonly';
|
|
2300
2344
|
if (isContactOnlyIntegration && bestQuote) {
|
|
@@ -2316,7 +2360,7 @@ const PageCarQuote = () => {
|
|
|
2316
2360
|
sundayHours: brokerProfile.hoursSunday,
|
|
2317
2361
|
weekdayHours: brokerProfile.hoursWorkdays,
|
|
2318
2362
|
}, phoneNumber: formatPhoneObject(brokerProfile.phone), redirectUrl: brokerProfile.redirectUrl || '', coverages: coverages, nonStandardCoverages: nonStandardCoverages, brokerIntegration: brokerIntegration, showRecalculateCta: showAbRecalculateCta, onRecalculateClick: handleRecalculateClick })) }, index)));
|
|
2319
|
-
})()) : (jsx(NoQuotesMessage, { type: "car" })) }), isAbReformActive &&
|
|
2363
|
+
})()) : (jsx(NoQuotesMessage, { type: "car" })) }), isAbReformActive && (jsx("div", { className: "quote-expiry-disclaimer", children: "The information provided through this quote is for indicative purposes only and is based on the details submitted. Quotes are subject to change, may expire, and are not guaranteed or binding. Final premiums, coverage, and eligibility are determined by the insurer upon full review and underwriting. Please speak with your broker to confirm all details and secure binding coverage." }))] }) }))] })) }));
|
|
2320
2364
|
};
|
|
2321
2365
|
|
|
2322
2366
|
const IndicatorsContainer = () => jsx(Fragment, {});
|