@saasquatch/mint-components 2.1.9-7 → 2.1.9-8
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/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/parseStates-d1effc19.js +16 -0
- package/dist/cjs/{sqm-big-stat_45.cjs.entry.js → sqm-big-stat_46.cjs.entry.js} +370 -5
- package/dist/cjs/sqm-code-verification.cjs.entry.js +3 -4
- package/dist/cjs/sqm-email-verification_2.cjs.entry.js +5 -4
- package/dist/cjs/{sqm-partner-info-modal-view-e3faede9.js → sqm-partner-info-modal-view-cd758f12.js} +1 -2
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +27 -1
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +1 -2
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +4 -1
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
- package/dist/collection/components/sqm-widget-verification/WidgetVerification.stories.js +16 -0
- package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +3 -4
- package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +0 -2
- package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +49 -1
- package/dist/esm/{ShadowViewAddon-d382a63e.js → ShadowViewAddon-657d18f0.js} +5 -5
- package/dist/esm/{data-a6752028.js → data-2b0feb3f.js} +2 -2
- package/dist/esm/{global-b2ee3a12.js → global-39f55ec2.js} +1 -1
- package/dist/esm/{index.module-e266b4d7.js → index.module-cede12c6.js} +1 -1
- package/dist/esm/{keys-406491dc.js → keys-db1897ae.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mint-components.js +3 -3
- package/dist/esm/parseStates-ed75e224.js +14 -0
- package/dist/esm/{re-render-4f4bd4da.js → re-render-7a0c7976.js} +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +9 -9
- package/dist/esm/{sqm-big-stat_45.entry.js → sqm-big-stat_46.entry.js} +379 -15
- package/dist/esm/sqm-close-button.entry.js +1 -1
- package/dist/esm/sqm-code-verification.entry.js +7 -8
- package/dist/esm/sqm-context-router.entry.js +1 -1
- package/dist/esm/sqm-email-verification_2.entry.js +9 -8
- package/dist/esm/sqm-empty_4.entry.js +2 -2
- package/dist/esm/sqm-google-sign-in.entry.js +1 -1
- package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm/sqm-instant-access-registration.entry.js +3 -3
- package/dist/esm/{sqm-lead-checkbox-field-view-00d76ba1.js → sqm-lead-checkbox-field-view-7cee2b4e.js} +1 -1
- package/dist/esm/sqm-lead-checkbox-field.entry.js +4 -4
- package/dist/esm/{sqm-lead-input-field-view-d8f76a9d.js → sqm-lead-input-field-view-11a4f9a9.js} +1 -1
- package/dist/esm/sqm-lead-input-field.entry.js +4 -4
- package/dist/esm/sqm-leaderboard-rank.entry.js +2 -2
- package/dist/esm/sqm-logout-current-user.entry.js +1 -1
- package/dist/esm/{sqm-navigation-sidebar-item-view-7f966119.js → sqm-navigation-sidebar-item-view-48e7e0d3.js} +1 -1
- package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
- package/dist/esm/sqm-navigation-sidebar.entry.js +1 -1
- package/dist/esm/sqm-pagination_3.entry.js +3 -3
- package/dist/esm/{sqm-partner-info-modal-view-77c231af.js → sqm-partner-info-modal-view-dbedda28.js} +1 -2
- package/dist/esm/sqm-password-field.entry.js +2 -2
- package/dist/esm/sqm-popup-container.entry.js +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-13e25037.js → sqm-portal-email-verification-view-80736644.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +3 -3
- package/dist/esm/sqm-portal-forgot-password_6.entry.js +4 -4
- package/dist/esm/sqm-portal-logout.entry.js +1 -1
- package/dist/esm/{sqm-portal-profile-view-a172bdcc.js → sqm-portal-profile-view-a6be8558.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +4 -4
- package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
- package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm/{sqm-portal-verify-email-view-c1a72c4f.js → sqm-portal-verify-email-view-92297506.js} +1 -1
- package/dist/esm/sqm-qr-code.entry.js +2 -2
- package/dist/esm/sqm-referral-table_11.entry.js +5 -5
- package/dist/esm/sqm-rewards-table-customer-note-column.entry.js +2 -2
- package/dist/esm/sqm-rewards-table_9.entry.js +5 -5
- package/dist/esm/sqm-stencilbook.entry.js +41 -15
- package/dist/esm/sqm-tab.entry.js +2 -2
- package/dist/esm/sqm-tabs.entry.js +3 -3
- package/dist/esm/{sqm-user-info-form-view-ef04a79f.js → sqm-user-info-form-view-f9026468.js} +2 -2
- package/dist/esm/sqm-widget-verification-controller.entry.js +2 -2
- package/dist/esm/{useChildElements-31ba3daf.js → useChildElements-c26d7347.js} +1 -1
- package/dist/esm/{useInstantAccessRegistration-1388dace.js → useInstantAccessRegistration-e2392f42.js} +2 -2
- package/dist/esm/{useLeadFormState-cec544ea.js → useLeadFormState-9099c8d4.js} +2 -2
- package/dist/esm/{usePayoutStatus-24145412.js → usePayoutStatus-fa504d49.js} +1 -1
- package/dist/esm/{usePortalRegistrationForm-6d562bf8.js → usePortalRegistrationForm-5844032a.js} +2 -2
- package/dist/esm/{useReferralCodes-1ca1fda0.js → useReferralCodes-3cde72d4.js} +1 -1
- package/dist/esm/{useReferralTable-456931fd.js → useReferralTable-35e6d4c1.js} +3 -3
- package/dist/esm/{useRegistrationFormState-0cee2d21.js → useRegistrationFormState-1813bdef.js} +1 -1
- package/dist/esm/{useVerificationEmail-5c6cd733.js → useVerificationEmail-cb3d51e3.js} +1 -1
- package/dist/esm/{utilities-f05633da.js → utilities-c9e730ed.js} +1 -1
- package/dist/esm-es5/{ShadowViewAddon-d382a63e.js → ShadowViewAddon-657d18f0.js} +1 -1
- package/dist/esm-es5/{data-a6752028.js → data-2b0feb3f.js} +1 -1
- package/dist/esm-es5/{global-b2ee3a12.js → global-39f55ec2.js} +1 -1
- package/dist/esm-es5/{index.module-e266b4d7.js → index.module-cede12c6.js} +1 -1
- package/dist/esm-es5/{keys-406491dc.js → keys-db1897ae.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/parseStates-ed75e224.js +1 -0
- package/dist/esm-es5/{re-render-4f4bd4da.js → re-render-7a0c7976.js} +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -0
- package/dist/esm-es5/sqm-close-button.entry.js +1 -1
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-context-router.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-google-sign-in.entry.js +1 -1
- package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm-es5/sqm-instant-access-registration.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-checkbox-field-view-00d76ba1.js → sqm-lead-checkbox-field-view-7cee2b4e.js} +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-input-field-view-d8f76a9d.js → sqm-lead-input-field-view-11a4f9a9.js} +1 -1
- package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-logout-current-user.entry.js +1 -1
- package/dist/esm-es5/{sqm-navigation-sidebar-item-view-7f966119.js → sqm-navigation-sidebar-item-view-48e7e0d3.js} +1 -1
- package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
- package/dist/esm-es5/sqm-navigation-sidebar.entry.js +1 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/sqm-partner-info-modal-view-dbedda28.js +1 -0
- package/dist/esm-es5/sqm-password-field.entry.js +1 -1
- package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-13e25037.js → sqm-portal-email-verification-view-80736644.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-forgot-password_6.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-a172bdcc.js → sqm-portal-profile-view-a6be8558.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-verify-email-view-c1a72c4f.js → sqm-portal-verify-email-view-92297506.js} +1 -1
- package/dist/esm-es5/sqm-qr-code.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table-customer-note-column.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/sqm-tab.entry.js +1 -1
- package/dist/esm-es5/sqm-tabs.entry.js +1 -1
- package/dist/esm-es5/{sqm-user-info-form-view-ef04a79f.js → sqm-user-info-form-view-f9026468.js} +1 -1
- package/dist/esm-es5/sqm-widget-verification-controller.entry.js +1 -1
- package/dist/esm-es5/{useChildElements-31ba3daf.js → useChildElements-c26d7347.js} +1 -1
- package/dist/esm-es5/{useInstantAccessRegistration-1388dace.js → useInstantAccessRegistration-e2392f42.js} +1 -1
- package/dist/esm-es5/{useLeadFormState-cec544ea.js → useLeadFormState-9099c8d4.js} +1 -1
- package/dist/esm-es5/{usePayoutStatus-24145412.js → usePayoutStatus-fa504d49.js} +1 -1
- package/dist/esm-es5/{usePortalRegistrationForm-6d562bf8.js → usePortalRegistrationForm-5844032a.js} +1 -1
- package/dist/esm-es5/{useReferralCodes-1ca1fda0.js → useReferralCodes-3cde72d4.js} +1 -1
- package/dist/esm-es5/{useReferralTable-456931fd.js → useReferralTable-35e6d4c1.js} +1 -1
- package/dist/esm-es5/{useRegistrationFormState-0cee2d21.js → useRegistrationFormState-1813bdef.js} +1 -1
- package/dist/esm-es5/{useVerificationEmail-5c6cd733.js → useVerificationEmail-cb3d51e3.js} +1 -1
- package/dist/esm-es5/{utilities-f05633da.js → utilities-c9e730ed.js} +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-51b8ed78.js → p-014977d7.js} +1 -1
- package/dist/mint-components/{p-30967f75.js → p-092db51a.js} +1 -1
- package/dist/mint-components/{p-bd804f4c.js → p-095b7128.js} +1 -1
- package/dist/mint-components/{p-bae7d6b5.system.entry.js → p-098d134a.system.entry.js} +1 -1
- package/dist/mint-components/{p-504ed1f2.entry.js → p-0c43b6ff.entry.js} +1 -1
- package/dist/mint-components/{p-ab678644.js → p-0d75a207.js} +1 -1
- package/dist/mint-components/p-115dfc03.system.js +1 -0
- package/dist/mint-components/p-13f3a647.js +1 -0
- package/dist/mint-components/{p-473562fc.system.js → p-140e6a15.system.js} +1 -1
- package/dist/mint-components/{p-fa32d8eb.system.entry.js → p-15a703c7.system.entry.js} +1 -1
- package/dist/mint-components/p-160764bc.system.entry.js +1 -0
- package/dist/mint-components/{p-b9652150.entry.js → p-160828b4.entry.js} +1 -1
- package/dist/mint-components/{p-878bb2cf.system.entry.js → p-16deb1a9.system.entry.js} +1 -1
- package/dist/mint-components/{p-1435edd4.entry.js → p-1b0cbbae.entry.js} +1 -1
- package/dist/mint-components/{p-f50c3306.entry.js → p-1b2fcd7f.entry.js} +1 -1
- package/dist/mint-components/p-1c413a06.system.js +1 -0
- package/dist/mint-components/{p-2774c704.system.entry.js → p-21e7079a.system.entry.js} +1 -1
- package/dist/mint-components/{p-695ec086.system.js → p-28e0062c.system.js} +1 -1
- package/dist/mint-components/{p-c8060ef5.system.entry.js → p-2f4d8ab8.system.entry.js} +1 -1
- package/dist/mint-components/{p-dfb50245.entry.js → p-3181e54a.entry.js} +1 -1
- package/dist/mint-components/{p-5d79c8a0.system.js → p-31dde9fc.system.js} +1 -1
- package/dist/mint-components/{p-d863acaa.js → p-32d078a3.js} +1 -1
- package/dist/mint-components/{p-7528770e.entry.js → p-3461a8cb.entry.js} +1 -1
- package/dist/mint-components/{p-6e816a17.system.entry.js → p-357040e6.system.entry.js} +1 -1
- package/dist/mint-components/{p-452f644f.system.js → p-36395228.system.js} +1 -1
- package/dist/mint-components/{p-5245e4ce.system.entry.js → p-3756d0d1.system.entry.js} +1 -1
- package/dist/mint-components/{p-5f6d617a.entry.js → p-37658fec.entry.js} +1 -1
- package/dist/mint-components/p-39840341.js +1 -0
- package/dist/mint-components/{p-5126508b.js → p-3c333076.js} +1 -1
- package/dist/mint-components/{p-6684e9ad.js → p-3c555674.js} +1 -1
- package/dist/mint-components/{p-21851092.js → p-3c88d2ed.js} +2 -2
- package/dist/mint-components/{p-e7a9ce16.js → p-438f6702.js} +1 -1
- package/dist/mint-components/{p-fe0eceba.system.entry.js → p-45475cf9.system.entry.js} +1 -1
- package/dist/mint-components/{p-f7948b16.system.entry.js → p-52748a87.system.entry.js} +1 -1
- package/dist/mint-components/{p-614630a8.system.js → p-54bf015a.system.js} +1 -1
- package/dist/mint-components/{p-d2d2c4ea.system.entry.js → p-59f69bdc.system.entry.js} +1 -1
- package/dist/mint-components/{p-96cbca52.system.entry.js → p-5c9d030a.system.entry.js} +1 -1
- package/dist/mint-components/{p-1b7b65ef.entry.js → p-5dc9e95b.entry.js} +2 -2
- package/dist/mint-components/{p-82be3d10.system.entry.js → p-60085f20.system.entry.js} +1 -1
- package/dist/mint-components/{p-cc0fe4a3.entry.js → p-608da224.entry.js} +1 -1
- package/dist/mint-components/{p-5825aee6.system.entry.js → p-6194855b.system.entry.js} +1 -1
- package/dist/mint-components/{p-b8766db9.entry.js → p-62212b9a.entry.js} +1 -1
- package/dist/mint-components/{p-f3ddbe2f.system.entry.js → p-62e1c8b2.system.entry.js} +1 -1
- package/dist/mint-components/p-63c299f1.system.js +1 -0
- package/dist/mint-components/{p-adb56df3.system.entry.js → p-64b56141.system.entry.js} +1 -1
- package/dist/mint-components/{p-1b9705fd.system.js → p-64f56cc9.system.js} +1 -1
- package/dist/mint-components/p-6638c7c6.system.js +1 -0
- package/dist/mint-components/{p-f95952a0.system.entry.js → p-66c0100c.system.entry.js} +1 -1
- package/dist/mint-components/{p-2ad9470d.system.entry.js → p-6a4496b3.system.entry.js} +1 -1
- package/dist/mint-components/{p-1775cb0c.system.js → p-70e34ae1.system.js} +2 -2
- package/dist/mint-components/p-7144ac40.js +1 -0
- package/dist/mint-components/{p-20280398.system.entry.js → p-71545bfd.system.entry.js} +1 -1
- package/dist/mint-components/{p-6d444f3f.system.js → p-74aac245.system.js} +1 -1
- package/dist/mint-components/{p-59644ef8.system.js → p-7547180f.system.js} +1 -1
- package/dist/mint-components/{p-f84605ec.system.js → p-77117f6c.system.js} +1 -1
- package/dist/mint-components/p-7a5814ef.system.entry.js +1 -0
- package/dist/mint-components/{p-a03189bd.js → p-7e36a1ff.js} +1 -1
- package/dist/mint-components/{p-5450693e.entry.js → p-8139fdec.entry.js} +1 -1
- package/dist/mint-components/{p-320b306b.js → p-8474aa63.js} +1 -1
- package/dist/mint-components/{p-33a6ab09.js → p-857a2d77.js} +1 -1
- package/dist/mint-components/{p-b179621d.system.js → p-86381dc7.system.js} +1 -1
- package/dist/mint-components/{p-e502fd80.entry.js → p-86a70151.entry.js} +1 -1
- package/dist/mint-components/{p-a30f0ffd.entry.js → p-886fb141.entry.js} +1 -1
- package/dist/mint-components/{p-b6fc53c9.entry.js → p-88c9cc1b.entry.js} +1 -1
- package/dist/mint-components/{p-97b8c481.js → p-896390f9.js} +1 -1
- package/dist/mint-components/{p-fca34d77.js → p-8f9c1387.js} +1 -1
- package/dist/mint-components/{p-44afc747.entry.js → p-93c5c8ec.entry.js} +1 -1
- package/dist/mint-components/{p-9c381424.system.entry.js → p-95aaf35a.system.entry.js} +1 -1
- package/dist/mint-components/{p-f6fc7569.entry.js → p-96e4e6a4.entry.js} +1 -1
- package/dist/mint-components/{p-ed17e1b8.entry.js → p-991f60fc.entry.js} +1 -1
- package/dist/mint-components/{p-353ab6db.entry.js → p-996eb820.entry.js} +1 -1
- package/dist/mint-components/{p-b8288385.system.entry.js → p-998c989a.system.entry.js} +1 -1
- package/dist/mint-components/{p-82905fda.system.js → p-9b33e2a7.system.js} +1 -1
- package/dist/mint-components/{p-7767314d.system.entry.js → p-9bd53e4d.system.entry.js} +1 -1
- package/dist/mint-components/{p-89f8ab67.entry.js → p-9c1b0c8b.entry.js} +1 -1
- package/dist/mint-components/{p-07f3b868.entry.js → p-9e43f1eb.entry.js} +1 -1
- package/dist/mint-components/{p-9fa6606e.js → p-a5912b2f.js} +1 -1
- package/dist/mint-components/{p-7a7ebf08.js → p-a7ee6531.js} +1 -1
- package/dist/mint-components/{p-83277c69.system.js → p-a86ce218.system.js} +1 -1
- package/dist/mint-components/{p-d6c1e876.system.js → p-a8ecdc44.system.js} +1 -1
- package/dist/mint-components/p-a9bf9d3c.entry.js +291 -0
- package/dist/mint-components/p-adcc37f3.entry.js +105 -0
- package/dist/mint-components/{p-f3b21df2.system.js → p-b1b8e629.system.js} +1 -1
- package/dist/mint-components/{p-93cb9438.system.entry.js → p-b297016f.system.entry.js} +1 -1
- package/dist/mint-components/p-b2a99637.system.js +1 -0
- package/dist/mint-components/p-b2bde2f5.entry.js +1 -0
- package/dist/mint-components/{p-d2448c85.system.entry.js → p-b451970a.system.entry.js} +1 -1
- package/dist/mint-components/{p-4da8028d.system.entry.js → p-b5c0bad5.system.entry.js} +1 -1
- package/dist/mint-components/{p-ad017a39.js → p-b5f57914.js} +1 -1
- package/dist/mint-components/{p-80174c14.entry.js → p-b5fed7c6.entry.js} +1 -1
- package/dist/mint-components/{p-c2c01ab5.entry.js → p-ba953c21.entry.js} +1 -1
- package/dist/mint-components/{p-47f594c3.entry.js → p-bba694e4.entry.js} +1 -1
- package/dist/mint-components/{p-d5375baf.js → p-bcadd021.js} +1 -1
- package/dist/mint-components/{p-79854479.system.js → p-be63f29b.system.js} +1 -1
- package/dist/mint-components/p-bfbfde38.entry.js +33 -0
- package/dist/mint-components/{p-07da0ddd.system.entry.js → p-c7535e70.system.entry.js} +1 -1
- package/dist/mint-components/{p-d42aba0e.system.js → p-c84a2512.system.js} +1 -1
- package/dist/mint-components/{p-55b1be64.system.entry.js → p-c8e45671.system.entry.js} +1 -1
- package/dist/mint-components/{p-e5e8e13e.js → p-ce11858c.js} +1 -1
- package/dist/mint-components/{p-1d450b85.js → p-d20188db.js} +1 -1
- package/dist/mint-components/{p-6a754f51.entry.js → p-d2927531.entry.js} +2 -2
- package/dist/mint-components/{p-e4d3b7a9.system.js → p-d355336b.system.js} +1 -1
- package/dist/mint-components/{p-5822a43f.system.entry.js → p-d5a1c979.system.entry.js} +1 -1
- package/dist/mint-components/p-d6714617.entry.js +1 -0
- package/dist/mint-components/{p-5e106c95.system.js → p-d798004f.system.js} +1 -1
- package/dist/mint-components/p-dac1f2cb.system.entry.js +1 -0
- package/dist/mint-components/{p-7333d103.system.entry.js → p-dbdb2a46.system.entry.js} +1 -1
- package/dist/mint-components/{p-c756bc32.system.js → p-e4dbca9a.system.js} +1 -1
- package/dist/mint-components/{p-7c0255ad.entry.js → p-e5ee6cf5.entry.js} +2 -2
- package/dist/mint-components/{p-8f5b316e.js → p-e95402dc.js} +1 -1
- package/dist/mint-components/{p-0a900fb1.system.entry.js → p-e9e05970.system.entry.js} +1 -1
- package/dist/mint-components/{p-546a65c7.system.js → p-eaf5d0af.system.js} +1 -1
- package/dist/mint-components/{p-84866680.entry.js → p-f11d29fd.entry.js} +1 -1
- package/dist/mint-components/{p-dece706f.js → p-f18a6658.js} +1 -1
- package/dist/mint-components/{p-06ca4346.entry.js → p-f4a57aed.entry.js} +1 -1
- package/dist/mint-components/{p-2e2c5ec4.entry.js → p-f972e5c9.entry.js} +1 -1
- package/dist/mint-components/{p-91c4b8d5.system.entry.js → p-fb4ab5ba.system.entry.js} +1 -1
- package/dist/types/components/sqm-widget-verification/WidgetVerification.stories.d.ts +8 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/cjs/extractProps-e9c55ba8.js +0 -35
- package/dist/cjs/sqm-widget-verification.cjs.entry.js +0 -314
- package/dist/esm/extractProps-54064fb0.js +0 -32
- package/dist/esm/sqm-widget-verification.entry.js +0 -310
- package/dist/esm-es5/extractProps-54064fb0.js +0 -1
- package/dist/esm-es5/sqm-big-stat_45.entry.js +0 -1
- package/dist/esm-es5/sqm-partner-info-modal-view-77c231af.js +0 -1
- package/dist/esm-es5/sqm-widget-verification.entry.js +0 -1
- package/dist/mint-components/p-0797a946.js +0 -1
- package/dist/mint-components/p-1b0d7020.js +0 -1
- package/dist/mint-components/p-2c0bb139.entry.js +0 -33
- package/dist/mint-components/p-2c962fa2.entry.js +0 -105
- package/dist/mint-components/p-35724e1c.entry.js +0 -1
- package/dist/mint-components/p-38c7775a.js +0 -1
- package/dist/mint-components/p-4b365f1f.system.js +0 -1
- package/dist/mint-components/p-57dd28bd.system.js +0 -1
- package/dist/mint-components/p-71c585b7.entry.js +0 -1
- package/dist/mint-components/p-78909fc0.system.js +0 -1
- package/dist/mint-components/p-9b05116b.system.entry.js +0 -1
- package/dist/mint-components/p-a1529aef.system.entry.js +0 -1
- package/dist/mint-components/p-a9855b29.system.entry.js +0 -1
- package/dist/mint-components/p-c0953cd9.entry.js +0 -19
- package/dist/mint-components/p-e44c816e.system.js +0 -1
- package/dist/mint-components/p-e55aafe9.system.js +0 -1
- package/dist/mint-components/p-e6924adb.entry.js +0 -273
- package/dist/mint-components/p-e9a596d6.system.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++){r=arguments[t];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s))e[s]=r[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,r,t,o){function s(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function n(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?t(e.value):s(e.value).then(a,n)}l((o=o.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,s,i,a;return a={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function n(e){return function(r){return l([e,r])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(t)try{if(o=1,s&&(i=a[0]&2?s["return"]:a[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;if(s=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;s=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=r.call(e,t)}catch(e){a=[6,e];s=0}finally{o=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-38ad4957.js";import{k as useState,n as h,m as useRef,f as useEffect}from"./dom-context-hooks.module-50442785.js";import{u as un,j as jn,i as isDemo,a as je,h as hn,V as Ve,b as useCallback,J,c as an,e as setUserIdentity}from"./index.module-e266b4d7.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath,g as getProps}from"./utils-334c1e34.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-738acfb3.js";import{P as PortalForgotPasswordView,a as PortalLoginView,b as PortalRegisterView,c as PortalVerifyEmailView}from"./sqm-portal-verify-email-view-c1a72c4f.js";import{A as AsYouType,u as usePortalRegistrationForm}from"./usePortalRegistrationForm-6d562bf8.js";import{u as useRegistrationFormState}from"./useRegistrationFormState-0cee2d21.js";import{P as PortalRegistrationFormView}from"./sqm-portal-registration-form-view-2f4936ef.js";function usePortalForgotPassword(e){var r=this;var t,o,s,i,a,n,l;var u=useState(false),d=u[0],c=u[1];var g=useState(""),h=g[0],f=g[1];var v=un(),m=v[0],b=v[1],p=b.loading,P=b.data,w=b.errors;var y=new URLSearchParams(jn.location.search);var x=y.get("nextPage");var E=function(t){return __awaiter(r,void 0,void 0,(function(){var r,o,s,i,a,n;return __generator(this,(function(l){switch(l.label){case 0:f("");c(false);o=t.detail.formData;o===null||o===void 0?void 0:o.forEach((function(e,r){jsonpointer.set(o,r,e)}));s=x?{nextPage:x}:null;i=e.redirectPath;a={email:o.email,urlParams:s,redirectPath:i};return[4,m(a)];case 1:n=l.sent();if(n instanceof Error){if(n.message)f(e.networkErrorMessage);return[2]}if((r=n.requestManagedIdentityPasswordResetEmail)===null||r===void 0?void 0:r.success){c(true)}return[2]}}))}))};return{states:{loading:p,error:((i=(s=(o=(t=w===null||w===void 0?void 0:w.response)===null||t===void 0?void 0:t.errors)===null||o===void 0?void 0:o[0])===null||s===void 0?void 0:s.extensions)===null||i===void 0?void 0:i.message)||((l=(n=(a=w===null||w===void 0?void 0:w.response)===null||a===void 0?void 0:a.errors)===null||n===void 0?void 0:n[0])===null||l===void 0?void 0:l.message)||h,success:d,loginPath:e.loginPath,headerText:e.headerText,loginText:e.loginText},callbacks:{submit:E}}}var PortalForgotPassword=function(){function e(e){registerInstance(this,e);this.ignored=true;this.redirectPath="/resetPassword";this.emailLabel="Email";this.submitLabel="Request Password Reset";this.loginPath="/login";this.headerText="Enter your email below to receive a password reset link.";this.loginText="Sign In";this.networkErrorMessage="An error occurred while loading this page. Please refresh the page.";this.successAlertText="If an account with that email exists, a password reset email will be sent.";this.backgroundColor="var(--sqm-portal-background, #ffffff)";this.borderRadius="var(--sqm-border-radius-normal, 8px)";this.border="var(--sqm-border-thickness, 1px) solid var(--sqm-border-color, #eaeaea)";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalForgotPasswordDemo(this):usePortalForgotPassword(this),r=e.states,t=e.callbacks;var o={messageSlot:h$1("slot",{name:"messageSlot"},this.headerText),emailLabel:this.emailLabel,submitLabel:this.submitLabel,successAlertText:this.successAlertText,loginText:this.loginText,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:this.border};return h$1(PortalForgotPasswordView,{states:r,callbacks:t,content:o})};return e}();function usePortalForgotPasswordDemo(e){var r=this;return cjs({states:{error:"",loading:false,success:false},callbacks:{submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){return[2]}))}))}},content:{secondaryButton:h$1("sl-button",{type:"secondary",exportparts:"base: secondarybutton-base",disabled:false,onClick:function(){return jn.push(e.loginPath)}},e.loginText),messageSlot:h$1("span",null,e.headerText),emailLabel:e.emailLabel,submitLabel:e.submitLabel,successAlertText:e.successAlertText,loginText:e.loginText,backgroundColor:e.backgroundColor,borderRadius:e.borderRadius,border:e.border}},e.demoData||{},{arrayMerge:function(e,r){return r}})}function usePortalLogin(e){var r=this;var t,o,s,i,a,n,l,u,d,c,g,h,f,v;var m=je(),b=m[0],p=m[1],P=p.loading,w=p.errors,y=p.data;var x=hn(),E=x[0],L=x[1],_=L.loading,T=L.errors;var k=useState(""),M=k[0],R=k[1];var j=new URLSearchParams(jn.location.search);var S=j.get("nextPage");var q=function(t){return __awaiter(r,void 0,void 0,(function(){var r,o,s,i,a,n;return __generator(this,(function(l){switch(l.label){case 0:if(!((r=t.detail)===null||r===void 0?void 0:r.credential))return[2];return[4,E({idToken:t.detail.credential})];case 1:a=l.sent();if(a instanceof Error){if((a===null||a===void 0?void 0:a.message)||((o=a===null||a===void 0?void 0:a["response"])===null||o===void 0?void 0:o["error"]))if((s=a===null||a===void 0?void 0:a["response"])===null||s===void 0?void 0:s["errors"].some((function(e){var r;return((r=e===null||e===void 0?void 0:e["extensions"])===null||r===void 0?void 0:r["message"])==="Invalid Credentials."}))){R(e.googleUserNotRegisteredError)}else{R(e.networkErrorMessage)}return[2]}if((i=a.authenticateManagedIdentityWithGoogle)===null||i===void 0?void 0:i.token){j.delete("nextPage");n=sanitizeUrlPath(S||e.nextPage);jn.push(n.href)}return[2]}}))}))};var I=function(t){return __awaiter(r,void 0,void 0,(function(){var r,o,s,i,a,n;return __generator(this,(function(l){switch(l.label){case 0:R("");s=t.detail.formData;s===null||s===void 0?void 0:s.forEach((function(e,r){jsonpointer.set(s,r,e)}));i={email:s.email,password:s.password};return[4,b(i)];case 1:a=l.sent();if(a instanceof Error){if((a===null||a===void 0?void 0:a.message)||((r=a===null||a===void 0?void 0:a["response"])===null||r===void 0?void 0:r["error"]))R(e.networkErrorMessage);return[2]}if((o=a.authenticateManagedIdentityWithEmailAndPassword)===null||o===void 0?void 0:o.token){j.delete("nextPage");n=sanitizeUrlPath(S||e.nextPage);jn.push(n.href)}return[2]}}))}))};var F=((i=(s=(o=(t=w===null||w===void 0?void 0:w.response)===null||t===void 0?void 0:t.errors)===null||o===void 0?void 0:o[0])===null||s===void 0?void 0:s.extensions)===null||i===void 0?void 0:i.message)||((l=(n=(a=w===null||w===void 0?void 0:w.response)===null||a===void 0?void 0:a.errors)===null||n===void 0?void 0:n[0])===null||l===void 0?void 0:l.message)||M;var C=((g=(c=(d=(u=T===null||T===void 0?void 0:T.response)===null||u===void 0?void 0:u.errors)===null||d===void 0?void 0:d[0])===null||c===void 0?void 0:c.extensions)===null||g===void 0?void 0:g.message)||((v=(f=(h=T===null||T===void 0?void 0:T.response)===null||h===void 0?void 0:h.errors)===null||f===void 0?void 0:f[0])===null||v===void 0?void 0:v.message)||M;return{states:{loading:P||_,error:F||C,registerPath:e.registerPath,forgotPasswordPath:e.forgotPasswordPath},callbacks:{googleSubmit:q,submit:I}}}var PortalGoogleLogin=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Sign In";this.forgotPasswordPath="/forgotPassword";this.forgotPasswordLabel="Forgot Password?";this.registerLabel="Register";this.registerPath="/register";this.pageLabel="Sign in to your account";this.networkErrorMessage="An error occurred while logging you in. Please refresh the page and try again.";this.googleUserNotRegisteredError="Your Google account has not registered on our platform. Please complete the registration process with your Google account.";this.registerCTA="Don't have an account?";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useLoginDemo(this):usePortalLogin(this),r=e.states,t=e.callbacks;var o={RegisterButton:{"&::part(label)":{padding:"0"}}};var s=createStyleSheet(o);var i=s.toString();var a={forgotPasswordButton:h$1("slot",{name:"forgotPassword"},h$1("a",{onClick:function(){return jn.push(r.forgotPasswordPath)}},this.forgotPasswordLabel)),googleButton:h$1("sqm-google-sign-in",{onInitComplete:t.googleSubmit}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,i),h$1("span",null,this.registerCTA," ",h$1("sl-button",{size:"large",type:"text",disabled:r.loading,onClick:function(){return jn.push(r.registerPath)},className:s.classes.RegisterButton},this.registerLabel))),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel};return h$1(PortalLoginView,{states:r,callbacks:t,content:a})};return e}();function useLoginDemo(e){var r=this;var t,o;return cjs({states:{error:((o=(t=e.demoData)===null||t===void 0?void 0:t.states)===null||o===void 0?void 0:o.error)||"",loading:false,forgotPasswordPath:"/forgotPassword",registerPath:"/register",showLoginForm:"manual"},callbacks:{googleSubmit:function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("google submit");return[2]}))}))},submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))}},content:{googleButton:null}},e.demoData||{},{arrayMerge:function(e,r){return r}})}var PortalLogin=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Sign In";this.forgotPasswordPath="/forgotPassword";this.forgotPasswordLabel="Forgot Password?";this.registerLabel="Register";this.registerPath="/register";this.pageLabel="Sign in to your account";this.networkErrorMessage="An error occurred while logging you in. Please refresh the page and try again.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useLoginDemo$1(this):usePortalLogin(this),r=e.states,t=e.callbacks;var o={RegisterButton:{"&::part(label)":{padding:"0"}}};var s=createStyleSheet(o);var i=s.toString();var a={forgotPasswordButton:h$1("slot",{name:"forgotPassword"},h$1("a",{onClick:function(){return jn.push(r.forgotPasswordPath)}},this.forgotPasswordLabel)),googleButton:null,secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,i),h$1("sl-button",{exportparts:"base: secondarybutton-base",type:"text",disabled:r.loading,onClick:function(){return jn.push(r.registerPath)}},this.registerLabel)),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel};return h$1(PortalLoginView,{states:r,callbacks:t,content:a})};return e}();function useLoginDemo$1(e){var r=this;return cjs({states:{error:"",loading:false,forgotPasswordPath:"/forgotPassword",registerPath:"/register",showLoginForm:"manual"},callbacks:{googleSubmit:function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("google submit");return[2]}))}))},submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))}},content:{googleButton:null}},e.demoData||{},{arrayMerge:function(e,r){return r}})}function usePortalRegister(e){var r=this;var t,o,s,i,a,n,l,u,d;var c=useRef(null);var g=useRegistrationFormState({}),h=g.registrationFormState,f=g.setRegistrationFormState;var v=Ve(),m=v[0],b=v[1],p=b.loading,P=b.errors,w=b.data;useEffect((function(){if(!c.current)return;var e=c.current;e.addEventListener("sl-input",x);return function(){e.removeEventListener("sl-input",x)}}),[c.current]);var y=function(t){return __awaiter(r,void 0,void 0,(function(){var r,o,s,i,a,n,l,u,d,c;return __generator(this,(function(g){switch(g.label){case 0:o=t.target.getFormControls();s={};i={};o===null||o===void 0?void 0:o.forEach((function(r){if(!r.name)return;var t=r.name;var o=r.value;jsonpointer.set(s,t,o);if(r.required&&!o){jsonpointer.set(i,t,e.requiredFieldErrorMessage)}if(typeof r.validationError==="function"){var a=r.validationError;var n=a({control:r,key:t,value:o});if(n)jsonpointer.set(i,t,n)}}));if((e.confirmPassword||s.confirmPassword)&&s.password!==s.confirmPassword){i=__assign(__assign({},i),{confirmPassword:e.passwordMismatchErrorMessage})}if(Object.keys(i).length){f({loading:false,error:"",validationErrors:i});return[2]}f({loading:true,error:"",validationErrors:{}});a=s.email,n=s.password;delete s.email;delete s.password;delete s.confirmPassword;s=__assign({},s);l=e.redirectPath;u={email:a,password:n,formData:s,redirectPath:l};g.label=1;case 1:g.trys.push([1,3,,4]);return[4,m(u)];case 2:d=g.sent();if(d instanceof Error){throw d}f({loading:false,error:"",validationErrors:{}});if((r=d.registerManagedIdentityWithEmailAndPassword)===null||r===void 0?void 0:r.token){jn.push(e.nextPage)}return[3,4];case 3:c=g.sent();f({loading:false,error:e.networkErrorMessage,validationErrors:{}});return[3,4];case 4:return[2]}}))}))};var x=useCallback((function(e){var r,t;var o=(t=(r=e.target)===null||r===void 0?void 0:r.type)===null||t===void 0?void 0:t.toLowerCase();if(o!=="tel")return;var s=new AsYouType("US");e.target.value=s.input(e.target.value)}),[]);var E="";if((t=P===null||P===void 0?void 0:P.response)===null||t===void 0?void 0:t["error"]){E=e.networkErrorMessage}else if((P===null||P===void 0?void 0:P.message)&&!((o=P===null||P===void 0?void 0:P.response)===null||o===void 0?void 0:o.errors.length)){E=e.networkErrorMessage}else{E=((n=(a=(i=(s=P===null||P===void 0?void 0:P.response)===null||s===void 0?void 0:s.errors)===null||i===void 0?void 0:i[0])===null||a===void 0?void 0:a.extensions)===null||n===void 0?void 0:n.message)||((d=(u=(l=P===null||P===void 0?void 0:P.response)===null||l===void 0?void 0:l.errors)===null||u===void 0?void 0:u[0])===null||d===void 0?void 0:d.message)||(h===null||h===void 0?void 0:h.error)}return{states:{loading:p,error:E,registrationFormState:h,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs,loginPath:e.loginPath,disablePasswordValidation:e.disablePasswordValidation},callbacks:{submit:y,inputFunction:x},refs:{formRef:c}}}var PortalRegister=function(){function e(e){registerInstance(this,e);this.ignored=false;this.nextPage="/";this.redirectPath="/verifyEmail";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Register";this.loginLabel="Sign in";this.confirmPasswordLabel="Confirm Password";this.confirmPassword=false;this.disablePasswordValidation=false;this.hideInputs=false;this.pageLabel="Register";this.loginPath="/login";this.requiredFieldErrorMessage="Cannot be empty";this.networkErrorMessage="Network request failed.";this.passwordMismatchErrorMessage="Passwords do not match.";this.invalidEmailErrorMessage="Must be a valid email address";this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useRegisterDemo(this):usePortalRegister(this),r=e.states,t=e.callbacks,o=e.refs;var s={formData:h$1("slot",{name:"formData"}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("sl-button",{type:"text",disabled:r.loading,onClick:function(){return jn.push(r.loginPath)}},this.loginLabel)),terms:h$1("slot",{name:"terms"}),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel,confirmPasswordLabel:this.confirmPasswordLabel,invalidEmailErrorMessage:this.invalidEmailErrorMessage,requiredFieldErrorMessage:this.requiredFieldErrorMessage,meetsRequirementsText:this.meetsRequirementsText,doesNotMeetRequirementsText:this.doesNotMeetRequirementsText,minErrorText:this.minErrorText,uppercaseErrorText:this.uppercaseErrorText,lowercaseErrorText:this.lowercaseErrorText,hasErrorText:this.hasErrorText};return h$1(PortalRegisterView,{states:r,callbacks:t,content:s,refs:o})};return e}();function useRegisterDemo(e){var r=this;return cjs({states:{error:"",loading:false,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs||false,customPasswordField:false,loginPath:e.loginPath,disablePasswordValidation:e.disablePasswordValidation},callbacks:{submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},inputFunction:function(){}},refs:{formRef:{}}},e.demoData||{},{arrayMerge:function(e,r){return r}})}var PortalRegistrationForm=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.redirectPath="/verifyEmail";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Register";this.loginLabel="Sign in";this.confirmPasswordLabel="Confirm Password";this.confirmPassword=false;this.disablePasswordValidation=false;this.hideInputs=false;this.pageLabel="Register";this.loginPath="/login";this.requiredFieldErrorMessage="Cannot be empty";this.networkErrorMessage="Network request failed.";this.passwordMismatchErrorMessage="Passwords do not match.";this.invalidEmailErrorMessage="Must be a valid email address";this.formDisabledErrorMessage="The registration form is currently disabled.";this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useRegisterDemo$1(this):usePortalRegistrationForm(this),r=e.states,t=e.callbacks,o=e.refs;var s={formData:h$1("slot",{name:"formData"}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("sl-button",{type:"text",disabled:r.loading,onClick:function(){return jn.push(r.loginPath)}},this.loginLabel)),terms:h$1("slot",{name:"terms"}),emailOptIn:h$1("slot",{name:"emailOptIn"}),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel,confirmPasswordLabel:this.confirmPasswordLabel,networkErrorMessage:this.networkErrorMessage,passwordMismatchErrorMessage:this.passwordMismatchErrorMessage,invalidEmailErrorMessage:this.invalidEmailErrorMessage,formDisabledErrorMessage:this.formDisabledErrorMessage,requiredFieldErrorMessage:this.requiredFieldErrorMessage,meetsRequirementsText:this.meetsRequirementsText,doesNotMeetRequirementsText:this.doesNotMeetRequirementsText,minErrorText:this.minErrorText,uppercaseErrorText:this.uppercaseErrorText,lowercaseErrorText:this.lowercaseErrorText,hasErrorText:this.hasErrorText};return h$1(PortalRegistrationFormView,{states:r,callbacks:t,content:s,refs:o})};return e}();function useRegisterDemo$1(e){var r=this;return cjs({states:{error:"",loading:false,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs||false,customPasswordField:false,loginPath:"/login"},callbacks:{submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},inputFunction:function(){}},refs:{formRef:{}}},e.demoData||{},{arrayMerge:function(e,r){return r}})}var globalPromise=null;function usePortalVerifyEmail(e){var r=this;var t=e.nextPage,o=e.failedPage,s=e.verifySuccessText,i=e.verifyEmailText,a=e.verifyInvalidText,n=e.networkErrorMessage,l=e.continueText;var u,d,c,g,h,f,v,m,b,p;var P=useState(false),w=P[0],y=P[1];var x=useState(false),E=x[0],L=x[1];var _=J();var T=an(),k=T[0],M=T[1],R=M.loading,j=M.data,S=M.errors;var q=new URLSearchParams(jn.location.search);var I=q.get("oobCode");var F=q.get("email");var C=q.get("nextPage");var D=j===undefined&&S===undefined&&!!I;var $=!!(((u=_===null||_===void 0?void 0:_.managedIdentity)===null||u===void 0?void 0:u.emailVerified)||((d=j===null||j===void 0?void 0:j.verifyManagedIdentityEmail)===null||d===void 0?void 0:d.success)||E);var V=((c=_===null||_===void 0?void 0:_.managedIdentity)===null||c===void 0?void 0:c.email)===F;var B=function(){return jn.push({pathname:o,search:q.toString()&&"?"+q.toString()})};var A=function(){q.delete("nextPage");var e=sanitizeUrlPath(C||t);jn.push(e.href)};var N=function(){setTimeout((function(){setUserIdentity(undefined);A()}),3e3)};var U=function(){setTimeout(A,3e3)};useEffect((function(){var e=function(){return __awaiter(r,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:if(!globalPromise)globalPromise=k({oobCode:I});return[4,globalPromise];case 1:e=r.sent();if(!(e instanceof Error)&&e.verifyManagedIdentityEmail.success){L(true)}y(true);return[2]}}))}))};e()}),[]);useEffect((function(){if(!w)return;if($&&V)U();else N()}),[w,$]);return{states:{loading:R||!w,disableContinue:D,error:((v=(f=(h=(g=S===null||S===void 0?void 0:S.response)===null||g===void 0?void 0:g.errors)===null||h===void 0?void 0:h[0])===null||f===void 0?void 0:f.extensions)===null||v===void 0?void 0:v.message)||((p=(b=(m=S===null||S===void 0?void 0:S.response)===null||m===void 0?void 0:m.errors)===null||b===void 0?void 0:b[0])===null||p===void 0?void 0:p.message)||((S===null||S===void 0?void 0:S.message)||!V)&&n,success:w&&E&&($||V)},data:{oobCode:I},callbacks:{failed:B,gotoNextPage:A},content:{verifySuccessText:s,verifyEmailText:i,verifyInvalidText:a,continueText:l}}}var PortalVerifyEmail=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.failedPage="/";this.verifyEmailText="Verify your email";this.verifySuccessText="Your email has been verified and you are being redirected. If you are not redirected, please click Continue.";this.verifyInvalidText="The email verification code is invalid or has expired, please try again.";this.continueText="Continue";this.networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalVerifyEmailDemo(getProps(this)):usePortalVerifyEmail(getProps(this)),r=e.states,t=e.data,o=e.callbacks,s=e.content;return h$1(PortalVerifyEmailView,{states:r,data:t,callbacks:o,content:s})};return e}();function usePortalVerifyEmailDemo(e){return cjs({states:{error:"",loading:false,success:true},data:{oobCode:"code"},callbacks:{failed:function(){console.log("failed")},gotoNextPage:function(){}},content:{verifySuccessText:e.verifySuccessText,verifyEmailText:e.verifyEmailText,verifyInvalidText:e.verifyInvalidText,continueText:e.continueText}},e.demoData||{},{arrayMerge:function(e,r){return r}})}export{PortalForgotPassword as sqm_portal_forgot_password,PortalGoogleLogin as sqm_portal_google_login,PortalLogin as sqm_portal_login,PortalRegister as sqm_portal_register,PortalRegistrationForm as sqm_portal_registration_form,PortalVerifyEmail as sqm_portal_verify_email};
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++){r=arguments[t];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s))e[s]=r[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,r,t,o){function s(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function n(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?t(e.value):s(e.value).then(a,n)}l((o=o.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,s,i,a;return a={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function n(e){return function(r){return l([e,r])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(t)try{if(o=1,s&&(i=a[0]&2?s["return"]:a[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;if(s=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;s=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=r.call(e,t)}catch(e){a=[6,e];s=0}finally{o=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-38ad4957.js";import{k as useState,n as h,m as useRef,f as useEffect}from"./dom-context-hooks.module-50442785.js";import{u as un,j as jn,i as isDemo,a as je,h as hn,V as Ve,b as useCallback,J,c as an,e as setUserIdentity}from"./index.module-cede12c6.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath,g as getProps}from"./utils-334c1e34.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-738acfb3.js";import{P as PortalForgotPasswordView,a as PortalLoginView,b as PortalRegisterView,c as PortalVerifyEmailView}from"./sqm-portal-verify-email-view-92297506.js";import{A as AsYouType,u as usePortalRegistrationForm}from"./usePortalRegistrationForm-5844032a.js";import{u as useRegistrationFormState}from"./useRegistrationFormState-1813bdef.js";import{P as PortalRegistrationFormView}from"./sqm-portal-registration-form-view-2f4936ef.js";function usePortalForgotPassword(e){var r=this;var t,o,s,i,a,n,l;var u=useState(false),d=u[0],c=u[1];var g=useState(""),h=g[0],f=g[1];var v=un(),m=v[0],b=v[1],p=b.loading,P=b.data,w=b.errors;var y=new URLSearchParams(jn.location.search);var x=y.get("nextPage");var E=function(t){return __awaiter(r,void 0,void 0,(function(){var r,o,s,i,a,n;return __generator(this,(function(l){switch(l.label){case 0:f("");c(false);o=t.detail.formData;o===null||o===void 0?void 0:o.forEach((function(e,r){jsonpointer.set(o,r,e)}));s=x?{nextPage:x}:null;i=e.redirectPath;a={email:o.email,urlParams:s,redirectPath:i};return[4,m(a)];case 1:n=l.sent();if(n instanceof Error){if(n.message)f(e.networkErrorMessage);return[2]}if((r=n.requestManagedIdentityPasswordResetEmail)===null||r===void 0?void 0:r.success){c(true)}return[2]}}))}))};return{states:{loading:p,error:((i=(s=(o=(t=w===null||w===void 0?void 0:w.response)===null||t===void 0?void 0:t.errors)===null||o===void 0?void 0:o[0])===null||s===void 0?void 0:s.extensions)===null||i===void 0?void 0:i.message)||((l=(n=(a=w===null||w===void 0?void 0:w.response)===null||a===void 0?void 0:a.errors)===null||n===void 0?void 0:n[0])===null||l===void 0?void 0:l.message)||h,success:d,loginPath:e.loginPath,headerText:e.headerText,loginText:e.loginText},callbacks:{submit:E}}}var PortalForgotPassword=function(){function e(e){registerInstance(this,e);this.ignored=true;this.redirectPath="/resetPassword";this.emailLabel="Email";this.submitLabel="Request Password Reset";this.loginPath="/login";this.headerText="Enter your email below to receive a password reset link.";this.loginText="Sign In";this.networkErrorMessage="An error occurred while loading this page. Please refresh the page.";this.successAlertText="If an account with that email exists, a password reset email will be sent.";this.backgroundColor="var(--sqm-portal-background, #ffffff)";this.borderRadius="var(--sqm-border-radius-normal, 8px)";this.border="var(--sqm-border-thickness, 1px) solid var(--sqm-border-color, #eaeaea)";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalForgotPasswordDemo(this):usePortalForgotPassword(this),r=e.states,t=e.callbacks;var o={messageSlot:h$1("slot",{name:"messageSlot"},this.headerText),emailLabel:this.emailLabel,submitLabel:this.submitLabel,successAlertText:this.successAlertText,loginText:this.loginText,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:this.border};return h$1(PortalForgotPasswordView,{states:r,callbacks:t,content:o})};return e}();function usePortalForgotPasswordDemo(e){var r=this;return cjs({states:{error:"",loading:false,success:false},callbacks:{submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){return[2]}))}))}},content:{secondaryButton:h$1("sl-button",{type:"secondary",exportparts:"base: secondarybutton-base",disabled:false,onClick:function(){return jn.push(e.loginPath)}},e.loginText),messageSlot:h$1("span",null,e.headerText),emailLabel:e.emailLabel,submitLabel:e.submitLabel,successAlertText:e.successAlertText,loginText:e.loginText,backgroundColor:e.backgroundColor,borderRadius:e.borderRadius,border:e.border}},e.demoData||{},{arrayMerge:function(e,r){return r}})}function usePortalLogin(e){var r=this;var t,o,s,i,a,n,l,u,d,c,g,h,f,v;var m=je(),b=m[0],p=m[1],P=p.loading,w=p.errors,y=p.data;var x=hn(),E=x[0],L=x[1],_=L.loading,T=L.errors;var k=useState(""),M=k[0],R=k[1];var j=new URLSearchParams(jn.location.search);var S=j.get("nextPage");var q=function(t){return __awaiter(r,void 0,void 0,(function(){var r,o,s,i,a,n;return __generator(this,(function(l){switch(l.label){case 0:if(!((r=t.detail)===null||r===void 0?void 0:r.credential))return[2];return[4,E({idToken:t.detail.credential})];case 1:a=l.sent();if(a instanceof Error){if((a===null||a===void 0?void 0:a.message)||((o=a===null||a===void 0?void 0:a["response"])===null||o===void 0?void 0:o["error"]))if((s=a===null||a===void 0?void 0:a["response"])===null||s===void 0?void 0:s["errors"].some((function(e){var r;return((r=e===null||e===void 0?void 0:e["extensions"])===null||r===void 0?void 0:r["message"])==="Invalid Credentials."}))){R(e.googleUserNotRegisteredError)}else{R(e.networkErrorMessage)}return[2]}if((i=a.authenticateManagedIdentityWithGoogle)===null||i===void 0?void 0:i.token){j.delete("nextPage");n=sanitizeUrlPath(S||e.nextPage);jn.push(n.href)}return[2]}}))}))};var I=function(t){return __awaiter(r,void 0,void 0,(function(){var r,o,s,i,a,n;return __generator(this,(function(l){switch(l.label){case 0:R("");s=t.detail.formData;s===null||s===void 0?void 0:s.forEach((function(e,r){jsonpointer.set(s,r,e)}));i={email:s.email,password:s.password};return[4,b(i)];case 1:a=l.sent();if(a instanceof Error){if((a===null||a===void 0?void 0:a.message)||((r=a===null||a===void 0?void 0:a["response"])===null||r===void 0?void 0:r["error"]))R(e.networkErrorMessage);return[2]}if((o=a.authenticateManagedIdentityWithEmailAndPassword)===null||o===void 0?void 0:o.token){j.delete("nextPage");n=sanitizeUrlPath(S||e.nextPage);jn.push(n.href)}return[2]}}))}))};var F=((i=(s=(o=(t=w===null||w===void 0?void 0:w.response)===null||t===void 0?void 0:t.errors)===null||o===void 0?void 0:o[0])===null||s===void 0?void 0:s.extensions)===null||i===void 0?void 0:i.message)||((l=(n=(a=w===null||w===void 0?void 0:w.response)===null||a===void 0?void 0:a.errors)===null||n===void 0?void 0:n[0])===null||l===void 0?void 0:l.message)||M;var C=((g=(c=(d=(u=T===null||T===void 0?void 0:T.response)===null||u===void 0?void 0:u.errors)===null||d===void 0?void 0:d[0])===null||c===void 0?void 0:c.extensions)===null||g===void 0?void 0:g.message)||((v=(f=(h=T===null||T===void 0?void 0:T.response)===null||h===void 0?void 0:h.errors)===null||f===void 0?void 0:f[0])===null||v===void 0?void 0:v.message)||M;return{states:{loading:P||_,error:F||C,registerPath:e.registerPath,forgotPasswordPath:e.forgotPasswordPath},callbacks:{googleSubmit:q,submit:I}}}var PortalGoogleLogin=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Sign In";this.forgotPasswordPath="/forgotPassword";this.forgotPasswordLabel="Forgot Password?";this.registerLabel="Register";this.registerPath="/register";this.pageLabel="Sign in to your account";this.networkErrorMessage="An error occurred while logging you in. Please refresh the page and try again.";this.googleUserNotRegisteredError="Your Google account has not registered on our platform. Please complete the registration process with your Google account.";this.registerCTA="Don't have an account?";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useLoginDemo(this):usePortalLogin(this),r=e.states,t=e.callbacks;var o={RegisterButton:{"&::part(label)":{padding:"0"}}};var s=createStyleSheet(o);var i=s.toString();var a={forgotPasswordButton:h$1("slot",{name:"forgotPassword"},h$1("a",{onClick:function(){return jn.push(r.forgotPasswordPath)}},this.forgotPasswordLabel)),googleButton:h$1("sqm-google-sign-in",{onInitComplete:t.googleSubmit}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,i),h$1("span",null,this.registerCTA," ",h$1("sl-button",{size:"large",type:"text",disabled:r.loading,onClick:function(){return jn.push(r.registerPath)},className:s.classes.RegisterButton},this.registerLabel))),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel};return h$1(PortalLoginView,{states:r,callbacks:t,content:a})};return e}();function useLoginDemo(e){var r=this;var t,o;return cjs({states:{error:((o=(t=e.demoData)===null||t===void 0?void 0:t.states)===null||o===void 0?void 0:o.error)||"",loading:false,forgotPasswordPath:"/forgotPassword",registerPath:"/register",showLoginForm:"manual"},callbacks:{googleSubmit:function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("google submit");return[2]}))}))},submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))}},content:{googleButton:null}},e.demoData||{},{arrayMerge:function(e,r){return r}})}var PortalLogin=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Sign In";this.forgotPasswordPath="/forgotPassword";this.forgotPasswordLabel="Forgot Password?";this.registerLabel="Register";this.registerPath="/register";this.pageLabel="Sign in to your account";this.networkErrorMessage="An error occurred while logging you in. Please refresh the page and try again.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useLoginDemo$1(this):usePortalLogin(this),r=e.states,t=e.callbacks;var o={RegisterButton:{"&::part(label)":{padding:"0"}}};var s=createStyleSheet(o);var i=s.toString();var a={forgotPasswordButton:h$1("slot",{name:"forgotPassword"},h$1("a",{onClick:function(){return jn.push(r.forgotPasswordPath)}},this.forgotPasswordLabel)),googleButton:null,secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,i),h$1("sl-button",{exportparts:"base: secondarybutton-base",type:"text",disabled:r.loading,onClick:function(){return jn.push(r.registerPath)}},this.registerLabel)),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel};return h$1(PortalLoginView,{states:r,callbacks:t,content:a})};return e}();function useLoginDemo$1(e){var r=this;return cjs({states:{error:"",loading:false,forgotPasswordPath:"/forgotPassword",registerPath:"/register",showLoginForm:"manual"},callbacks:{googleSubmit:function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("google submit");return[2]}))}))},submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))}},content:{googleButton:null}},e.demoData||{},{arrayMerge:function(e,r){return r}})}function usePortalRegister(e){var r=this;var t,o,s,i,a,n,l,u,d;var c=useRef(null);var g=useRegistrationFormState({}),h=g.registrationFormState,f=g.setRegistrationFormState;var v=Ve(),m=v[0],b=v[1],p=b.loading,P=b.errors,w=b.data;useEffect((function(){if(!c.current)return;var e=c.current;e.addEventListener("sl-input",x);return function(){e.removeEventListener("sl-input",x)}}),[c.current]);var y=function(t){return __awaiter(r,void 0,void 0,(function(){var r,o,s,i,a,n,l,u,d,c;return __generator(this,(function(g){switch(g.label){case 0:o=t.target.getFormControls();s={};i={};o===null||o===void 0?void 0:o.forEach((function(r){if(!r.name)return;var t=r.name;var o=r.value;jsonpointer.set(s,t,o);if(r.required&&!o){jsonpointer.set(i,t,e.requiredFieldErrorMessage)}if(typeof r.validationError==="function"){var a=r.validationError;var n=a({control:r,key:t,value:o});if(n)jsonpointer.set(i,t,n)}}));if((e.confirmPassword||s.confirmPassword)&&s.password!==s.confirmPassword){i=__assign(__assign({},i),{confirmPassword:e.passwordMismatchErrorMessage})}if(Object.keys(i).length){f({loading:false,error:"",validationErrors:i});return[2]}f({loading:true,error:"",validationErrors:{}});a=s.email,n=s.password;delete s.email;delete s.password;delete s.confirmPassword;s=__assign({},s);l=e.redirectPath;u={email:a,password:n,formData:s,redirectPath:l};g.label=1;case 1:g.trys.push([1,3,,4]);return[4,m(u)];case 2:d=g.sent();if(d instanceof Error){throw d}f({loading:false,error:"",validationErrors:{}});if((r=d.registerManagedIdentityWithEmailAndPassword)===null||r===void 0?void 0:r.token){jn.push(e.nextPage)}return[3,4];case 3:c=g.sent();f({loading:false,error:e.networkErrorMessage,validationErrors:{}});return[3,4];case 4:return[2]}}))}))};var x=useCallback((function(e){var r,t;var o=(t=(r=e.target)===null||r===void 0?void 0:r.type)===null||t===void 0?void 0:t.toLowerCase();if(o!=="tel")return;var s=new AsYouType("US");e.target.value=s.input(e.target.value)}),[]);var E="";if((t=P===null||P===void 0?void 0:P.response)===null||t===void 0?void 0:t["error"]){E=e.networkErrorMessage}else if((P===null||P===void 0?void 0:P.message)&&!((o=P===null||P===void 0?void 0:P.response)===null||o===void 0?void 0:o.errors.length)){E=e.networkErrorMessage}else{E=((n=(a=(i=(s=P===null||P===void 0?void 0:P.response)===null||s===void 0?void 0:s.errors)===null||i===void 0?void 0:i[0])===null||a===void 0?void 0:a.extensions)===null||n===void 0?void 0:n.message)||((d=(u=(l=P===null||P===void 0?void 0:P.response)===null||l===void 0?void 0:l.errors)===null||u===void 0?void 0:u[0])===null||d===void 0?void 0:d.message)||(h===null||h===void 0?void 0:h.error)}return{states:{loading:p,error:E,registrationFormState:h,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs,loginPath:e.loginPath,disablePasswordValidation:e.disablePasswordValidation},callbacks:{submit:y,inputFunction:x},refs:{formRef:c}}}var PortalRegister=function(){function e(e){registerInstance(this,e);this.ignored=false;this.nextPage="/";this.redirectPath="/verifyEmail";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Register";this.loginLabel="Sign in";this.confirmPasswordLabel="Confirm Password";this.confirmPassword=false;this.disablePasswordValidation=false;this.hideInputs=false;this.pageLabel="Register";this.loginPath="/login";this.requiredFieldErrorMessage="Cannot be empty";this.networkErrorMessage="Network request failed.";this.passwordMismatchErrorMessage="Passwords do not match.";this.invalidEmailErrorMessage="Must be a valid email address";this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useRegisterDemo(this):usePortalRegister(this),r=e.states,t=e.callbacks,o=e.refs;var s={formData:h$1("slot",{name:"formData"}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("sl-button",{type:"text",disabled:r.loading,onClick:function(){return jn.push(r.loginPath)}},this.loginLabel)),terms:h$1("slot",{name:"terms"}),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel,confirmPasswordLabel:this.confirmPasswordLabel,invalidEmailErrorMessage:this.invalidEmailErrorMessage,requiredFieldErrorMessage:this.requiredFieldErrorMessage,meetsRequirementsText:this.meetsRequirementsText,doesNotMeetRequirementsText:this.doesNotMeetRequirementsText,minErrorText:this.minErrorText,uppercaseErrorText:this.uppercaseErrorText,lowercaseErrorText:this.lowercaseErrorText,hasErrorText:this.hasErrorText};return h$1(PortalRegisterView,{states:r,callbacks:t,content:s,refs:o})};return e}();function useRegisterDemo(e){var r=this;return cjs({states:{error:"",loading:false,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs||false,customPasswordField:false,loginPath:e.loginPath,disablePasswordValidation:e.disablePasswordValidation},callbacks:{submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},inputFunction:function(){}},refs:{formRef:{}}},e.demoData||{},{arrayMerge:function(e,r){return r}})}var PortalRegistrationForm=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.redirectPath="/verifyEmail";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Register";this.loginLabel="Sign in";this.confirmPasswordLabel="Confirm Password";this.confirmPassword=false;this.disablePasswordValidation=false;this.hideInputs=false;this.pageLabel="Register";this.loginPath="/login";this.requiredFieldErrorMessage="Cannot be empty";this.networkErrorMessage="Network request failed.";this.passwordMismatchErrorMessage="Passwords do not match.";this.invalidEmailErrorMessage="Must be a valid email address";this.formDisabledErrorMessage="The registration form is currently disabled.";this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useRegisterDemo$1(this):usePortalRegistrationForm(this),r=e.states,t=e.callbacks,o=e.refs;var s={formData:h$1("slot",{name:"formData"}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("sl-button",{type:"text",disabled:r.loading,onClick:function(){return jn.push(r.loginPath)}},this.loginLabel)),terms:h$1("slot",{name:"terms"}),emailOptIn:h$1("slot",{name:"emailOptIn"}),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel,confirmPasswordLabel:this.confirmPasswordLabel,networkErrorMessage:this.networkErrorMessage,passwordMismatchErrorMessage:this.passwordMismatchErrorMessage,invalidEmailErrorMessage:this.invalidEmailErrorMessage,formDisabledErrorMessage:this.formDisabledErrorMessage,requiredFieldErrorMessage:this.requiredFieldErrorMessage,meetsRequirementsText:this.meetsRequirementsText,doesNotMeetRequirementsText:this.doesNotMeetRequirementsText,minErrorText:this.minErrorText,uppercaseErrorText:this.uppercaseErrorText,lowercaseErrorText:this.lowercaseErrorText,hasErrorText:this.hasErrorText};return h$1(PortalRegistrationFormView,{states:r,callbacks:t,content:s,refs:o})};return e}();function useRegisterDemo$1(e){var r=this;return cjs({states:{error:"",loading:false,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs||false,customPasswordField:false,loginPath:"/login"},callbacks:{submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},inputFunction:function(){}},refs:{formRef:{}}},e.demoData||{},{arrayMerge:function(e,r){return r}})}var globalPromise=null;function usePortalVerifyEmail(e){var r=this;var t=e.nextPage,o=e.failedPage,s=e.verifySuccessText,i=e.verifyEmailText,a=e.verifyInvalidText,n=e.networkErrorMessage,l=e.continueText;var u,d,c,g,h,f,v,m,b,p;var P=useState(false),w=P[0],y=P[1];var x=useState(false),E=x[0],L=x[1];var _=J();var T=an(),k=T[0],M=T[1],R=M.loading,j=M.data,S=M.errors;var q=new URLSearchParams(jn.location.search);var I=q.get("oobCode");var F=q.get("email");var C=q.get("nextPage");var D=j===undefined&&S===undefined&&!!I;var $=!!(((u=_===null||_===void 0?void 0:_.managedIdentity)===null||u===void 0?void 0:u.emailVerified)||((d=j===null||j===void 0?void 0:j.verifyManagedIdentityEmail)===null||d===void 0?void 0:d.success)||E);var V=((c=_===null||_===void 0?void 0:_.managedIdentity)===null||c===void 0?void 0:c.email)===F;var B=function(){return jn.push({pathname:o,search:q.toString()&&"?"+q.toString()})};var A=function(){q.delete("nextPage");var e=sanitizeUrlPath(C||t);jn.push(e.href)};var N=function(){setTimeout((function(){setUserIdentity(undefined);A()}),3e3)};var U=function(){setTimeout(A,3e3)};useEffect((function(){var e=function(){return __awaiter(r,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:if(!globalPromise)globalPromise=k({oobCode:I});return[4,globalPromise];case 1:e=r.sent();if(!(e instanceof Error)&&e.verifyManagedIdentityEmail.success){L(true)}y(true);return[2]}}))}))};e()}),[]);useEffect((function(){if(!w)return;if($&&V)U();else N()}),[w,$]);return{states:{loading:R||!w,disableContinue:D,error:((v=(f=(h=(g=S===null||S===void 0?void 0:S.response)===null||g===void 0?void 0:g.errors)===null||h===void 0?void 0:h[0])===null||f===void 0?void 0:f.extensions)===null||v===void 0?void 0:v.message)||((p=(b=(m=S===null||S===void 0?void 0:S.response)===null||m===void 0?void 0:m.errors)===null||b===void 0?void 0:b[0])===null||p===void 0?void 0:p.message)||((S===null||S===void 0?void 0:S.message)||!V)&&n,success:w&&E&&($||V)},data:{oobCode:I},callbacks:{failed:B,gotoNextPage:A},content:{verifySuccessText:s,verifyEmailText:i,verifyInvalidText:a,continueText:l}}}var PortalVerifyEmail=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.failedPage="/";this.verifyEmailText="Verify your email";this.verifySuccessText="Your email has been verified and you are being redirected. If you are not redirected, please click Continue.";this.verifyInvalidText="The email verification code is invalid or has expired, please try again.";this.continueText="Continue";this.networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalVerifyEmailDemo(getProps(this)):usePortalVerifyEmail(getProps(this)),r=e.states,t=e.data,o=e.callbacks,s=e.content;return h$1(PortalVerifyEmailView,{states:r,data:t,callbacks:o,content:s})};return e}();function usePortalVerifyEmailDemo(e){return cjs({states:{error:"",loading:false,success:true},data:{oobCode:"code"},callbacks:{failed:function(){console.log("failed")},gotoNextPage:function(){}},content:{verifySuccessText:e.verifySuccessText,verifyEmailText:e.verifyEmailText,verifyInvalidText:e.verifyInvalidText,continueText:e.continueText}},e.demoData||{},{arrayMerge:function(e,r){return r}})}export{PortalForgotPassword as sqm_portal_forgot_password,PortalGoogleLogin as sqm_portal_google_login,PortalLogin as sqm_portal_login,PortalRegister as sqm_portal_register,PortalRegistrationForm as sqm_portal_registration_form,PortalVerifyEmail as sqm_portal_verify_email};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance}from"./index-38ad4957.js";import{n as h}from"./dom-context-hooks.module-50442785.js";import{e as setUserIdentity,j as jn,i as isDemo}from"./index.module-
|
|
1
|
+
import{r as registerInstance}from"./index-38ad4957.js";import{n as h}from"./dom-context-hooks.module-50442785.js";import{e as setUserIdentity,j as jn,i as isDemo}from"./index.module-cede12c6.js";function usePortalLogout(t){var o=t.nextPage;setUserIdentity(undefined);jn.push({pathname:o,search:""})}var PortalLogout=function(){function t(t){registerInstance(this,t);this.ignored=true;this.nextPage="/";h(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){isDemo()?useLogoutDemo():usePortalLogout(this)};return t}();function useLogoutDemo(t){}export{PortalLogout as sqm_portal_logout};
|
package/dist/esm-es5/{sqm-portal-profile-view-a172bdcc.js → sqm-portal-profile-view-a6be8558.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h}from"./index-38ad4957.js";import{i as intl}from"./global-
|
|
1
|
+
import{h}from"./index-38ad4957.js";import{i as intl}from"./global-39f55ec2.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{T as TextSpanView}from"./sqm-text-span-view-738acfb3.js";function PortalProfileView(e){var a,t,s,i,l;var r=e.states,o=e.callbacks;var n=r.text,d=r.formState;var m=d.errors,u=d.error;var p={Container:{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-xxx-large)",padding:"var(--sl-spacing-xxx-large)"},FormStyle:{width:"100%",minWidth:"700px","& >*:not(:last-child)":{"margin-bottom":"32px"},"@media screen and (max-width: 1100px)":{minWidth:"100%"}},Error:{"&::part(erroralert-base)":{"margin-bottom":"32px"}},Success:{"&::part(successalert-base)":{"margin-bottom":"32px"}},NameInputStyle:{width:"50%","@media screen and (max-width: 860px)":{width:"100%","margin-right":"0"}},NameInputContainer:{display:"flex",gap:"32px",width:"100%","@media screen and (max-width: 860px)":{flexDirection:"column"}}};var c=createStyleSheet(p);var v=c.toString();var b=((a=r.user)===null||a===void 0?void 0:a.countryCode)?intl.formatDisplayName((t=r.user)===null||t===void 0?void 0:t.countryCode,{type:"region"}):"";return h("div",{class:c.classes.Container,part:"sqm-base"},h("style",{type:"text/css"},v),h(TextSpanView,Object.assign({},{type:"h1"}),n.editProfileHeader),h(TextSpanView,Object.assign({},{type:"h2"}),n.editProfileSubHeader),h("form",{class:c.classes.FormStyle,onSubmit:o.onSubmit},r.success&&h("sqm-form-message",{class:c.classes.Success,exportparts:"success-icon"},h("div",{part:"successalert-text"},n.submissionSuccessText)),u&&h("sqm-form-message",{class:c.classes.Error,type:"error",exportparts:"erroralert-icon"},h("div",{part:"erroralert-text"},u)),h("div",{class:c.classes.NameInputContainer},h("sl-input",Object.assign({class:c.classes.NameInputStyle,exportparts:"label: input-label, base: input-base",value:(s=r.user)===null||s===void 0?void 0:s.firstName,onInput:o.onChange,label:n.firstnametext,disabled:r.loading},(m===null||m===void 0?void 0:m.firstName)&&(m===null||m===void 0?void 0:m.firstName.status)!=="valid"?{class:"ErrorStyles",helpText:n.fieldEmptyText}:[],{id:"firstName",name:"firstName",error:(m===null||m===void 0?void 0:m.firstName)&&(m===null||m===void 0?void 0:m.firstName.status)!=="valid"?m===null||m===void 0?void 0:m.firstName.message:undefined})),h("sl-input",Object.assign({class:c.classes.NameInputStyle,exportparts:"label: input-label, base: input-base",value:(i=r.user)===null||i===void 0?void 0:i.lastName,onInput:o.onChange,label:n.lastnametext,disabled:r.loading,id:"lastName",name:"lastName"},(m===null||m===void 0?void 0:m.lastName)&&(m===null||m===void 0?void 0:m.lastName.status)!=="valid"?{class:"ErrorStyles",helpText:n.fieldEmptyText}:[],{error:(m===null||m===void 0?void 0:m.lastName)&&(m===null||m===void 0?void 0:m.lastName.status)!=="valid"?m===null||m===void 0?void 0:m.lastName.message:undefined}))),h("sl-input",{label:n.emailtext,value:(l=r.user)===null||l===void 0?void 0:l.email,exportparts:"label: input-label, base: input-base",disabled:true}),r.showCountry&&h("sl-input",{label:n.countrytext,value:b,exportparts:"label: input-label, base: input-base",disabled:true}),h("sl-button",{type:"primary",exportparts:"base: primarybutton-base",loading:r.loading,disabled:r.submitDisabled,onClick:function(e){o.onSubmit(e)},submit:true},n.submitChangeButtonText)))}export{PortalProfileView as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-38ad4957.js";import"./global-39f55ec2.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-50442785.js";import{d as dist,J,w as wn,$ as $e,i as isDemo}from"./index.module-cede12c6.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import"./sqm-text-span-view-738acfb3.js";import{P as PortalProfileView}from"./sqm-portal-profile-view-a6be8558.js";import{i as isEmpty}from"./utilities-c9e730ed.js";var GET_USER=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query {\n viewer {\n ... on User {\n id\n accountId\n firstName\n lastName\n email\n countryCode\n }\n }\n }\n"],["\n query {\n viewer {\n ... on User {\n id\n accountId\n firstName\n lastName\n email\n countryCode\n }\n }\n }\n"])));var UPSERT_USER=dist.gql(templateObject_2||(templateObject_2=__makeTemplateObject(["\n mutation (\n $id: String!\n $accountId: String!\n $firstName: String!\n $lastName: String!\n ) {\n upsertUser(\n userInput: {\n id: $id\n accountId: $accountId\n firstName: $firstName\n lastName: $lastName\n }\n ) {\n firstName\n lastName\n }\n }\n"],["\n mutation (\n $id: String!\n $accountId: String!\n $firstName: String!\n $lastName: String!\n ) {\n upsertUser(\n userInput: {\n id: $id\n accountId: $accountId\n firstName: $firstName\n lastName: $lastName\n }\n ) {\n firstName\n lastName\n }\n }\n"])));var defaultFormState={country:"",email:"",firstName:"",lastName:"",errors:{},error:""};function usePortalProfile(e){var t=J();var r=useState(false),i=r[0],n=r[1];var a=useState(undefined),s=a[0],o=a[1];var l=useState(defaultFormState),u=l[0],d=l[1];var m=wn(GET_USER,{},!(t===null||t===void 0?void 0:t.jwt));var f=$e(UPSERT_USER),c=f[0],v=f[1];useEffect((function(){if(v===null||v===void 0?void 0:v.loading)return;if(v===null||v===void 0?void 0:v.errors){d((function(e){var t,r,i;return __assign(__assign({},e),{error:(i=(r=(t=v===null||v===void 0?void 0:v.errors)===null||t===void 0?void 0:t.response)===null||r===void 0?void 0:r.errors)===null||i===void 0?void 0:i[0].message})}))}else{o((function(e){var t;return __assign(__assign({},e),(t=v===null||v===void 0?void 0:v.data)===null||t===void 0?void 0:t.upsertUser)}));if(v===null||v===void 0?void 0:v.data)n(true)}}),[v===null||v===void 0?void 0:v.loading]);useEffect((function(){var e,t;o((function(e){var t;return __assign(__assign({},e),(t=m===null||m===void 0?void 0:m.data)===null||t===void 0?void 0:t.viewer)}));d(__assign(__assign(__assign({},defaultFormState),(e=m.data)===null||e===void 0?void 0:e.viewer),(t=v.data)===null||t===void 0?void 0:t.upsertUser))}),[m===null||m===void 0?void 0:m.data]);useEffect((function(){var t,r;if((t=v===null||v===void 0?void 0:v.errors)===null||t===void 0?void 0:t.message){d(__assign(__assign({},(r=m.data)===null||r===void 0?void 0:r.viewer),{error:e.networkRequestMessage}))}}),[v===null||v===void 0?void 0:v.errors]);var g=function(){n(false);if(u.firstName&&u.lastName){c({id:t===null||t===void 0?void 0:t.id,accountId:t===null||t===void 0?void 0:t.accountId,firstName:u.firstName,lastName:u.lastName});d((function(e){return __assign(__assign({},e),{errors:{},error:""})}));return}var r={};if(!u.firstName){r["firstName"]={message:e.fieldEmptyText}}if(!u.lastName){r["lastName"]={message:e.fieldEmptyText}}if(!isEmpty(r)){d((function(t){return __assign(__assign({},t),{error:e.formErrorText})}))}d((function(e){return __assign(__assign({},e),{errors:r})}))};return{states:{success:i,loading:(m===null||m===void 0?void 0:m.loading)||v.loading,submitDisabled:false,showCountry:!e.hideCountry,formState:u,user:s,text:{firstnametext:e.firstnametext,lastnametext:e.lastnametext,countrytext:e.countrytext,emailtext:e.emailtext,editProfileHeader:e.editProfileHeader,editProfileSubHeader:e.editProfileSubHeader,submitChangeButtonText:e.submitChangeButtonText}},callbacks:{onSubmit:g,onChange:function(e){var t=e.target,r=t.name,i=t.value;d((function(e){var t;return __assign(__assign({},e),(t={},t[r]=i,t))}))}}}}var PortalProfile=function(){function e(e){registerInstance(this,e);this.ignored=true;this.firstnametext="First Name";this.lastnametext="Last Name";this.emailtext="Email";this.countrytext="Country";this.editProfileHeader="Edit your profile";this.editProfileSubHeader="Personal Information";this.submitChangeButtonText="Submit Changes";this.hideCountry=false;this.networkRequestMessage="An error occurred while loading this page. Please refresh the page.";this.fieldEmptyText="Field is required";this.formErrorText="Please correct the errors below to update your profile.";this.submissionSuccessText="Your profile has been successfully updated.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalProfileDemo(getProps(this)):usePortalProfile(getProps(this));return h$1(PortalProfileView,Object.assign({},e))};return e}();function usePortalProfileDemo(e){return cjs({states:{success:false,loading:false,submitDisabled:false,showCountry:!e.hideCountry,user:{id:"01",accountId:"111100000",firstName:"Joe",lastName:"Smith",email:"jsmith@gmail.com",countryCode:"CA"},text:{firstnametext:e.firstnametext,lastnametext:e.lastnametext,emailtext:e.emailtext,countrytext:e.countrytext,editProfileHeader:e.editProfileHeader,editProfileSubHeader:e.editProfileSubHeader,submitChangeButtonText:e.submitChangeButtonText,submissionSuccessText:e.submissionSuccessText,fieldEmptyText:e.fieldEmptyText},formState:{country:"Canada",firstName:"Joe",lastName:"Smith",errors:null,error:""}},callbacks:{onSubmit:function(e){return console.log(e)},onChange:function(e){return console.log(e)}}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{PortalProfile as sqm_portal_profile};var templateObject_1,templateObject_2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h as h$1,c as Host}from"./index-38ad4957.js";import{f as useEffect,n as h}from"./dom-context-hooks.module-50442785.js";import{J,k as kn,j as jn,i as isDemo}from"./index.module-
|
|
1
|
+
import{r as registerInstance,h as h$1,c as Host}from"./index-38ad4957.js";import{f as useEffect,n as h}from"./dom-context-hooks.module-50442785.js";import{J,k as kn,j as jn,i as isDemo}from"./index.module-cede12c6.js";function usePortalProtectedRoute(e){var t=e.requireEmailVerification,r=e.redirectTo,o=e.redirectToUnverified;var i;var n=J();var a=!!(n===null||n===void 0?void 0:n.jwt);var s=(i=n===null||n===void 0?void 0:n.managedIdentity)===null||i===void 0?void 0:i.emailVerified;var u=kn(),c=u.pathname,d=u.search;var l=new URLSearchParams;l.append("nextPage",""+c+d);useEffect((function(){if(!a){return jn.push({pathname:r,search:"?"+l.toString()})}if(t&&!s){return jn.push({pathname:o||r,search:"?"+l.toString()})}}),[]);return!!n}var PortalProtectedRoute=function(){function e(e){registerInstance(this,e);this.ignored=true;this.redirectTo="/";this.requireEmailVerification=false;this.redirectToUnverified="/emailVerification";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalProtectedRouteDemo():usePortalProtectedRoute(this);return h$1(Host,{style:{display:e?"contents":"none"}},h$1("slot",null))};return e}();function usePortalProtectedRouteDemo(e){return true}export{PortalProtectedRoute as sqm_portal_protected_route};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,r,t,s){function o(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function n(e){try{d(s.next(e))}catch(e){a(e)}}function i(e){try{d(s["throw"](e))}catch(e){a(e)}}function d(e){e.done?t(e.value):o(e.value).then(n,i)}d((s=s.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,o,a,n;return n={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function i(e){return function(r){return d([e,r])}}function d(n){if(s)throw new TypeError("Generator is already executing.");while(t)try{if(s=1,o&&(a=n[0]&2?o["return"]:n[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;if(o=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:t.label++;return{value:n[1],done:false};case 5:t.label++;o=n[1];n=[0];continue;case 7:n=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){t=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){t.label=n[1];break}if(n[0]===6&&t.label<a[1]){t.label=a[1];a=n;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(n);break}if(a[2])t.ops.pop();t.trys.pop();continue}n=r.call(e,t)}catch(e){n=[6,e];o=0}finally{s=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-38ad4957.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-50442785.js";import{o as Je,T as Te,j as jn,i as isDemo}from"./index.module-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,r,t,s){function o(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function n(e){try{d(s.next(e))}catch(e){a(e)}}function i(e){try{d(s["throw"](e))}catch(e){a(e)}}function d(e){e.done?t(e.value):o(e.value).then(n,i)}d((s=s.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,o,a,n;return n={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function i(e){return function(r){return d([e,r])}}function d(n){if(s)throw new TypeError("Generator is already executing.");while(t)try{if(s=1,o&&(a=n[0]&2?o["return"]:n[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;if(o=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:t.label++;return{value:n[1],done:false};case 5:t.label++;o=n[1];n=[0];continue;case 7:n=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){t=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){t.label=n[1];break}if(n[0]===6&&t.label<a[1]){t.label=a[1];a=n;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(n);break}if(a[2])t.ops.pop();t.trys.pop();continue}n=r.call(e,t)}catch(e){n=[6,e];o=0}finally{s=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-38ad4957.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-50442785.js";import{o as Je,T as Te,j as jn,i as isDemo}from"./index.module-cede12c6.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-738acfb3.js";import{P as PortalResetPasswordView}from"./sqm-portal-reset-password-view-cfbc0eb0.js";function usePortalResetPassword(e){var r=this;var t,s,o,a,n,i,d,c,u,l;var f=useState(false),w=f[0],h=f[1];var m=useState(""),p=m[0],x=m[1];var v=Je(),T=v[0],P=v[1];var b=Te(),g=b[0],E=b[1];var y=new URLSearchParams(jn.location.search);var R=y.get("oobCode");y.delete("oobCode");var _=y.get("nextPage");var j=function(){return __awaiter(r,void 0,void 0,(function(){var r;return __generator(this,(function(t){switch(t.label){case 0:return[4,T({oobCode:R})];case 1:r=t.sent();if(r instanceof Error){x(e.networkErrorMessage)}return[2]}}))}))};useEffect((function(){j()}),[]);var M=function(t){return __awaiter(r,void 0,void 0,(function(){var r,s,o;return __generator(this,(function(a){switch(a.label){case 0:x("");r=t.detail.formData;r===null||r===void 0?void 0:r.forEach((function(e,t){jsonpointer.set(r,t,e)}));s={oobCode:R,password:r.password};if(r.password!==r.confirmPassword){x(e.passwordMismatchText);return[2]}return[4,g(s)];case 1:o=a.sent();if(o instanceof Error){return[2,x(e.networkErrorMessage)]}if(o.resetManagedIdentityPassword){h(true);setTimeout((function(){k()}),5e3)}return[2]}}))}))};var k=function(){y.delete("nextPage");var r=sanitizeUrlPath(_||e.nextPage);jn.push(r.href)};var q=function(){jn.push({pathname:e.failedPage,search:y.toString()&&"?"+y.toString()})};return{states:{loading:E.loading,reset:w,confirmPassword:e.confirmPassword,error:((n=(a=(o=(s=(t=E.errors)===null||t===void 0?void 0:t.response)===null||s===void 0?void 0:s.errors)===null||o===void 0?void 0:o[0])===null||a===void 0?void 0:a.extensions)===null||n===void 0?void 0:n.message)||((u=(c=(d=(i=E.errors)===null||i===void 0?void 0:i.response)===null||d===void 0?void 0:d.errors)===null||c===void 0?void 0:c[0])===null||u===void 0?void 0:u.message)||p,oobCodeValidating:P.loading,oobCodeValid:(l=P.data)===null||l===void 0?void 0:l.verifyManagedIdentityPasswordResetCode.success,content:{passwordResetHeader:e.passwordResetHeader,resetPasswordHeader:e.resetPasswordHeader,continueButtonText:e.continueButtonText,resetPasswordButtonText:e.resetPasswordButtonText,confirmPasswordFieldLabel:e.confirmPasswordFieldLabel,passwordFieldLabel:e.passwordFieldLabel,meetsRequirementsText:e.meetsRequirementsText,doesNotMeetRequirementsText:e.doesNotMeetRequirementsText,minErrorText:e.minErrorText,uppercaseErrorText:e.uppercaseErrorText,lowercaseErrorText:e.lowercaseErrorText,hasErrorText:e.hasErrorText,passwordMismatchText:e.passwordMismatchText,codeInvalidText:e.codeInvalidText,resetSuccessText:e.resetSuccessText}},callbacks:{submit:M,failed:q,gotoNextPage:k}}}var PortalResetPassword=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.failedPage="/";this.confirmPassword=false;this.resetPasswordHeader="Reset your password";this.passwordResetHeader="Password reset";this.resetPasswordButtonText="Reset Password";this.continueButtonText="Continue";this.confirmPasswordFieldLabel="Confirm Password";this.passwordFieldLabel="New Password";this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";this.passwordMismatchText="Passwords do not match.";this.codeInvalidText="The password reset code is invalid or has expired, please try again.";this.resetSuccessText="Your password has been reset and you are being redirected. If you are not redirected, please click Continue.";this.networkErrorMessage="An error occurred while resetting your password. Please refresh the page and try again.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalResetPasswordDemo(this):usePortalResetPassword(this),r=e.states,t=e.callbacks;return h$1(PortalResetPasswordView,{states:r,callbacks:t})};return e}();function usePortalResetPasswordDemo(e){var r=this;return cjs({states:{error:"",loading:false,reset:false,confirmPassword:e.confirmPassword,oobCodeValidating:false,oobCodeValid:true,content:{passwordResetHeader:e.passwordResetHeader,resetPasswordHeader:e.resetPasswordHeader,continueButtonText:e.continueButtonText,resetPasswordButtonText:e.resetPasswordButtonText,confirmPasswordFieldLabel:e.confirmPasswordFieldLabel,passwordFieldLabel:e.passwordFieldLabel,meetsRequirementsText:e.meetsRequirementsText,doesNotMeetRequirementsText:e.doesNotMeetRequirementsText,minErrorText:e.minErrorText,uppercaseErrorText:e.uppercaseErrorText,lowercaseErrorText:e.lowercaseErrorText,hasErrorText:e.hasErrorText,passwordMismatchText:e.passwordMismatchText,codeInvalidText:e.codeInvalidText,resetSuccessText:e.resetSuccessText}},callbacks:{submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},failed:function(){},gotoNextPage:function(){}}},e.demoData||{},{arrayMerge:function(e,r){return r}})}export{PortalResetPassword as sqm_portal_reset_password};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++){t=arguments[r];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};import{h}from"./index-38ad4957.js";import{j as jn}from"./index.module-
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++){t=arguments[r];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};import{h}from"./index-38ad4957.js";import{j as jn}from"./index.module-cede12c6.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{A as AuthWrapper,a as AuthColumn,b as AuthButtonsContainer,H as HostBlock,E as ErrorStyles}from"./mixins-f750863a.js";import{T as TextSpanView}from"./sqm-text-span-view-738acfb3.js";var vanillaStyle="\n:host {\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n";function PortalForgotPasswordView(e){var t=e.states,r=e.callbacks,s=e.content;var a={FormWrapper:__assign(__assign({},AuthWrapper),{background:s.backgroundColor||"var(--sqm-portal-background)",borderRadius:s.borderRadius||"var(--sqm-border-radius-normal)",border:s.border||"var(--sqm-border-thickness) solid var(--sqm-border-color)"}),Column:__assign({},AuthColumn),ButtonsContainer:AuthButtonsContainer,SecondaryButton:{margin:"auto",display:"block",cursor:"pointer"}};var o=createStyleSheet(a);var i=o.toString();return h("div",{class:o.classes.FormWrapper,part:"sqm-base"},h("style",{type:"text/css"},vanillaStyle,i),h(TextSpanView,{type:"h3"},s.messageSlot),h("sl-form",{class:o.classes.Column,"onSl-submit":r.submit},e.states.error&&h("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},h("div",{part:"erroralert-text"},e.states.error)),e.states.success&&h("sqm-form-message",{type:"success",exportparts:"successalert-icon"},h("div",{part:"successalert-text"},s.successAlertText)),h("sl-input",{exportparts:"label: input-label, base: input-base",type:"email",name:"/email",label:s.emailLabel||"Email",disabled:t.loading,required:true}),h("div",{class:o.classes.ButtonsContainer},h("sl-button",{submit:true,loading:t.loading,exportparts:"base: primarybutton-base",type:"primary"},s.submitLabel||"Reset Password"),h("sl-button",{type:"secondary",exportparts:"base: secondarybutton-base",class:o.classes.SecondaryButton,disabled:t.loading,onClick:function(){return jn.push(t.loginPath)}},s.loginText))))}var style={Wrapper:AuthWrapper,Column:AuthColumn,ForgotButtonContainer:{display:"inline",cursor:"pointer","font-size":"13px","font-weight":"600",color:"var(--sqm-text-subdued)",margin:"0"},ButtonsContainer:__assign(__assign({},AuthButtonsContainer),{gap:"var(--sl-spacing-medium)","& > *":{margin:"0 !important"}})};var vanillaStyle$1="\n:host {\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n";var sheet=createStyleSheet(style);var styleString=sheet.toString();function PortalLoginView(e){var t=e.states,r=e.callbacks,s=e.content;return h("div",{class:sheet.classes.Wrapper,part:"sqm-base"},h("style",{type:"text/css"},vanillaStyle$1,styleString),h(TextSpanView,{type:"h3"},s.pageLabel),h("sl-form",{class:sheet.classes.Column,"onSl-submit":r.submit},e.states.error&&h("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},h("div",{part:"erroralert-text"},e.states.error)),h("sl-input",{exportparts:"label: input-label, base: input-base",type:"email",name:"/email",label:s.emailLabel||"Email",disabled:t.loading,required:true}),h("div",null,h("sl-input",{exportparts:"label: input-label, base: input-base",type:"password",name:"/password",label:s.passwordLabel||"Password",disabled:t.loading,required:true}),h("div",{class:sheet.classes.ForgotButtonContainer},s.forgotPasswordButton)),h("div",{class:sheet.classes.ButtonsContainer},h("sl-button",{submit:true,loading:t.loading,exportparts:"base: primarybutton-base",type:"primary"},s.submitLabel||"Login"),s.googleButton&&h("sl-menu-divider",null),s.googleButton,s.secondaryButton)))}var style$1={Wrapper:__assign(__assign({},AuthWrapper),{"max-width":"600px"}),Column:AuthColumn,HostBlock:HostBlock,":host":{margin:"0 auto",width:"100%"},ButtonsContainer:AuthButtonsContainer,ErrorStyle:ErrorStyles};var vanillaStyle$2="\nsqm-portal-register {\n margin: 0 auto;\n width: 100%;\n display: block;\n}\n\n:host{\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n";var sheet$1=createStyleSheet(style$1);var styleString$1=sheet$1.toString();function PortalRegisterView(e){var t,r,s,a,o,i,n,l,u,d,p,m,c;var b=e.states,v=e.refs,y=e.callbacks,g=e.content;if(b.error){window.scrollTo({top:0,left:0,behavior:"smooth"})}return h("div",{class:sheet$1.classes.Wrapper,part:"sqm-base"},h("style",{type:"text/css"},vanillaStyle$2,styleString$1),h(TextSpanView,{type:"h3"},g.pageLabel),h("sl-form",{class:sheet$1.classes.Column,"onSl-submit":y.submit,ref:function(e){return v.formRef.current=e},novalidate:true},b.error&&h("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},h("div",{part:"erroralert-text"},e.states.error)),g.formData,!b.hideInputs&&h("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"email",name:"/email",label:g.emailLabel||"Email",disabled:b.loading,required:true,validationError:function(e){var t=e.value;if(!t){return g.requiredFieldErrorMessage}if(!t.includes("@")){return g.invalidEmailErrorMessage}}},((r=(t=b.registrationFormState)===null||t===void 0?void 0:t.validationErrors)===null||r===void 0?void 0:r.email)?{class:sheet$1.classes.ErrorStyle,helpText:((a=(s=b.registrationFormState)===null||s===void 0?void 0:s.validationErrors)===null||a===void 0?void 0:a.email)||g.requiredFieldErrorMessage}:[])),!b.hideInputs&&h("sqm-password-field",{fieldLabel:g.passwordLabel,"disable-validation":b.disablePasswordValidation,meetsRequirementsText:g.meetsRequirementsText,doesNotMeetRequirementsText:g.doesNotMeetRequirementsText,minErrorText:g.minErrorText,uppercaseErrorText:g.uppercaseErrorText,lowercaseErrorText:g.lowercaseErrorText,hasErrorText:g.hasErrorText}),g.passwordField,!b.hideInputs&&b.confirmPassword&&h("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"password",name:"/confirmPassword",label:g.confirmPasswordLabel,disabled:b.loading||((o=b.registrationFormState)===null||o===void 0?void 0:o.disabled),required:true},((n=(i=b.registrationFormState)===null||i===void 0?void 0:i.initialData)===null||n===void 0?void 0:n.confirmPassword)?{value:(u=(l=b.registrationFormState)===null||l===void 0?void 0:l.initialData)===null||u===void 0?void 0:u.confirmPassword}:{},((p=(d=b.registrationFormState)===null||d===void 0?void 0:d.validationErrors)===null||p===void 0?void 0:p.confirmPassword)?{class:sheet$1.classes.ErrorStyle,helpText:((c=(m=b.registrationFormState)===null||m===void 0?void 0:m.validationErrors)===null||c===void 0?void 0:c.confirmPassword)||g.requiredFieldErrorMessage}:[])),g.terms,h("div",{class:sheet$1.classes.ButtonsContainer},h("sl-button",{submit:true,loading:b.loading,exportparts:"base: primarybutton-base",type:"primary"},g.submitLabel||"Register"),g.secondaryButton)))}var style$2={Wrapper:AuthWrapper,Column:AuthColumn,ContinueButton:{width:"100%"}};var vanillaStyle$3="\n:host {\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n";var sheet$2=createStyleSheet(style$2);var styleString$2=sheet$2.toString();function PortalVerifyEmailView(e){var t=e.states,r=e.data,s=e.callbacks,a=e.content;if(t.loading)return;if(t.success){return h("div",{class:sheet$2.classes.Wrapper,part:"sqm-base"},h("style",{type:"text/css"},vanillaStyle$3,styleString$2),h(TextSpanView,{type:"h3"},a.verifyEmailText),h("sqm-form-message",{exportparts:"success-icon"},h("div",{part:"successalert-text"},a.verifySuccessText)),h("sl-button",{class:sheet$2.classes.ContinueButton,onClick:s.gotoNextPage,loading:t.loading,exportparts:"base: primarybutton-base",type:"primary"},a.continueText))}if(t.error||!r.oobCode){return h("div",{class:sheet$2.classes.Wrapper,part:"sqm-base"},h("style",{type:"text/css"},styleString$2),h(TextSpanView,{type:"h3"},a.verifyEmailText),h("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},h("div",{part:"erroralert-text"},a.verifyInvalidText)),h("sl-button",{class:sheet$2.classes.ContinueButton,onClick:s.failed,disabled:t.loading,exportparts:"base: primarybutton-base",type:"primary"},a.continueText))}}export{PortalForgotPasswordView as P,PortalLoginView as a,PortalRegisterView as b,PortalVerifyEmailView as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return c([e,t])}}function c(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(a=i[0]&2?o["return"]:i[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;if(o=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;o=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){n.label=i[1];break}if(i[0]===6&&n.label<a[1]){n.label=a[1];a=i;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(i);break}if(a[2])n.ops.pop();n.trys.pop();continue}i=t.call(e,n)}catch(e){i=[6,e];o=0}finally{r=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-38ad4957.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-50442785.js";import{d as dist,H,J,B,F as Fn,w as wn,$ as $e,i as isDemo}from"./index.module-
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return c([e,t])}}function c(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(a=i[0]&2?o["return"]:i[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;if(o=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;o=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){n.label=i[1];break}if(i[0]===6&&n.label<a[1]){n.label=a[1];a=i;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(i);break}if(a[2])n.ops.pop();n.trys.pop();continue}i=t.call(e,n)}catch(e){i=[6,e];o=0}finally{r=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-38ad4957.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-50442785.js";import{d as dist,H,J,B,F as Fn,w as wn,$ as $e,i as isDemo}from"./index.module-cede12c6.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import{a as REFERRAL_CODES_NAMESPACE}from"./useReferralCodes-3cde72d4.js";import"./ErrorView-74cb3af8.js";import{Q as QrCodeView}from"./sqm-qr-code-view-ce476721.js";var ShareLinkQuery=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query shareLink($programId: ID, $engagementMedium: UserEngagementMedium!) {\n user: viewer {\n ... on User {\n shareLink(\n programId: $programId\n engagementMedium: $engagementMedium\n shareMedium: DIRECT\n )\n }\n }\n }\n"],["\n query shareLink($programId: ID, $engagementMedium: UserEngagementMedium!) {\n user: viewer {\n ... on User {\n shareLink(\n programId: $programId\n engagementMedium: $engagementMedium\n shareMedium: DIRECT\n )\n }\n }\n }\n"])));var WIDGET_ENGAGEMENT_EVENT=dist.gql(templateObject_2||(templateObject_2=__makeTemplateObject(["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"],["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"])));function useQRCode(e){var t=this;var n;var r=H();var o=J();var a=B();var i=Fn(REFERRAL_CODES_NAMESPACE);var s=useState(null),c=s[0],u=s[1];var d=useState(false),l=d[0],f=d[1];var m=useState(false),v=m[0],h=m[1];var g=wn(ShareLinkQuery,{programId:r,engagementMedium:a},!(o===null||o===void 0?void 0:o.jwt)||(i===null||i===void 0?void 0:i.shareLink)!==undefined),p=g.data,_=g.errors,w=g.loading;var b=$e(WIDGET_ENGAGEMENT_EVENT)[0];var E=(n=p===null||p===void 0?void 0:p.user)===null||n===void 0?void 0:n.shareLink;var C=E+"?qrCode";var y=w||v;useEffect((function(){if(!E)return;var e=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){u(E+"?qrCode&qrCodeImageFormat=svg&qrCodeQuietZoneSize=0");return[2]}))}))};e()}),[E]);var T=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){b({eventMeta:{programId:r,id:o===null||o===void 0?void 0:o.id,accountId:o===null||o===void 0?void 0:o.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:a,shareMedium:"DIRECT"}}});return[2]}))}))};var R=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,n,r,o;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);return[4,fetch(C+"&qrCodeSize=800&qrCodeImageFormat=png")];case 1:e=a.sent();return[4,e.blob()];case 2:t=a.sent();n=URL.createObjectURL(t);if(t)T();r=document.createElement("a");r.href=n;r.download="qrCode.png";document.body.appendChild(r);r.click();document.body.removeChild(r);return[3,4];case 3:o=a.sent();console.error("Failed to fetch QR code:",o);f(true);return[3,4];case 4:return[2]}}))}))};var j=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,n,r,o,a;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,fetch(C+"&qrCodeSize=1000&qrCodeImageFormat=png&qrCodeErrorCorrectionLevel=H")];case 1:e=i.sent();return[4,e.blob()];case 2:t=i.sent();n=URL.createObjectURL(t);if(t)T();r=window.open("about:blank","_new");o=r.document.createElement("img");o.src=n;o.onload=function(){r.print();r.close()};r.document.body.appendChild(o);return[3,4];case 3:a=i.sent();console.error("Failed to fetch QR code: ",a);f(true);return[3,4];case 4:return[2]}}))}))};return __assign(__assign({},e),{loading:y,qrLink:c,error:l,createDownloadable:R,createPrintable:j})}var QrCode=function(){function e(e){registerInstance(this,e);this.titleText="Share your QR code";this.viewCodeText="View QR code";this.downloadCodeText="Download";this.printCodeText="Print";this.errorHeaderText="There was an error loading your QR code";this.errorDescriptionText="Please refresh this page and try again";this.hideTitle=false;this.alignment="center";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoQRCode(e):useQRCode(e);return h$1(QrCodeView,Object.assign({},t))};return e}();function useDemoQRCode(e){var t=this;var n=useState(false),r=n[0],o=n[1];return cjs({dialogIsOpen:r,hideTitle:e.hideTitle,showDialog:function(){return o(true)},hideDialog:function(){return o(false)},loading:true,titleText:e.titleText,viewCodeText:e.viewCodeText,downloadCodeText:e.downloadCodeText,printCodeText:e.printCodeText,alignment:e.alignment,qrLink:"https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",fireViewQrEvent:function(){console.log("View QR Code clicked")},createDownloadable:function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){console.log("Download QR Code clicked");return[2]}))}))},createPrintable:function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){console.log("Print QR Code clicked");return[2]}))}))}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{QrCode as sqm_qr_code};var templateObject_1,templateObject_2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function l(e){try{o(a.next(e))}catch(e){i(e)}}function s(e){try{o(a["throw"](e))}catch(e){i(e)}}function o(e){e.done?r(e.value):n(e.value).then(l,s)}o((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return o([e,t])}}function o(l){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,n&&(i=l[0]&2?n["return"]:l[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;if(n=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:r.label++;return{value:l[1],done:false};case 5:r.label++;n=l[1];l=[0];continue;case 7:l=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(l[0]===6&&r.label<i[1]){r.label=i[1];i=l;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(l);break}if(i[2])r.ops.pop();r.trys.pop();continue}l=t.call(e,r)}catch(e){l=[6,e];n=0}finally{a=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var a=Array(e),n=0,t=0;t<r;t++)for(var i=arguments[t],l=0,s=i.length;l<s;l++,n++)a[n]=i[l];return a};import{r as registerInstance,h as h$1,g as getElement,c as Host}from"./index-38ad4957.js";import{i as intl}from"./global-b2ee3a12.js";import{n as h,j as useReducer,u as useMemo,f as useEffect}from"./dom-context-hooks.module-50442785.js";import{i as isDemo}from"./index.module-e266b4d7.js";import{c as cjs}from"./cjs-bdfb4486.js";import{l as luxonLocale}from"./utils-334c1e34.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import{T as TextSpanView}from"./sqm-text-span-view-738acfb3.js";import{G as GenericTableView}from"./GenericTableView-8c72ac30.js";import{a as useRequestRerender,u as useRerenderListener}from"./re-render-4f4bd4da.js";import{u as useChildElements}from"./useChildElements-31ba3daf.js";import{l as luxon}from"./luxon-1be92a8e.js";import{g as getPaypalMeta}from"./mockRewardData-9b27d6f1.js";import{u as useReferralTable,t as tryMethod}from"./useReferralTable-456931fd.js";var mockReferralData=function(e){if(e===void 0){e=4}var t=__spreadArrays(Array(e)).map((function(){return getMockData()}));return{totalCount:6,count:e,referredByReferral:{dateConverted:null,dateReferralStarted:1643912659850,referrerUser:{firstName:"John",lastName:"Snow",rewards:[]}},data:t}};var statuses=[["AVAILABLE"],["PENDING"],["CANCELLED"],["EXPIRED"],["REDEEMED"]];var firstNames=["Rajesh","Pierre","Ji-Ho","Chinua","Charleston","Sally","Gael","Jill","Jane","Khadija"];var lastNames=["Smith","Parker","Kent","Chew","Stark","Banner","Jones","Odinson","Pym","Rogers"];var getMockData=function(){return{id:"5cae6b0fcc540e209db45b53",referredUser:{id:"5cae6b0ce4b0d81c67b78e82",accountId:"SPX1MZBIPTFL3E1H",firstName:firstNames[Math.floor(Math.random()*firstNames.length)],lastName:lastNames[Math.floor(Math.random()*lastNames.length)],email:"example.uexwltgh@mailosaur.io",programGoals:[]},shareLinkUsed:null,referralCodeUsed:"JIMBONEUTRON2",moderationStatus:"PENDING",dateConverted:Math.floor(Math.random()*10)>=5?luxon.DateTime.now().minus({days:6}).toMillis():null,dateFraudChecksCompleted:null,dateModerated:1558730033306,dateModified:1554934543447,dateReferralEnded:null,dateReferralPaid:null,dateReferralStarted:luxon.DateTime.now().minus({days:8}).toMillis(),dateUserModified:null,programId:"sam-partner-test-2",program:{id:"sam-partner-test-2",name:"Partner Program 2.0"},rewards:Math.floor(Math.random()*10)>=5?[{id:"5cae6b16cc540e209db45cfa",type:"CREDIT",value:1,unit:"POINT",name:"Partner Reward",dateGiven:1554934550726,dateExpires:null,dateCancelled:null,dateRedeemed:1637004373582,dateScheduledFor:null,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:"1 Point",statuses:statuses[Math.floor(Math.random()*statuses.length)],globalRewardKey:null,programRewardKey:"partnerReward",meta:__assign({},getPaypalMeta()),rewardRedemptionTransactions:{data:[{exchangedRewards:{data:[{prettyValue:"CAD10.00 Visa* Prepaid Card CAD",type:"INTEGRATION",fuelTankCode:null,globalRewardKey:"gc1"}]}}]}}]:[],childNodes:{data:[{data:{id:"5cae6b16cc540e209db45cb3",statuses:statuses[Math.floor(Math.random()*statuses.length)],type:"PCT_DISCOUNT",value:50},depth:1},{data:{id:"5cae6b16cc540e209db45cfa",statuses:statuses[Math.floor(Math.random()*statuses.length)],type:"CREDIT",value:1},depth:1}]}}};var ReferralTable=function(){function e(e){registerInstance(this,e);this.perPage=4;this.hideLabels=false;this.prevLabel="Prev";this.moreLabel="Next";this.showReferrer=false;this.hiddenColumns="0";this.smBreakpoint=599;this.mdBreakpoint=799;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=h$1(EmptySlot,null);var t=h$1(LoadingSlot,null);var r=isDemo()?useReferralTableDemo(this,e,t):useReferralTable(this,e,t),a=r.states,n=r.data,i=r.callbacks,l=r.elements;useRequestRerender([this.showReferrer,this.perPage]);return h$1(GenericTableView,{states:a,data:n,callbacks:i,elements:l})};return e}();function EmptySlot(){return h$1("slot",{name:"empty"},h$1("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/empty_referral2.png","empty-state-header":"View your referral details","empty-state-text":"Refer a friend to view the status of your referrals and rewards earned"}))}function LoadingSlot(){return h$1("slot",{name:"loading"},h$1(LoadingRow,null),h$1(LoadingRow,null),h$1(LoadingRow,null),h$1(LoadingRow,null))}function LoadingRow(){return h$1("sqm-table-row",null,h$1("sqm-table-cell",{colspan:5},h$1("sqm-skeleton",null)))}function useReferralTableDemo(e,t,r){var a=useReducer((function(e,t){return __assign(__assign({},e),t)}),{columns:[],rows:[],loading:false,page:0}),n=a[0],i=a[1];var l=useRerenderListener();var s=useMemo((function(){var t;return((t=e.demoData)===null||t===void 0?void 0:t.mockData)||mockReferralData(e.perPage)}),[e.perPage]);var o=useChildElements();function d(t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,l,o,d,u,c,f,h,p,v,m,E;var g=this;return __generator(this,(function(T){switch(T.label){case 0:n=s===null||s===void 0?void 0:s.referredByReferral;l=e.showReferrer&&!!((r=s===null||s===void 0?void 0:s.referredByReferral)===null||r===void 0?void 0:r.dateReferralStarted);if(l){a=s.data.slice(0,e.perPage-1)}else{a=s.data.slice(0,e.perPage)}o=t.filter((function(e){var t,r;return e.slot!=="loading"&&e.slot!=="empty"&&((t=e===null||e===void 0?void 0:e.firstElementChild)===null||t===void 0?void 0:t.getAttribute("slot"))!=="loading"&&((r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot"))!=="empty"}));d=o===null||o===void 0?void 0:o.map((function(e,t){return __awaiter(g,void 0,void 0,(function(){var r,a,n;return __generator(this,(function(i){a=(r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot");if(e.tagName==="RAISINS-PLOP-TARGET"&&a!=="loading"&&a!=="empty"){e.setAttribute("slot","column-"+t);e.style.position="absolute";n=e.firstElementChild.childNodes[1];n.innerHTML="+";n.style.lineHeight="20px";return[2,tryMethod(e,(function(){return e.renderLabel(t)}))]}return[2,tryMethod(e,(function(){return e.renderLabel()}))]}))}))}));if(!l)return[3,2];c=o===null||o===void 0?void 0:o.map((function(e){return __awaiter(g,void 0,void 0,(function(){return __generator(this,(function(t){return[2,tryMethod(e,(function t(){return e.renderCell(n,e)}))]}))}))}));return[4,Promise.all(c)];case 1:u=T.sent();T.label=2;case 2:f=a===null||a===void 0?void 0:a.map((function(e){return __awaiter(g,void 0,void 0,(function(){var t,r;var a=this;return __generator(this,(function(n){switch(n.label){case 0:t=o===null||o===void 0?void 0:o.map((function(t){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(r){return[2,tryMethod(t,(function(){return t.renderCell(e,undefined)}))]}))}))}));return[4,Promise.all(t)];case 1:r=n.sent();return[2,r]}}))}))}));p=f;if(!p)return[3,4];v=[[u]];return[4,Promise.all(f)];case 3:p=__spreadArrays.apply(void 0,v.concat([T.sent()])).filter((function(e){return e}));T.label=4;case 4:h=p;i({rows:h});E=d;if(!E)return[3,6];return[4,Promise.all(d)];case 5:E=T.sent();T.label=6;case 6:m=E;i({columns:m,loading:false,page:0});return[2]}}))}))}useEffect((function(){i({loading:true});(s===null||s===void 0?void 0:s.data)&&d(o)}),[s===null||s===void 0?void 0:s.data,o,l]);var u=cjs({states:{hasPrev:false,hasNext:false,loading:false,show:"rows"},callbacks:{prevPage:function(){return console.log("Prev")},nextPage:function(){return console.log("Next")}},data:{textOverrides:{showLabels:!e.hideLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},hiddenColumns:e.hiddenColumns,referralData:[],mdBreakpoint:799,smBreakpoint:599},elements:{columns:n.columns,rows:n.rows,emptyElement:t,loadingElement:r}},e.demoData||{},{arrayMerge:function(e,t){return t}});return u}var ReferralTableCell=function(){function e(e){registerInstance(this,e);this.ignored=true;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){return h$1("div",{innerHTML:this.innerTemplate})};return e}();var ReferralTableGenericColumn=function(){function e(e){registerInstance(this,e);h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,h$1("sqm-referral-table-cell",{"inner-template":getElement(this).innerHTML})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,Promise.resolve(this.columnTitle)]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle]);return h$1(Host,{style:{display:"none"}},h$1("slot",null))};return e}();var ReferralTableDateCell=function(){function e(e){registerInstance(this,e);this.ignored=true;this.locale="en";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e;var t=!this.date?"-":(e=luxon.DateTime.fromMillis(this.date))===null||e===void 0?void 0:e.setLocale(luxonLocale(this.locale)).toLocaleString(luxon.DateTime.DATE_MED);return t};return e}();var ReferralTableDateColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Date converted";this.dateShown="dateConverted";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,h$1("sqm-referral-table-date-cell",{date:e[this.dateShown],locale:t===null||t===void 0?void 0:t.locale})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,h$1("sqm-referral-table-date-cell",{date:e[this.dateShown]})]}))}))};e.prototype.render=function(){useRequestRerender([this.dateShown,this.columnTitle]);return h$1(Host,{style:{display:"none"}})};return e}();var ReferralTableRewardsCell=function(){function e(e){registerInstance(this,e);this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.pendingForText="{status} for {date}";this.locale="en"}e.prototype.render=function(){var e=this;var t;intl.locale=this.locale;var r={"@keyframes slideRight":{from:{opacity:0},to:{opacity:1}},DetailsContainer:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between","margin-right":"var(--sl-spacing-small)","flex-wrap":"wrap"},Details:{"max-width":"500px","&::part(header)":{padding:"var(--sl-spacing-x-small)",cursor:""+(this.hideDetails?"default":"pointer")},"&::part(content)":{padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)"},"&::part(base)":{border:"var(--sqm-border-thickness) solid var(--sqm-border-color)",opacity:"1"},"&::part(summary-icon)":{display:""+(this.hideDetails?"none":"flex")},"&::part(summary-icon[open])":{transform:"rotate(-90deg)"}},BadgeContainer:{"& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}},BoldText:{"font-weight":"var(--sl-font-weight-semibold)"},RedeemBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}};var a=createStyleSheet(r);var n=a.toString();var i=function(e){switch(e){case"primary":return a.classes.RedeemBadge;case"danger":return a.classes.DangerBadge;case"success":return a.classes.SuccessBadge;case"warning":case"info":return a.classes.WarningBadge;default:return a.classes.WarningBadge}};var l=function(e,t){var r,a,n,i,l,s,o,d,u,c,f,h;var p=["REDEEMED","CANCELLED","EXPIRED","PENDING","AVAILABLE","PENDING_REVIEW","DENIED","PAYOUT_APPROVED","PAYOUT_CANCELLED","PAYOUT_FAILED","PENDING_TAX_REVIEW","PENDING_NEW_TAX_FORM","PENDING_TAX_SUBMISSION","PENDING_PARTNER_CREATION","PROCESSING"];if(((a=(r=e.referral)===null||r===void 0?void 0:r.fraudData)===null||a===void 0?void 0:a.moderationStatus)!=="APPROVED"){if(((i=(n=e.referral)===null||n===void 0?void 0:n.fraudData)===null||i===void 0?void 0:i.moderationStatus)==="PENDING")return"PENDING_REVIEW";if(((s=(l=e.referral)===null||l===void 0?void 0:l.fraudData)===null||s===void 0?void 0:s.moderationStatus)==="DENIED")return"DENIED"}var v=(o=e.partnerFundsTransfer)===null||o===void 0?void 0:o.status;if(e.partnerFundsTransfer){if(v==="REVERSED")return"PAYOUT_CANCELLED";if(v==="OVERDUE")return"PAYOUT_FAILED";if(e.partnerFundsTransfer.dateScheduled&&e.partnerFundsTransfer.dateScheduled>Date.now()){return"PROCESSING"}if(v==="TRANSFERRED"||v==="NOT_YET_DUE"||e.partnerFundsTransfer.dateScheduled&&e.partnerFundsTransfer.dateScheduled<Date.now()&&v!=="OVERDUE"&&v!=="REVERSED")return"PAYOUT_APPROVED"}if((d=e===null||e===void 0?void 0:e.pendingReasons)===null||d===void 0?void 0:d.includes("US_TAX")){if(!(t===null||t===void 0?void 0:t.taxHandlingEnabled))return"PENDING";if(!(t===null||t===void 0?void 0:t.connected))return"PENDING_PARTNER_CREATION";if((u=t===null||t===void 0?void 0:t.publisher)===null||u===void 0?void 0:u.requiredTaxDocumentType){if(!((c=t===null||t===void 0?void 0:t.publisher)===null||c===void 0?void 0:c.currentTaxDocument))return"PENDING_TAX_SUBMISSION";var m=t.publisher.currentTaxDocument.status;if(m==="INACTIVE"||m==="INVALID_W9_ELECTRONIC_DOCUMENT"||m==="INVALID_W9_ELECTRONIC_DOCUMENT_CHECK_INTERNAL")return"PENDING_NEW_TAX_FORM";if(m==="NOT_VERIFIED")return"PENDING_TAX_REVIEW"}if(!((f=t===null||t===void 0?void 0:t.publisher)===null||f===void 0?void 0:f.withdrawalSettings))return"PENDING_PARTNER_CREATION"}if((h=e===null||e===void 0?void 0:e.pendingReasons)===null||h===void 0?void 0:h.includes("MISSING_PAYOUT_CONFIGURATION")){return"PENDING_PARTNER_CREATION"}if(e.statuses.length===1)return e.statuses[0];return p.find((function(t){return e.statuses.includes(t)&&t}))};var s=function(e){switch(e){case"REDEEMED":case"PAYOUT_APPROVED":return"primary";case"DENIED":case"EXPIRED":case"CANCELLED":case"PAYOUT_FAILED":case"PAYOUT_CANCELLED":return"danger";case"PENDING":case"PENDING_REVIEW":case"PENDING_TAX_REVIEW":case"PENDING_NEW_TAX_FORM":case"PENDING_TAX_SUBMISSION":case"PENDING_PARTNER_CREATION":case"PROCESSING":return"warning";case"AVAILABLE":return"success"}};var o=function(t){return luxon.DateTime.fromMillis(t).setLocale(luxonLocale(e.locale)).toRelative().replace("in","").trim()};return(t=this.rewards)===null||t===void 0?void 0:t.map((function(t){var r,d,u,c;var f=l(t,e.taxConnection);var h=s(f);var p=intl.formatMessage({id:"statusShortMessage",defaultMessage:e.statusText},{status:f});var v=intl.formatMessage({id:"statusLongMessage",defaultMessage:e.statusLongText},{status:f,scheduledPayoutDate:((r=t.partnerFundsTransfer)===null||r===void 0?void 0:r.dateScheduled)?(d=luxon.DateTime.fromMillis(t.partnerFundsTransfer.dateScheduled))===null||d===void 0?void 0:d.setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED):null});return h$1("sl-details",{class:a.classes.Details,disabled:e.hideDetails},h$1("style",{type:"text/css"},n),h$1("div",{slot:"summary",class:a.classes.DetailsContainer},h$1(TextSpanView,{type:"p"},h$1("span",{part:"sqm-cell-value",class:a.classes.BoldText},t.prettyValue)),h$1("div",{class:a.classes.BadgeContainer},f==="PENDING"&&t.dateScheduledFor?h$1("sl-badge",{class:i(h),type:h,pill:true},intl.formatMessage({id:"pendingForText",defaultMessage:e.pendingForText},{status:p,date:o(t.dateScheduledFor)})):h$1("sl-badge",{class:i(h),type:h,pill:true},p),t.dateExpires&&f==="AVAILABLE"&&h$1("sl-badge",{class:i(h),type:"info",pill:true},e.expiringText," "+o(t.dateExpires)))),h$1("div",null,f==="PENDING_REVIEW"&&((u=t.referral)===null||u===void 0?void 0:u.dateModerated)&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.referral.dateModerated).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),f==="PAYOUT_APPROVED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PROCESSING"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PAYOUT_FAILED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PAYOUT_CANCELLED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PENDING_TAX_REVIEW"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PENDING_NEW_TAX_FORM"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PENDING_TAX_SUBMISSION"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PENDING_PARTNER_CREATION"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="DENIED"&&((c=t.referral)===null||c===void 0?void 0:c.dateModerated)&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.referral.dateModerated).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)),".",e.deniedHelpText?" "+e.deniedHelpText:"")),t.dateGiven&&h$1("div",null,h$1(TextSpanView,{type:"p"},e.rewardReceivedText," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateGiven).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),f==="EXPIRED"&&t.dateExpires&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateExpires).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),f==="CANCELLED"&&t.dateCancelled&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateCancelled).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),f==="PENDING"&&t.dateScheduledFor&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateScheduledFor).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED))))," ",f==="AVAILABLE"&&t.dateExpires&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateExpires).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),t.fuelTankCode&&h$1("div",null,e.fuelTankText," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},t.fuelTankCode))))}))};return e}();var ReferralTableRewardsColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Rewards";this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.fuelTankText="Your code is";this.rewardReceivedText="Reward received on";this.expiringText="Expiring in";this.pendingForText="{status} for {date}";this.deniedHelpText="Contact support if you think this is a mistake.";this.hideDetails=false;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,h$1("sqm-referral-table-rewards-cell",{rewards:e.rewards,taxConnection:t===null||t===void 0?void 0:t.taxConnection,statusText:this.statusText,statusLongText:this.statusLongText,fuelTankText:this.fuelTankText,rewardReceivedText:this.rewardReceivedText,expiringText:this.expiringText,pendingForText:this.pendingForText,hideDetails:this.hideDetails,deniedHelpText:this.deniedHelpText,locale:t===null||t===void 0?void 0:t.locale,exportparts:"sqm-cell-value"})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,h$1("sqm-referral-table-rewards-cell",{rewards:e.rewards,exportparts:"sqm-cell-value"})]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle,this.statusText,this.statusLongText,this.fuelTankText,this.rewardReceivedText,this.expiringText,this.pendingForText,this.hideDetails]);return h$1(Host,{style:{display:"none"}})};return e}();var style={SubText:{fontSize:"var(--sl-font-size-small)",color:"var(--sqm-text-subdued)",margin:"0"},RedeemBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}};var sheet=createStyleSheet(style);var styleString=sheet.toString();var ReferralTableStatusCell=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){var e=this;var t=createStyleSheet(style);var r=t.toString();var a=function(t){if(t==="PENDING")return"warning";if(t==="DENIED")return"danger";if(e.converted)return"success";return"warning"};var n=function(e){switch(e){case"primary":return t.classes.RedeemBadge;case"danger":return t.classes.DangerBadge;case"success":return t.classes.SuccessBadge;case"warning":case"info":return t.classes.WarningBadge;default:return t.classes.WarningBadge}};return h$1("div",null,h$1("style",{type:"text/css"},r),h$1("sl-badge",{pill:true,type:a(this.fraudStatus),class:n(a(this.fraudStatus))},this.statusText),this.statusSubText?h$1("p",{class:t.classes.SubText},this.statusSubText):null)};return e}();var ReferralTableStatusColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Status";this.convertedStatusText="Converted";this.inProgressStatusText="In Progress";this.pendingReviewStatusText="Pending";this.deniedStatusText="Denied";this.pendingReviewStatusSubText="Awaiting review";this.deniedStatusSubText="Detected self-referral";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){n=(t=e===null||e===void 0?void 0:e.fraudData)===null||t===void 0?void 0:t.moderationStatus;if(n==="DENIED"){r=this.deniedStatusText;a=this.deniedStatusSubText}else if(n==="PENDING"){r=this.pendingReviewStatusText;a=this.pendingReviewStatusSubText}else{r=e.dateConverted?this.convertedStatusText:this.inProgressStatusText}return[2,h$1("sqm-referral-table-status-cell",{"status-text":r,"status-sub-text":a,"fraud-status":n,converted:e.dateConverted?true:false})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=e.dateConverted?this.convertedStatusText:this.inProgressStatusText;return[2,h$1("sqm-referral-table-status-cell",{"status-text":t,converted:e.dateConverted?true:false})]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle,this.convertedStatusText,this.inProgressStatusText]);return h$1(Host,{style:{display:"none"}})};return e}();var ReferralTableUserCell=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return this.name};return e}();var ReferralTableUserColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Customer";this.anonymousUser="Your Friend";this.deletedUser="Deleted User";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,l,s,o,d;return __generator(this,(function(u){if(!(e===null||e===void 0?void 0:e.referredUser)&&!(e===null||e===void 0?void 0:e.referrerUser)){d=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referredUser)===null||t===void 0?void 0:t.firstName)&&!((r=e===null||e===void 0?void 0:e.referredUser)===null||r===void 0?void 0:r.lastName)&&!((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)&&!((n=e===null||e===void 0?void 0:e.referrerUser)===null||n===void 0?void 0:n.lastName)){d=this.anonymousUser}else if(e===null||e===void 0?void 0:e.referrerUser){d=((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.firstName)+" "+((l=e===null||e===void 0?void 0:e.referrerUser)===null||l===void 0?void 0:l.lastName)}else{d=((s=e===null||e===void 0?void 0:e.referredUser)===null||s===void 0?void 0:s.firstName)+" "+((o=e===null||e===void 0?void 0:e.referredUser)===null||o===void 0?void 0:o.lastName)}return[2,h$1("sqm-referral-table-user-cell",{name:d})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(l){if(!e){i=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referrerUser)===null||t===void 0?void 0:t.firstName)&&!((r=e.referrerUser)===null||r===void 0?void 0:r.lastName)){i=this.anonymousUser}else{i=((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)+" "+((n=e===null||e===void 0?void 0:e.referrerUser)===null||n===void 0?void 0:n.lastName)}return[2,h$1("sqm-referral-table-user-cell",{name:i})]}))}))};e.prototype.render=function(){useRequestRerender([this.deletedUser,this.anonymousUser,this.columnTitle]);return h$1(Host,{style:{display:"none"}})};return e}();export{ReferralTable as sqm_referral_table,ReferralTableCell as sqm_referral_table_cell,ReferralTableGenericColumn as sqm_referral_table_column,ReferralTableDateCell as sqm_referral_table_date_cell,ReferralTableDateColumn as sqm_referral_table_date_column,ReferralTableRewardsCell as sqm_referral_table_rewards_cell,ReferralTableRewardsColumn as sqm_referral_table_rewards_column,ReferralTableStatusCell as sqm_referral_table_status_cell,ReferralTableStatusColumn as sqm_referral_table_status_column,ReferralTableUserCell as sqm_referral_table_user_cell,ReferralTableUserColumn as sqm_referral_table_user_column};
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function l(e){try{o(a.next(e))}catch(e){i(e)}}function s(e){try{o(a["throw"](e))}catch(e){i(e)}}function o(e){e.done?r(e.value):n(e.value).then(l,s)}o((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return o([e,t])}}function o(l){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,n&&(i=l[0]&2?n["return"]:l[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;if(n=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:r.label++;return{value:l[1],done:false};case 5:r.label++;n=l[1];l=[0];continue;case 7:l=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(l[0]===6&&r.label<i[1]){r.label=i[1];i=l;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(l);break}if(i[2])r.ops.pop();r.trys.pop();continue}l=t.call(e,r)}catch(e){l=[6,e];n=0}finally{a=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var a=Array(e),n=0,t=0;t<r;t++)for(var i=arguments[t],l=0,s=i.length;l<s;l++,n++)a[n]=i[l];return a};import{r as registerInstance,h as h$1,g as getElement,c as Host}from"./index-38ad4957.js";import{i as intl}from"./global-39f55ec2.js";import{n as h,j as useReducer,u as useMemo,f as useEffect}from"./dom-context-hooks.module-50442785.js";import{i as isDemo}from"./index.module-cede12c6.js";import{c as cjs}from"./cjs-bdfb4486.js";import{l as luxonLocale}from"./utils-334c1e34.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import{T as TextSpanView}from"./sqm-text-span-view-738acfb3.js";import{G as GenericTableView}from"./GenericTableView-8c72ac30.js";import{a as useRequestRerender,u as useRerenderListener}from"./re-render-7a0c7976.js";import{u as useChildElements}from"./useChildElements-c26d7347.js";import{l as luxon}from"./luxon-1be92a8e.js";import{g as getPaypalMeta}from"./mockRewardData-9b27d6f1.js";import{u as useReferralTable,t as tryMethod}from"./useReferralTable-35e6d4c1.js";var mockReferralData=function(e){if(e===void 0){e=4}var t=__spreadArrays(Array(e)).map((function(){return getMockData()}));return{totalCount:6,count:e,referredByReferral:{dateConverted:null,dateReferralStarted:1643912659850,referrerUser:{firstName:"John",lastName:"Snow",rewards:[]}},data:t}};var statuses=[["AVAILABLE"],["PENDING"],["CANCELLED"],["EXPIRED"],["REDEEMED"]];var firstNames=["Rajesh","Pierre","Ji-Ho","Chinua","Charleston","Sally","Gael","Jill","Jane","Khadija"];var lastNames=["Smith","Parker","Kent","Chew","Stark","Banner","Jones","Odinson","Pym","Rogers"];var getMockData=function(){return{id:"5cae6b0fcc540e209db45b53",referredUser:{id:"5cae6b0ce4b0d81c67b78e82",accountId:"SPX1MZBIPTFL3E1H",firstName:firstNames[Math.floor(Math.random()*firstNames.length)],lastName:lastNames[Math.floor(Math.random()*lastNames.length)],email:"example.uexwltgh@mailosaur.io",programGoals:[]},shareLinkUsed:null,referralCodeUsed:"JIMBONEUTRON2",moderationStatus:"PENDING",dateConverted:Math.floor(Math.random()*10)>=5?luxon.DateTime.now().minus({days:6}).toMillis():null,dateFraudChecksCompleted:null,dateModerated:1558730033306,dateModified:1554934543447,dateReferralEnded:null,dateReferralPaid:null,dateReferralStarted:luxon.DateTime.now().minus({days:8}).toMillis(),dateUserModified:null,programId:"sam-partner-test-2",program:{id:"sam-partner-test-2",name:"Partner Program 2.0"},rewards:Math.floor(Math.random()*10)>=5?[{id:"5cae6b16cc540e209db45cfa",type:"CREDIT",value:1,unit:"POINT",name:"Partner Reward",dateGiven:1554934550726,dateExpires:null,dateCancelled:null,dateRedeemed:1637004373582,dateScheduledFor:null,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:"1 Point",statuses:statuses[Math.floor(Math.random()*statuses.length)],globalRewardKey:null,programRewardKey:"partnerReward",meta:__assign({},getPaypalMeta()),rewardRedemptionTransactions:{data:[{exchangedRewards:{data:[{prettyValue:"CAD10.00 Visa* Prepaid Card CAD",type:"INTEGRATION",fuelTankCode:null,globalRewardKey:"gc1"}]}}]}}]:[],childNodes:{data:[{data:{id:"5cae6b16cc540e209db45cb3",statuses:statuses[Math.floor(Math.random()*statuses.length)],type:"PCT_DISCOUNT",value:50},depth:1},{data:{id:"5cae6b16cc540e209db45cfa",statuses:statuses[Math.floor(Math.random()*statuses.length)],type:"CREDIT",value:1},depth:1}]}}};var ReferralTable=function(){function e(e){registerInstance(this,e);this.perPage=4;this.hideLabels=false;this.prevLabel="Prev";this.moreLabel="Next";this.showReferrer=false;this.hiddenColumns="0";this.smBreakpoint=599;this.mdBreakpoint=799;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=h$1(EmptySlot,null);var t=h$1(LoadingSlot,null);var r=isDemo()?useReferralTableDemo(this,e,t):useReferralTable(this,e,t),a=r.states,n=r.data,i=r.callbacks,l=r.elements;useRequestRerender([this.showReferrer,this.perPage]);return h$1(GenericTableView,{states:a,data:n,callbacks:i,elements:l})};return e}();function EmptySlot(){return h$1("slot",{name:"empty"},h$1("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/empty_referral2.png","empty-state-header":"View your referral details","empty-state-text":"Refer a friend to view the status of your referrals and rewards earned"}))}function LoadingSlot(){return h$1("slot",{name:"loading"},h$1(LoadingRow,null),h$1(LoadingRow,null),h$1(LoadingRow,null),h$1(LoadingRow,null))}function LoadingRow(){return h$1("sqm-table-row",null,h$1("sqm-table-cell",{colspan:5},h$1("sqm-skeleton",null)))}function useReferralTableDemo(e,t,r){var a=useReducer((function(e,t){return __assign(__assign({},e),t)}),{columns:[],rows:[],loading:false,page:0}),n=a[0],i=a[1];var l=useRerenderListener();var s=useMemo((function(){var t;return((t=e.demoData)===null||t===void 0?void 0:t.mockData)||mockReferralData(e.perPage)}),[e.perPage]);var o=useChildElements();function d(t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,l,o,d,u,c,f,h,p,v,m,E;var g=this;return __generator(this,(function(T){switch(T.label){case 0:n=s===null||s===void 0?void 0:s.referredByReferral;l=e.showReferrer&&!!((r=s===null||s===void 0?void 0:s.referredByReferral)===null||r===void 0?void 0:r.dateReferralStarted);if(l){a=s.data.slice(0,e.perPage-1)}else{a=s.data.slice(0,e.perPage)}o=t.filter((function(e){var t,r;return e.slot!=="loading"&&e.slot!=="empty"&&((t=e===null||e===void 0?void 0:e.firstElementChild)===null||t===void 0?void 0:t.getAttribute("slot"))!=="loading"&&((r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot"))!=="empty"}));d=o===null||o===void 0?void 0:o.map((function(e,t){return __awaiter(g,void 0,void 0,(function(){var r,a,n;return __generator(this,(function(i){a=(r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot");if(e.tagName==="RAISINS-PLOP-TARGET"&&a!=="loading"&&a!=="empty"){e.setAttribute("slot","column-"+t);e.style.position="absolute";n=e.firstElementChild.childNodes[1];n.innerHTML="+";n.style.lineHeight="20px";return[2,tryMethod(e,(function(){return e.renderLabel(t)}))]}return[2,tryMethod(e,(function(){return e.renderLabel()}))]}))}))}));if(!l)return[3,2];c=o===null||o===void 0?void 0:o.map((function(e){return __awaiter(g,void 0,void 0,(function(){return __generator(this,(function(t){return[2,tryMethod(e,(function t(){return e.renderCell(n,e)}))]}))}))}));return[4,Promise.all(c)];case 1:u=T.sent();T.label=2;case 2:f=a===null||a===void 0?void 0:a.map((function(e){return __awaiter(g,void 0,void 0,(function(){var t,r;var a=this;return __generator(this,(function(n){switch(n.label){case 0:t=o===null||o===void 0?void 0:o.map((function(t){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(r){return[2,tryMethod(t,(function(){return t.renderCell(e,undefined)}))]}))}))}));return[4,Promise.all(t)];case 1:r=n.sent();return[2,r]}}))}))}));p=f;if(!p)return[3,4];v=[[u]];return[4,Promise.all(f)];case 3:p=__spreadArrays.apply(void 0,v.concat([T.sent()])).filter((function(e){return e}));T.label=4;case 4:h=p;i({rows:h});E=d;if(!E)return[3,6];return[4,Promise.all(d)];case 5:E=T.sent();T.label=6;case 6:m=E;i({columns:m,loading:false,page:0});return[2]}}))}))}useEffect((function(){i({loading:true});(s===null||s===void 0?void 0:s.data)&&d(o)}),[s===null||s===void 0?void 0:s.data,o,l]);var u=cjs({states:{hasPrev:false,hasNext:false,loading:false,show:"rows"},callbacks:{prevPage:function(){return console.log("Prev")},nextPage:function(){return console.log("Next")}},data:{textOverrides:{showLabels:!e.hideLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},hiddenColumns:e.hiddenColumns,referralData:[],mdBreakpoint:799,smBreakpoint:599},elements:{columns:n.columns,rows:n.rows,emptyElement:t,loadingElement:r}},e.demoData||{},{arrayMerge:function(e,t){return t}});return u}var ReferralTableCell=function(){function e(e){registerInstance(this,e);this.ignored=true;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){return h$1("div",{innerHTML:this.innerTemplate})};return e}();var ReferralTableGenericColumn=function(){function e(e){registerInstance(this,e);h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,h$1("sqm-referral-table-cell",{"inner-template":getElement(this).innerHTML})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,Promise.resolve(this.columnTitle)]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle]);return h$1(Host,{style:{display:"none"}},h$1("slot",null))};return e}();var ReferralTableDateCell=function(){function e(e){registerInstance(this,e);this.ignored=true;this.locale="en";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e;var t=!this.date?"-":(e=luxon.DateTime.fromMillis(this.date))===null||e===void 0?void 0:e.setLocale(luxonLocale(this.locale)).toLocaleString(luxon.DateTime.DATE_MED);return t};return e}();var ReferralTableDateColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Date converted";this.dateShown="dateConverted";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,h$1("sqm-referral-table-date-cell",{date:e[this.dateShown],locale:t===null||t===void 0?void 0:t.locale})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,h$1("sqm-referral-table-date-cell",{date:e[this.dateShown]})]}))}))};e.prototype.render=function(){useRequestRerender([this.dateShown,this.columnTitle]);return h$1(Host,{style:{display:"none"}})};return e}();var ReferralTableRewardsCell=function(){function e(e){registerInstance(this,e);this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.pendingForText="{status} for {date}";this.locale="en"}e.prototype.render=function(){var e=this;var t;intl.locale=this.locale;var r={"@keyframes slideRight":{from:{opacity:0},to:{opacity:1}},DetailsContainer:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between","margin-right":"var(--sl-spacing-small)","flex-wrap":"wrap"},Details:{"max-width":"500px","&::part(header)":{padding:"var(--sl-spacing-x-small)",cursor:""+(this.hideDetails?"default":"pointer")},"&::part(content)":{padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)"},"&::part(base)":{border:"var(--sqm-border-thickness) solid var(--sqm-border-color)",opacity:"1"},"&::part(summary-icon)":{display:""+(this.hideDetails?"none":"flex")},"&::part(summary-icon[open])":{transform:"rotate(-90deg)"}},BadgeContainer:{"& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}},BoldText:{"font-weight":"var(--sl-font-weight-semibold)"},RedeemBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}};var a=createStyleSheet(r);var n=a.toString();var i=function(e){switch(e){case"primary":return a.classes.RedeemBadge;case"danger":return a.classes.DangerBadge;case"success":return a.classes.SuccessBadge;case"warning":case"info":return a.classes.WarningBadge;default:return a.classes.WarningBadge}};var l=function(e,t){var r,a,n,i,l,s,o,d,u,c,f,h;var p=["REDEEMED","CANCELLED","EXPIRED","PENDING","AVAILABLE","PENDING_REVIEW","DENIED","PAYOUT_APPROVED","PAYOUT_CANCELLED","PAYOUT_FAILED","PENDING_TAX_REVIEW","PENDING_NEW_TAX_FORM","PENDING_TAX_SUBMISSION","PENDING_PARTNER_CREATION","PROCESSING"];if(((a=(r=e.referral)===null||r===void 0?void 0:r.fraudData)===null||a===void 0?void 0:a.moderationStatus)!=="APPROVED"){if(((i=(n=e.referral)===null||n===void 0?void 0:n.fraudData)===null||i===void 0?void 0:i.moderationStatus)==="PENDING")return"PENDING_REVIEW";if(((s=(l=e.referral)===null||l===void 0?void 0:l.fraudData)===null||s===void 0?void 0:s.moderationStatus)==="DENIED")return"DENIED"}var v=(o=e.partnerFundsTransfer)===null||o===void 0?void 0:o.status;if(e.partnerFundsTransfer){if(v==="REVERSED")return"PAYOUT_CANCELLED";if(v==="OVERDUE")return"PAYOUT_FAILED";if(e.partnerFundsTransfer.dateScheduled&&e.partnerFundsTransfer.dateScheduled>Date.now()){return"PROCESSING"}if(v==="TRANSFERRED"||v==="NOT_YET_DUE"||e.partnerFundsTransfer.dateScheduled&&e.partnerFundsTransfer.dateScheduled<Date.now()&&v!=="OVERDUE"&&v!=="REVERSED")return"PAYOUT_APPROVED"}if((d=e===null||e===void 0?void 0:e.pendingReasons)===null||d===void 0?void 0:d.includes("US_TAX")){if(!(t===null||t===void 0?void 0:t.taxHandlingEnabled))return"PENDING";if(!(t===null||t===void 0?void 0:t.connected))return"PENDING_PARTNER_CREATION";if((u=t===null||t===void 0?void 0:t.publisher)===null||u===void 0?void 0:u.requiredTaxDocumentType){if(!((c=t===null||t===void 0?void 0:t.publisher)===null||c===void 0?void 0:c.currentTaxDocument))return"PENDING_TAX_SUBMISSION";var m=t.publisher.currentTaxDocument.status;if(m==="INACTIVE"||m==="INVALID_W9_ELECTRONIC_DOCUMENT"||m==="INVALID_W9_ELECTRONIC_DOCUMENT_CHECK_INTERNAL")return"PENDING_NEW_TAX_FORM";if(m==="NOT_VERIFIED")return"PENDING_TAX_REVIEW"}if(!((f=t===null||t===void 0?void 0:t.publisher)===null||f===void 0?void 0:f.withdrawalSettings))return"PENDING_PARTNER_CREATION"}if((h=e===null||e===void 0?void 0:e.pendingReasons)===null||h===void 0?void 0:h.includes("MISSING_PAYOUT_CONFIGURATION")){return"PENDING_PARTNER_CREATION"}if(e.statuses.length===1)return e.statuses[0];return p.find((function(t){return e.statuses.includes(t)&&t}))};var s=function(e){switch(e){case"REDEEMED":case"PAYOUT_APPROVED":return"primary";case"DENIED":case"EXPIRED":case"CANCELLED":case"PAYOUT_FAILED":case"PAYOUT_CANCELLED":return"danger";case"PENDING":case"PENDING_REVIEW":case"PENDING_TAX_REVIEW":case"PENDING_NEW_TAX_FORM":case"PENDING_TAX_SUBMISSION":case"PENDING_PARTNER_CREATION":case"PROCESSING":return"warning";case"AVAILABLE":return"success"}};var o=function(t){return luxon.DateTime.fromMillis(t).setLocale(luxonLocale(e.locale)).toRelative().replace("in","").trim()};return(t=this.rewards)===null||t===void 0?void 0:t.map((function(t){var r,d,u,c;var f=l(t,e.taxConnection);var h=s(f);var p=intl.formatMessage({id:"statusShortMessage",defaultMessage:e.statusText},{status:f});var v=intl.formatMessage({id:"statusLongMessage",defaultMessage:e.statusLongText},{status:f,scheduledPayoutDate:((r=t.partnerFundsTransfer)===null||r===void 0?void 0:r.dateScheduled)?(d=luxon.DateTime.fromMillis(t.partnerFundsTransfer.dateScheduled))===null||d===void 0?void 0:d.setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED):null});return h$1("sl-details",{class:a.classes.Details,disabled:e.hideDetails},h$1("style",{type:"text/css"},n),h$1("div",{slot:"summary",class:a.classes.DetailsContainer},h$1(TextSpanView,{type:"p"},h$1("span",{part:"sqm-cell-value",class:a.classes.BoldText},t.prettyValue)),h$1("div",{class:a.classes.BadgeContainer},f==="PENDING"&&t.dateScheduledFor?h$1("sl-badge",{class:i(h),type:h,pill:true},intl.formatMessage({id:"pendingForText",defaultMessage:e.pendingForText},{status:p,date:o(t.dateScheduledFor)})):h$1("sl-badge",{class:i(h),type:h,pill:true},p),t.dateExpires&&f==="AVAILABLE"&&h$1("sl-badge",{class:i(h),type:"info",pill:true},e.expiringText," "+o(t.dateExpires)))),h$1("div",null,f==="PENDING_REVIEW"&&((u=t.referral)===null||u===void 0?void 0:u.dateModerated)&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.referral.dateModerated).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),f==="PAYOUT_APPROVED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PROCESSING"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PAYOUT_FAILED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PAYOUT_CANCELLED"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PENDING_TAX_REVIEW"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PENDING_NEW_TAX_FORM"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PENDING_TAX_SUBMISSION"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="PENDING_PARTNER_CREATION"&&h$1("div",null,h$1(TextSpanView,{type:"p"},v)),f==="DENIED"&&((c=t.referral)===null||c===void 0?void 0:c.dateModerated)&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.referral.dateModerated).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)),".",e.deniedHelpText?" "+e.deniedHelpText:"")),t.dateGiven&&h$1("div",null,h$1(TextSpanView,{type:"p"},e.rewardReceivedText," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateGiven).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),f==="EXPIRED"&&t.dateExpires&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateExpires).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),f==="CANCELLED"&&t.dateCancelled&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateCancelled).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),f==="PENDING"&&t.dateScheduledFor&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateScheduledFor).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED))))," ",f==="AVAILABLE"&&t.dateExpires&&h$1("div",null,h$1(TextSpanView,{type:"p"},v," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},luxon.DateTime.fromMillis(t.dateExpires).setLocale(luxonLocale(e.locale)).toLocaleString(luxon.DateTime.DATE_MED)))),t.fuelTankCode&&h$1("div",null,e.fuelTankText," ",h$1("span",{class:a.classes.BoldText,part:"sqm-cell-value"},t.fuelTankCode))))}))};return e}();var ReferralTableRewardsColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Rewards";this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PROCESSING {Payment Processing} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PROCESSING {Processing until {scheduledPayoutDate}. Payout is then scheduled based on your settings.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.fuelTankText="Your code is";this.rewardReceivedText="Reward received on";this.expiringText="Expiring in";this.pendingForText="{status} for {date}";this.deniedHelpText="Contact support if you think this is a mistake.";this.hideDetails=false;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,h$1("sqm-referral-table-rewards-cell",{rewards:e.rewards,taxConnection:t===null||t===void 0?void 0:t.taxConnection,statusText:this.statusText,statusLongText:this.statusLongText,fuelTankText:this.fuelTankText,rewardReceivedText:this.rewardReceivedText,expiringText:this.expiringText,pendingForText:this.pendingForText,hideDetails:this.hideDetails,deniedHelpText:this.deniedHelpText,locale:t===null||t===void 0?void 0:t.locale,exportparts:"sqm-cell-value"})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,h$1("sqm-referral-table-rewards-cell",{rewards:e.rewards,exportparts:"sqm-cell-value"})]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle,this.statusText,this.statusLongText,this.fuelTankText,this.rewardReceivedText,this.expiringText,this.pendingForText,this.hideDetails]);return h$1(Host,{style:{display:"none"}})};return e}();var style={SubText:{fontSize:"var(--sl-font-size-small)",color:"var(--sqm-text-subdued)",margin:"0"},RedeemBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-informative-color-icon)",color:"var(--sl-color-white)"}},DangerBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-danger-color-icon)",color:"var(--sl-color-white)"}},WarningBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-warning-color-icon)",color:"var(--sl-color-white)"}},SuccessBadge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line",background:"var(--sqm-success-color-icon)",color:"var(--sl-color-white)"}}};var sheet=createStyleSheet(style);var styleString=sheet.toString();var ReferralTableStatusCell=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){var e=this;var t=createStyleSheet(style);var r=t.toString();var a=function(t){if(t==="PENDING")return"warning";if(t==="DENIED")return"danger";if(e.converted)return"success";return"warning"};var n=function(e){switch(e){case"primary":return t.classes.RedeemBadge;case"danger":return t.classes.DangerBadge;case"success":return t.classes.SuccessBadge;case"warning":case"info":return t.classes.WarningBadge;default:return t.classes.WarningBadge}};return h$1("div",null,h$1("style",{type:"text/css"},r),h$1("sl-badge",{pill:true,type:a(this.fraudStatus),class:n(a(this.fraudStatus))},this.statusText),this.statusSubText?h$1("p",{class:t.classes.SubText},this.statusSubText):null)};return e}();var ReferralTableStatusColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Status";this.convertedStatusText="Converted";this.inProgressStatusText="In Progress";this.pendingReviewStatusText="Pending";this.deniedStatusText="Denied";this.pendingReviewStatusSubText="Awaiting review";this.deniedStatusSubText="Detected self-referral";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){n=(t=e===null||e===void 0?void 0:e.fraudData)===null||t===void 0?void 0:t.moderationStatus;if(n==="DENIED"){r=this.deniedStatusText;a=this.deniedStatusSubText}else if(n==="PENDING"){r=this.pendingReviewStatusText;a=this.pendingReviewStatusSubText}else{r=e.dateConverted?this.convertedStatusText:this.inProgressStatusText}return[2,h$1("sqm-referral-table-status-cell",{"status-text":r,"status-sub-text":a,"fraud-status":n,converted:e.dateConverted?true:false})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=e.dateConverted?this.convertedStatusText:this.inProgressStatusText;return[2,h$1("sqm-referral-table-status-cell",{"status-text":t,converted:e.dateConverted?true:false})]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle,this.convertedStatusText,this.inProgressStatusText]);return h$1(Host,{style:{display:"none"}})};return e}();var ReferralTableUserCell=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return this.name};return e}();var ReferralTableUserColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Customer";this.anonymousUser="Your Friend";this.deletedUser="Deleted User";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,l,s,o,d;return __generator(this,(function(u){if(!(e===null||e===void 0?void 0:e.referredUser)&&!(e===null||e===void 0?void 0:e.referrerUser)){d=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referredUser)===null||t===void 0?void 0:t.firstName)&&!((r=e===null||e===void 0?void 0:e.referredUser)===null||r===void 0?void 0:r.lastName)&&!((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)&&!((n=e===null||e===void 0?void 0:e.referrerUser)===null||n===void 0?void 0:n.lastName)){d=this.anonymousUser}else if(e===null||e===void 0?void 0:e.referrerUser){d=((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.firstName)+" "+((l=e===null||e===void 0?void 0:e.referrerUser)===null||l===void 0?void 0:l.lastName)}else{d=((s=e===null||e===void 0?void 0:e.referredUser)===null||s===void 0?void 0:s.firstName)+" "+((o=e===null||e===void 0?void 0:e.referredUser)===null||o===void 0?void 0:o.lastName)}return[2,h$1("sqm-referral-table-user-cell",{name:d})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(l){if(!e){i=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referrerUser)===null||t===void 0?void 0:t.firstName)&&!((r=e.referrerUser)===null||r===void 0?void 0:r.lastName)){i=this.anonymousUser}else{i=((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)+" "+((n=e===null||e===void 0?void 0:e.referrerUser)===null||n===void 0?void 0:n.lastName)}return[2,h$1("sqm-referral-table-user-cell",{name:i})]}))}))};e.prototype.render=function(){useRequestRerender([this.deletedUser,this.anonymousUser,this.columnTitle]);return h$1(Host,{style:{display:"none"}})};return e}();export{ReferralTable as sqm_referral_table,ReferralTableCell as sqm_referral_table_cell,ReferralTableGenericColumn as sqm_referral_table_column,ReferralTableDateCell as sqm_referral_table_date_cell,ReferralTableDateColumn as sqm_referral_table_date_column,ReferralTableRewardsCell as sqm_referral_table_rewards_cell,ReferralTableRewardsColumn as sqm_referral_table_rewards_column,ReferralTableStatusCell as sqm_referral_table_status_cell,ReferralTableStatusColumn as sqm_referral_table_status_column,ReferralTableUserCell as sqm_referral_table_user_cell,ReferralTableUserColumn as sqm_referral_table_user_column};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):o(e.value).then(a,u)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;o=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];o=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h as h$1,c as Host}from"./index-38ad4957.js";import{n as h}from"./dom-context-hooks.module-50442785.js";import"./index.module-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):o(e.value).then(a,u)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;o=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];o=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h as h$1,c as Host}from"./index-38ad4957.js";import{n as h}from"./dom-context-hooks.module-50442785.js";import"./index.module-cede12c6.js";import{a as useRequestRerender}from"./re-render-7a0c7976.js";var RewardTableCustomerNoteColumn=function(){function e(e){registerInstance(this,e);this.columnTitle="Note";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,r;return __generator(this,(function(o){r=e;return[2,h$1("sqm-rewards-table-customer-note-cell",{note:(n=r===null||r===void 0?void 0:r.meta)===null||n===void 0?void 0:n.message,locale:t===null||t===void 0?void 0:t.locale})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.render=function(){useRequestRerender([this.columnTitle]);return h$1(Host,{style:{display:"none"}})};return e}();export{RewardTableCustomerNoteColumn as sqm_rewards_table_customer_note_column};
|