@saasquatch/mint-components 1.15.0-118 → 1.15.0-119

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.
Files changed (290) hide show
  1. package/dist/cjs/{ShadowViewAddon-8fed996f.js → ShadowViewAddon-8d4ab3f3.js} +49 -3
  2. package/dist/cjs/{copy-text-view-44dfefc7.js → copy-text-view-e2782134.js} +5 -3
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/mint-components.cjs.js +1 -1
  5. package/dist/cjs/{sqm-big-stat_43.cjs.entry.js → sqm-big-stat_44.cjs.entry.js} +145 -2
  6. package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
  7. package/dist/cjs/sqm-stencilbook.cjs.entry.js +23 -8
  8. package/dist/cjs/sqm-widget-verification-controller.cjs.entry.js +2 -2
  9. package/dist/collection/components/sqm-hero/Hero.stories.js +1 -1
  10. package/dist/collection/components/sqm-hero/sqm-hero-view.js +3 -2
  11. package/dist/collection/components/sqm-portal-forgot-password/PortalForgotPassword.stories.js +1 -0
  12. package/dist/collection/components/sqm-share-link/ShareLink.stories.js +13 -0
  13. package/dist/collection/components/sqm-share-link/sqm-share-link.js +1 -0
  14. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-controller.js +4 -4
  15. package/dist/collection/components/views/copy-text-view.js +5 -3
  16. package/dist/esm/{IndirectTaxDetailsView-084314d5.js → IndirectTaxDetailsView-a2beb98a.js} +2 -2
  17. package/dist/esm/{ShadowViewAddon-928bfc1a.js → ShadowViewAddon-ae08cb04.js} +54 -9
  18. package/dist/esm/{copy-text-view-a319c261.js → copy-text-view-d8822c16.js} +5 -3
  19. package/dist/esm/{data-ee3ae298.js → data-dea73d4d.js} +1 -1
  20. package/dist/esm/{global-80edfef3.js → global-ef7a7354.js} +1 -1
  21. package/dist/esm/{index.module-38dad6c9.js → index.module-c9811a48.js} +1 -1
  22. package/dist/esm/loader.js +3 -3
  23. package/dist/esm/mint-components.js +3 -3
  24. package/dist/esm/{re-render-9c90767d.js → re-render-7e22fb0d.js} +1 -1
  25. package/dist/esm/sqm-banking-info-form_10.entry.js +9 -9
  26. package/dist/esm/{sqm-big-stat_43.entry.js → sqm-big-stat_44.entry.js} +155 -13
  27. package/dist/esm/sqm-close-button.entry.js +1 -1
  28. package/dist/esm/sqm-code-verification.entry.js +3 -3
  29. package/dist/esm/sqm-context-router.entry.js +1 -1
  30. package/dist/esm/sqm-email-verification.entry.js +3 -3
  31. package/dist/esm/sqm-empty_4.entry.js +2 -2
  32. package/dist/esm/sqm-google-sign-in.entry.js +1 -1
  33. package/dist/esm/sqm-graphql-client-provider.entry.js +1 -1
  34. package/dist/esm/sqm-instant-access-registration.entry.js +3 -3
  35. package/dist/esm/sqm-leaderboard-rank.entry.js +2 -2
  36. package/dist/esm/sqm-logout-current-user.entry.js +1 -1
  37. package/dist/esm/{sqm-navigation-sidebar-item-view-797601b0.js → sqm-navigation-sidebar-item-view-bedd6ed7.js} +1 -1
  38. package/dist/esm/sqm-navigation-sidebar-item.entry.js +2 -2
  39. package/dist/esm/sqm-navigation-sidebar.entry.js +1 -1
  40. package/dist/esm/sqm-pagination_3.entry.js +4 -4
  41. package/dist/esm/sqm-password-field.entry.js +2 -2
  42. package/dist/esm/sqm-popup-container.entry.js +1 -1
  43. package/dist/esm/{sqm-portal-email-verification-view-5719eb87.js → sqm-portal-email-verification-view-37bee5df.js} +1 -1
  44. package/dist/esm/sqm-portal-email-verification.entry.js +3 -3
  45. package/dist/esm/sqm-portal-google-login.entry.js +2 -2
  46. package/dist/esm/sqm-portal-google-registration-form.entry.js +3 -3
  47. package/dist/esm/sqm-portal-logout.entry.js +1 -1
  48. package/dist/esm/{sqm-portal-profile-view-9a82fe2e.js → sqm-portal-profile-view-afb6d879.js} +1 -1
  49. package/dist/esm/sqm-portal-profile.entry.js +4 -4
  50. package/dist/esm/sqm-portal-protected-route.entry.js +1 -1
  51. package/dist/esm/sqm-portal-registration-form.entry.js +3 -3
  52. package/dist/esm/sqm-portal-reset-password.entry.js +1 -1
  53. package/dist/esm/sqm-portal-verify-email.entry.js +1 -1
  54. package/dist/esm/sqm-qr-code.entry.js +2 -2
  55. package/dist/esm/sqm-referral-table_11.entry.js +5 -5
  56. package/dist/esm/sqm-rewards-table-customer-note-column.entry.js +2 -2
  57. package/dist/esm/sqm-rewards-table_9.entry.js +5 -5
  58. package/dist/esm/sqm-stencilbook.entry.js +29 -14
  59. package/dist/esm/sqm-tab.entry.js +2 -2
  60. package/dist/esm/sqm-tabs.entry.js +3 -3
  61. package/dist/esm/sqm-tax-and-cash.entry.js +4 -4
  62. package/dist/esm/sqm-widget-verification-controller.entry.js +3 -3
  63. package/dist/esm/sqm-widget-verification.entry.js +1 -1
  64. package/dist/esm/{useChildElements-4e70ac0e.js → useChildElements-3d872cef.js} +1 -1
  65. package/dist/esm/{useInstantAccessRegistration-0f04459e.js → useInstantAccessRegistration-dda1f52b.js} +2 -2
  66. package/dist/esm/{usePayoutStatus-7eeec61b.js → usePayoutStatus-93462be3.js} +1 -1
  67. package/dist/esm/{usePortalLogin-d0720c81.js → usePortalLogin-e95df3c3.js} +1 -1
  68. package/dist/esm/{usePortalRegistrationForm-afc0171e.js → usePortalRegistrationForm-1eb3cd72.js} +2 -2
  69. package/dist/esm/{useReferralCodes-311e6d72.js → useReferralCodes-c2e809cf.js} +1 -1
  70. package/dist/esm/{useReferralTable-65a01a6a.js → useReferralTable-909ccb28.js} +3 -3
  71. package/dist/esm/{useRegistrationFormState-18c2cea7.js → useRegistrationFormState-24d594ea.js} +1 -1
  72. package/dist/esm/{useVerificationEmail-f9413de9.js → useVerificationEmail-55e0e98f.js} +1 -1
  73. package/dist/esm/{utilities-ad9c2893.js → utilities-72c07b09.js} +1 -1
  74. package/dist/esm/{utils-27b2ed4b.js → utils-a86c25e9.js} +1 -1
  75. package/dist/esm-es5/{IndirectTaxDetailsView-084314d5.js → IndirectTaxDetailsView-a2beb98a.js} +1 -1
  76. package/dist/esm-es5/ShadowViewAddon-ae08cb04.js +1 -0
  77. package/dist/esm-es5/copy-text-view-d8822c16.js +1 -0
  78. package/dist/esm-es5/{data-ee3ae298.js → data-dea73d4d.js} +1 -1
  79. package/dist/esm-es5/{global-80edfef3.js → global-ef7a7354.js} +1 -1
  80. package/dist/esm-es5/{index.module-38dad6c9.js → index.module-c9811a48.js} +1 -1
  81. package/dist/esm-es5/loader.js +1 -1
  82. package/dist/esm-es5/mint-components.js +1 -1
  83. package/dist/esm-es5/{re-render-9c90767d.js → re-render-7e22fb0d.js} +1 -1
  84. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  85. package/dist/esm-es5/sqm-big-stat_44.entry.js +1 -0
  86. package/dist/esm-es5/sqm-close-button.entry.js +1 -1
  87. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  88. package/dist/esm-es5/sqm-context-router.entry.js +1 -1
  89. package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
  90. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  91. package/dist/esm-es5/sqm-google-sign-in.entry.js +1 -1
  92. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  93. package/dist/esm-es5/sqm-instant-access-registration.entry.js +1 -1
  94. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  95. package/dist/esm-es5/sqm-logout-current-user.entry.js +1 -1
  96. package/dist/esm-es5/{sqm-navigation-sidebar-item-view-797601b0.js → sqm-navigation-sidebar-item-view-bedd6ed7.js} +1 -1
  97. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  98. package/dist/esm-es5/sqm-navigation-sidebar.entry.js +1 -1
  99. package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
  100. package/dist/esm-es5/sqm-password-field.entry.js +1 -1
  101. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  102. package/dist/esm-es5/{sqm-portal-email-verification-view-5719eb87.js → sqm-portal-email-verification-view-37bee5df.js} +1 -1
  103. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  104. package/dist/esm-es5/sqm-portal-google-login.entry.js +1 -1
  105. package/dist/esm-es5/sqm-portal-google-registration-form.entry.js +1 -1
  106. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  107. package/dist/esm-es5/{sqm-portal-profile-view-9a82fe2e.js → sqm-portal-profile-view-afb6d879.js} +1 -1
  108. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  109. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  110. package/dist/esm-es5/sqm-portal-registration-form.entry.js +1 -1
  111. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  112. package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
  113. package/dist/esm-es5/sqm-qr-code.entry.js +1 -1
  114. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  115. package/dist/esm-es5/sqm-rewards-table-customer-note-column.entry.js +1 -1
  116. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  117. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  118. package/dist/esm-es5/sqm-tab.entry.js +1 -1
  119. package/dist/esm-es5/sqm-tabs.entry.js +1 -1
  120. package/dist/esm-es5/sqm-tax-and-cash.entry.js +1 -1
  121. package/dist/esm-es5/sqm-widget-verification-controller.entry.js +1 -1
  122. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  123. package/dist/esm-es5/{useChildElements-4e70ac0e.js → useChildElements-3d872cef.js} +1 -1
  124. package/dist/esm-es5/{useInstantAccessRegistration-0f04459e.js → useInstantAccessRegistration-dda1f52b.js} +1 -1
  125. package/dist/esm-es5/{usePayoutStatus-7eeec61b.js → usePayoutStatus-93462be3.js} +1 -1
  126. package/dist/esm-es5/{usePortalLogin-d0720c81.js → usePortalLogin-e95df3c3.js} +1 -1
  127. package/dist/esm-es5/{usePortalRegistrationForm-afc0171e.js → usePortalRegistrationForm-1eb3cd72.js} +1 -1
  128. package/dist/esm-es5/{useReferralCodes-311e6d72.js → useReferralCodes-c2e809cf.js} +1 -1
  129. package/dist/esm-es5/{useReferralTable-65a01a6a.js → useReferralTable-909ccb28.js} +1 -1
  130. package/dist/esm-es5/{useRegistrationFormState-18c2cea7.js → useRegistrationFormState-24d594ea.js} +1 -1
  131. package/dist/esm-es5/{useVerificationEmail-f9413de9.js → useVerificationEmail-55e0e98f.js} +1 -1
  132. package/dist/esm-es5/{utilities-ad9c2893.js → utilities-72c07b09.js} +1 -1
  133. package/dist/esm-es5/{utils-27b2ed4b.js → utils-a86c25e9.js} +1 -1
  134. package/dist/mint-components/mint-components.esm.js +1 -1
  135. package/dist/mint-components/mint-components.js +1 -1
  136. package/dist/mint-components/p-087b86af.system.entry.js +1 -0
  137. package/dist/mint-components/{p-e34b460e.entry.js → p-0bc0f590.entry.js} +1 -1
  138. package/dist/mint-components/{p-8e2bead4.js → p-0ec54f97.js} +1 -1
  139. package/dist/mint-components/{p-aa77d858.system.entry.js → p-0ef925fd.system.entry.js} +1 -1
  140. package/dist/mint-components/{p-3d99fa43.entry.js → p-10c63703.entry.js} +1 -1
  141. package/dist/mint-components/p-125a894f.js +1 -0
  142. package/dist/mint-components/{p-7270fb59.entry.js → p-14fd4b05.entry.js} +1 -1
  143. package/dist/mint-components/{p-bb627d95.entry.js → p-155f7d25.entry.js} +2 -2
  144. package/dist/mint-components/{p-d8c5b80a.system.js → p-171310d9.system.js} +1 -1
  145. package/dist/mint-components/{p-1c1f4ce7.system.js → p-17a0f310.system.js} +1 -1
  146. package/dist/mint-components/p-18d33a7f.js +448 -0
  147. package/dist/mint-components/{p-773ce89c.system.js → p-2074933f.system.js} +1 -1
  148. package/dist/mint-components/{p-5e0af707.entry.js → p-20916402.entry.js} +2 -2
  149. package/dist/mint-components/{p-14bc40a9.entry.js → p-261ef00a.entry.js} +1 -1
  150. package/dist/mint-components/{p-0cba75e6.system.entry.js → p-26a7051d.system.entry.js} +1 -1
  151. package/dist/mint-components/{p-d5f1df29.entry.js → p-27a7f6a6.entry.js} +1 -1
  152. package/dist/mint-components/{p-d2e2e10f.js → p-28c50364.js} +1 -1
  153. package/dist/mint-components/{p-b065215a.entry.js → p-29398c98.entry.js} +1 -1
  154. package/dist/mint-components/{p-0e59a91e.js → p-293e3b25.js} +1 -1
  155. package/dist/mint-components/{p-6e069052.entry.js → p-29ba2eaa.entry.js} +1 -1
  156. package/dist/mint-components/{p-433ca566.system.entry.js → p-29fa3d84.system.entry.js} +1 -1
  157. package/dist/mint-components/{p-00378aec.entry.js → p-2c0c8872.entry.js} +2 -2
  158. package/dist/mint-components/{p-9dbfdb41.system.entry.js → p-2e1eceb7.system.entry.js} +1 -1
  159. package/dist/mint-components/{p-a6234a78.entry.js → p-2fd59b38.entry.js} +1 -1
  160. package/dist/mint-components/{p-0d22c0e5.system.entry.js → p-355079f4.system.entry.js} +1 -1
  161. package/dist/mint-components/{p-c2c59452.system.js → p-37ffa277.system.js} +1 -1
  162. package/dist/mint-components/{p-c3884e55.entry.js → p-386ec00c.entry.js} +1 -1
  163. package/dist/mint-components/{p-e425b7a1.entry.js → p-3b0e2094.entry.js} +2 -2
  164. package/dist/mint-components/p-40752a0f.entry.js +1 -0
  165. package/dist/mint-components/{p-485e2d9f.system.entry.js → p-40c33b6a.system.entry.js} +1 -1
  166. package/dist/mint-components/{p-a4e56204.js → p-43246ab1.js} +1 -1
  167. package/dist/mint-components/{p-b3da317b.system.entry.js → p-43d9c1c5.system.entry.js} +1 -1
  168. package/dist/mint-components/{p-3787a4d6.js → p-49400aab.js} +2 -2
  169. package/dist/mint-components/{p-f0e0d0b9.system.entry.js → p-4a0f42ac.system.entry.js} +1 -1
  170. package/dist/mint-components/{p-19f41a8e.js → p-4a379796.js} +1 -1
  171. package/dist/mint-components/p-4ae4db45.system.js +1 -0
  172. package/dist/mint-components/{p-e4e3ddb6.system.js → p-4ddf5eaa.system.js} +1 -1
  173. package/dist/mint-components/{p-a2533860.system.entry.js → p-4f5a3dad.system.entry.js} +1 -1
  174. package/dist/mint-components/{p-0e66f410.system.entry.js → p-5116afad.system.entry.js} +1 -1
  175. package/dist/mint-components/{p-3cb249c3.js → p-513f5d80.js} +1 -1
  176. package/dist/mint-components/{p-3dc34570.system.js → p-537a3894.system.js} +1 -1
  177. package/dist/mint-components/{p-258f4e5e.system.entry.js → p-54abb144.system.entry.js} +1 -1
  178. package/dist/mint-components/{p-6ad674c2.js → p-552a6d1b.js} +1 -1
  179. package/dist/mint-components/p-5581ba8e.system.js +1 -0
  180. package/dist/mint-components/{p-c1629004.entry.js → p-56069d3f.entry.js} +1 -1
  181. package/dist/mint-components/{p-1394d253.system.js → p-574b08e7.system.js} +1 -1
  182. package/dist/mint-components/{p-002e6205.system.entry.js → p-58e0eccc.system.entry.js} +1 -1
  183. package/dist/mint-components/{p-8543a70f.system.entry.js → p-5aad9df5.system.entry.js} +1 -1
  184. package/dist/mint-components/{p-4271f436.system.entry.js → p-5b29d833.system.entry.js} +1 -1
  185. package/dist/mint-components/{p-ef8b70cd.system.entry.js → p-5bb59fa8.system.entry.js} +1 -1
  186. package/dist/mint-components/{p-22d20816.system.entry.js → p-5e8d6f3a.system.entry.js} +1 -1
  187. package/dist/mint-components/{p-7af4fba0.system.entry.js → p-60ec0961.system.entry.js} +1 -1
  188. package/dist/mint-components/p-621f3e30.entry.js +1 -0
  189. package/dist/mint-components/p-625ca62f.entry.js +1 -0
  190. package/dist/mint-components/{p-1f511d5d.entry.js → p-682359ae.entry.js} +1 -1
  191. package/dist/mint-components/p-6919414d.entry.js +33 -0
  192. package/dist/mint-components/{p-1d4a327c.js → p-699a9b20.js} +1 -1
  193. package/dist/mint-components/{p-a148663a.system.js → p-6c82d60c.system.js} +1 -1
  194. package/dist/mint-components/{p-f307b716.js → p-71af93e3.js} +1 -1
  195. package/dist/mint-components/{p-fa6fba34.system.js → p-71daeed9.system.js} +1 -1
  196. package/dist/mint-components/p-7558f9ef.entry.js +258 -0
  197. package/dist/mint-components/{p-9f82e69d.entry.js → p-75b8fd75.entry.js} +1 -1
  198. package/dist/mint-components/{p-05650cb6.entry.js → p-78878a5a.entry.js} +1 -1
  199. package/dist/mint-components/{p-ac2fdad8.system.entry.js → p-78c754de.system.entry.js} +1 -1
  200. package/dist/mint-components/{p-b9bccc55.entry.js → p-7eb0573c.entry.js} +1 -1
  201. package/dist/mint-components/{p-df37ef17.system.js → p-7ff34e84.system.js} +1 -1
  202. package/dist/mint-components/{p-15012f59.system.js → p-867b2baf.system.js} +1 -1
  203. package/dist/mint-components/{p-1a278658.entry.js → p-92a54b0c.entry.js} +1 -1
  204. package/dist/mint-components/{p-dbe29e53.system.entry.js → p-9491f5fb.system.entry.js} +1 -1
  205. package/dist/mint-components/p-976ee669.js +1 -0
  206. package/dist/mint-components/{p-4d19270b.js → p-97dc6863.js} +2 -2
  207. package/dist/mint-components/{p-0b0f49ad.entry.js → p-9943f53e.entry.js} +1 -1
  208. package/dist/mint-components/{p-ebb487d0.system.entry.js → p-9ab8a0fd.system.entry.js} +1 -1
  209. package/dist/mint-components/{p-5b9297cd.system.entry.js → p-9b29f4f5.system.entry.js} +1 -1
  210. package/dist/mint-components/{p-862845d7.js → p-9c79ab08.js} +2 -2
  211. package/dist/mint-components/p-a0f3c1f0.js +1 -0
  212. package/dist/mint-components/{p-89b859c7.system.entry.js → p-a4564acb.system.entry.js} +1 -1
  213. package/dist/mint-components/{p-a5c9ce6c.entry.js → p-a4e8eb33.entry.js} +1 -1
  214. package/dist/mint-components/{p-9aadc253.entry.js → p-a52df294.entry.js} +1 -1
  215. package/dist/mint-components/{p-e64fbb70.js → p-a5b58d30.js} +1 -1
  216. package/dist/mint-components/p-a5e8bfd4.system.js +1 -0
  217. package/dist/mint-components/{p-0bb21f5b.system.entry.js → p-a8c86cd8.system.entry.js} +1 -1
  218. package/dist/mint-components/p-a8e92144.js +1 -0
  219. package/dist/mint-components/{p-5ed49bf2.js → p-aa596749.js} +1 -1
  220. package/dist/mint-components/{p-3d1b91a1.system.entry.js → p-af69ee79.system.entry.js} +1 -1
  221. package/dist/mint-components/{p-711bc624.entry.js → p-b2fdb0b1.entry.js} +1 -1
  222. package/dist/mint-components/{p-da3ffd4e.system.entry.js → p-b4a922e1.system.entry.js} +1 -1
  223. package/dist/mint-components/{p-9fb8b33a.system.js → p-bb5d153f.system.js} +1 -1
  224. package/dist/mint-components/{p-0ea61502.system.js → p-bcac83f0.system.js} +1 -1
  225. package/dist/mint-components/p-bd093069.system.entry.js +1 -0
  226. package/dist/mint-components/{p-b22b7891.js → p-c30ad421.js} +1 -1
  227. package/dist/mint-components/{p-da6fe95f.system.entry.js → p-cc8ca3ff.system.entry.js} +1 -1
  228. package/dist/mint-components/{p-8dc1cd0f.entry.js → p-d08bcd88.entry.js} +1 -1
  229. package/dist/mint-components/{p-d399162b.system.js → p-d09d3b8f.system.js} +1 -1
  230. package/dist/mint-components/{p-d821418e.system.js → p-d14f3149.system.js} +1 -1
  231. package/dist/mint-components/{p-100c878b.system.entry.js → p-d399b343.system.entry.js} +1 -1
  232. package/dist/mint-components/{p-f51e41dd.system.entry.js → p-d51c9a98.system.entry.js} +1 -1
  233. package/dist/mint-components/p-d6ea42b6.entry.js +9 -0
  234. package/dist/mint-components/{p-abd33116.system.entry.js → p-d848957e.system.entry.js} +1 -1
  235. package/dist/mint-components/{p-672d144e.entry.js → p-dcc50d90.entry.js} +1 -1
  236. package/dist/mint-components/p-e05590ac.system.entry.js +1 -0
  237. package/dist/mint-components/{p-91014439.system.js → p-e174b704.system.js} +1 -1
  238. package/dist/mint-components/{p-9d29a0ff.system.entry.js → p-e71e147a.system.entry.js} +1 -1
  239. package/dist/mint-components/{p-94f9fbf7.entry.js → p-ea063d99.entry.js} +1 -1
  240. package/dist/mint-components/{p-587115cb.system.entry.js → p-ee92a728.system.entry.js} +1 -1
  241. package/dist/mint-components/{p-82505f6e.system.js → p-f3392945.system.js} +1 -1
  242. package/dist/mint-components/{p-d785a297.system.entry.js → p-f4202a64.system.entry.js} +1 -1
  243. package/dist/mint-components/{p-fb5be0c5.js → p-f5fff87e.js} +1 -1
  244. package/dist/mint-components/{p-c79bb1c6.entry.js → p-f764e51f.entry.js} +2 -2
  245. package/dist/mint-components/p-f7919872.system.js +1 -0
  246. package/dist/mint-components/{p-22c11f0e.entry.js → p-f9295990.entry.js} +1 -1
  247. package/dist/mint-components/p-fa0ad3f2.entry.js +11 -0
  248. package/dist/mint-components/{p-e539fed3.entry.js → p-fab109de.entry.js} +1 -1
  249. package/dist/mint-components/{p-ad586adc.system.entry.js → p-fcbed888.system.entry.js} +1 -1
  250. package/dist/mint-components/{p-578a27c8.system.js → p-ff0e1564.system.js} +1 -1
  251. package/dist/types/components/sqm-portal-forgot-password/PortalForgotPassword.stories.d.ts +1 -0
  252. package/dist/types/components/sqm-share-link/ShareLink.stories.d.ts +1 -0
  253. package/dist/types/components/sqm-widget-verification/sqm-widget-verification-controller.d.ts +2 -2
  254. package/dist/types/components.d.ts +4 -4
  255. package/docs/docs.docx +0 -0
  256. package/docs/raisins.json +1 -1
  257. package/package.json +1 -1
  258. package/dist/cjs/sqm-portal-forgot-password-view-0a8d3243.js +0 -53
  259. package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +0 -156
  260. package/dist/esm/sqm-portal-forgot-password-view-0e795cdd.js +0 -51
  261. package/dist/esm/sqm-portal-forgot-password.entry.js +0 -152
  262. package/dist/esm-es5/ShadowViewAddon-928bfc1a.js +0 -1
  263. package/dist/esm-es5/copy-text-view-a319c261.js +0 -1
  264. package/dist/esm-es5/sqm-big-stat_43.entry.js +0 -1
  265. package/dist/esm-es5/sqm-portal-forgot-password-view-0e795cdd.js +0 -1
  266. package/dist/esm-es5/sqm-portal-forgot-password.entry.js +0 -1
  267. package/dist/mint-components/p-000c91b1.js +0 -1
  268. package/dist/mint-components/p-10507209.system.entry.js +0 -1
  269. package/dist/mint-components/p-1337f47c.entry.js +0 -1
  270. package/dist/mint-components/p-1de49f76.js +0 -1
  271. package/dist/mint-components/p-209ea185.js +0 -1
  272. package/dist/mint-components/p-3f1f78c0.system.entry.js +0 -1
  273. package/dist/mint-components/p-42da8239.system.js +0 -1
  274. package/dist/mint-components/p-56a5e3b2.entry.js +0 -9
  275. package/dist/mint-components/p-7059ee40.system.entry.js +0 -1
  276. package/dist/mint-components/p-7970e73a.js +0 -1
  277. package/dist/mint-components/p-84a5b46a.system.js +0 -1
  278. package/dist/mint-components/p-9374b5bb.system.entry.js +0 -1
  279. package/dist/mint-components/p-a0c8162d.entry.js +0 -258
  280. package/dist/mint-components/p-a89baf7b.system.js +0 -1
  281. package/dist/mint-components/p-c4886223.entry.js +0 -1
  282. package/dist/mint-components/p-c7965639.entry.js +0 -1
  283. package/dist/mint-components/p-cab1f502.js +0 -1
  284. package/dist/mint-components/p-d278519f.js +0 -448
  285. package/dist/mint-components/p-e57d61af.system.js +0 -1
  286. package/dist/mint-components/p-e9d0caf7.entry.js +0 -11
  287. package/dist/mint-components/p-f4dc053e.entry.js +0 -33
  288. package/dist/mint-components/p-f4f57363.system.js +0 -1
  289. package/dist/mint-components/p-fb77f662.entry.js +0 -1
  290. package/shoelace/assets/icons/twitter-x.svg +0 -4
@@ -1 +1 @@
1
- var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,r){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:r})}else{e.raw=r}return e};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{i as intl}from"./global-80edfef3.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,H,J,w as wn,i as isDemo}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import{L as LeaderboardRankView}from"./sqm-leaderboard-rank-view-18baae5b.js";var GET_RANK=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query ($type: String!, $filter: UserLeaderboardFilterInput) {\n viewer {\n ... on User {\n leaderboardRank(type: $type, filter: $filter) {\n rowNumber\n rank\n denseRank\n }\n }\n }\n }\n"],["\n query ($type: String!, $filter: UserLeaderboardFilterInput) {\n viewer {\n ... on User {\n leaderboardRank(type: $type, filter: $filter) {\n rowNumber\n rank\n denseRank\n }\n }\n }\n }\n"])));function useLeaderboardRank(e){var r,a,n,t;var o=H();var d=(r=e.programId)!==null&&r!==void 0?r:o;var i=J();var s=d?{type:e.leaderboardType,filter:{programId_eq:d}}:{type:e.leaderboardType,filter:{}};if(e.interval){s.filter["interval"]=e.interval}var l=wn(GET_RANK,s,!(i===null||i===void 0?void 0:i.jwt)).data;var m=((a=l===null||l===void 0?void 0:l.viewer)===null||a===void 0?void 0:a.leaderboardRank)?intl.formatMessage({id:"rankText",defaultMessage:e.rankText},{rank:(t=(n=l===null||l===void 0?void 0:l.viewer)===null||n===void 0?void 0:n.leaderboardRank)===null||t===void 0?void 0:t[e.rankType]}):e.unrankedText||"unranked";return{data:{rank:m}}}var sqmLeaderboardRankCss="p,.P{font-size:var(--sl-font-size-small);color:var(--sqm-text);margin-top:0px}p.Subtitle,.P.Subtitle{color:var(--sqm-text-subdued);margin:0px}";var LeaderboardRank=function(){function e(e){registerInstance(this,e);this.rankText="You are currently in {rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th} } place!";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useLeaderboardRankDemo(this):useLeaderboardRank(this);return h$1(LeaderboardRankView,Object.assign({},e))};return e}();function useLeaderboardRankDemo(e){var r=intl.formatMessage({id:"rankText",defaultMessage:e.rankText},{rank:1})||"1st";return cjs({data:{rank:r}},e.demoData||{},{arrayMerge:function(e,r){return r}})}LeaderboardRank.style=sqmLeaderboardRankCss;export{LeaderboardRank as sqm_leaderboard_rank};var templateObject_1;
1
+ var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,r){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:r})}else{e.raw=r}return e};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{i as intl}from"./global-ef7a7354.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,H,J,w as wn,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{L as LeaderboardRankView}from"./sqm-leaderboard-rank-view-18baae5b.js";var GET_RANK=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query ($type: String!, $filter: UserLeaderboardFilterInput) {\n viewer {\n ... on User {\n leaderboardRank(type: $type, filter: $filter) {\n rowNumber\n rank\n denseRank\n }\n }\n }\n }\n"],["\n query ($type: String!, $filter: UserLeaderboardFilterInput) {\n viewer {\n ... on User {\n leaderboardRank(type: $type, filter: $filter) {\n rowNumber\n rank\n denseRank\n }\n }\n }\n }\n"])));function useLeaderboardRank(e){var r,a,n,t;var o=H();var d=(r=e.programId)!==null&&r!==void 0?r:o;var i=J();var s=d?{type:e.leaderboardType,filter:{programId_eq:d}}:{type:e.leaderboardType,filter:{}};if(e.interval){s.filter["interval"]=e.interval}var l=wn(GET_RANK,s,!(i===null||i===void 0?void 0:i.jwt)).data;var m=((a=l===null||l===void 0?void 0:l.viewer)===null||a===void 0?void 0:a.leaderboardRank)?intl.formatMessage({id:"rankText",defaultMessage:e.rankText},{rank:(t=(n=l===null||l===void 0?void 0:l.viewer)===null||n===void 0?void 0:n.leaderboardRank)===null||t===void 0?void 0:t[e.rankType]}):e.unrankedText||"unranked";return{data:{rank:m}}}var sqmLeaderboardRankCss="p,.P{font-size:var(--sl-font-size-small);color:var(--sqm-text);margin-top:0px}p.Subtitle,.P.Subtitle{color:var(--sqm-text-subdued);margin:0px}";var LeaderboardRank=function(){function e(e){registerInstance(this,e);this.rankText="You are currently in {rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th} } place!";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useLeaderboardRankDemo(this):useLeaderboardRank(this);return h$1(LeaderboardRankView,Object.assign({},e))};return e}();function useLeaderboardRankDemo(e){var r=intl.formatMessage({id:"rankText",defaultMessage:e.rankText},{rank:1})||"1st";return cjs({data:{rank:r}},e.demoData||{},{arrayMerge:function(e,r){return r}})}LeaderboardRank.style=sqmLeaderboardRankCss;export{LeaderboardRank as sqm_leaderboard_rank};var templateObject_1;
@@ -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,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,J,w as wn,b as setUserIdentity,i as isDemo}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import{L as LogoutCurrentUserView}from"./sqm-logout-current-user-view-f21e54e3.js";var GET_USER_DETAILS=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query getUserDetails {\n viewer {\n ... on User {\n id\n accountId\n email\n }\n }\n }\n"],["\n query getUserDetails {\n viewer {\n ... on User {\n id\n accountId\n email\n }\n }\n }\n"])));function useLogoutCurrentUser(e){var t,r;var n=J();var i=wn(GET_USER_DETAILS,{},!n),s=i.loading,o=i.data;var a=function(){setUserIdentity(undefined)};var u=(t=e.userIdentificationText)===null||t===void 0?void 0:t.replace("{email}",(r=o===null||o===void 0?void 0:o.viewer)===null||r===void 0?void 0:r.email);return __assign({loading:s,onSwitchClick:a,filledInEmailText:u},e)}var LogoutCurrentUser=function(){function e(e){registerInstance(this,e);this.userIdentificationText="{email}";this.switchUserText="not you?";this.emailErrorText="Error fetching email";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useDemoLogoutCurrentUser(this):useLogoutCurrentUser(getProps(this));var t={userIdentificationText:this.userIdentificationText,switchUserText:this.switchUserText,emailErrorText:this.emailErrorText};return h$1(LogoutCurrentUserView,Object.assign({},e,t))};return e}();function useDemoLogoutCurrentUser(e){return cjs({onSwitchClick:function(){return setUserIdentity(undefined)},filledInEmailText:"john@example.com",switchUserText:e.switchUserText,emailErrorText:e.emailErrorText,loading:false},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{LogoutCurrentUser as sqm_logout_current_user};var templateObject_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,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,J,w as wn,b as setUserIdentity,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import{L as LogoutCurrentUserView}from"./sqm-logout-current-user-view-f21e54e3.js";var GET_USER_DETAILS=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query getUserDetails {\n viewer {\n ... on User {\n id\n accountId\n email\n }\n }\n }\n"],["\n query getUserDetails {\n viewer {\n ... on User {\n id\n accountId\n email\n }\n }\n }\n"])));function useLogoutCurrentUser(e){var t,r;var n=J();var i=wn(GET_USER_DETAILS,{},!n),s=i.loading,o=i.data;var a=function(){setUserIdentity(undefined)};var u=(t=e.userIdentificationText)===null||t===void 0?void 0:t.replace("{email}",(r=o===null||o===void 0?void 0:o.viewer)===null||r===void 0?void 0:r.email);return __assign({loading:s,onSwitchClick:a,filledInEmailText:u},e)}var LogoutCurrentUser=function(){function e(e){registerInstance(this,e);this.userIdentificationText="{email}";this.switchUserText="not you?";this.emailErrorText="Error fetching email";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useDemoLogoutCurrentUser(this):useLogoutCurrentUser(getProps(this));var t={userIdentificationText:this.userIdentificationText,switchUserText:this.switchUserText,emailErrorText:this.emailErrorText};return h$1(LogoutCurrentUserView,Object.assign({},e,t))};return e}();function useDemoLogoutCurrentUser(e){return cjs({onSwitchClick:function(){return setUserIdentity(undefined)},filledInEmailText:"john@example.com",switchUserText:e.switchUserText,emailErrorText:e.emailErrorText,loading:false},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{LogoutCurrentUser as sqm_logout_current_user};var templateObject_1;
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(a){for(var r,e=1,o=arguments.length;e<o;e++){r=arguments[e];for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))a[t]=r[t]}return a};return __assign.apply(this,arguments)};import{h}from"./index-b3a06de8.js";import{j as jn}from"./index.module-38dad6c9.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{g as gap}from"./mixins-f750863a.js";function NavigationSidebarItemView(a){var r=a.states,e=a.data,o=a.padding,t=o===void 0?"x-small":o;var s=a.backgroundColor||"var(--sqm-portal-background)";var i=a.backgroundHoverColor||"var(--sqm-accent-color-background)";var n=a.backgroundFocusedColor||"var(--sqm-primary-color)";var c=a.textFocusedColor||"var(--sqm-text)";var l={ItemContainer:__assign(__assign({display:"flex","background-color":""+(r.active?n:s),borderRadius:a.borderRadius?a.borderRadius+"px":"var(--sqm-border-radius-normal)",padding:"var(--sl-spacing-"+t+")","text-decoration":"none",color:r.active?c:a.textColor||"var(--sqm-text)","align-items":"center"},gap({direction:"row",size:"var(--sl-font-size-small)"})),{"&:hover":{cursor:"pointer",background:r.active?n:i,color:r.active?c:a.textHoverColor||"var(--sqm-text)"}}),Label:{margin:"0"},Icon:{"flex-shrink":"0"}};var d=createStyleSheet(l);var v=d.toString();return h("a",{part:"sqm-link",href:e.path,onClick:function(a){a.preventDefault();jn.push(e.path)},class:d.classes.ItemContainer},h("style",{type:"text/css"},v),h("sl-icon",{class:d.classes.Icon,name:e.icon}),h("p",{class:d.classes.Label,part:"sqm-label"},e.label))}export{NavigationSidebarItemView as N};
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(a){for(var r,e=1,o=arguments.length;e<o;e++){r=arguments[e];for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))a[t]=r[t]}return a};return __assign.apply(this,arguments)};import{h}from"./index-b3a06de8.js";import{j as jn}from"./index.module-c9811a48.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{g as gap}from"./mixins-f750863a.js";function NavigationSidebarItemView(a){var r=a.states,e=a.data,o=a.padding,t=o===void 0?"x-small":o;var s=a.backgroundColor||"var(--sqm-portal-background)";var i=a.backgroundHoverColor||"var(--sqm-accent-color-background)";var n=a.backgroundFocusedColor||"var(--sqm-primary-color)";var c=a.textFocusedColor||"var(--sqm-text)";var l={ItemContainer:__assign(__assign({display:"flex","background-color":""+(r.active?n:s),borderRadius:a.borderRadius?a.borderRadius+"px":"var(--sqm-border-radius-normal)",padding:"var(--sl-spacing-"+t+")","text-decoration":"none",color:r.active?c:a.textColor||"var(--sqm-text)","align-items":"center"},gap({direction:"row",size:"var(--sl-font-size-small)"})),{"&:hover":{cursor:"pointer",background:r.active?n:i,color:r.active?c:a.textHoverColor||"var(--sqm-text)"}}),Label:{margin:"0"},Icon:{"flex-shrink":"0"}};var d=createStyleSheet(l);var v=d.toString();return h("a",{part:"sqm-link",href:e.path,onClick:function(a){a.preventDefault();jn.push(e.path)},class:d.classes.ItemContainer},h("style",{type:"text/css"},v),h("sl-icon",{class:d.classes.Icon,name:e.icon}),h("p",{class:d.classes.Label,part:"sqm-label"},e.label))}export{NavigationSidebarItemView as N};
@@ -1 +1 @@
1
- import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{k as kn,i as isDemo}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import{N as NavigationSidebarItemView}from"./sqm-navigation-sidebar-item-view-797601b0.js";function useNavigationSidebarItem(o){var e=kn();return{states:{active:e.pathname===o.path},data:{label:o.label,icon:o.icon,path:o.path},backgroundColor:o.backgroundColor,backgroundHoverColor:o.backgroundHoverColor,textColor:o.textColor,textHoverColor:o.textHoverColor,borderRadius:o.borderRadius,backgroundFocusedColor:o.backgroundFocusedColor,textFocusedColor:o.textFocusedColor,padding:o.padding}}var NavigationSidebarItem=function(){function o(o){registerInstance(this,o);this.padding="x-small";h(this)}o.prototype.disconnectedCallback=function(){};o.prototype.render=function(){var o=isDemo()?useSidebarItemDemo(getProps(this)):useNavigationSidebarItem(getProps(this));return h$1(NavigationSidebarItemView,Object.assign({},o))};return o}();function useSidebarItemDemo(o){return cjs({states:{active:false},data:{label:o.label||"Dashboard",icon:o.icon||"house"},backgroundColor:o.backgroundColor,backgroundHoverColor:o.backgroundHoverColor,textColor:o.textColor,textHoverColor:o.textHoverColor,borderRadius:o.borderRadius,backgroundFocusedColor:o.backgroundFocusedColor,textFocusedColor:o.textFocusedColor,padding:o.padding},o.demoData||{},{arrayMerge:function(o,e){return e}})}export{NavigationSidebarItem as sqm_navigation_sidebar_item};
1
+ import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{k as kn,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import{N as NavigationSidebarItemView}from"./sqm-navigation-sidebar-item-view-bedd6ed7.js";function useNavigationSidebarItem(o){var e=kn();return{states:{active:e.pathname===o.path},data:{label:o.label,icon:o.icon,path:o.path},backgroundColor:o.backgroundColor,backgroundHoverColor:o.backgroundHoverColor,textColor:o.textColor,textHoverColor:o.textHoverColor,borderRadius:o.borderRadius,backgroundFocusedColor:o.backgroundFocusedColor,textFocusedColor:o.textFocusedColor,padding:o.padding}}var NavigationSidebarItem=function(){function o(o){registerInstance(this,o);this.padding="x-small";h(this)}o.prototype.disconnectedCallback=function(){};o.prototype.render=function(){var o=isDemo()?useSidebarItemDemo(getProps(this)):useNavigationSidebarItem(getProps(this));return h$1(NavigationSidebarItemView,Object.assign({},o))};return o}();function useSidebarItemDemo(o){return cjs({states:{active:false},data:{label:o.label||"Dashboard",icon:o.icon||"house"},backgroundColor:o.backgroundColor,backgroundHoverColor:o.backgroundHoverColor,textColor:o.textColor,textHoverColor:o.textHoverColor,borderRadius:o.borderRadius,backgroundFocusedColor:o.backgroundFocusedColor,textFocusedColor:o.textFocusedColor,padding:o.padding},o.demoData||{},{arrayMerge:function(o,e){return e}})}export{NavigationSidebarItem as sqm_navigation_sidebar_item};
@@ -1 +1 @@
1
- import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h,k as useState,f as useEffect}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,k as kn,H}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import{N as NavigationSidebarView}from"./sqm-navigation-sidebar-view-0a2ec560.js";var NavigationSidebar=function(){function e(e){registerInstance(this,e);this.ignored=true;this.mobileMenuColor="var(--sqm-text, #444445)";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useDemoNavigationSidebar(this):useNavigationSidebar(this);return h$1(NavigationSidebarView,Object.assign({},e),h$1("slot",null))};return e}();function useNavigationSidebar(e){var i=kn();var a=H();var o=useState(false),t=o[0],n=o[1];useEffect((function(){n(false)}),[i.pathname,a]);function r(e){n(e.target.checked)}return{mobileMenuColor:e.mobileMenuColor,checked:t,onClick:r}}function useDemoNavigationSidebar(e){return cjs({mobileMenuColor:e.mobileMenuColor},e.demoData||{},{arrayMerge:function(e,i){return i}})}export{NavigationSidebar as sqm_navigation_sidebar};
1
+ import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h,k as useState,f as useEffect}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,k as kn,H}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{N as NavigationSidebarView}from"./sqm-navigation-sidebar-view-0a2ec560.js";var NavigationSidebar=function(){function e(e){registerInstance(this,e);this.ignored=true;this.mobileMenuColor="var(--sqm-text, #444445)";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useDemoNavigationSidebar(this):useNavigationSidebar(this);return h$1(NavigationSidebarView,Object.assign({},e),h$1("slot",null))};return e}();function useNavigationSidebar(e){var i=kn();var a=H();var o=useState(false),t=o[0],n=o[1];useEffect((function(){n(false)}),[i.pathname,a]);function r(e){n(e.target.checked)}return{mobileMenuColor:e.mobileMenuColor,checked:t,onClick:r}}function useDemoNavigationSidebar(e){return cjs({mobileMenuColor:e.mobileMenuColor},e.demoData||{},{arrayMerge:function(e,i){return i}})}export{NavigationSidebar as sqm_navigation_sidebar};
@@ -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,a=1,n=arguments.length;a<n;a++){t=arguments[a];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,a,n){function r(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,o){function i(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?a(e.value):r(e.value).then(i,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,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 l([e,t])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(o=i[0]&2?r["return"]:i[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;if(r=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{h,F as Fragment,r as registerInstance}from"./index-b3a06de8.js";import{i as intl}from"./global-80edfef3.js";import{n as h$1,k as useState}from"./dom-context-hooks.module-63370afd.js";import{F as Fn,i as isDemo,d as dist,H,J,B,w as wn,$ as $e}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{R as REFERRAL_CODES_PAGINATION_CONTEXT,a as REFERRAL_CODES_NAMESPACE,S as SET_CODE_COPIED,u as useReferralCodes}from"./useReferralCodes-311e6d72.js";import"./mixins-f750863a.js";import{C as CopyTextView}from"./copy-text-view-a319c261.js";var style={Container:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"var(--sl-spacing-small)",width:"100%"},TextContainer:{display:"flex",gap:"var(--sl-spacing-xx-small)"}};var sheet=createStyleSheet(style);var styleString=sheet.toString();function PaginationView(e){var t=e.states,a=e.callbacks,n=e.text,r=e.buttonType;var o=a.onNext,i=a.onPrev;var s=t.currentPage,l=t.totalPages,u=t.loading;if(l===1)return h(Fragment,null);return h("span",{class:sheet.classes.Container,part:"sqm-base"},h("style",{type:"text/css"},styleString),!u&&h(Fragment,null,h("sl-button",{exportparts:"base: "+r+"button-base",onClick:i,part:"sqm-pagination-button",circle:true,disabled:s===1},h("sl-icon",{name:"chevron-left",label:"Previous Page"})),h("div",{class:sheet.classes.TextContainer},n.paginationText)),h("sl-button",{exportparts:"base: "+r+"button-base",onClick:o,part:"sqm-pagination-button",circle:true,disabled:s===l},h("sl-icon",{name:"chevron-right",label:"Previous Page"})))}function usePagination(e){var t;var a=Fn(REFERRAL_CODES_PAGINATION_CONTEXT);var n=a.states.currentPage+1;var r=(t=a.states)===null||t===void 0?void 0:t.pageCount;return{states:{currentPage:n,totalPages:r,loading:a.states.loading},callbacks:{onNext:function(){var e,t;return(e=a.callbacks)===null||e===void 0?void 0:e.setCurrentPage(((t=a.states)===null||t===void 0?void 0:t.currentPage)+1)},onPrev:function(){var e,t;return(e=a.callbacks)===null||e===void 0?void 0:e.setCurrentPage(((t=a.states)===null||t===void 0?void 0:t.currentPage)-1)}},text:{paginationText:intl.formatMessage({id:"paginationText",defaultMessage:e.paginationText},{currentPage:n,totalPages:r})}}}var Pagination=function(){function e(e){registerInstance(this,e);this.ignored=true;this.paginationText="{currentPage} of {totalPages}";this.buttonType="secondary";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useDemoPagination(getProps(this)):usePagination(getProps(this));return h(PaginationView,Object.assign({},e))};return e}();function useDemoPagination(e){var t=useState(1),a=t[0],n=t[1];return cjs({states:{currentPage:a,totalPages:5,loading:false},buttonType:e.buttonType,callbacks:{onNext:function(){return n(a+1)},onPrev:function(){return n(a-1)}},text:{paginationText:intl.formatMessage({id:"paginationText",defaultMessage:e.paginationText||"{currentPage} of {totalPages}"},{currentPage:a,totalPages:5})}},e.demoData||{},{arrayMerge:function(e,t){return t}})}var MessageLinkQuery=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query getReferralCode($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\n }\n }\n }\n"],["\n query getReferralCode($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\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 useReferralCode(e){var t,a;var n=e.programId,r=n===void 0?H():n;var o=J();var i=B();var s=Fn(REFERRAL_CODES_NAMESPACE);var l=wn(MessageLinkQuery,{programId:r},!(o===null||o===void 0?void 0:o.jwt)||(s===null||s===void 0?void 0:s.referralCode)!==undefined).data;var u=$e(WIDGET_ENGAGEMENT_EVENT)[0];var c=$e(SET_CODE_COPIED)[0];var d=(a=(s===null||s===void 0?void 0:s.referralCode)||((t=l===null||l===void 0?void 0:l.user)===null||t===void 0?void 0:t.referralCode))!==null&&a!==void 0?a:"...";var p=useState(false),f=p[0],g=p[1];function h(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!s)return[3,2];return[4,c({referralCode:s.referralCode})];case 1:t.sent();s.refresh();t.label=2;case 2:navigator.clipboard.writeText(d);g(true);setTimeout((function(){return g(false)}),e.tooltiplifespan);u({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:i,shareMedium:"DIRECT"}}});return[2]}}))}))}return __assign(__assign({},e),{onClick:h,open:f,copyString:d,isCopied:s===null||s===void 0?void 0:s.isCopied,showNotificationText:e.showNotificationText&&!!(s===null||s===void 0?void 0:s.singleUse)})}var ReferralCode=function(){function e(e){registerInstance(this,e);this.tooltiptext="Copied to Clipboard";this.showNotificationText=false;this.notificationText="You've copied this code before";this.tooltiplifespan=1e3;this.textAlign="left";this.copyButtonLabel="Copy Code";this.buttonStyle="icon";this.buttonType="primary";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoReferralCode(e):useReferralCode(e);return h(CopyTextView,Object.assign({},t))};return e}();function useDemoReferralCode(e){var t=useState(false),a=t[0],n=t[1];var r="REFERRALCODE001";return cjs({copyString:r,tooltiptext:e.tooltiptext,textAlign:e.textAlign,copyButtonLabel:e.copyButtonLabel,buttonStyle:e.buttonStyle,notificationText:e.notificationText,showNotificationText:e.showNotificationText,isCopied:e.showNotificationText,borderColor:e.borderColor,backgroundColor:e.backgroundColor,textColor:e.textColor,borderRadius:e.borderRadius,buttonType:e.buttonType,isUsed:false,rewardStatus:"AVAILABLE",open:a,onClick:function(){navigator.clipboard.writeText(r);n(true);setTimeout((function(){return n(false)}),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:function(e,t){return t}})}function ReferralCodesView(e){var t=e.slots,a=e.titleText,n=e.states,r=e.textColor,o=r===void 0?"var(--sqm-text-subdued)":r;var i={Wrapper:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column",gap:"var(--sl-spacing-large)",color:o},HeaderContainer:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},ShareCodeContainer:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column"},ShareButtonContainer:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column"},TitleText:{fontSize:"var(--sl-font-size-large)",margin:"0"}};var s="\n :host {\n display: block;\n }\n :host([hidden]): {\n display: none;\n }\n ";var l=createStyleSheet(i);var u=l.toString();var c=function(e){if(e.noCodes){return t.empty}if(e.loading){return t.loading}return h("div",{class:l.classes.Wrapper},h("div",{class:l.classes.ShareCodeContainer},t.shareCodes),h("div",{class:l.classes.ShareButtonContainer},t.shareButtons))};return h("div",{class:l.classes.Wrapper,part:"sqm-base"},h("style",{type:"text/css"},s,u),h("div",{class:l.classes.HeaderContainer},h("h2",{class:l.classes.TitleText},a),!n.noCodes&&!n.loading&&t.pagination),c(n))}var ReferralCodes=function(){function e(e){registerInstance(this,e);this.titleText="Start sharing";this.emptyStateHeaderText="Your new codes and links aren’t ready yet";this.emptyStateDescriptionText="Please contact our program support team to let them know you’re out of codes.";this.emptyStateImageUrl="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoReferralCodes(e):useReferralCodes(e);var a={shareButtons:h("slot",{name:"shareButtons"}),shareCodes:h("slot",{name:"shareCodes"}),pagination:h("slot",{name:"pagination"}),empty:h(EmptySlot,{headerText:this.emptyStateHeaderText,descriptionText:this.emptyStateDescriptionText,imageUrl:this.emptyStateImageUrl}),loading:h(LoadingSlot,null)};var n=__assign(__assign({slots:a},t),{loading:t.states.loading,noCodes:t.states.noCodes});return h(ReferralCodesView,Object.assign({},n))};return e}();function EmptySlot(e){var t=e.headerText,a=e.descriptionText,n=e.imageUrl;return h("slot",{name:"empty"},h("sqm-empty",{emptyStateHeader:t,emptyStateText:a,emptyStateImage:n}))}function LoadingSlot(){return h("slot",{name:"loading"},h(LoadingRow,null),h(LoadingRow,null),h(LoadingRow,null),h(LoadingRow,null))}function LoadingRow(){return h("sl-skeleton",{style:{width:"100%"}})}function useDemoReferralCodes(e){return cjs({titleText:e.titleText,textColor:e.textColor,states:{noCodes:false,loading:false}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{Pagination as sqm_pagination,ReferralCode as sqm_referral_code,ReferralCodes as sqm_referral_codes};var templateObject_1,templateObject_2;
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,a=1,n=arguments.length;a<n;a++){t=arguments[a];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,a,n){function r(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,o){function i(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?a(e.value):r(e.value).then(i,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,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 l([e,t])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(o=i[0]&2?r["return"]:i[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;if(r=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];r=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{h,F as Fragment,r as registerInstance}from"./index-b3a06de8.js";import{i as intl}from"./global-ef7a7354.js";import{n as h$1,k as useState}from"./dom-context-hooks.module-63370afd.js";import{F as Fn,i as isDemo,d as dist,H,J,B,w as wn,$ as $e}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{R as REFERRAL_CODES_PAGINATION_CONTEXT,a as REFERRAL_CODES_NAMESPACE,S as SET_CODE_COPIED,u as useReferralCodes}from"./useReferralCodes-c2e809cf.js";import"./mixins-f750863a.js";import{C as CopyTextView}from"./copy-text-view-d8822c16.js";var style={Container:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"var(--sl-spacing-small)",width:"100%"},TextContainer:{display:"flex",gap:"var(--sl-spacing-xx-small)"}};var sheet=createStyleSheet(style);var styleString=sheet.toString();function PaginationView(e){var t=e.states,a=e.callbacks,n=e.text,r=e.buttonType;var o=a.onNext,i=a.onPrev;var s=t.currentPage,l=t.totalPages,u=t.loading;if(l===1)return h(Fragment,null);return h("span",{class:sheet.classes.Container,part:"sqm-base"},h("style",{type:"text/css"},styleString),!u&&h(Fragment,null,h("sl-button",{exportparts:"base: "+r+"button-base",onClick:i,part:"sqm-pagination-button",circle:true,disabled:s===1},h("sl-icon",{name:"chevron-left",label:"Previous Page"})),h("div",{class:sheet.classes.TextContainer},n.paginationText)),h("sl-button",{exportparts:"base: "+r+"button-base",onClick:o,part:"sqm-pagination-button",circle:true,disabled:s===l},h("sl-icon",{name:"chevron-right",label:"Previous Page"})))}function usePagination(e){var t;var a=Fn(REFERRAL_CODES_PAGINATION_CONTEXT);var n=a.states.currentPage+1;var r=(t=a.states)===null||t===void 0?void 0:t.pageCount;return{states:{currentPage:n,totalPages:r,loading:a.states.loading},callbacks:{onNext:function(){var e,t;return(e=a.callbacks)===null||e===void 0?void 0:e.setCurrentPage(((t=a.states)===null||t===void 0?void 0:t.currentPage)+1)},onPrev:function(){var e,t;return(e=a.callbacks)===null||e===void 0?void 0:e.setCurrentPage(((t=a.states)===null||t===void 0?void 0:t.currentPage)-1)}},text:{paginationText:intl.formatMessage({id:"paginationText",defaultMessage:e.paginationText},{currentPage:n,totalPages:r})}}}var Pagination=function(){function e(e){registerInstance(this,e);this.ignored=true;this.paginationText="{currentPage} of {totalPages}";this.buttonType="secondary";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useDemoPagination(getProps(this)):usePagination(getProps(this));return h(PaginationView,Object.assign({},e))};return e}();function useDemoPagination(e){var t=useState(1),a=t[0],n=t[1];return cjs({states:{currentPage:a,totalPages:5,loading:false},buttonType:e.buttonType,callbacks:{onNext:function(){return n(a+1)},onPrev:function(){return n(a-1)}},text:{paginationText:intl.formatMessage({id:"paginationText",defaultMessage:e.paginationText||"{currentPage} of {totalPages}"},{currentPage:a,totalPages:5})}},e.demoData||{},{arrayMerge:function(e,t){return t}})}var MessageLinkQuery=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query getReferralCode($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\n }\n }\n }\n"],["\n query getReferralCode($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\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 useReferralCode(e){var t,a;var n=e.programId,r=n===void 0?H():n;var o=J();var i=B();var s=Fn(REFERRAL_CODES_NAMESPACE);var l=wn(MessageLinkQuery,{programId:r},!(o===null||o===void 0?void 0:o.jwt)||(s===null||s===void 0?void 0:s.referralCode)!==undefined).data;var u=$e(WIDGET_ENGAGEMENT_EVENT)[0];var c=$e(SET_CODE_COPIED)[0];var d=(a=(s===null||s===void 0?void 0:s.referralCode)||((t=l===null||l===void 0?void 0:l.user)===null||t===void 0?void 0:t.referralCode))!==null&&a!==void 0?a:"...";var p=useState(false),f=p[0],g=p[1];function h(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!s)return[3,2];return[4,c({referralCode:s.referralCode})];case 1:t.sent();s.refresh();t.label=2;case 2:navigator.clipboard.writeText(d);g(true);setTimeout((function(){return g(false)}),e.tooltiplifespan);u({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:i,shareMedium:"DIRECT"}}});return[2]}}))}))}return __assign(__assign({},e),{onClick:h,open:f,copyString:d,isCopied:s===null||s===void 0?void 0:s.isCopied,showNotificationText:e.showNotificationText&&!!(s===null||s===void 0?void 0:s.singleUse)})}var ReferralCode=function(){function e(e){registerInstance(this,e);this.tooltiptext="Copied to Clipboard";this.showNotificationText=false;this.notificationText="You've copied this code before";this.tooltiplifespan=1e3;this.textAlign="left";this.copyButtonLabel="Copy Code";this.buttonStyle="icon";this.buttonType="primary";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoReferralCode(e):useReferralCode(e);return h(CopyTextView,Object.assign({},t))};return e}();function useDemoReferralCode(e){var t=useState(false),a=t[0],n=t[1];var r="REFERRALCODE001";return cjs({copyString:r,tooltiptext:e.tooltiptext,textAlign:e.textAlign,copyButtonLabel:e.copyButtonLabel,buttonStyle:e.buttonStyle,notificationText:e.notificationText,showNotificationText:e.showNotificationText,isCopied:e.showNotificationText,borderColor:e.borderColor,backgroundColor:e.backgroundColor,textColor:e.textColor,borderRadius:e.borderRadius,buttonType:e.buttonType,isUsed:false,rewardStatus:"AVAILABLE",open:a,onClick:function(){navigator.clipboard.writeText(r);n(true);setTimeout((function(){return n(false)}),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:function(e,t){return t}})}function ReferralCodesView(e){var t=e.slots,a=e.titleText,n=e.states,r=e.textColor,o=r===void 0?"var(--sqm-text-subdued)":r;var i={Wrapper:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column",gap:"var(--sl-spacing-large)",color:o},HeaderContainer:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},ShareCodeContainer:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column"},ShareButtonContainer:{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"center",flexDirection:"column"},TitleText:{fontSize:"var(--sl-font-size-large)",margin:"0"}};var s="\n :host {\n display: block;\n }\n :host([hidden]): {\n display: none;\n }\n ";var l=createStyleSheet(i);var u=l.toString();var c=function(e){if(e.noCodes){return t.empty}if(e.loading){return t.loading}return h("div",{class:l.classes.Wrapper},h("div",{class:l.classes.ShareCodeContainer},t.shareCodes),h("div",{class:l.classes.ShareButtonContainer},t.shareButtons))};return h("div",{class:l.classes.Wrapper,part:"sqm-base"},h("style",{type:"text/css"},s,u),h("div",{class:l.classes.HeaderContainer},h("h2",{class:l.classes.TitleText},a),!n.noCodes&&!n.loading&&t.pagination),c(n))}var ReferralCodes=function(){function e(e){registerInstance(this,e);this.titleText="Start sharing";this.emptyStateHeaderText="Your new codes and links aren’t ready yet";this.emptyStateDescriptionText="Please contact our program support team to let them know you’re out of codes.";this.emptyStateImageUrl="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png";h$1(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getProps(this);var t=isDemo()?useDemoReferralCodes(e):useReferralCodes(e);var a={shareButtons:h("slot",{name:"shareButtons"}),shareCodes:h("slot",{name:"shareCodes"}),pagination:h("slot",{name:"pagination"}),empty:h(EmptySlot,{headerText:this.emptyStateHeaderText,descriptionText:this.emptyStateDescriptionText,imageUrl:this.emptyStateImageUrl}),loading:h(LoadingSlot,null)};var n=__assign(__assign({slots:a},t),{loading:t.states.loading,noCodes:t.states.noCodes});return h(ReferralCodesView,Object.assign({},n))};return e}();function EmptySlot(e){var t=e.headerText,a=e.descriptionText,n=e.imageUrl;return h("slot",{name:"empty"},h("sqm-empty",{emptyStateHeader:t,emptyStateText:a,emptyStateImage:n}))}function LoadingSlot(){return h("slot",{name:"loading"},h(LoadingRow,null),h(LoadingRow,null),h(LoadingRow,null),h(LoadingRow,null))}function LoadingRow(){return h("sl-skeleton",{style:{width:"100%"}})}function useDemoReferralCodes(e){return cjs({titleText:e.titleText,textColor:e.textColor,states:{noCodes:false,loading:false}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{Pagination as sqm_pagination,ReferralCode as sqm_referral_code,ReferralCodes as sqm_referral_codes};var templateObject_1,templateObject_2;
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,s=1,r=arguments.length;s<r;s++){e=arguments[s];for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))t[i]=e[i]}return t};return __assign.apply(this,arguments)};import{h,r as registerInstance}from"./index-b3a06de8.js";import{i as d,k as useState,n as h$1}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{E as ErrorStyles}from"./mixins-f750863a.js";import{R as REGISTRATION_FORM_STATE_CONTEXT}from"./useRegistrationFormState-18c2cea7.js";var constants={error:{length:"Length should be a valid positive number",password:"Password should be a valid string"},regex:{digits:"(\\d.*)",letters:"([a-zA-Z].*)",symbols:"([`~\\!@#\\$%\\^\\&\\*\\(\\)\\-_\\=\\+\\[\\{\\}\\]\\\\|;:\\'\",<.>\\/\\?€£¥₹§±].*)",spaces:"([\\s].*)"}};var regex=constants.regex;function _process(t,e){if(e&&e>1){var s=parseInt(e,10);return new RegExp(t+"{"+s+",}").test(this.password)===this.positive}return new RegExp(t).test(this.password)===this.positive}var lib={not:function t(e){this.positive=false;if(e){return _process.call(this,e)}return true},has:function t(e){this.positive=true;if(e){return _process.call(this,e)}return true},is:function t(){this.positive=true;return true},min:function t(e){return this.password.length>=e},max:function t(e){return this.password.length<=e},digits:function t(e){return _process.call(this,regex.digits,e)},letters:function t(e){return _process.call(this,regex.letters,e)},uppercase:function t(e){if(e&&e>1){var s=0;var r=0;while(r<e&&s<this.password.length){var i=this.password.charAt(s);if(i!==i.toLowerCase()){r++}s++}return r===e===this.positive}return this.password!==this.password.toLowerCase()===this.positive},lowercase:function t(e){if(e&&e>1){var s=0;var r=0;while(r<e&&s<this.password.length){var i=this.password.charAt(s);if(i!==i.toUpperCase()){r++}s++}return r===e===this.positive}return this.password!==this.password.toUpperCase()===this.positive},symbols:function t(e){return _process.call(this,regex.symbols,e)},spaces:function t(e){return _process.call(this,regex.spaces,e)},oneOf:function t(e){return e.indexOf(this.password)>=0===this.positive}};var error=constants.error;function _validateLength(t){var e=Number(t);if(isNaN(e)||!Number.isInteger(e)||e<1){throw new Error(error.length)}}function _isPasswordValidFor(t){return lib[t.method].apply(this,t.arguments)}function _register(t,e){this.properties.push({method:t,arguments:e});return this}var PasswordValidator=function(){function t(){this.properties=[]}t.prototype.validate=function(t,e){var s=this;this.list=Boolean(e&&e.list);this.password=String(t);this.positive=true;if(this.list){return this.properties.reduce((function(t,e){if(!_isPasswordValidFor.call(s,e)){return t.concat(e.method)}return t}),[])}return this.properties.every(_isPasswordValidFor.bind(this))};t.prototype.letters=function(t){t&&_validateLength(t);return _register.call(this,"letters",arguments)};t.prototype.digits=function(t){t&&_validateLength(t);return _register.call(this,"digits",arguments)};t.prototype.symbols=function(t){t&&_validateLength(t);return _register.call(this,"symbols",arguments)};t.prototype.min=function(t){_validateLength(t);return _register.call(this,"min",arguments)};t.prototype.max=function(t){_validateLength(t);return _register.call(this,"max",arguments)};t.prototype.lowercase=function(t){t&&_validateLength(t);return _register.call(this,"lowercase",arguments)};t.prototype.uppercase=function(t){t&&_validateLength(t);return _register.call(this,"uppercase",arguments)};t.prototype.spaces=function(t){t&&_validateLength(t);return _register.call(this,"spaces",arguments)};t.prototype.has=function(){return _register.call(this,"has",arguments)};t.prototype.not=function(){return _register.call(this,"not",arguments)};t.prototype.is=function(){return _register.call(this,"is",arguments)};t.prototype.oneOf=function(){return _register.call(this,"oneOf",arguments)};return t}();var src=PasswordValidator;var passwordSchema=(new src).is().min(8).has().uppercase().has().lowercase().has(/([\d`~\!@#\$%\^\&\*\(\)\-_\=\+\[\{\}\]\\\|;:'",<.>\/\?€£¥₹§±].*){1,}/);var validateNewPassword=function(t,e){var s=passwordSchema.validate(t,{list:true});var r=getErrorMessage(s,t,e);return r};var Valid=function(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},h("path",{d:"M6 0C2.688 0 0 2.688 0 6C0 9.312 2.688 12 6 12C9.312 12 12 9.312 12 6C12 2.688 9.312 0 6 0ZM4.8 9L1.8 6L2.646 5.154L4.8 7.302L9.354 2.748L10.2 3.6L4.8 9Z",fill:"#259053"}))};var Invalid=function(){return h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M6 0C2.688 0 0 2.688 0 6C0 9.312 2.688 12 6 12C9.312 12 12 9.312 12 6C12 2.688 9.312 0 6 0ZM6 10.8C3.354 10.8 1.2 8.646 1.2 6C1.2 3.354 3.354 1.2 6 1.2C8.646 1.2 10.8 3.354 10.8 6C10.8 8.646 8.646 10.8 6 10.8ZM8.754 3.348L4.8 7.302L3.246 5.754L2.4 6.6L4.8 9L9.6 4.2L8.754 3.348Z",fill:"#555555"}))};var baseItem={display:"flex",alignItems:"center",fontSize:"var(--sl-font-size-small)","& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}};var style={Base:{fontSize:"var(--sl-font-size-small)"},ValidationList:{"list-style-type":"none",paddingRight:"var(--sl-spacing-large)",margin:"var(--sl-spacing-small) 0 var(--sl-spacing-x-large)","& > :not(:last-child)":{"margin-bottom":"var(--sl-spacing-xx-small)"},"& *":{"line-height":"var(--sl-line-height-dense)"}},ValidationItemValid:__assign(__assign({},baseItem),{color:"var(--sl-color-success-600)"}),ValidationItemInvalid:__assign({},baseItem)};var sheet=createStyleSheet(style);var styleString=sheet.toString();var getErrorMessage=function(t,e,s){var r={min:s.minErrorText,uppercase:s.uppercaseErrorText,lowercase:s.lowercaseErrorText,has:s.hasErrorText};if(!t.length&&e)return h("div",{class:sheet.classes.ValidationItemValid,style:{paddingBottom:"var(--sl-spacing-x-large)"}},h("style",{type:"text/css"},styleString),h(Valid,null)," ",h("span",null,s.meetsRequirementsText));return h("div",{class:sheet.classes.Base},h("style",{type:"text/css"},styleString),s.doesNotMeetRequirementsText,h("ul",{class:sheet.classes.ValidationList},Object.keys(r).map((function(e){return t.includes(e)?h("li",{class:sheet.classes.ValidationItemInvalid},h(Invalid,null)," ",h("span",null,r[e])):h("li",{class:sheet.classes.ValidationItemValid},h(Valid,null)," ",h("span",null,r[e]))}))))};var style$1={InputContainer:{"& > :not(:last-child)":{"margin-bottom":"20px"}},ErrorStyle:ErrorStyles};var vanillaStyle="\n:host {\n margin: 0 auto;\n width: 100%;\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n";var sheet$1=createStyleSheet(style$1);var styleString$1=sheet$1.toString();function PortalResetPasswordView(t){var e,s,r,i,a,n,o,l,d,u;var c=t.states,p=t.callbacks;return h("div",{class:sheet$1.classes.InputContainer,part:"sqm-base"},h("style",{type:"text/css"},vanillaStyle,styleString$1),h("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"password",name:"/password",label:c.content.fieldLabel||"Password",required:true,disabled:((e=c.registrationFormState)===null||e===void 0?void 0:e.loading)||((s=c.registrationFormState)===null||s===void 0?void 0:s.disabled),validationError:function(t){var e=t.value;if(!e){return"Cannot be empty"}}},((i=(r=c.registrationFormState)===null||r===void 0?void 0:r.initialData)===null||i===void 0?void 0:i.password)?{value:(n=(a=c.registrationFormState)===null||a===void 0?void 0:a.initialData)===null||n===void 0?void 0:n.password}:{},((l=(o=c.registrationFormState)===null||o===void 0?void 0:o.validationErrors)===null||l===void 0?void 0:l.password)?{class:sheet$1.classes.ErrorStyle,helpText:((u=(d=c.registrationFormState)===null||d===void 0?void 0:d.validationErrors)===null||u===void 0?void 0:u.password)||"Cannot be empty"}:[],{onInput:function(t){return c.enableValidation&&p.onInput(t)}})),c.dynamicValidation)}function usePasswordField(t){var e=d(REGISTRATION_FORM_STATE_CONTEXT);var s=useState(""),r=s[0],i=s[1];function a(e){var s=validateNewPassword(e.target.value,t);i(s)}return{states:{enableValidation:!t.disableValidation,dynamicValidation:r,registrationFormState:e,content:{fieldLabel:t.fieldLabel}},callbacks:{onInput:a}}}var PortalPasswordField=function(){function t(t){registerInstance(this,t);this.ignored=true;this.fieldLabel="Password";this.disableValidation=false;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$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=isDemo()?usePasswordFieldDemo(getProps(this)):usePasswordField(getProps(this)),e=t.states,s=t.callbacks;return h(PortalResetPasswordView,{states:e,callbacks:s})};return t}();function usePasswordFieldDemo(t){var e,s,r,i,a,n,o;var l=useState(""),d=l[0],u=l[1];var c=useState(""),h=c[0],p=c[1];if(t.demoData&&h!=((e=t===null||t===void 0?void 0:t.demoData)===null||e===void 0?void 0:e.initValue)){var v=validateNewPassword(((s=t===null||t===void 0?void 0:t.demoData)===null||s===void 0?void 0:s.initValue)||"",t);u(((r=t===null||t===void 0?void 0:t.demoData)===null||r===void 0?void 0:r.initValue)===""?"":v);p((i=t===null||t===void 0?void 0:t.demoData)===null||i===void 0?void 0:i.initValue)}function g(e){var s=validateNewPassword(e.target.value,t);u(s)}return cjs({states:{enableValidation:!t.disableValidation,dynamicValidation:d,registrationFormState:((n=(a=t===null||t===void 0?void 0:t.demoData)===null||a===void 0?void 0:a.states)===null||n===void 0?void 0:n.registrationFormState)||{},content:{fieldLabel:t.fieldLabel}},callbacks:{onInput:g}},((o=t===null||t===void 0?void 0:t.demoData)===null||o===void 0?void 0:o.states)||{},{arrayMerge:function(t,e){return e}})}export{PortalPasswordField as sqm_password_field};
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,s=1,r=arguments.length;s<r;s++){e=arguments[s];for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))t[i]=e[i]}return t};return __assign.apply(this,arguments)};import{h,r as registerInstance}from"./index-b3a06de8.js";import{i as d,k as useState,n as h$1}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{E as ErrorStyles}from"./mixins-f750863a.js";import{R as REGISTRATION_FORM_STATE_CONTEXT}from"./useRegistrationFormState-24d594ea.js";var constants={error:{length:"Length should be a valid positive number",password:"Password should be a valid string"},regex:{digits:"(\\d.*)",letters:"([a-zA-Z].*)",symbols:"([`~\\!@#\\$%\\^\\&\\*\\(\\)\\-_\\=\\+\\[\\{\\}\\]\\\\|;:\\'\",<.>\\/\\?€£¥₹§±].*)",spaces:"([\\s].*)"}};var regex=constants.regex;function _process(t,e){if(e&&e>1){var s=parseInt(e,10);return new RegExp(t+"{"+s+",}").test(this.password)===this.positive}return new RegExp(t).test(this.password)===this.positive}var lib={not:function t(e){this.positive=false;if(e){return _process.call(this,e)}return true},has:function t(e){this.positive=true;if(e){return _process.call(this,e)}return true},is:function t(){this.positive=true;return true},min:function t(e){return this.password.length>=e},max:function t(e){return this.password.length<=e},digits:function t(e){return _process.call(this,regex.digits,e)},letters:function t(e){return _process.call(this,regex.letters,e)},uppercase:function t(e){if(e&&e>1){var s=0;var r=0;while(r<e&&s<this.password.length){var i=this.password.charAt(s);if(i!==i.toLowerCase()){r++}s++}return r===e===this.positive}return this.password!==this.password.toLowerCase()===this.positive},lowercase:function t(e){if(e&&e>1){var s=0;var r=0;while(r<e&&s<this.password.length){var i=this.password.charAt(s);if(i!==i.toUpperCase()){r++}s++}return r===e===this.positive}return this.password!==this.password.toUpperCase()===this.positive},symbols:function t(e){return _process.call(this,regex.symbols,e)},spaces:function t(e){return _process.call(this,regex.spaces,e)},oneOf:function t(e){return e.indexOf(this.password)>=0===this.positive}};var error=constants.error;function _validateLength(t){var e=Number(t);if(isNaN(e)||!Number.isInteger(e)||e<1){throw new Error(error.length)}}function _isPasswordValidFor(t){return lib[t.method].apply(this,t.arguments)}function _register(t,e){this.properties.push({method:t,arguments:e});return this}var PasswordValidator=function(){function t(){this.properties=[]}t.prototype.validate=function(t,e){var s=this;this.list=Boolean(e&&e.list);this.password=String(t);this.positive=true;if(this.list){return this.properties.reduce((function(t,e){if(!_isPasswordValidFor.call(s,e)){return t.concat(e.method)}return t}),[])}return this.properties.every(_isPasswordValidFor.bind(this))};t.prototype.letters=function(t){t&&_validateLength(t);return _register.call(this,"letters",arguments)};t.prototype.digits=function(t){t&&_validateLength(t);return _register.call(this,"digits",arguments)};t.prototype.symbols=function(t){t&&_validateLength(t);return _register.call(this,"symbols",arguments)};t.prototype.min=function(t){_validateLength(t);return _register.call(this,"min",arguments)};t.prototype.max=function(t){_validateLength(t);return _register.call(this,"max",arguments)};t.prototype.lowercase=function(t){t&&_validateLength(t);return _register.call(this,"lowercase",arguments)};t.prototype.uppercase=function(t){t&&_validateLength(t);return _register.call(this,"uppercase",arguments)};t.prototype.spaces=function(t){t&&_validateLength(t);return _register.call(this,"spaces",arguments)};t.prototype.has=function(){return _register.call(this,"has",arguments)};t.prototype.not=function(){return _register.call(this,"not",arguments)};t.prototype.is=function(){return _register.call(this,"is",arguments)};t.prototype.oneOf=function(){return _register.call(this,"oneOf",arguments)};return t}();var src=PasswordValidator;var passwordSchema=(new src).is().min(8).has().uppercase().has().lowercase().has(/([\d`~\!@#\$%\^\&\*\(\)\-_\=\+\[\{\}\]\\\|;:'",<.>\/\?€£¥₹§±].*){1,}/);var validateNewPassword=function(t,e){var s=passwordSchema.validate(t,{list:true});var r=getErrorMessage(s,t,e);return r};var Valid=function(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},h("path",{d:"M6 0C2.688 0 0 2.688 0 6C0 9.312 2.688 12 6 12C9.312 12 12 9.312 12 6C12 2.688 9.312 0 6 0ZM4.8 9L1.8 6L2.646 5.154L4.8 7.302L9.354 2.748L10.2 3.6L4.8 9Z",fill:"#259053"}))};var Invalid=function(){return h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M6 0C2.688 0 0 2.688 0 6C0 9.312 2.688 12 6 12C9.312 12 12 9.312 12 6C12 2.688 9.312 0 6 0ZM6 10.8C3.354 10.8 1.2 8.646 1.2 6C1.2 3.354 3.354 1.2 6 1.2C8.646 1.2 10.8 3.354 10.8 6C10.8 8.646 8.646 10.8 6 10.8ZM8.754 3.348L4.8 7.302L3.246 5.754L2.4 6.6L4.8 9L9.6 4.2L8.754 3.348Z",fill:"#555555"}))};var baseItem={display:"flex",alignItems:"center",fontSize:"var(--sl-font-size-small)","& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}};var style={Base:{fontSize:"var(--sl-font-size-small)"},ValidationList:{"list-style-type":"none",paddingRight:"var(--sl-spacing-large)",margin:"var(--sl-spacing-small) 0 var(--sl-spacing-x-large)","& > :not(:last-child)":{"margin-bottom":"var(--sl-spacing-xx-small)"},"& *":{"line-height":"var(--sl-line-height-dense)"}},ValidationItemValid:__assign(__assign({},baseItem),{color:"var(--sl-color-success-600)"}),ValidationItemInvalid:__assign({},baseItem)};var sheet=createStyleSheet(style);var styleString=sheet.toString();var getErrorMessage=function(t,e,s){var r={min:s.minErrorText,uppercase:s.uppercaseErrorText,lowercase:s.lowercaseErrorText,has:s.hasErrorText};if(!t.length&&e)return h("div",{class:sheet.classes.ValidationItemValid,style:{paddingBottom:"var(--sl-spacing-x-large)"}},h("style",{type:"text/css"},styleString),h(Valid,null)," ",h("span",null,s.meetsRequirementsText));return h("div",{class:sheet.classes.Base},h("style",{type:"text/css"},styleString),s.doesNotMeetRequirementsText,h("ul",{class:sheet.classes.ValidationList},Object.keys(r).map((function(e){return t.includes(e)?h("li",{class:sheet.classes.ValidationItemInvalid},h(Invalid,null)," ",h("span",null,r[e])):h("li",{class:sheet.classes.ValidationItemValid},h(Valid,null)," ",h("span",null,r[e]))}))))};var style$1={InputContainer:{"& > :not(:last-child)":{"margin-bottom":"20px"}},ErrorStyle:ErrorStyles};var vanillaStyle="\n:host {\n margin: 0 auto;\n width: 100%;\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n";var sheet$1=createStyleSheet(style$1);var styleString$1=sheet$1.toString();function PortalResetPasswordView(t){var e,s,r,i,a,n,o,l,d,u;var c=t.states,p=t.callbacks;return h("div",{class:sheet$1.classes.InputContainer,part:"sqm-base"},h("style",{type:"text/css"},vanillaStyle,styleString$1),h("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"password",name:"/password",label:c.content.fieldLabel||"Password",required:true,disabled:((e=c.registrationFormState)===null||e===void 0?void 0:e.loading)||((s=c.registrationFormState)===null||s===void 0?void 0:s.disabled),validationError:function(t){var e=t.value;if(!e){return"Cannot be empty"}}},((i=(r=c.registrationFormState)===null||r===void 0?void 0:r.initialData)===null||i===void 0?void 0:i.password)?{value:(n=(a=c.registrationFormState)===null||a===void 0?void 0:a.initialData)===null||n===void 0?void 0:n.password}:{},((l=(o=c.registrationFormState)===null||o===void 0?void 0:o.validationErrors)===null||l===void 0?void 0:l.password)?{class:sheet$1.classes.ErrorStyle,helpText:((u=(d=c.registrationFormState)===null||d===void 0?void 0:d.validationErrors)===null||u===void 0?void 0:u.password)||"Cannot be empty"}:[],{onInput:function(t){return c.enableValidation&&p.onInput(t)}})),c.dynamicValidation)}function usePasswordField(t){var e=d(REGISTRATION_FORM_STATE_CONTEXT);var s=useState(""),r=s[0],i=s[1];function a(e){var s=validateNewPassword(e.target.value,t);i(s)}return{states:{enableValidation:!t.disableValidation,dynamicValidation:r,registrationFormState:e,content:{fieldLabel:t.fieldLabel}},callbacks:{onInput:a}}}var PortalPasswordField=function(){function t(t){registerInstance(this,t);this.ignored=true;this.fieldLabel="Password";this.disableValidation=false;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$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=isDemo()?usePasswordFieldDemo(getProps(this)):usePasswordField(getProps(this)),e=t.states,s=t.callbacks;return h(PortalResetPasswordView,{states:e,callbacks:s})};return t}();function usePasswordFieldDemo(t){var e,s,r,i,a,n,o;var l=useState(""),d=l[0],u=l[1];var c=useState(""),h=c[0],p=c[1];if(t.demoData&&h!=((e=t===null||t===void 0?void 0:t.demoData)===null||e===void 0?void 0:e.initValue)){var v=validateNewPassword(((s=t===null||t===void 0?void 0:t.demoData)===null||s===void 0?void 0:s.initValue)||"",t);u(((r=t===null||t===void 0?void 0:t.demoData)===null||r===void 0?void 0:r.initValue)===""?"":v);p((i=t===null||t===void 0?void 0:t.demoData)===null||i===void 0?void 0:i.initValue)}function g(e){var s=validateNewPassword(e.target.value,t);u(s)}return cjs({states:{enableValidation:!t.disableValidation,dynamicValidation:d,registrationFormState:((n=(a=t===null||t===void 0?void 0:t.demoData)===null||a===void 0?void 0:a.states)===null||n===void 0?void 0:n.registrationFormState)||{},content:{fieldLabel:t.fieldLabel}},callbacks:{onInput:g}},((o=t===null||t===void 0?void 0:t.demoData)===null||o===void 0?void 0:o.states)||{},{arrayMerge:function(t,e){return e}})}export{PortalPasswordField as sqm_password_field};
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,o=1,s=arguments.length;o<s;o++){e=arguments[o];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]}return t};return __assign.apply(this,arguments)};import{h,c as Host,r as registerInstance}from"./index-b3a06de8.js";import{n as h$1}from"./dom-context-hooks.module-63370afd.js";import{B}from"./index.module-38dad6c9.js";import{g as getProps}from"./utils-03188de2.js";var PopupContainerView=function(t){var e=t.states,o=t.callbacks;var s=e.styles;return h(Host,{class:"squatch-container"},h("div",{style:{padding:t.states.styles.padding},part:"sqm-base"},s.closeButton&&h("span",{part:"sqm-close-button",class:"close squatch-header-close","data-close-panel":"#squatch-panel",onClick:function(){return o.closePopup()}},s.closeButtonText),h("slot",null),s.poweredBy?h("a",{class:"sqh-attribution",href:"https://impact.com/advocate/",target:"_blank"},s.poweredByText):""))};function usePopupContainer(t){var e=B();function o(){var t;if(B()==="POPUP"){(t=window.frameElement["squatchJsApi"])===null||t===void 0?void 0:t.close()}}var s=t.popupPadding?t.popupPadding==="none"?"0":"var(--sl-spacing-"+t.popupPadding+")":"var(--sl-spacing-medium)";var n=t.embedPadding?t.embedPadding==="none"?"0":"var(--sl-spacing-"+t.embedPadding+")":"0";var a=B()==="POPUP"?s:n;return{states:{showCloseButton:t.closeButton&&e==="POPUP",styles:__assign(__assign({},t),{padding:a,closeButtonText:t.closeButtonText?t.closeButtonText:"X",poweredByText:t.poweredByText})},data:{},callbacks:{closePopup:o}}}var sqmPopupContainerCss=".squatch-header-close{position:absolute;right:20px;top:10px;cursor:pointer}.squatch-container{background-color:var(--widget-background-color);display:block}";var PopupContainer=function(){function t(t){registerInstance(this,t);this.poweredByText="Powered By";h$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=getProps(this);return h(PopupContainerView,Object.assign({},usePopupContainer(t)))};return t}();PopupContainer.style=sqmPopupContainerCss;export{PopupContainer as sqm_popup_container};
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,o=1,s=arguments.length;o<s;o++){e=arguments[o];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]}return t};return __assign.apply(this,arguments)};import{h,c as Host,r as registerInstance}from"./index-b3a06de8.js";import{n as h$1}from"./dom-context-hooks.module-63370afd.js";import{B}from"./index.module-c9811a48.js";import{g as getProps}from"./utils-03188de2.js";var PopupContainerView=function(t){var e=t.states,o=t.callbacks;var s=e.styles;return h(Host,{class:"squatch-container"},h("div",{style:{padding:t.states.styles.padding},part:"sqm-base"},s.closeButton&&h("span",{part:"sqm-close-button",class:"close squatch-header-close","data-close-panel":"#squatch-panel",onClick:function(){return o.closePopup()}},s.closeButtonText),h("slot",null),s.poweredBy?h("a",{class:"sqh-attribution",href:"https://impact.com/advocate/",target:"_blank"},s.poweredByText):""))};function usePopupContainer(t){var e=B();function o(){var t;if(B()==="POPUP"){(t=window.frameElement["squatchJsApi"])===null||t===void 0?void 0:t.close()}}var s=t.popupPadding?t.popupPadding==="none"?"0":"var(--sl-spacing-"+t.popupPadding+")":"var(--sl-spacing-medium)";var n=t.embedPadding?t.embedPadding==="none"?"0":"var(--sl-spacing-"+t.embedPadding+")":"0";var a=B()==="POPUP"?s:n;return{states:{showCloseButton:t.closeButton&&e==="POPUP",styles:__assign(__assign({},t),{padding:a,closeButtonText:t.closeButtonText?t.closeButtonText:"X",poweredByText:t.poweredByText})},data:{},callbacks:{closePopup:o}}}var sqmPopupContainerCss=".squatch-header-close{position:absolute;right:20px;top:10px;cursor:pointer}.squatch-container{background-color:var(--widget-background-color);display:block}";var PopupContainer=function(){function t(t){registerInstance(this,t);this.poweredByText="Powered By";h$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=getProps(this);return h(PopupContainerView,Object.assign({},usePopupContainer(t)))};return t}();PopupContainer.style=sqmPopupContainerCss;export{PopupContainer as sqm_popup_container};
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,s=1,a=arguments.length;s<a;s++){t=arguments[s];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};import{h}from"./index-b3a06de8.js";import{i as intl}from"./global-80edfef3.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{A as AuthWrapper,a as AuthColumn}from"./mixins-f750863a.js";import{T as TextSpanView}from"./sqm-text-span-view-4c17b8c9.js";var style={Wrapper:AuthWrapper,Column:__assign({},AuthColumn),ButtonLink:{fontSize:"14px",color:"var(--sl-color-primary-500)",display:"inline-block !important","&:hover":{cursor:"pointer",textDecoration:"underline"}},ButtonLinkLoading:{fontSize:"14px",color:"var(--sl-color-gray-500)",opacity:"0.6",display:"inline-block !important",textDecoration:"underline","&:hover":{cursor:"not-allowed"}}};var vanillaStyle="\n:host {\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n";var sheet=createStyleSheet(style);var styleString=sheet.toString();function PortalEmailVerificationView(e){var t=e.states,s=e.callbacks,a=e.content,i=a.email,r=a.verifyMessage,o=a.emailVerificationHeader,n=a.resendEmailButtonText,l=a.verificationStatusMessage,c=a.verificationLoadingMessage,p=a.verificationResentMessage;return h("div",{class:sheet.classes.Wrapper},h("style",{type:"text/css"},vanillaStyle,styleString),h(TextSpanView,{type:"h3"},o),h("sl-form",{class:sheet.classes.Column,"onSl-submit":s.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"},p)),h(TextSpanView,{type:"p"},intl.formatMessage({id:"verifyMessage",defaultMessage:r},{email:h("span",{style:{fontWeight:"var(--sl-font-weight-semibold)"}},i)})),h("p",{style:{color:"var(--sl-color-gray-500)",fontSize:"14px"}},intl.formatMessage({id:"verificationStatus",defaultMessage:t.loadingVerification?c+" {countdown}":l},{countdown:t.loadingVerification?h("sl-spinner",null):t.countdown})),h("a",{class:t.loading?sheet.classes.ButtonLinkLoading:sheet.classes.ButtonLink,onClick:s.submit},n)))}export{PortalEmailVerificationView as P};
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,s=1,a=arguments.length;s<a;s++){t=arguments[s];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};import{h}from"./index-b3a06de8.js";import{i as intl}from"./global-ef7a7354.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{A as AuthWrapper,a as AuthColumn}from"./mixins-f750863a.js";import{T as TextSpanView}from"./sqm-text-span-view-4c17b8c9.js";var style={Wrapper:AuthWrapper,Column:__assign({},AuthColumn),ButtonLink:{fontSize:"14px",color:"var(--sl-color-primary-500)",display:"inline-block !important","&:hover":{cursor:"pointer",textDecoration:"underline"}},ButtonLinkLoading:{fontSize:"14px",color:"var(--sl-color-gray-500)",opacity:"0.6",display:"inline-block !important",textDecoration:"underline","&:hover":{cursor:"not-allowed"}}};var vanillaStyle="\n:host {\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n";var sheet=createStyleSheet(style);var styleString=sheet.toString();function PortalEmailVerificationView(e){var t=e.states,s=e.callbacks,a=e.content,i=a.email,r=a.verifyMessage,o=a.emailVerificationHeader,n=a.resendEmailButtonText,l=a.verificationStatusMessage,c=a.verificationLoadingMessage,p=a.verificationResentMessage;return h("div",{class:sheet.classes.Wrapper},h("style",{type:"text/css"},vanillaStyle,styleString),h(TextSpanView,{type:"h3"},o),h("sl-form",{class:sheet.classes.Column,"onSl-submit":s.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"},p)),h(TextSpanView,{type:"p"},intl.formatMessage({id:"verifyMessage",defaultMessage:r},{email:h("span",{style:{fontWeight:"var(--sl-font-weight-semibold)"}},i)})),h("p",{style:{color:"var(--sl-color-gray-500)",fontSize:"14px"}},intl.formatMessage({id:"verificationStatus",defaultMessage:t.loadingVerification?c+" {countdown}":l},{countdown:t.loadingVerification?h("sl-spinner",null):t.countdown})),h("a",{class:t.loading?sheet.classes.ButtonLinkLoading:sheet.classes.ButtonLink,onClick:s.submit},n)))}export{PortalEmailVerificationView as P};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,i,t,r){function n(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(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?t(e.value):n(e.value).then(o,s)}c((r=r.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return c([e,i])}}function c(o){if(r)throw new TypeError("Generator is already executing.");while(t)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;n=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){t.label=o[1];break}if(o[0]===6&&t.label<a[1]){t.label=a[1];a=o;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(o);break}if(a[2])t.ops.pop();t.trys.pop();continue}o=i.call(e,t)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-80edfef3.js";import{k as useState,m as useRef,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{l as ln,n as nn,J,j as jn,u as useCallback,i as isDemo}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalEmailVerificationView}from"./sqm-portal-email-verification-view-5719eb87.js";function usePortalEmailVerification(e){var i=this;var t,r,n,a,o,s,c,l,u;var f=ln(),d=f[0],v=f[1],m=v.loading,g=v.data,h=v.errors;var p=nn(),y=p[0],b=p[1],w=b.data,E=b.loading;var M=J();var _=(t=M===null||M===void 0?void 0:M.managedIdentity)===null||t===void 0?void 0:t.email;var k=new URLSearchParams(jn.location.search);var V=k.get("nextPage");var x=useState(false),P=x[0],S=x[1];var j=useState(""),I=j[0],R=j[1];var L=useState(10),T=L[0],B=L[1];var C=useRef(undefined);var D=useRef(undefined);var H=function(){return __awaiter(i,void 0,void 0,(function(){var i,t,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:if(!_)return[2];R("");S(false);t=V?{nextPage:V}:null;r=e.redirectPath;n={email:_,urlParams:t,redirectPath:r};return[4,d(n)];case 1:a=o.sent();if(a instanceof Error){if(a.message)R(e.networkErrorMessage);return[2]}if((i=a.requestManagedIdentityVerificationEmail)===null||i===void 0?void 0:i.success)S(true);return[2]}}))}))};function q(){return __awaiter(this,void 0,void 0,(function(){var i,t;return __generator(this,(function(r){switch(r.label){case 0:return[4,y()];case 1:t=r.sent();if((i=t===null||t===void 0?void 0:t.managedIdentitySession)===null||i===void 0?void 0:i.emailVerified){clearInterval(C.current);return[2,jn.push({pathname:e.redirectPath,search:k.toString()&&"?"+k.toString()})]}G(10);return[2]}}))}))}var A=function(e){if(e===void 0){e=1e4}return setInterval(q,e)};var $=function(e){return setInterval((function(){return B(e)}),1e3)};function G(e){clearInterval(D.current);clearInterval(C.current);if(document.visibilityState==="hidden")return;if(e)B(e);var i=T||10;D.current=$(e-1||i-1);C.current=A(e*1e3||i*1e3)}var U=useCallback((function(){return G()}),[T]);useEffect((function(){if(!C.current){q();C.current=A()}return function(){clearInterval(C.current)}}),[]);useEffect((function(){if(T>0){clearInterval(D.current);D.current=$(T-1)}document.addEventListener("visibilitychange",U);return function(){clearInterval(D.current);document.removeEventListener("visibilitychange",U)}}),[T]);return{states:{loading:m,error:((o=(a=(n=(r=h===null||h===void 0?void 0:h.response)===null||r===void 0?void 0:r.errors)===null||n===void 0?void 0:n[0])===null||a===void 0?void 0:a.extensions)===null||o===void 0?void 0:o.message)||((l=(c=(s=h===null||h===void 0?void 0:h.response)===null||s===void 0?void 0:s.errors)===null||c===void 0?void 0:c[0])===null||l===void 0?void 0:l.message)||I,success:P,loadingVerification:E,isVerified:!!((u=w===null||w===void 0?void 0:w.managedIdentitySession)===null||u===void 0?void 0:u.emailVerified),countdown:T},callbacks:{submit:H},content:{email:_,verifyMessage:e.verifyMessage,emailVerificationHeader:e.emailVerificationHeader,resendEmailButtonText:e.resendEmailButtonText,verificationLoadingMessage:e.verificationLoadingMessage,verificationStatusMessage:e.verificationStatusMessage,verificationResentMessage:e.verificationResentMessage,networkErrorMessage:e.networkErrorMessage}}}var PortalEmailVerification=function(){function e(e){registerInstance(this,e);this.ignored=true;this.redirectPath="/verifyEmail";this.emailVerificationHeader="Verify your email";this.resendEmailButtonText="Re-send Email";this.verifyMessage="A verification email was sent to {email}. Please verify your email to continue to the portal. Resending an email will invalidate the previous email.";this.verificationStatusMessage="Checking verification status in {countdown}";this.verificationLoadingMessage="Checking verification status";this.verificationResentMessage="Your verification email has been resent successfully";this.networkErrorMessage="An error occurred while verifying your password. Please refresh the page.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalEmailVerificationDemo(this):usePortalEmailVerification(this),i=e.states,t=e.callbacks,r=e.content;return h$1(PortalEmailVerificationView,{states:i,callbacks:t,content:r})};return e}();function usePortalEmailVerificationDemo(e){var i=this;return cjs({states:{error:"",loading:false,success:false,countdown:10},callbacks:{submit:function(e){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(e){return[2]}))}))}},content:{email:"test@example.com",verifyMessage:e.verifyMessage,emailVerificationHeader:e.emailVerificationHeader,resendEmailButtonText:e.resendEmailButtonText,verificationLoadingMessage:e.verificationLoadingMessage,verificationStatusMessage:e.verificationStatusMessage,verificationResentMessage:e.verificationResentMessage,networkErrorMessage:e.networkErrorMessage}},e.demoData||{},{arrayMerge:function(e,i){return i}})}export{PortalEmailVerification as sqm_portal_email_verification};
1
+ var __awaiter=this&&this.__awaiter||function(e,i,t,r){function n(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(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?t(e.value):n(e.value).then(o,s)}c((r=r.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return c([e,i])}}function c(o){if(r)throw new TypeError("Generator is already executing.");while(t)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;n=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){t.label=o[1];break}if(o[0]===6&&t.label<a[1]){t.label=a[1];a=o;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(o);break}if(a[2])t.ops.pop();t.trys.pop();continue}o=i.call(e,t)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-ef7a7354.js";import{k as useState,m as useRef,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{l as ln,n as nn,J,j as jn,u as useCallback,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalEmailVerificationView}from"./sqm-portal-email-verification-view-37bee5df.js";function usePortalEmailVerification(e){var i=this;var t,r,n,a,o,s,c,l,u;var f=ln(),v=f[0],d=f[1],m=d.loading,g=d.data,h=d.errors;var p=nn(),y=p[0],b=p[1],w=b.data,E=b.loading;var M=J();var _=(t=M===null||M===void 0?void 0:M.managedIdentity)===null||t===void 0?void 0:t.email;var k=new URLSearchParams(jn.location.search);var V=k.get("nextPage");var x=useState(false),P=x[0],S=x[1];var j=useState(""),I=j[0],R=j[1];var L=useState(10),T=L[0],B=L[1];var C=useRef(undefined);var D=useRef(undefined);var H=function(){return __awaiter(i,void 0,void 0,(function(){var i,t,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:if(!_)return[2];R("");S(false);t=V?{nextPage:V}:null;r=e.redirectPath;n={email:_,urlParams:t,redirectPath:r};return[4,v(n)];case 1:a=o.sent();if(a instanceof Error){if(a.message)R(e.networkErrorMessage);return[2]}if((i=a.requestManagedIdentityVerificationEmail)===null||i===void 0?void 0:i.success)S(true);return[2]}}))}))};function q(){return __awaiter(this,void 0,void 0,(function(){var i,t;return __generator(this,(function(r){switch(r.label){case 0:return[4,y()];case 1:t=r.sent();if((i=t===null||t===void 0?void 0:t.managedIdentitySession)===null||i===void 0?void 0:i.emailVerified){clearInterval(C.current);return[2,jn.push({pathname:e.redirectPath,search:k.toString()&&"?"+k.toString()})]}G(10);return[2]}}))}))}var A=function(e){if(e===void 0){e=1e4}return setInterval(q,e)};var $=function(e){return setInterval((function(){return B(e)}),1e3)};function G(e){clearInterval(D.current);clearInterval(C.current);if(document.visibilityState==="hidden")return;if(e)B(e);var i=T||10;D.current=$(e-1||i-1);C.current=A(e*1e3||i*1e3)}var U=useCallback((function(){return G()}),[T]);useEffect((function(){if(!C.current){q();C.current=A()}return function(){clearInterval(C.current)}}),[]);useEffect((function(){if(T>0){clearInterval(D.current);D.current=$(T-1)}document.addEventListener("visibilitychange",U);return function(){clearInterval(D.current);document.removeEventListener("visibilitychange",U)}}),[T]);return{states:{loading:m,error:((o=(a=(n=(r=h===null||h===void 0?void 0:h.response)===null||r===void 0?void 0:r.errors)===null||n===void 0?void 0:n[0])===null||a===void 0?void 0:a.extensions)===null||o===void 0?void 0:o.message)||((l=(c=(s=h===null||h===void 0?void 0:h.response)===null||s===void 0?void 0:s.errors)===null||c===void 0?void 0:c[0])===null||l===void 0?void 0:l.message)||I,success:P,loadingVerification:E,isVerified:!!((u=w===null||w===void 0?void 0:w.managedIdentitySession)===null||u===void 0?void 0:u.emailVerified),countdown:T},callbacks:{submit:H},content:{email:_,verifyMessage:e.verifyMessage,emailVerificationHeader:e.emailVerificationHeader,resendEmailButtonText:e.resendEmailButtonText,verificationLoadingMessage:e.verificationLoadingMessage,verificationStatusMessage:e.verificationStatusMessage,verificationResentMessage:e.verificationResentMessage,networkErrorMessage:e.networkErrorMessage}}}var PortalEmailVerification=function(){function e(e){registerInstance(this,e);this.ignored=true;this.redirectPath="/verifyEmail";this.emailVerificationHeader="Verify your email";this.resendEmailButtonText="Re-send Email";this.verifyMessage="A verification email was sent to {email}. Please verify your email to continue to the portal. Resending an email will invalidate the previous email.";this.verificationStatusMessage="Checking verification status in {countdown}";this.verificationLoadingMessage="Checking verification status";this.verificationResentMessage="Your verification email has been resent successfully";this.networkErrorMessage="An error occurred while verifying your password. Please refresh the page.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalEmailVerificationDemo(this):usePortalEmailVerification(this),i=e.states,t=e.callbacks,r=e.content;return h$1(PortalEmailVerificationView,{states:i,callbacks:t,content:r})};return e}();function usePortalEmailVerificationDemo(e){var i=this;return cjs({states:{error:"",loading:false,success:false,countdown:10},callbacks:{submit:function(e){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(e){return[2]}))}))}},content:{email:"test@example.com",verifyMessage:e.verifyMessage,emailVerificationHeader:e.emailVerificationHeader,resendEmailButtonText:e.resendEmailButtonText,verificationLoadingMessage:e.verificationLoadingMessage,verificationStatusMessage:e.verificationStatusMessage,verificationResentMessage:e.verificationResentMessage,networkErrorMessage:e.networkErrorMessage}},e.demoData||{},{arrayMerge:function(e,i){return i}})}export{PortalEmailVerification as sqm_portal_email_verification};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,o,r){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,s){function a(t){try{l(r.next(t))}catch(t){s(t)}}function i(t){try{l(r["throw"](t))}catch(t){s(t)}}function l(t){t.done?o(t.value):n(t.value).then(a,i)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function i(t){return function(e){return l([t,e])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t];n=0}finally{r=s=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-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,j as jn}from"./index.module-38dad6c9.js";import"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./utils-03188de2.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalLoginView}from"./sqm-portal-login-view-7670cd86.js";import{u as usePortalLogin}from"./usePortalLogin-d0720c81.js";var PortalGoogleLogin=function(){function t(t){registerInstance(this,t);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)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=isDemo()?useLoginDemo(this):usePortalLogin(this),e=t.states,o=t.callbacks;var r={RegisterButton:{"&::part(label)":{padding:"0"}}};var n=createStyleSheet(r);var s=n.toString();var a={forgotPasswordButton:h$1("slot",{name:"forgotPassword"},h$1("a",{onClick:function(){return jn.push(e.forgotPasswordPath)}},this.forgotPasswordLabel)),googleButton:h$1("sqm-google-sign-in",{onInitComplete:o.googleSubmit}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,s),h$1("span",null,this.registerCTA," ",h$1("sl-button",{size:"large",type:"text",disabled:e.loading,onClick:function(){return jn.push(e.registerPath)},className:n.classes.RegisterButton},this.registerLabel))),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel};return h$1(PortalLoginView,{states:e,callbacks:o,content:a})};return t}();function useLoginDemo(t){var e=this;return cjs({states:{error:"",loading:false,forgotPasswordPath:"/forgotPassword",registerPath:"/register",showLoginForm:"manual"},callbacks:{googleSubmit:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){console.log("google submit");return[2]}))}))},submit:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){console.log("submit");return[2]}))}))}},content:{googleButton:null}},t.demoData||{},{arrayMerge:function(t,e){return e}})}export{PortalGoogleLogin as sqm_portal_google_login};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,o,r){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,s){function a(t){try{l(r.next(t))}catch(t){s(t)}}function i(t){try{l(r["throw"](t))}catch(t){s(t)}}function l(t){t.done?o(t.value):n(t.value).then(a,i)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function i(t){return function(e){return l([t,e])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t];n=0}finally{r=s=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-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,j as jn}from"./index.module-c9811a48.js";import"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./utils-03188de2.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalLoginView}from"./sqm-portal-login-view-7670cd86.js";import{u as usePortalLogin}from"./usePortalLogin-e95df3c3.js";var PortalGoogleLogin=function(){function t(t){registerInstance(this,t);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)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=isDemo()?useLoginDemo(this):usePortalLogin(this),e=t.states,o=t.callbacks;var r={RegisterButton:{"&::part(label)":{padding:"0"}}};var n=createStyleSheet(r);var s=n.toString();var a={forgotPasswordButton:h$1("slot",{name:"forgotPassword"},h$1("a",{onClick:function(){return jn.push(e.forgotPasswordPath)}},this.forgotPasswordLabel)),googleButton:h$1("sqm-google-sign-in",{onInitComplete:o.googleSubmit}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,s),h$1("span",null,this.registerCTA," ",h$1("sl-button",{size:"large",type:"text",disabled:e.loading,onClick:function(){return jn.push(e.registerPath)},className:n.classes.RegisterButton},this.registerLabel))),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel};return h$1(PortalLoginView,{states:e,callbacks:o,content:a})};return t}();function useLoginDemo(t){var e=this;return cjs({states:{error:"",loading:false,forgotPasswordPath:"/forgotPassword",registerPath:"/register",showLoginForm:"manual"},callbacks:{googleSubmit:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){console.log("google submit");return[2]}))}))},submit:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){console.log("submit");return[2]}))}))}},content:{googleButton:null}},t.demoData||{},{arrayMerge:function(t,e){return e}})}export{PortalGoogleLogin as sqm_portal_google_login};
@@ -1 +1 @@
1
- var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){e(t,r);function o(){this.constructor=t}t.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;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)};var __awaiter=this&&this.__awaiter||function(e,t,r,o){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function n(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((o=o.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:[]},o,a,i,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(n){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,a&&(i=n[0]&2?a["return"]:n[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;if(a=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;a=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){r.label=n[1];break}if(n[0]===6&&r.label<i[1]){r.label=i[1];i=n;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(n);break}if(i[2])r.ops.pop();r.trys.pop();continue}n=t.call(e,r)}catch(e){n=[6,e];a=0}finally{o=i=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-b3a06de8.js";import{k as useState,n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,j as jn}from"./index.module-38dad6c9.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{a as useRegistrationForm}from"./useRegistrationFormState-18c2cea7.js";import{B as BaseRegistrationFormView}from"./sqm-base-registration-form-view-193f1721.js";import{P as PortalRegistrationFormView}from"./sqm-portal-registration-form-view-8bdc3804.js";import"./AsYouType-46f67d0d.js";import{u as usePortalRegistrationForm}from"./usePortalRegistrationForm-afc0171e.js";var InvalidTokenError=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);InvalidTokenError.prototype.name="InvalidTokenError";function b64DecodeUnicode(e){return decodeURIComponent(atob(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();if(r.length<2){r="0"+r}return"%"+r})))}function base64UrlDecode(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return b64DecodeUnicode(t)}catch(e){return atob(t)}}function jwtDecode(e,t){if(typeof e!=="string"){throw new InvalidTokenError("Invalid token specified: must be a string")}t||(t={});var r=t.header===true?0:1;var o=e.split(".")[r];if(typeof o!=="string"){throw new InvalidTokenError("Invalid token specified: missing part #"+(r+1))}var a;try{a=base64UrlDecode(o)}catch(e){throw new InvalidTokenError("Invalid token specified: invalid base64 for part #"+(r+1)+" ("+e.message+")")}try{return JSON.parse(a)}catch(e){throw new InvalidTokenError("Invalid token specified: invalid json for part #"+(r+1)+" ("+e.message+")")}}function usePortalGoogleRegistrationForm(e){var t=this;var r=useState(null),o=r[0],a=r[1];var i=useRegistrationForm(),n=i[0],s=i[1];var l=useState({mode:"base"}),u=l[0],c=l[1];var m=function(r){return __awaiter(t,void 0,void 0,(function(){var t,o,i;return __generator(this,(function(l){t=r.target.getFormControls();o={};i=null;t.forEach((function(t){if(!t.name||t.name!=="/email")return;jsonpointer.set(o,t.name,t.value);if(t.required&&!t.value)i=e.requiredFieldErrorMessage;if(typeof t.validationError==="function"){var r=t.validationError;var a=r({control:t,key:"email",value:t.value});if(a)i=a}}));if(i){a(i);return[2]}s(__assign(__assign({},n),{initialData:__assign(__assign({},n===null||n===void 0?void 0:n.initialData),o)}));c({mode:"manual"});return[2]}))}))};var d=function(e){var t;if(!((t=e.detail)===null||t===void 0?void 0:t.credential))return;try{var r=jwtDecode(e.detail.credential);s(__assign(__assign({},n),{_googleOAuthIdToken:e.detail.credential,initialData:{email:r.email,firstName:r.given_name,lastName:r.family_name}}));c({mode:"google"})}catch(e){console.error("Failed to decode Google Sign In credential JWT:",e)}};return{showRegistrationForm:u,emailValidationError:o,handleGoogleInit:d,handleEmailSubmit:m}}var PortalGoogleRegistrationForm=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.loginCTA="Already have an account?";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";this.googleButtonText="signup_with";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useRegisterDemo(this):usePortalRegistrationForm(this),t=e.states,r=e.callbacks,o=e.refs;var a={LoginButton:{"&::part(label)":{padding:"0"}}};var i=createStyleSheet(a);var n=i.toString();var s=isDemo()?useGoogleDemo(this):usePortalGoogleRegistrationForm(this),l=s.handleGoogleInit,u=s.handleEmailSubmit,c=s.showRegistrationForm,m=s.emailValidationError;var d={formData:h$1("slot",{name:"formData"}),googleButton:h$1("sqm-google-sign-in",{text:this.googleButtonText,onInitComplete:l}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,n),h$1("span",null,this.loginCTA," ",h$1("sl-button",{size:"large",type:"text",disabled:t.loading,onClick:function(){return jn.push(t.loginPath)},className:i.classes.LoginButton},this.loginLabel)," ")),terms:h$1("slot",{name:"terms"}),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};if(c.mode==="base"){return h$1(BaseRegistrationFormView,{states:{error:m},callbacks:{handleEmailSubmit:u},content:d})}return h$1(PortalRegistrationFormView,{states:__assign(__assign({},t),{emailDisabled:true,hidePasswords:c.mode==="google"}),callbacks:r,content:__assign({},d),refs:o})};return e}();function useRegisterDemo(e){var t=this;return cjs({states:{error:"",loading:false,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs||false,customPasswordField:false,loginPath:"/login"},callbacks:{handleGoogleInit:function(){},setShowRegistrationForm:function(){},submit:function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},inputFunction:function(){}},content:{pageLabel:"Register",formData:null,passwordField:null},refs:{formRef:{}}},e.demoData||{},{arrayMerge:function(e,t){return t}})}function useGoogleDemo(e){var t=useState({mode:"base"}),r=t[0],o=t[1];return cjs({emailValidationError:true,handleEmailSubmit:function(){return o({mode:"manual"})},showRegistrationForm:r,handleGoogleInit:function(){return o({mode:"google"})}},e.demoGoogleData||{},{arrayMerge:function(e,t){return t}})}export{PortalGoogleRegistrationForm as sqm_portal_google_registration_form};
1
+ var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){e(t,r);function o(){this.constructor=t}t.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;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)};var __awaiter=this&&this.__awaiter||function(e,t,r,o){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function n(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((o=o.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:[]},o,a,i,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(n){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,a&&(i=n[0]&2?a["return"]:n[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;if(a=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;a=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){r.label=n[1];break}if(n[0]===6&&r.label<i[1]){r.label=i[1];i=n;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(n);break}if(i[2])r.ops.pop();r.trys.pop();continue}n=t.call(e,r)}catch(e){n=[6,e];a=0}finally{o=i=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-b3a06de8.js";import{k as useState,n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,j as jn}from"./index.module-c9811a48.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{a as useRegistrationForm}from"./useRegistrationFormState-24d594ea.js";import{B as BaseRegistrationFormView}from"./sqm-base-registration-form-view-193f1721.js";import{P as PortalRegistrationFormView}from"./sqm-portal-registration-form-view-8bdc3804.js";import"./AsYouType-46f67d0d.js";import{u as usePortalRegistrationForm}from"./usePortalRegistrationForm-1eb3cd72.js";var InvalidTokenError=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);InvalidTokenError.prototype.name="InvalidTokenError";function b64DecodeUnicode(e){return decodeURIComponent(atob(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();if(r.length<2){r="0"+r}return"%"+r})))}function base64UrlDecode(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return b64DecodeUnicode(t)}catch(e){return atob(t)}}function jwtDecode(e,t){if(typeof e!=="string"){throw new InvalidTokenError("Invalid token specified: must be a string")}t||(t={});var r=t.header===true?0:1;var o=e.split(".")[r];if(typeof o!=="string"){throw new InvalidTokenError("Invalid token specified: missing part #"+(r+1))}var a;try{a=base64UrlDecode(o)}catch(e){throw new InvalidTokenError("Invalid token specified: invalid base64 for part #"+(r+1)+" ("+e.message+")")}try{return JSON.parse(a)}catch(e){throw new InvalidTokenError("Invalid token specified: invalid json for part #"+(r+1)+" ("+e.message+")")}}function usePortalGoogleRegistrationForm(e){var t=this;var r=useState(null),o=r[0],a=r[1];var i=useRegistrationForm(),n=i[0],s=i[1];var l=useState({mode:"base"}),u=l[0],c=l[1];var m=function(r){return __awaiter(t,void 0,void 0,(function(){var t,o,i;return __generator(this,(function(l){t=r.target.getFormControls();o={};i=null;t.forEach((function(t){if(!t.name||t.name!=="/email")return;jsonpointer.set(o,t.name,t.value);if(t.required&&!t.value)i=e.requiredFieldErrorMessage;if(typeof t.validationError==="function"){var r=t.validationError;var a=r({control:t,key:"email",value:t.value});if(a)i=a}}));if(i){a(i);return[2]}s(__assign(__assign({},n),{initialData:__assign(__assign({},n===null||n===void 0?void 0:n.initialData),o)}));c({mode:"manual"});return[2]}))}))};var d=function(e){var t;if(!((t=e.detail)===null||t===void 0?void 0:t.credential))return;try{var r=jwtDecode(e.detail.credential);s(__assign(__assign({},n),{_googleOAuthIdToken:e.detail.credential,initialData:{email:r.email,firstName:r.given_name,lastName:r.family_name}}));c({mode:"google"})}catch(e){console.error("Failed to decode Google Sign In credential JWT:",e)}};return{showRegistrationForm:u,emailValidationError:o,handleGoogleInit:d,handleEmailSubmit:m}}var PortalGoogleRegistrationForm=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.loginCTA="Already have an account?";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";this.googleButtonText="signup_with";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useRegisterDemo(this):usePortalRegistrationForm(this),t=e.states,r=e.callbacks,o=e.refs;var a={LoginButton:{"&::part(label)":{padding:"0"}}};var i=createStyleSheet(a);var n=i.toString();var s=isDemo()?useGoogleDemo(this):usePortalGoogleRegistrationForm(this),l=s.handleGoogleInit,u=s.handleEmailSubmit,c=s.showRegistrationForm,m=s.emailValidationError;var d={formData:h$1("slot",{name:"formData"}),googleButton:h$1("sqm-google-sign-in",{text:this.googleButtonText,onInitComplete:l}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,n),h$1("span",null,this.loginCTA," ",h$1("sl-button",{size:"large",type:"text",disabled:t.loading,onClick:function(){return jn.push(t.loginPath)},className:i.classes.LoginButton},this.loginLabel)," ")),terms:h$1("slot",{name:"terms"}),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};if(c.mode==="base"){return h$1(BaseRegistrationFormView,{states:{error:m},callbacks:{handleEmailSubmit:u},content:d})}return h$1(PortalRegistrationFormView,{states:__assign(__assign({},t),{emailDisabled:true,hidePasswords:c.mode==="google"}),callbacks:r,content:__assign({},d),refs:o})};return e}();function useRegisterDemo(e){var t=this;return cjs({states:{error:"",loading:false,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs||false,customPasswordField:false,loginPath:"/login"},callbacks:{handleGoogleInit:function(){},setShowRegistrationForm:function(){},submit:function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},inputFunction:function(){}},content:{pageLabel:"Register",formData:null,passwordField:null},refs:{formRef:{}}},e.demoData||{},{arrayMerge:function(e,t){return t}})}function useGoogleDemo(e){var t=useState({mode:"base"}),r=t[0],o=t[1];return cjs({emailValidationError:true,handleEmailSubmit:function(){return o({mode:"manual"})},showRegistrationForm:r,handleGoogleInit:function(){return o({mode:"google"})}},e.demoGoogleData||{},{arrayMerge:function(e,t){return t}})}export{PortalGoogleRegistrationForm as sqm_portal_google_registration_form};
@@ -1 +1 @@
1
- import{r as registerInstance}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{b as setUserIdentity,j as jn,i as isDemo}from"./index.module-38dad6c9.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};
1
+ import{r as registerInstance}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{b as setUserIdentity,j as jn,i as isDemo}from"./index.module-c9811a48.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};
@@ -1 +1 @@
1
- import{h}from"./index-b3a06de8.js";import{i as intl}from"./global-80edfef3.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{T as TextSpanView}from"./sqm-text-span-view-4c17b8c9.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 b=c.toString();var v=((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"},b),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:v,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
+ import{h}from"./index-b3a06de8.js";import{i as intl}from"./global-ef7a7354.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{T as TextSpanView}from"./sqm-text-span-view-4c17b8c9.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 b=c.toString();var v=((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"},b),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:v,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 a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-80edfef3.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,J,w as wn,$ as $e,i as isDemo}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalProfileView}from"./sqm-portal-profile-view-9a82fe2e.js";import{i as isEmpty}from"./utilities-ad9c2893.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],a=r[1];var n=useState(undefined),s=n[0],o=n[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)a(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(){a(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
+ 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 a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import"./global-ef7a7354.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,J,w as wn,$ as $e,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalProfileView}from"./sqm-portal-profile-view-afb6d879.js";import{i as isEmpty}from"./utilities-72c07b09.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],a=r[1];var n=useState(undefined),s=n[0],o=n[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)a(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(){a(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-b3a06de8.js";import{f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{J,k as kn,j as jn,i as isDemo}from"./index.module-38dad6c9.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(),d=u.pathname,c=u.search;var l=new URLSearchParams;l.append("nextPage",""+d+c);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
+ import{r as registerInstance,h as h$1,c as Host}from"./index-b3a06de8.js";import{f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{J,k as kn,j as jn,i as isDemo}from"./index.module-c9811a48.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 a(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function n(e){try{l(s["throw"](e))}catch(e){i(e)}}function l(e){e.done?t(e.value):a(e.value).then(o,n)}l((s=s.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:[]},s,a,i,o;return o={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function n(e){return function(r){return l([e,r])}}function l(o){if(s)throw new TypeError("Generator is already executing.");while(t)try{if(s=1,a&&(i=o[0]&2?a["return"]:o[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;if(a=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;a=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){t.label=o[1];break}if(o[0]===6&&t.label<i[1]){t.label=i[1];i=o;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(o);break}if(i[2])t.ops.pop();t.trys.pop();continue}o=r.call(e,t)}catch(e){o=[6,e];a=0}finally{s=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,j as jn}from"./index.module-38dad6c9.js";import"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import"./useRegistrationFormState-18c2cea7.js";import{P as PortalRegistrationFormView}from"./sqm-portal-registration-form-view-8bdc3804.js";import"./AsYouType-46f67d0d.js";import{u as usePortalRegistrationForm}from"./usePortalRegistrationForm-afc0171e.js";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(this):usePortalRegistrationForm(this),r=e.states,t=e.callbacks,s=e.refs;var a={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:a,refs:s})};return e}();function useRegisterDemo(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}})}export{PortalRegistrationForm as sqm_portal_registration_form};
1
+ var __awaiter=this&&this.__awaiter||function(e,r,t,s){function i(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{l(s.next(e))}catch(e){a(e)}}function n(e){try{l(s["throw"](e))}catch(e){a(e)}}function l(e){e.done?t(e.value):i(e.value).then(o,n)}l((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,i,a,o;return o={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function n(e){return function(r){return l([e,r])}}function l(o){if(s)throw new TypeError("Generator is already executing.");while(t)try{if(s=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;i=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){t.label=o[1];break}if(o[0]===6&&t.label<a[1]){t.label=a[1];a=o;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(o);break}if(a[2])t.ops.pop();t.trys.pop();continue}o=r.call(e,t)}catch(e){o=[6,e];i=0}finally{s=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{n as h}from"./dom-context-hooks.module-63370afd.js";import{i as isDemo,j as jn}from"./index.module-c9811a48.js";import"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import"./useRegistrationFormState-24d594ea.js";import{P as PortalRegistrationFormView}from"./sqm-portal-registration-form-view-8bdc3804.js";import"./AsYouType-46f67d0d.js";import{u as usePortalRegistrationForm}from"./usePortalRegistrationForm-1eb3cd72.js";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(this):usePortalRegistrationForm(this),r=e.states,t=e.callbacks,s=e.refs;var i={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:i,refs:s})};return e}();function useRegisterDemo(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}})}export{PortalRegistrationForm as sqm_portal_registration_form};
@@ -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-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{f as Je,T as Te,j as jn,i as isDemo}from"./index.module-38dad6c9.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalResetPasswordView}from"./sqm-portal-reset-password-view-abef7286.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
+ 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-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{e as Je,T as Te,j as jn,i as isDemo}from"./index.module-c9811a48.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalResetPasswordView}from"./sqm-portal-reset-password-view-abef7286.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 __awaiter=this&&this.__awaiter||function(e,t,i,r){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r["throw"](e))}catch(e){a(e)}}function l(e){e.done?i(e.value):n(e.value).then(o,s)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{J,o as an,j as jn,b as setUserIdentity,i as isDemo}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath,g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalVerifyEmailView}from"./sqm-portal-verify-email-view-33805220.js";var globalPromise=null;function usePortalVerifyEmail(e){var t=this;var i=e.nextPage,r=e.failedPage,n=e.verifySuccessText,a=e.verifyEmailText,o=e.verifyInvalidText,s=e.networkErrorMessage,l=e.continueText;var u,c,f,d,v,m,y,h,g,p;var x=useState(false),b=x[0],P=x[1];var T=useState(false),w=T[0],E=T[1];var j=J();var S=an(),_=S[0],k=S[1],I=k.loading,V=k.data,C=k.errors;var D=new URLSearchParams(jn.location.search);var M=D.get("oobCode");var U=D.get("email");var q=D.get("nextPage");var z=V===undefined&&C===undefined&&!!M;var N=!!(((u=j===null||j===void 0?void 0:j.managedIdentity)===null||u===void 0?void 0:u.emailVerified)||((c=V===null||V===void 0?void 0:V.verifyManagedIdentityEmail)===null||c===void 0?void 0:c.success)||w);var $=((f=j===null||j===void 0?void 0:j.managedIdentity)===null||f===void 0?void 0:f.email)===U;var A=function(){return jn.push({pathname:r,search:D.toString()&&"?"+D.toString()})};var G=function(){D.delete("nextPage");var e=sanitizeUrlPath(q||i);jn.push(e.href)};var L=function(){setTimeout((function(){setUserIdentity(undefined);G()}),3e3)};var R=function(){setTimeout(G,3e3)};useEffect((function(){var e=function(){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!globalPromise)globalPromise=_({oobCode:M});return[4,globalPromise];case 1:e=t.sent();if(!(e instanceof Error)&&e.verifyManagedIdentityEmail.success){E(true)}P(true);return[2]}}))}))};e()}),[]);useEffect((function(){if(!b)return;if(N&&$)R();else L()}),[b,N]);return{states:{loading:I||!b,disableContinue:z,error:((y=(m=(v=(d=C===null||C===void 0?void 0:C.response)===null||d===void 0?void 0:d.errors)===null||v===void 0?void 0:v[0])===null||m===void 0?void 0:m.extensions)===null||y===void 0?void 0:y.message)||((p=(g=(h=C===null||C===void 0?void 0:C.response)===null||h===void 0?void 0:h.errors)===null||g===void 0?void 0:g[0])===null||p===void 0?void 0:p.message)||((C===null||C===void 0?void 0:C.message)||!$)&&s,success:b&&(N||$)},data:{oobCode:M},callbacks:{failed:A,gotoNextPage:G},content:{verifySuccessText:n,verifyEmailText:a,verifyInvalidText:o,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)),t=e.states,i=e.data,r=e.callbacks,n=e.content;return h$1(PortalVerifyEmailView,{states:t,data:i,callbacks:r,content:n})};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,t){return t}})}export{PortalVerifyEmail as sqm_portal_verify_email};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,r){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r["throw"](e))}catch(e){a(e)}}function l(e){e.done?i(e.value):n(e.value).then(o,s)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{J,f as an,j as jn,b as setUserIdentity,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{s as sanitizeUrlPath,g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import"./sqm-text-span-view-4c17b8c9.js";import{P as PortalVerifyEmailView}from"./sqm-portal-verify-email-view-33805220.js";var globalPromise=null;function usePortalVerifyEmail(e){var t=this;var i=e.nextPage,r=e.failedPage,n=e.verifySuccessText,a=e.verifyEmailText,o=e.verifyInvalidText,s=e.networkErrorMessage,l=e.continueText;var u,c,f,d,v,m,y,h,g,p;var x=useState(false),b=x[0],P=x[1];var T=useState(false),w=T[0],E=T[1];var j=J();var S=an(),_=S[0],k=S[1],I=k.loading,V=k.data,C=k.errors;var D=new URLSearchParams(jn.location.search);var M=D.get("oobCode");var U=D.get("email");var q=D.get("nextPage");var z=V===undefined&&C===undefined&&!!M;var N=!!(((u=j===null||j===void 0?void 0:j.managedIdentity)===null||u===void 0?void 0:u.emailVerified)||((c=V===null||V===void 0?void 0:V.verifyManagedIdentityEmail)===null||c===void 0?void 0:c.success)||w);var $=((f=j===null||j===void 0?void 0:j.managedIdentity)===null||f===void 0?void 0:f.email)===U;var A=function(){return jn.push({pathname:r,search:D.toString()&&"?"+D.toString()})};var G=function(){D.delete("nextPage");var e=sanitizeUrlPath(q||i);jn.push(e.href)};var L=function(){setTimeout((function(){setUserIdentity(undefined);G()}),3e3)};var R=function(){setTimeout(G,3e3)};useEffect((function(){var e=function(){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!globalPromise)globalPromise=_({oobCode:M});return[4,globalPromise];case 1:e=t.sent();if(!(e instanceof Error)&&e.verifyManagedIdentityEmail.success){E(true)}P(true);return[2]}}))}))};e()}),[]);useEffect((function(){if(!b)return;if(N&&$)R();else L()}),[b,N]);return{states:{loading:I||!b,disableContinue:z,error:((y=(m=(v=(d=C===null||C===void 0?void 0:C.response)===null||d===void 0?void 0:d.errors)===null||v===void 0?void 0:v[0])===null||m===void 0?void 0:m.extensions)===null||y===void 0?void 0:y.message)||((p=(g=(h=C===null||C===void 0?void 0:C.response)===null||h===void 0?void 0:h.errors)===null||g===void 0?void 0:g[0])===null||p===void 0?void 0:p.message)||((C===null||C===void 0?void 0:C.message)||!$)&&s,success:b&&(N||$)},data:{oobCode:M},callbacks:{failed:A,gotoNextPage:G},content:{verifySuccessText:n,verifyEmailText:a,verifyInvalidText:o,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)),t=e.states,i=e.data,r=e.callbacks,n=e.content;return h$1(PortalVerifyEmailView,{states:t,data:i,callbacks:r,content:n})};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,t){return t}})}export{PortalVerifyEmail as sqm_portal_verify_email};
@@ -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,n=arguments.length;r<n;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)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n["throw"](e))}catch(e){o(e)}}function c(e){e.done?r(e.value):a(e.value).then(i,s)}c((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,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(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,a&&(o=i[0]&2?a["return"]:i[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,i[1])).done)return o;if(a=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;a=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){r.label=i[1];break}if(i[0]===6&&r.label<o[1]){r.label=o[1];o=i;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(i);break}if(o[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];a=0}finally{n=o=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-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,H,J,B,F as Fn,w as wn,$ as $e,i as isDemo}from"./index.module-38dad6c9.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import{a as REFERRAL_CODES_NAMESPACE}from"./useReferralCodes-311e6d72.js";import{Q as QrCodeView}from"./sqm-qr-code-view-97124a66.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 r;var n=H();var a=J();var o=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:n,engagementMedium:o},!(a===null||a===void 0?void 0:a.jwt)||(i===null||i===void 0?void 0:i.shareLink)!==undefined),p=g.data,_=g.errors,b=g.loading;var w=$e(WIDGET_ENGAGEMENT_EVENT)[0];var E=(r=p===null||p===void 0?void 0:p.user)===null||r===void 0?void 0:r.shareLink;var C=E+"?qrCode";var y=b||v;useEffect((function(){if(!E)return;var e=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(a){switch(a.label){case 0:h(true);a.label=1;case 1:a.trys.push([1,4,5,6]);return[4,fetch(E+"?qrCode&qrCodeImageFormat=svg&qrCodeQuietZoneSize=0")];case 2:e=a.sent();return[4,e.blob()];case 3:t=a.sent();r=URL.createObjectURL(t);u(r);return[3,6];case 4:n=a.sent();f(true);return[3,6];case 5:h(false);return[7];case 6:return[2]}}))}))};e()}),[E]);var R=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){w({eventMeta:{programId:n,id:a===null||a===void 0?void 0:a.id,accountId:a===null||a===void 0?void 0:a.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:o,shareMedium:"DIRECT"}}});return[2]}))}))};var T=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,fetch(C+"&qrCodeSize=800&qrCodeImageFormat=png")];case 1:e=o.sent();return[4,e.blob()];case 2:t=o.sent();r=URL.createObjectURL(t);if(t)R();n=document.createElement("a");n.href=r;n.download="qrCode.png";document.body.appendChild(n);n.click();document.body.removeChild(n);return[3,4];case 3:a=o.sent();console.error("Failed to fetch QR code:",a);f(true);return[3,4];case 4:return[2]}}))}))};var j=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,n,a,o;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();r=URL.createObjectURL(t);if(t)R();n=window.open("about:blank","_new");a=n.document.createElement("img");a.src=r;a.onload=function(){n.print();n.close()};n.document.body.appendChild(a);return[3,4];case 3:o=i.sent();console.error("Failed to fetch QR code: ",o);f(true);return[3,4];case 4:return[2]}}))}))};return __assign(__assign({},e),{loading:y,qrLink:c,error:l,createDownloadable:T,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 r=useState(false),n=r[0],a=r[1];return cjs({dialogIsOpen:n,hideTitle:e.hideTitle,showDialog:function(){return a(true)},hideDialog:function(){return a(false)},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
+ 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,n=arguments.length;r<n;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)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n["throw"](e))}catch(e){o(e)}}function c(e){e.done?r(e.value):a(e.value).then(i,s)}c((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,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(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,a&&(o=i[0]&2?a["return"]:i[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,i[1])).done)return o;if(a=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;a=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){r.label=i[1];break}if(i[0]===6&&r.label<o[1]){r.label=o[1];o=i;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(i);break}if(o[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];a=0}finally{n=o=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-b3a06de8.js";import{k as useState,f as useEffect,n as h}from"./dom-context-hooks.module-63370afd.js";import{d as dist,H,J,B,F as Fn,w as wn,$ as $e,i as isDemo}from"./index.module-c9811a48.js";import{c as cjs}from"./cjs-bdfb4486.js";import{g as getProps}from"./utils-03188de2.js";import"./JSS-67b5cff8.js";import{a as REFERRAL_CODES_NAMESPACE}from"./useReferralCodes-c2e809cf.js";import{Q as QrCodeView}from"./sqm-qr-code-view-97124a66.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 r;var n=H();var a=J();var o=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:n,engagementMedium:o},!(a===null||a===void 0?void 0:a.jwt)||(i===null||i===void 0?void 0:i.shareLink)!==undefined),p=g.data,_=g.errors,b=g.loading;var w=$e(WIDGET_ENGAGEMENT_EVENT)[0];var E=(r=p===null||p===void 0?void 0:p.user)===null||r===void 0?void 0:r.shareLink;var C=E+"?qrCode";var y=b||v;useEffect((function(){if(!E)return;var e=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(a){switch(a.label){case 0:h(true);a.label=1;case 1:a.trys.push([1,4,5,6]);return[4,fetch(E+"?qrCode&qrCodeImageFormat=svg&qrCodeQuietZoneSize=0")];case 2:e=a.sent();return[4,e.blob()];case 3:t=a.sent();r=URL.createObjectURL(t);u(r);return[3,6];case 4:n=a.sent();f(true);return[3,6];case 5:h(false);return[7];case 6:return[2]}}))}))};e()}),[E]);var R=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){w({eventMeta:{programId:n,id:a===null||a===void 0?void 0:a.id,accountId:a===null||a===void 0?void 0:a.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:o,shareMedium:"DIRECT"}}});return[2]}))}))};var T=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,fetch(C+"&qrCodeSize=800&qrCodeImageFormat=png")];case 1:e=o.sent();return[4,e.blob()];case 2:t=o.sent();r=URL.createObjectURL(t);if(t)R();n=document.createElement("a");n.href=r;n.download="qrCode.png";document.body.appendChild(n);n.click();document.body.removeChild(n);return[3,4];case 3:a=o.sent();console.error("Failed to fetch QR code:",a);f(true);return[3,4];case 4:return[2]}}))}))};var j=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,n,a,o;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();r=URL.createObjectURL(t);if(t)R();n=window.open("about:blank","_new");a=n.document.createElement("img");a.src=r;a.onload=function(){n.print();n.close()};n.document.body.appendChild(a);return[3,4];case 3:o=i.sent();console.error("Failed to fetch QR code: ",o);f(true);return[3,4];case 4:return[2]}}))}))};return __assign(__assign({},e),{loading:y,qrLink:c,error:l,createDownloadable:T,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 r=useState(false),n=r[0],a=r[1];return cjs({dialogIsOpen:n,hideTitle:e.hideTitle,showDialog:function(){return a(true)},hideDialog:function(){return a(false)},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;