@mychoice/mychoice-sdk-modules 2.1.5 → 2.1.7

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/esm/index.js CHANGED
@@ -1507,7 +1507,7 @@ const BlockNextPageInfo$2 = () => {
1507
1507
  };
1508
1508
 
1509
1509
  const BlockSubmit$2 = ({ className, label, buttonSize, isRecalc = false, }) => {
1510
- const { quoteState: { isRequested } } = useStoreFormCarQuote();
1510
+ const { quoteState: { isRequested, quoteConfirm } } = useStoreFormCarQuote();
1511
1511
  const { discountState: { isValid } } = useStoreFormCarDiscount();
1512
1512
  const { appConfigState: { localIndex, insuranceType } } = useStoreAppConfig();
1513
1513
  const navigate = useNavigate();
@@ -1515,10 +1515,10 @@ const BlockSubmit$2 = ({ className, label, buttonSize, isRecalc = false, }) => {
1515
1515
  const { carDiscountFormValidate } = useValidationCarDiscount();
1516
1516
  const handleGetQuotesClick = () => {
1517
1517
  if (!isValid) {
1518
- carDiscountFormValidate(false, () => postRequestQuote(isRecalc));
1518
+ carDiscountFormValidate(false, () => postRequestQuote(isRecalc, quoteConfirm));
1519
1519
  }
1520
1520
  else if (!isRequested) {
1521
- postRequestQuote(isRecalc);
1521
+ postRequestQuote(isRecalc, quoteConfirm);
1522
1522
  }
1523
1523
  else if (!isRecalc) {
1524
1524
  navigate(`/${localIndex || defaultLocalIndex}/${insuranceType}/quotes`);
@@ -1802,7 +1802,7 @@ const SectionConfirm = () => {
1802
1802
  };
1803
1803
  if (!bestQuote)
1804
1804
  return null;
1805
- return (jsxs("div", { style: { zIndex: '1' }, children: [jsxs("div", { className: "shadow-box", children: [jsx("div", { className: "highlighted-heading", children: "Best Offer" }), jsx("h1", { children: `$${bestQuote.priceMonthly} / month` }), jsx("div", { className: "highlighted-heading", children: jsx("span", { children: `$${bestQuote.priceYearly} / year` }) })] }), jsxs("div", { className: "statistics-wrapper", children: [jsx("div", { className: "counter", id: "output", children: comparedCountMin.toLocaleString('en-US') }), jsx("div", { className: "divider" }), jsx("div", { style: { textAlign: 'center', fontSize: '1.15rem', marginTop: '10px' }, children: ` and saved ${savedPercentage}% on average` })] }), jsx("div", { style: { marginBottom: '2rem' }, children: jsx("div", { className: "all-quotes-form", children: jsx("h2", { style: { whiteSpace: 'normal', marginTop: '20px', textAlign: 'center' }, children: `${lockEmoji} Complete the form below to see which companies are offering your quotes.` }) }) }), jsx("div", { style: { marginBottom: '1rem' }, children: jsx(InputFormBox, { name: "firstName", title: "First Name", onChange: handleFirstNameChange, defaultValue: firstName, placeholder: "Your First Name", error: !firstName && discountState.inValidation, errorMessage: getErrorMessage(firstName, discountState.inValidation) }) }), jsx("div", { style: { marginBottom: '1rem' }, children: jsx(InputFormBox, { name: "lastname", title: "Last Name", onChange: handleLastNameChange, defaultValue: lastName, placeholder: "Your Last Name", error: !lastName && discountState.inValidation, errorMessage: getErrorMessage(lastName, discountState.inValidation) }) }), jsx("div", { style: { marginBottom: '1rem' }, children: jsx(InputFormPhoneBox, { name: "phone", onChange: handlePhoneNumberChange, defaultValue: phone, title: "Phone Number", placeholder: "(111) 111-1111", error: !phone && discountState.inValidation, errorMessage: getErrorMessage(phone, discountState.inValidation) }) }), jsx("div", { className: "submit-wrapper", children: jsx(ButtonBase, { className: "mychoice", size: SizeTypes.Large, category: CategoryTypes.Filled, onClick: handleSubmit, color: ColorTypes.Primary, label: "Get Your Quote" }) }), jsxs("div", { className: "extra-info", children: [jsx("h5", { children: "On the next page, you will also be able to:" }), jsx("div", { className: "next-page-points", children: jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [jsxs("div", { className: "bullet-container", children: [jsx("div", { className: "bullet-point", children: "1" }), jsx("div", { children: "See what rates insurance carriers are offering" })] }), jsxs("div", { className: "bullet-container", children: [jsx("div", { className: "bullet-point", children: "2" }), jsx("div", { children: "Get in touch with a broker and secure your rate" })] }), jsxs("div", { className: "bullet-container", children: [jsx("div", { className: "bullet-point", children: "3" }), jsx("div", { children: "Potentially save more by speaking with a broker" })] })] }) }), jsx("div", { className: "privacy-policy", children: 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", jsx("a", { href: "https://www.mychoice.ca/privacy-policy/", children: " Privacy Policy" }), "."] }) })] })] }));
1805
+ return (jsxs("div", { style: { zIndex: '1' }, children: [jsxs("div", { className: "shadow-box", children: [jsx("div", { className: "highlighted-heading", children: "Best Offer" }), jsx("h1", { children: `$${bestQuote.priceMonthly} / month` }), jsx("div", { className: "highlighted-heading", children: jsx("span", { children: `$${bestQuote.priceYearly} / year` }) })] }), jsxs("div", { className: "statistics-wrapper", children: [jsx("div", { className: "counter", id: "output", children: comparedCountMin.toLocaleString('en-US') }), jsx("div", { className: "divider" }), jsx("div", { style: { textAlign: 'center', fontSize: '1.15rem', marginTop: '10px' }, children: `Canadians have compared rates in the last 24 hours and saved ${savedPercentage}% on average` })] }), jsx("div", { style: { marginBottom: '2rem' }, children: jsx("div", { className: "all-quotes-form", children: jsx("h2", { style: { whiteSpace: 'normal', marginTop: '20px', textAlign: 'center' }, children: `${lockEmoji} Complete the form below to see which companies are offering your quotes.` }) }) }), jsx("div", { style: { marginBottom: '1rem' }, children: jsx(InputFormBox, { name: "firstName", title: "First Name", onChange: handleFirstNameChange, defaultValue: firstName, placeholder: "Your First Name", error: !firstName && discountState.inValidation, errorMessage: getErrorMessage(firstName, discountState.inValidation) }) }), jsx("div", { style: { marginBottom: '1rem' }, children: jsx(InputFormBox, { name: "lastname", title: "Last Name", onChange: handleLastNameChange, defaultValue: lastName, placeholder: "Your Last Name", error: !lastName && discountState.inValidation, errorMessage: getErrorMessage(lastName, discountState.inValidation) }) }), jsx("div", { style: { marginBottom: '1rem' }, children: jsx(InputFormPhoneBox, { name: "phone", onChange: handlePhoneNumberChange, defaultValue: phone, title: "Phone Number", placeholder: "(111) 111-1111", error: !phone && discountState.inValidation, errorMessage: getErrorMessage(phone, discountState.inValidation) }) }), jsx("div", { className: "submit-wrapper", children: jsx(ButtonBase, { className: "mychoice", size: SizeTypes.Large, category: CategoryTypes.Filled, onClick: handleSubmit, color: ColorTypes.Primary, label: "Get Your Quote" }) }), jsxs("div", { className: "extra-info", children: [jsx("h5", { children: "On the next page, you will also be able to:" }), jsx("div", { className: "next-page-points", children: jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [jsxs("div", { className: "bullet-container", children: [jsx("div", { className: "bullet-point", children: "1" }), jsx("div", { children: "See what rates insurance carriers are offering" })] }), jsxs("div", { className: "bullet-container", children: [jsx("div", { className: "bullet-point", children: "2" }), jsx("div", { children: "Get in touch with a broker and secure your rate" })] }), jsxs("div", { className: "bullet-container", children: [jsx("div", { className: "bullet-point", children: "3" }), jsx("div", { children: "Potentially save more by speaking with a broker" })] })] }) }), jsx("div", { className: "privacy-policy", children: 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", jsx("a", { href: "https://www.mychoice.ca/privacy-policy/", children: " Privacy Policy" }), "."] }) })] })] }));
1806
1806
  };
1807
1807
 
1808
1808
  const SplashScreen$2 = () => {
@@ -1840,7 +1840,7 @@ const PageCarQuote = () => {
1840
1840
  carDiscountFormValidate();
1841
1841
  }
1842
1842
  if (!quoteState.isRequested) {
1843
- postRequestQuote(false);
1843
+ postRequestQuote(false, quoteConfirm);
1844
1844
  }
1845
1845
  window.scrollTo({
1846
1846
  top: 0,
@@ -2882,7 +2882,7 @@ const PageHomeQuote = () => {
2882
2882
  saturdayHours: items[0]?.brokerProfile.hoursSaturday,
2883
2883
  sundayHours: items[0]?.brokerProfile.hoursSunday,
2884
2884
  weekdayHours: items[0]?.brokerProfile.hoursWorkdays,
2885
- }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) }))
2885
+ }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '', fulfillmentUrl: items[0]?.fulfillmentUrl || '' }) }))
2886
2886
  : jsx(SplashScreen$1, {}) })) })), jsx(SectionQuoteEdit$1, {}), jsx(SectionQuoteRecalc, {})] }), appDeviceType !== DeviceTypes.Mobile && quoteState.showCallMessage
2887
2887
  && jsx(SplashScreen$1, {}), !quoteState.showCallMessage
2888
2888
  && (jsx("div", { className: "offer-container", children: !!items?.length