@mychoice/mychoice-sdk-modules 2.1.68 → 2.1.70

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 CHANGED
@@ -87,8 +87,8 @@ InputFormLicenceBox.defaultProps = {
87
87
  };
88
88
 
89
89
  const SelectFormBox = (props) => {
90
- const { className, defaultValue, disabled, error, name, title, description, onChange, errorMessage, hintMessage, isRemovable, onIconClick, options, groupOptions, placeholder, autoSelectIfValueIsOutOfOptions, } = props;
91
- return (jsxRuntime.jsx(Container, { name: name, className: ` ${className} ${error ? 'error' : ''}`, title: title, description: description, errorMessage: errorMessage, hintMessage: hintMessage, isRemovable: isRemovable, onIconClick: onIconClick, children: jsxRuntime.jsx(mychoiceSdkComponents.SelectForm, { className: "input-form", name: name, defaultValue: defaultValue, onChange: onChange, options: options || [], groupOptions: groupOptions || [], placeholder: placeholder, disabled: disabled, autoSelectIfValueIsOutOfOptions: autoSelectIfValueIsOutOfOptions, error: error }) }));
90
+ const { className, defaultValue, disabled, error, name, title, description, onChange, errorMessage, hintMessage, isRemovable, onIconClick, options, groupOptions, placeholder, autoSelectIfValueIsOutOfOptions, size, } = props;
91
+ return (jsxRuntime.jsx(Container, { name: name, className: ` ${className} ${error ? 'error' : ''}`, title: title, description: description, errorMessage: errorMessage, hintMessage: hintMessage, isRemovable: isRemovable, onIconClick: onIconClick, children: jsxRuntime.jsx(mychoiceSdkComponents.SelectForm, { className: "input-form", name: name, defaultValue: defaultValue, onChange: onChange, options: options || [], groupOptions: groupOptions || [], placeholder: placeholder, disabled: disabled, autoSelectIfValueIsOutOfOptions: autoSelectIfValueIsOutOfOptions, error: error, size: size }) }));
92
92
  };
93
93
  SelectFormBox.defaultProps = {
94
94
  className: '',
@@ -149,10 +149,246 @@ SwitchButtonBox.defaultProps = {
149
149
  items: [],
150
150
  };
151
151
 
152
- const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, isBestOffer, operationHours = {}, redirectUrl, fulfillmentUrl, }) => {
152
+ const getSelectedOption = (options, val) => {
153
+ if (typeof val === 'boolean') {
154
+ return options.find(({ value }) => val === value)?.value || false;
155
+ }
156
+ if (typeof val === 'number') {
157
+ return options.find((option) => option.value?.toString() === val.toString())?.value;
158
+ }
159
+ return options.find((option) => option.value === val)?.value;
160
+ };
161
+ const getErrorMessage = (value, inValidation = false, message = '') => {
162
+ if (inValidation) {
163
+ if (value === null) {
164
+ return 'This field is required.';
165
+ }
166
+ if (typeof value === 'boolean') {
167
+ return '';
168
+ }
169
+ return !value ? 'This field is required.' : message;
170
+ }
171
+ return '';
172
+ };
173
+ const getDateErrorMessage = (values, inValidation = false) => {
174
+ const emptyValues = values.filter((value) => !value);
175
+ if (inValidation) {
176
+ if (emptyValues.length > 1) {
177
+ return 'These fields are required.';
178
+ }
179
+ if (emptyValues.length === 1) {
180
+ return 'This field is required.';
181
+ }
182
+ }
183
+ return '';
184
+ };
185
+ const formatPhoneObject = (phone) => {
186
+ const phoneToArray = (phone || mychoiceSdkComponents.defaultBrokerPhone).split(',');
187
+ const onlyNumbers = phoneToArray[0].replace(/\D/g, '');
188
+ let phoneNumber;
189
+ if (onlyNumbers.length < 11) {
190
+ phoneNumber = `1${onlyNumbers}`;
191
+ }
192
+ else {
193
+ phoneNumber = onlyNumbers;
194
+ }
195
+ const phoneToNumbers = Number(phoneNumber).toString();
196
+ const phoneWithoutSpecialKey = phoneToNumbers.length > 10
197
+ ? phoneToNumbers.replace(/(\d{1})(\d{3})(\d{3})(\d{4})/, '$1-$2-$3-$4')
198
+ : phoneToNumbers.replace(/(\d{1})(\d{3})(\d{3})(\d{3})/, '$1-$2-$3-$4');
199
+ const title = phoneToArray.length < 2 ? phoneWithoutSpecialKey : `${phoneWithoutSpecialKey} x${phoneToArray[1]}`;
200
+ const specialKeys = phoneToArray[1] ? `,${phoneToArray[1]}` : '';
201
+ return {
202
+ number: phoneWithoutSpecialKey,
203
+ title,
204
+ specialKeys,
205
+ };
206
+ };
207
+ const formatTitleToCapital = (name) => name.replace(/-/g, ' ')
208
+ .replace(/\+/g, ' ').replace(/(\b[a-z](?!\s))/g, (letter) => letter.toUpperCase());
209
+ const capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
210
+
211
+ const BlockVehLinks = () => {
212
+ const { vehicleState: { items: vehicles } } = mychoiceSdkStore.useStoreFormCarVehicle();
213
+ const { driverState: { items: drivers } } = mychoiceSdkStore.useStoreFormCarDriverBase();
214
+ const { discountState: { vehlinks }, dispatchDiscountState } = mychoiceSdkStore.useStoreFormCarDiscount();
215
+ const driverOptions = drivers.map((driver, index) => ({ name: driver.firstName, value: index }));
216
+ const handleDriverChange = (vehicleIndex) => ({ value }) => {
217
+ dispatchDiscountState({
218
+ type: mychoiceSdkStore.StoreFormCarDiscountActionTypes.FormCarDiscountVehlinkSelect,
219
+ payload: {
220
+ driverIndex: value,
221
+ vehicleIndex,
222
+ },
223
+ });
224
+ };
225
+ if (drivers.length > 1) {
226
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(LabelFormBox, { title: "Since there are multiple drivers in this quote,\n please tell us who drives which vehicle the most.\n Please provide an answer that best suits your situation." }), vehicles.map((vehicle, index) => {
227
+ const { year, make, model } = vehicle;
228
+ const selectedDriver = vehlinks.find((vehlink) => (vehlink.vehicleIndex === index && vehlink.priority === mychoiceSdkComponents.DriverPriorityTypes.Prn));
229
+ return (jsxRuntime.jsx(SelectFormBox, { title: `Who is the principal driver of the ${year} ${make} ${model} ?`, onChange: handleDriverChange(index), options: driverOptions, defaultValue: selectedDriver?.driverIndex || 0, name: `vehlink-${index}` }, `vehlink-${index}`));
230
+ })] }));
231
+ }
232
+ return null;
233
+ };
234
+
235
+ const BlockNextPageInfo$2 = () => {
153
236
  const { appConfigState: { appType } } = mychoiceSdkStore.useStoreAppConfig();
237
+ const isTheBig = appType === mychoiceSdkComponents.AppTypes.TheBig;
238
+ return (jsxRuntime.jsx("div", { className: "next-page-info", children: isTheBig ? (jsxRuntime.jsx("div", { className: "privacy-policy", children: jsxRuntime.jsxs("p", { children: [jsxRuntime.jsx("span", { children: "DISCLAIMER: " }), "As insurance premiums are based on the information you provide it is important that it be 100% accurate and up to date. If you are not sure it is best to check before completing your quote."] }) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("h5", { children: "On the next page, you will also be able to:" }), jsxRuntime.jsxs("div", { className: "next-page-points", children: [jsxRuntime.jsx("p", { children: "1. See what rates insurance carriers are offering" }), jsxRuntime.jsx("p", { children: "2. Get in touch with a broker and secure your rate" }), jsxRuntime.jsx("p", { children: "3. Potentially save more by speaking with a broker" })] }), jsxRuntime.jsx("div", { className: "privacy-policy", children: jsxRuntime.jsxs("p", { children: ["Once you submit this form, you are agreeing to have your insurance quote sent to you via email and My Choice will provide your contact information to one of our trusted broker partners, who will contact you after your quote is complete to further assist you in securing your best rate. For more details, see our", jsxRuntime.jsx("a", { href: "https://www.mychoice.ca/privacy-policy/", children: " Privacy Policy" }), "."] }) })] })) }));
239
+ };
240
+
241
+ const BlockSubmit$2 = ({ className, label, buttonSize, isRecalc = false, }) => {
242
+ const { quoteState: { isRequested, quoteConfirm } } = mychoiceSdkStore.useStoreFormCarQuote();
243
+ const { discountState: { isValid } } = mychoiceSdkStore.useStoreFormCarDiscount();
244
+ const { appConfigState: { localIndex, insuranceType } } = mychoiceSdkStore.useStoreAppConfig();
245
+ const navigate = reactRouterDom.useNavigate();
246
+ const { postRequestQuote } = mychoiceSdkStore.CarQuoteDataHandler();
247
+ const { carDiscountFormValidate } = mychoiceSdkStore.useValidationCarDiscount();
248
+ const handleGetQuotesClick = () => {
249
+ if (!isValid) {
250
+ carDiscountFormValidate(false, () => postRequestQuote(isRecalc, quoteConfirm));
251
+ }
252
+ else if (!isRequested) {
253
+ postRequestQuote(isRecalc, quoteConfirm);
254
+ }
255
+ else if (!isRecalc) {
256
+ navigate(`/${localIndex || mychoiceSdkComponents.defaultLocalIndex}/${insuranceType}/quotes`);
257
+ }
258
+ };
259
+ return (jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: className, size: buttonSize, category: mychoiceSdkComponents.CategoryTypes.Filled, onClick: handleGetQuotesClick, color: mychoiceSdkComponents.ColorTypes.Primary, label: label }));
260
+ };
261
+ BlockSubmit$2.defaultProps = {
262
+ buttonSize: mychoiceSdkComponents.SizeTypes.Large,
263
+ label: 'Get Your Quotes',
264
+ className: '',
265
+ };
266
+
267
+ const VehicleOfferCoverages = ({ coverages, nonStandardCoverages, }) => {
268
+ const { vehicleState, dispatchVehicleState } = mychoiceSdkStore.useStoreFormCarVehicle();
269
+ const { comprehensive, collision, liability, lossofuse, liabilityfordamage, limitedwaiverofdepreciation } = vehicleState.items[vehicleState.activeIndex];
270
+ const vehicle_names = vehicleState.items.map(({ year, make, model }) => [`${year} ${make} ${model}`]);
271
+ const isLeased = vehicleState.items.some((item) => item.leased);
272
+ const handleComprehensiveChange = ({ value }) => {
273
+ for (let i = 0; i < vehicleState.items.length; i += 1) {
274
+ dispatchVehicleState({
275
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarVehicleSelect,
276
+ payload: {
277
+ vehicleIndex: i,
278
+ },
279
+ });
280
+ dispatchVehicleState({
281
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarComprehensiveCoverageSelect,
282
+ payload: { coverage: !!Number(value), deductible: value },
283
+ });
284
+ }
285
+ };
286
+ const handleLiabilityChange = ({ value }) => {
287
+ for (let i = 0; i < vehicleState.items.length; i += 1) {
288
+ dispatchVehicleState({
289
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarVehicleSelect,
290
+ payload: {
291
+ vehicleIndex: i,
292
+ },
293
+ });
294
+ dispatchVehicleState({
295
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarLiabilityCoverageSelect,
296
+ payload: { coverage: true, limit: value },
297
+ });
298
+ }
299
+ };
300
+ const handleCollisionChange = ({ value }) => {
301
+ for (let i = 0; i < vehicleState.items.length; i += 1) {
302
+ dispatchVehicleState({
303
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarVehicleSelect,
304
+ payload: {
305
+ vehicleIndex: i,
306
+ },
307
+ });
308
+ dispatchVehicleState({
309
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarCollisionCoverageSelect,
310
+ payload: { coverage: !!Number(value), deductible: value },
311
+ });
312
+ }
313
+ };
314
+ const handleLossOfUseChange = ({ value }) => {
315
+ for (let i = 0; i < vehicleState.items.length; i += 1) {
316
+ dispatchVehicleState({
317
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarVehicleSelect,
318
+ payload: {
319
+ vehicleIndex: i,
320
+ },
321
+ });
322
+ dispatchVehicleState({
323
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarLossOfUseCoverageSelect,
324
+ payload: { coverage: !!Number(value), limit: value },
325
+ });
326
+ }
327
+ };
328
+ const handleLiaiblityForDamageChange = ({ value }) => {
329
+ for (let i = 0; i < vehicleState.items.length; i += 1) {
330
+ dispatchVehicleState({
331
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarVehicleSelect,
332
+ payload: {
333
+ vehicleIndex: i,
334
+ },
335
+ });
336
+ dispatchVehicleState({
337
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarLiabilityForDamageCoverageSelect,
338
+ payload: { coverage: !!Number(value), limit: value },
339
+ });
340
+ }
341
+ };
342
+ const handleLimitedWaiverOfDepreciationChange = ({ value }) => {
343
+ for (let i = 0; i < vehicleState.items.length; i += 1) {
344
+ dispatchVehicleState({
345
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarVehicleSelect,
346
+ payload: {
347
+ vehicleIndex: i,
348
+ },
349
+ });
350
+ dispatchVehicleState({
351
+ type: mychoiceSdkStore.StoreFormCarVehicleActionTypes.FormCarLimitedWaiverOfDepreciationCoverageSelect,
352
+ payload: { coverage: !!Number(value), limit: value },
353
+ });
354
+ }
355
+ };
356
+ const getCoveragePremium = (code) => {
357
+ const coverage = coverages.find((coverage) => coverage.code === code);
358
+ return coverage ? `$${coverage.annualPremium.toFixed(2)}` : '-';
359
+ };
360
+ const doesCoverageExist = (code) => {
361
+ return coverages.some((coverage) => coverage.code === code);
362
+ };
363
+ const isNonStandardCoverageActive = (name) => {
364
+ if (!nonStandardCoverages)
365
+ return false;
366
+ return nonStandardCoverages[name] === true;
367
+ };
368
+ const getTPBIandTPPD = () => {
369
+ const tpbi = coverages.find((coverage) => coverage.code === 'TPBI');
370
+ const tppd = coverages.find((coverage) => coverage.code === 'TPPD');
371
+ if (!tpbi || !tppd) {
372
+ return '-';
373
+ }
374
+ const total = tpbi.annualPremium + tppd.annualPremium;
375
+ return `$${total.toFixed(2)}`;
376
+ };
377
+ const getSumOfPremiums = () => {
378
+ const premiums = coverages.map((coverage) => coverage.annualPremium);
379
+ const total = premiums.reduce((acc, premium) => {
380
+ return acc + Number(premium);
381
+ }, 0);
382
+ return `$${total.toFixed(2)}`;
383
+ };
384
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "offer-coverages-container", children: jsxRuntime.jsxs("table", { className: "offer-coverages-table", children: [jsxRuntime.jsxs("tr", { className: "table-header", children: [jsxRuntime.jsx("td", { children: vehicle_names.join(', ') }), jsxRuntime.jsx("td", { children: "Selection" }), jsxRuntime.jsx("td", { children: "Premium" })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) }), jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Third Party Liability Coverage", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: "Third-party liability coverage is mandatory in Ontario and protects you if you're found at fault for injuring or killing someone or damaging their property while driving. This includes people in other vehicles, pedestrians, cyclists, and even passengers in your own car, as well as property like fences, buildings, street signs, and light poles. If you’re sued, this coverage helps pay for legal defence, settlements, and any court-ordered payments. The minimum required coverage is $200,000, but that amount often isn’t enough—most drivers choose at least $2 million to avoid having to pay out-of-pocket if costs exceed the limit. This is a mandatory coverage in Ontario. Talk to your broker to ensure you have the right amount of protection." }) })] }), jsxRuntime.jsx("td", { children: jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.liabilityOptions, name: "liability-limit", onChange: handleLiabilityChange, defaultValue: getSelectedOption(mychoiceSdkComponents.liabilityOptions, liability.coverage ? liability.limit : 1000000), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: mychoiceSdkComponents.SizeTypes.Small, className: "coverages-select-input" }) }), jsxRuntime.jsx("td", { children: getTPBIandTPPD() })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) }), jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Direct Compensation - Property Damange Coverage", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: "Third - Party Liability Direct Compensation responds when you are determined to be not at-fault in an accident with another vehicle, and covers the cost of damage to your vehicle (or actual cash value payout), it's equipment, contents, loss of use, and other associated incidentals such as towing fees and lot fees. This is considered an optional coverage, and it is highly recommended that you do not remove it. If your vehicle is financed or leased, the lienholder/lessor must agree to allow you to remove it. Should you remove it, you must also remove collision or all perils coverage. You will be entirely out-of-pocket in a not-at-fault accident and are legally restricted from claiming reimbursement (suing) the other vehicle owner or their insurer. Chat to your broker for more details about this coverage." }) })] }), jsxRuntime.jsx("td", { children: "$0 Deductible" }), jsxRuntime.jsx("td", { children: getCoveragePremium('TPDC') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) }), jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Accident Benefits Coverage", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: 'Accident Benefits is a mandatory coverage that responds when there is injury or death in an accident, regardless of fault, and for all affected individuals. It provides a core series of benefits with the capacity to increase coverage values, along with a menu of optional additional benefits that can be added on. The core and optional coverages must be thoroughly reviewed and evaluated, and decisions made based on your own personal circumstances and needs. Chat to your broker for more details about this coverage.' }) })] }), jsxRuntime.jsx("td", { children: "Included" }), jsxRuntime.jsx("td", { children: getCoveragePremium('AB') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) }), jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Uninsured Automobile Coverage", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: 'Uninsured Motorist Coverage is a mandatory coverage which responds when you are not at-fault in an accident with an uninsured or unidentified (hit-and-run) vehicle, and have incurred bodily injuries, death, or damage to your property, and the offending vehicle owner cannot be found, of if identified, cannot adequately compensate you. Coverage is capped to match the province minimum liability limit of $200,000. Due to the low coverage value, it is highly recommended to ensure inclusion of the OPCF44 Family Protection Coverage endorsement for additional protection. Chat to your broker for more details about this coverage.' }) })] }), jsxRuntime.jsx("td", { children: "Included" }), jsxRuntime.jsx("td", { children: getCoveragePremium('UA') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) }), jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Comprehensive Coverage", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: 'Comprehensive coverage responds to types of damages ( repair or actual cash value payout) incurred by your vehicle when it is not actively being driven. Examples would be fire, theft, vandalism, glass breakage, and weather-related losses. While considered an optional coverage, it is highly recommended. Should your vehicle be financed or leased, the lienholder/lessor will not allow you to leave this coverage out and will impose a satisfactory deductible to meet their requirements.' }) })] }), jsxRuntime.jsx("td", { children: jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.coverageOptions, name: "comprehensive-coverage", onChange: handleComprehensiveChange, defaultValue: getSelectedOption(mychoiceSdkComponents.coverageOptions, comprehensive.coverage ? comprehensive.deductible : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: mychoiceSdkComponents.SizeTypes.Small, className: "coverages-select-input" }) }), jsxRuntime.jsx("td", { children: getCoveragePremium('CMP') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) }), jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Collision Coverage", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: 'Collision coverage responds to your vehicle damages (repair or actual cash value payout) in the event you collide with another vehicle or object in the course of its use or operation, and is determined to be at-fault. While considered an optional coverage, it is highly recommended. Should your vehicle be financed or leased, the lienholder/lessor will not allow you to leave this coverage out and will impose a satisfactory deductible to meet their requirements. Chat to your broker for more details about this coverage.' }) })] }), jsxRuntime.jsx("td", { children: jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.coverageOptions, name: "collision-coverage", onChange: handleCollisionChange, defaultValue: getSelectedOption(mychoiceSdkComponents.coverageOptions, collision.coverage ? collision.deductible : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: mychoiceSdkComponents.SizeTypes.Small, className: "coverages-select-input" }) }), jsxRuntime.jsx("td", { children: getCoveragePremium('COL') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) }), doesCoverageExist('5') && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsx("td", { children: "Permission to Rent or Lease (OPCF 5)" }), jsxRuntime.jsx("td", { children: "Included" }), jsxRuntime.jsx("td", { children: getCoveragePremium('5') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) })] })), isNonStandardCoverageActive(20) && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Loss of Use (OPCF 20)", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: 'The OPCF20 Loss of Use / Transportation Replacement endorsement responds when you are determined to be at-fault for an accident, or have a comprehensive claim, and need replacement transportation while your vehicle is out-of-service being repaired, or until it is deemed to be a total loss and a settlement offer is made by your insurer. Most often used to pay for a temporary replacement vehicle rental, it can also be used to compensate for other acceptable forms of travel. Depending on the insurer, the coverage limits available may be a dollar amount or a time amount, and you must have collision and comprehensive, or all perils coverage to include this endorsement. While it is optional, it is highly recommended, and careful consideration must be given to the coverage amounts chosen, as repair delays can quickly exhaust your policy limits, leaving you out-of-pocket for transportation expenses. Chat to your broker for more details about this coverage.' }) })] }), jsxRuntime.jsx("td", { style: { paddingBottom: '7px' }, children: jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.lossOfUseOptions, name: "loss-of-use", onChange: handleLossOfUseChange, defaultValue: getSelectedOption(mychoiceSdkComponents.lossOfUseOptions, lossofuse.coverage ? lossofuse.limit : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: mychoiceSdkComponents.SizeTypes.Small, className: "coverages-select-input" }) }), jsxRuntime.jsx("td", { rowSpan: doesCoverageExist('PAK6') ? 2 : 1, children: doesCoverageExist('PAK6') ? getCoveragePremium('PAK6') : getCoveragePremium('20') })] }) })), isNonStandardCoverageActive(27) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Liability for Damage for Non-Owned Cars (OPCF 27)", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: 'The OPCF27 Liability for Damage to Non-Owned Automobile(s) endorsement responds when you rent or borrow a vehicle, and want to extend your coverages to that vehicle. Often used for special occasion rentals or vacation vehicle rentals. Full liability and physical damage coverages must be on your insured vehicle for this endorsement to apply, and a deductible is applicable. Careful consideration must be given in choosing a coverage amount that adequately covers the value of the vehicle you are expecting to rent or borrow. While considered optional, it is highly recommended, and often "packaged" with the OPCF20 Loss of Use / Transportation Replacement coverage by many insurers. Chat to your broker for more details about this coverage.' }) })] }), jsxRuntime.jsx("td", { children: jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.liabilityForDamageOptions, name: "liaiblity-for-damage", onChange: handleLiaiblityForDamageChange, defaultValue: getSelectedOption(mychoiceSdkComponents.liabilityForDamageOptions, liabilityfordamage.coverage ? liabilityfordamage.limit : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: mychoiceSdkComponents.SizeTypes.Small, className: "coverages-select-input" }) }), !doesCoverageExist('PAK6') && jsxRuntime.jsx("td", { children: getCoveragePremium('27') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) })] })), isNonStandardCoverageActive('aCCW') && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Accident Waiver or Forgiveness (OPCF 39)", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: "The OPCF39 Accident Waiver/Forgiveness endorsement responds by protecting your existing driving record from being negatively impacted by a single, partial at-fault or fully at-fault accident, and must be on the policy before the accident. The benefit of the coverage continues as long as you stay with the same insurer, as it's not transferable should you move to another insurance company. Subsequent at-fault or partial at-fault accidents will not have the protection and will be adversely rated accordingly. Eligibility, terms, conditions, and formulations used can vary significantly between insurers, so careful review and consideration are essential. While purchasing this endorsement is optional, it is highly recommended as the alternative of being accident-rated for several years will be significantly higher in premiums than the cost of the endorsement. Chat to your broker for more details about this coverage." }) })] }), jsxRuntime.jsx("td", { children: "Included" }), jsxRuntime.jsx("td", { children: getCoveragePremium('ACCW') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) })] })), isNonStandardCoverageActive(43) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Limited waiver of depreciation (OPCF ", isLeased ? '43A' : '43', ")", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: 'The OPCF43/43A Removing Depreciation Deduction / Limited Waiver of Depreciation endorsement responds by protecting your original purchase/lease price of a "new" vehicle (as evidenced by a bill of sale or lease agreement) from depreciation should the vehicle be a total loss from an insured peril. Only new vehicles, and in some cases "demo\'s" with limited mileage are eligible, and the endorsement must be added immediately upon the vehicle delivery. Coverage durations available vary between insurers, generally ranging from 24 months to 60 months from the possession date of the vehicle. While an optional coverage, it is highly recommended as, without it, a total loss settlement based on actual cash value could leave you contractually owing money to a lienholder or lessor. Chat to your broker for more details about this coverage.' }) })] }), jsxRuntime.jsx("td", { children: jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.limitedWaiverOfDepreciationOptions, name: "liaiblity-for-damage", onChange: handleLimitedWaiverOfDepreciationChange, defaultValue: getSelectedOption(mychoiceSdkComponents.limitedWaiverOfDepreciationOptions, limitedwaiverofdepreciation.coverage ? limitedwaiverofdepreciation.limit : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: mychoiceSdkComponents.SizeTypes.Small, className: "coverages-select-input" }) }), jsxRuntime.jsx("td", { children: getCoveragePremium('43') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) })] })), jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsxs("td", { children: ["Family Protection (OPCF 44)", jsxRuntime.jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsxRuntime.jsx(mychoiceSdkComponents.TooltipForm, { id: "my-tooltip", description: 'The OPCF44 Family Protection Endorsement responds when you are determined to be not at-fault in a vehicle accident, and your claim / civil suit against the offending vehicle owner is not adequately satisfied as they are unidentified, uninsured, or underinsured. This endorsement bridges their coverages (if any) up to the full limits of the OPCF44 coverage on your policy. While considered an optional coverage, it is highly recommended as a form of self protection, and is extremely low in cost. Chat to your broker for more details about this coverage.' }) })] }), jsxRuntime.jsx("td", { children: "Included" }), jsxRuntime.jsx("td", { children: getCoveragePremium('44') })] }), jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: 3, children: jsxRuntime.jsx("div", { className: "divider" }) }) }), jsxRuntime.jsxs("tr", { className: "premium-total", children: [jsxRuntime.jsx("td", { children: "Annual Premium" }), jsxRuntime.jsx("td", {}), jsxRuntime.jsx("td", { children: getSumOfPremiums() })] })] }) }), jsxRuntime.jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: jsxRuntime.jsx(BlockSubmit$2, { className: "mychoice recalculate", label: "Recalculate Quote", buttonSize: mychoiceSdkComponents.SizeTypes.Medium, isRecalc: true }) })] }));
385
+ };
386
+
387
+ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, isBestOffer, operationHours = {}, redirectUrl, fulfillmentUrl, coverages, nonStandardCoverages, }) => {
388
+ const { appConfigState: { appType }, } = mychoiceSdkStore.useStoreAppConfig();
154
389
  const { postRequestQuoteOnliaUrl } = mychoiceSdkStore.CarQuoteDataHandler();
155
390
  const isTheBig = appType === mychoiceSdkComponents.AppTypes.TheBig;
391
+ const isMyChoice = appType === mychoiceSdkComponents.AppTypes.MyChoice;
156
392
  const mychoiceCls = appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : '';
157
393
  const { weekdayHours, saturdayHours, sundayHours } = operationHours;
158
394
  const [detailsIsOpen, setDetailsIsOpenIsOpen] = React.useState(isBestOffer ?? false);
@@ -167,9 +403,7 @@ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, is
167
403
  }
168
404
  postRequestQuoteOnliaUrl(true, redirectUrl);
169
405
  };
170
- return (jsxRuntime.jsxs("div", { className: `offer-section ${mychoiceCls}`, children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferHeader, { className: isTheBig ? 'thebig-bold' : '', companyName: offerCompany?.name, isBestOffer: isBestOffer }), jsxRuntime.jsx(mychoiceSdkComponents.OfferPrice, { className: isTheBig ? 'thebig' : '', companyLogo: offerCompany?.logo, price: offerPrice }), !isTheBig && offsiteUrl
171
- ? (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { children: "Click below to get this rate" }), jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: "Buy Online", type: mychoiceSdkComponents.ButtonTypes.Button, category: mychoiceSdkComponents.CategoryTypes.Filled, color: mychoiceSdkComponents.ColorTypes.Primary, variant: mychoiceSdkComponents.ButtonVariantTypes.Rectangle, size: mychoiceSdkComponents.SizeTypes.Medium, onClick: handleCTAClick })] })) : (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { className: isTheBig ? 'thebig-bold' : '', children: "Call now to get this rate" }), jsxRuntime.jsx("a", { target: "_blank", rel: "noreferrer noopener", href: `tel:${phoneNumber?.number}`, children: jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} offer-phone-number`, label: phoneNumber?.title, type: mychoiceSdkComponents.ButtonTypes.Button, category: mychoiceSdkComponents.CategoryTypes.Filled, color: mychoiceSdkComponents.ColorTypes.Primary, variant: mychoiceSdkComponents.ButtonVariantTypes.Rectangle, size: mychoiceSdkComponents.SizeTypes.Medium }) })] })), jsxRuntime.jsxs("button", { className: "dropdown", onClick: handleDropdownClick, children: [jsxRuntime.jsx("span", { children: detailsIsOpen ? 'Less Info' : 'More Info' }), jsxRuntime.jsx(mychoiceSdkComponents.IconDropdownArrow, { color: "grey", className: detailsIsOpen ? 'rotated' : '' })] }), detailsIsOpen && (jsxRuntime.jsxs("div", { className: "offer-details", children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: offerCompany?.name, companyType: mychoiceSdkComponents.CompanyRoleTypes.Offering, description: offerCompany?.description }), jsxRuntime.jsx("hr", {}), (isTheBig || !offsiteUrl)
172
- && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', logo: brokerCompany?.logo, name: brokerCompany?.title, companyType: mychoiceSdkComponents.CompanyRoleTypes.Broker, description: brokerCompany?.description }), jsxRuntime.jsx("hr", {})] })), jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: "Hours of Operation", children: jsxRuntime.jsx(mychoiceSdkComponents.OperationHoursInfo, { weekdayHours: weekdayHours, saturdayHours: saturdayHours, sundayHours: sundayHours }) })] }))] }));
406
+ return (jsxRuntime.jsxs("div", { className: `offer-section ${mychoiceCls}`, children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferHeader, { className: isTheBig ? 'thebig-bold' : '', companyName: offerCompany?.name, isBestOffer: isBestOffer }), jsxRuntime.jsx(mychoiceSdkComponents.OfferPrice, { className: isTheBig ? 'thebig' : '', companyLogo: offerCompany?.logo, price: offerPrice }), !isTheBig && offsiteUrl ? (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { children: "Click below to get this rate" }), jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: "Buy Online", type: mychoiceSdkComponents.ButtonTypes.Button, category: mychoiceSdkComponents.CategoryTypes.Filled, color: mychoiceSdkComponents.ColorTypes.Primary, variant: mychoiceSdkComponents.ButtonVariantTypes.Rectangle, size: mychoiceSdkComponents.SizeTypes.Medium, onClick: handleCTAClick })] })) : (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { className: isTheBig ? 'thebig-bold' : '', children: "Call now to get this rate" }), jsxRuntime.jsx("a", { target: "_blank", rel: "noreferrer noopener", href: `tel:${phoneNumber?.number}`, children: jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} offer-phone-number`, label: phoneNumber?.title, type: mychoiceSdkComponents.ButtonTypes.Button, category: mychoiceSdkComponents.CategoryTypes.Filled, color: mychoiceSdkComponents.ColorTypes.Primary, variant: mychoiceSdkComponents.ButtonVariantTypes.Rectangle, size: mychoiceSdkComponents.SizeTypes.Medium }) })] })), jsxRuntime.jsxs("button", { className: "dropdown", onClick: handleDropdownClick, children: [jsxRuntime.jsx("span", { children: detailsIsOpen ? 'Less Info' : 'More Info' }), jsxRuntime.jsx(mychoiceSdkComponents.IconDropdownArrow, { color: "grey", className: detailsIsOpen ? 'rotated' : '' })] }), detailsIsOpen && (jsxRuntime.jsxs("div", { className: "offer-details", children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: offerCompany?.name, companyType: mychoiceSdkComponents.CompanyRoleTypes.Offering, description: offerCompany?.description }), jsxRuntime.jsx("hr", {}), (isTheBig || !offsiteUrl) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', logo: brokerCompany?.logo, name: brokerCompany?.title, companyType: mychoiceSdkComponents.CompanyRoleTypes.Broker, description: brokerCompany?.description }), jsxRuntime.jsx("hr", {})] })), jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: "Hours of Operation", children: jsxRuntime.jsx(mychoiceSdkComponents.OperationHoursInfo, { weekdayHours: weekdayHours, saturdayHours: saturdayHours, sundayHours: sundayHours }) }), isMyChoice && coverages && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("hr", {}), jsxRuntime.jsx(VehicleOfferCoverages, { coverages: coverages, nonStandardCoverages: nonStandardCoverages })] }))] }))] }));
173
407
  };
174
408
  OfferSection.defaultProps = {
175
409
  offerPrice: { monthly: 0, yearly: 0 },
@@ -383,65 +617,6 @@ const getRecommendedRange = (distanceDaily, distanceBusiness) => {
383
617
  }
384
618
  };
385
619
 
386
- const getSelectedOption = (options, val) => {
387
- if (typeof val === 'boolean') {
388
- return options.find(({ value }) => val === value)?.value || false;
389
- }
390
- if (typeof val === 'number') {
391
- return options.find((option) => option.value?.toString() === val.toString())?.value;
392
- }
393
- return options.find((option) => option.value === val)?.value;
394
- };
395
- const getErrorMessage = (value, inValidation = false, message = '') => {
396
- if (inValidation) {
397
- if (value === null) {
398
- return 'This field is required.';
399
- }
400
- if (typeof value === 'boolean') {
401
- return '';
402
- }
403
- return !value ? 'This field is required.' : message;
404
- }
405
- return '';
406
- };
407
- const getDateErrorMessage = (values, inValidation = false) => {
408
- const emptyValues = values.filter((value) => !value);
409
- if (inValidation) {
410
- if (emptyValues.length > 1) {
411
- return 'These fields are required.';
412
- }
413
- if (emptyValues.length === 1) {
414
- return 'This field is required.';
415
- }
416
- }
417
- return '';
418
- };
419
- const formatPhoneObject = (phone) => {
420
- const phoneToArray = (phone || mychoiceSdkComponents.defaultBrokerPhone).split(',');
421
- const onlyNumbers = phoneToArray[0].replace(/\D/g, '');
422
- let phoneNumber;
423
- if (onlyNumbers.length < 11) {
424
- phoneNumber = `1${onlyNumbers}`;
425
- }
426
- else {
427
- phoneNumber = onlyNumbers;
428
- }
429
- const phoneToNumbers = Number(phoneNumber).toString();
430
- const phoneWithoutSpecialKey = phoneToNumbers.length > 10
431
- ? phoneToNumbers.replace(/(\d{1})(\d{3})(\d{3})(\d{4})/, '$1-$2-$3-$4')
432
- : phoneToNumbers.replace(/(\d{1})(\d{3})(\d{3})(\d{3})/, '$1-$2-$3-$4');
433
- const title = phoneToArray.length < 2 ? phoneWithoutSpecialKey : `${phoneWithoutSpecialKey} x${phoneToArray[1]}`;
434
- const specialKeys = phoneToArray[1] ? `,${phoneToArray[1]}` : '';
435
- return {
436
- number: phoneWithoutSpecialKey,
437
- title,
438
- specialKeys,
439
- };
440
- };
441
- const formatTitleToCapital = (name) => name.replace(/-/g, ' ')
442
- .replace(/\+/g, ' ').replace(/(\b[a-z](?!\s))/g, (letter) => letter.toUpperCase());
443
- const capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
444
-
445
620
  const BlockCarInfo = () => {
446
621
  const { status: statusMake, getVehicleMake, vehicleMakeList = [] } = mychoiceSdkStore.useHandlerCarMake();
447
622
  const { status: statusModel, getVehicleModel, vehicleModelList = [] } = mychoiceSdkStore.useHandlerCarModel();
@@ -1531,62 +1706,6 @@ const PageDriver = () => {
1531
1706
  return (jsxRuntime.jsxs("div", { className: "form-container", children: [jsxRuntime.jsx(TabDriver, { createItem: createDriver }), jsxRuntime.jsxs("div", { className: "form-section-container", children: [isRender && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SectionDriverInfo, {}), jsxRuntime.jsx(SectionDriverLicence, {}), jsxRuntime.jsx(SectionDriverInsurancePolicy, {}), jsxRuntime.jsx(SectionDriverCancellation, {}), jsxRuntime.jsx(SectionDriverHistory, {}), appType === mychoiceSdkComponents.AppTypes.MyChoice && jsxRuntime.jsx(HonestyMessage, {})] })), appType === mychoiceSdkComponents.AppTypes.TheBig ? (jsxRuntime.jsx(NavigationBottomTheBig, { createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid })) : (jsxRuntime.jsx(NavigationBottom, { className: "mychoice", createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid }))] }), localIndex !== mychoiceSdkComponents.defaultLocalIndex && (jsxRuntime.jsx("img", { className: "logo-for-partner", src: myChoicePartnerLogo, alt: "partner logo" }))] }));
1532
1707
  };
1533
1708
 
1534
- const BlockVehLinks = () => {
1535
- const { vehicleState: { items: vehicles } } = mychoiceSdkStore.useStoreFormCarVehicle();
1536
- const { driverState: { items: drivers } } = mychoiceSdkStore.useStoreFormCarDriverBase();
1537
- const { discountState: { vehlinks }, dispatchDiscountState } = mychoiceSdkStore.useStoreFormCarDiscount();
1538
- const driverOptions = drivers.map((driver, index) => ({ name: driver.firstName, value: index }));
1539
- const handleDriverChange = (vehicleIndex) => ({ value }) => {
1540
- dispatchDiscountState({
1541
- type: mychoiceSdkStore.StoreFormCarDiscountActionTypes.FormCarDiscountVehlinkSelect,
1542
- payload: {
1543
- driverIndex: value,
1544
- vehicleIndex,
1545
- },
1546
- });
1547
- };
1548
- if (drivers.length > 1) {
1549
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(LabelFormBox, { title: "Since there are multiple drivers in this quote,\n please tell us who drives which vehicle the most.\n Please provide an answer that best suits your situation." }), vehicles.map((vehicle, index) => {
1550
- const { year, make, model } = vehicle;
1551
- const selectedDriver = vehlinks.find((vehlink) => (vehlink.vehicleIndex === index && vehlink.priority === mychoiceSdkComponents.DriverPriorityTypes.Prn));
1552
- return (jsxRuntime.jsx(SelectFormBox, { title: `Who is the principal driver of the ${year} ${make} ${model} ?`, onChange: handleDriverChange(index), options: driverOptions, defaultValue: selectedDriver?.driverIndex || 0, name: `vehlink-${index}` }, `vehlink-${index}`));
1553
- })] }));
1554
- }
1555
- return null;
1556
- };
1557
-
1558
- const BlockNextPageInfo$2 = () => {
1559
- const { appConfigState: { appType } } = mychoiceSdkStore.useStoreAppConfig();
1560
- const isTheBig = appType === mychoiceSdkComponents.AppTypes.TheBig;
1561
- return (jsxRuntime.jsx("div", { className: "next-page-info", children: isTheBig ? (jsxRuntime.jsx("div", { className: "privacy-policy", children: jsxRuntime.jsxs("p", { children: [jsxRuntime.jsx("span", { children: "DISCLAIMER: " }), "As insurance premiums are based on the information you provide it is important that it be 100% accurate and up to date. If you are not sure it is best to check before completing your quote."] }) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("h5", { children: "On the next page, you will also be able to:" }), jsxRuntime.jsxs("div", { className: "next-page-points", children: [jsxRuntime.jsx("p", { children: "1. See what rates insurance carriers are offering" }), jsxRuntime.jsx("p", { children: "2. Get in touch with a broker and secure your rate" }), jsxRuntime.jsx("p", { children: "3. Potentially save more by speaking with a broker" })] }), jsxRuntime.jsx("div", { className: "privacy-policy", children: jsxRuntime.jsxs("p", { children: ["Once you submit this form, you are agreeing to have your insurance quote sent to you via email and My Choice will provide your contact information to one of our trusted broker partners, who will contact you after your quote is complete to further assist you in securing your best rate. For more details, see our", jsxRuntime.jsx("a", { href: "https://www.mychoice.ca/privacy-policy/", children: " Privacy Policy" }), "."] }) })] })) }));
1562
- };
1563
-
1564
- const BlockSubmit$2 = ({ className, label, buttonSize, isRecalc = false, }) => {
1565
- const { quoteState: { isRequested, quoteConfirm } } = mychoiceSdkStore.useStoreFormCarQuote();
1566
- const { discountState: { isValid } } = mychoiceSdkStore.useStoreFormCarDiscount();
1567
- const { appConfigState: { localIndex, insuranceType } } = mychoiceSdkStore.useStoreAppConfig();
1568
- const navigate = reactRouterDom.useNavigate();
1569
- const { postRequestQuote } = mychoiceSdkStore.CarQuoteDataHandler();
1570
- const { carDiscountFormValidate } = mychoiceSdkStore.useValidationCarDiscount();
1571
- const handleGetQuotesClick = () => {
1572
- if (!isValid) {
1573
- carDiscountFormValidate(false, () => postRequestQuote(isRecalc, quoteConfirm));
1574
- }
1575
- else if (!isRequested) {
1576
- postRequestQuote(isRecalc, quoteConfirm);
1577
- }
1578
- else if (!isRecalc) {
1579
- navigate(`/${localIndex || mychoiceSdkComponents.defaultLocalIndex}/${insuranceType}/quotes`);
1580
- }
1581
- };
1582
- return (jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: className, size: buttonSize, category: mychoiceSdkComponents.CategoryTypes.Filled, onClick: handleGetQuotesClick, color: mychoiceSdkComponents.ColorTypes.Primary, label: label }));
1583
- };
1584
- BlockSubmit$2.defaultProps = {
1585
- buttonSize: mychoiceSdkComponents.SizeTypes.Large,
1586
- label: 'Get Your Quotes',
1587
- className: '',
1588
- };
1589
-
1590
1709
  const getDynamicLicenceBoxProps = ({ isAlbertaProvince, isOntarioProvince, isNewfoundlandProvince, isNovaScotiaProvince, isNewBrunswickProvince, }) => {
1591
1710
  if (isAlbertaProvince) {
1592
1711
  return {
@@ -1920,7 +2039,7 @@ const PageCarQuote = () => {
1920
2039
  saturdayHours: items[0]?.brokerProfile.hoursSaturday,
1921
2040
  sundayHours: items[0]?.brokerProfile.hoursSunday,
1922
2041
  weekdayHours: items[0]?.brokerProfile.hoursWorkdays,
1923
- }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) })) : (jsxRuntime.jsx(SplashScreen$2, {})) })) : (jsxRuntime.jsx(NoQuotesMessage, { type: "car" })) })), (!hasConfirmStep || appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SectionQuoteEdit$2, {}), jsxRuntime.jsx(SectionQuoteRecalc$1, {})] }))] }), appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile && quoteState.showCallMessage && jsxRuntime.jsx(SplashScreen$2, {}), !quoteState.showCallMessage && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { style: { position: 'relative', width: '100%' }, children: [hasConfirmStep && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "offer-container", children: jsxRuntime.jsx(SectionConfirm, {}) }), appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SectionQuoteEdit$2, {}), jsxRuntime.jsx(SectionQuoteRecalc$1, {})] }))] })), jsxRuntime.jsx("div", { className: `offer-container ${hasConfirmStep ? 'blur' : ''}`, children: !!items?.length ? (quoteItems.map(({ company, brokerProfile, priceMonthly, priceYearly }, index) => (jsxRuntime.jsx("div", { children: (appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile ||
2042
+ }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '', coverages: items[0]?.coverages, nonStandardCoverages: items[0]?.nonStandardCoverages }) })) : (jsxRuntime.jsx(SplashScreen$2, {})) })) : (jsxRuntime.jsx(NoQuotesMessage, { type: "car" })) })), (!hasConfirmStep || appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SectionQuoteEdit$2, {}), (isTheBig || !items[0]?.coverages) && jsxRuntime.jsx(SectionQuoteRecalc$1, {})] }))] }), appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile && quoteState.showCallMessage && jsxRuntime.jsx(SplashScreen$2, {}), !quoteState.showCallMessage && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { style: { position: 'relative', width: '100%' }, children: [hasConfirmStep && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "offer-container", children: jsxRuntime.jsx(SectionConfirm, {}) }), appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SectionQuoteEdit$2, {}), (isTheBig || !items[0]?.coverages) && jsxRuntime.jsx(SectionQuoteRecalc$1, {})] }))] })), jsxRuntime.jsx("div", { className: `offer-container ${hasConfirmStep ? 'blur' : ''}`, children: !!items?.length ? (quoteItems.map(({ company, brokerProfile, priceMonthly, priceYearly, coverages, nonStandardCoverages, }, index) => (jsxRuntime.jsx("div", { children: (appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile ||
1924
2043
  (appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && index !== 0)) && (jsxRuntime.jsx(OfferSection, { isBestOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
1925
2044
  monthly: priceMonthly,
1926
2045
  yearly: priceYearly,
@@ -1928,7 +2047,7 @@ const PageCarQuote = () => {
1928
2047
  saturdayHours: brokerProfile.hoursSaturday,
1929
2048
  sundayHours: brokerProfile.hoursSunday,
1930
2049
  weekdayHours: brokerProfile.hoursWorkdays,
1931
- }, phoneNumber: formatPhoneObject(brokerProfile.phone), redirectUrl: brokerProfile.redirectUrl || '' })) }, index)))) : (jsxRuntime.jsx(NoQuotesMessage, { type: "car" })) })] }) }))] })) }));
2050
+ }, phoneNumber: formatPhoneObject(brokerProfile.phone), redirectUrl: brokerProfile.redirectUrl || '', coverages: coverages, nonStandardCoverages: nonStandardCoverages })) }, index)))) : (jsxRuntime.jsx(NoQuotesMessage, { type: "car" })) })] }) }))] })) }));
1932
2051
  };
1933
2052
 
1934
2053
  const IndicatorsContainer = () => jsxRuntime.jsx(jsxRuntime.Fragment, {});