@monetize.software/sdk 3.0.0-alpha.6 → 3.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/README.md +34 -13
  2. package/dist/chunks/{PaywallUI-BYquPomD.js → PaywallUI-BrDiS6zg.js} +926 -962
  3. package/dist/chunks/PaywallUI-BrDiS6zg.js.map +1 -0
  4. package/dist/chunks/PaywallUI-Bvx8nRL0.js +26 -0
  5. package/dist/chunks/PaywallUI-Bvx8nRL0.js.map +1 -0
  6. package/dist/chunks/{ar-nh4l4WDE.js → ar-CHae8g-2.js} +4 -3
  7. package/dist/chunks/ar-CHae8g-2.js.map +1 -0
  8. package/dist/chunks/ar-E1mc8SO_.js +2 -0
  9. package/dist/chunks/ar-E1mc8SO_.js.map +1 -0
  10. package/dist/chunks/cs-Dccq6LAT.js +2 -0
  11. package/dist/chunks/cs-Dccq6LAT.js.map +1 -0
  12. package/dist/chunks/{cs-2UYO2rWf.js → cs-eZTedzaK.js} +2 -1
  13. package/dist/chunks/cs-eZTedzaK.js.map +1 -0
  14. package/dist/chunks/da-C_4MbEh5.js +2 -0
  15. package/dist/chunks/da-C_4MbEh5.js.map +1 -0
  16. package/dist/chunks/{da-BD0O_HfV.js → da-Dca6j8fp.js} +2 -1
  17. package/dist/chunks/da-Dca6j8fp.js.map +1 -0
  18. package/dist/chunks/{de-BkCiXPsn.js → de-BCjn3PUI.js} +3 -1
  19. package/dist/chunks/de-BCjn3PUI.js.map +1 -0
  20. package/dist/chunks/de-DulxcJj-.js +2 -0
  21. package/dist/chunks/de-DulxcJj-.js.map +1 -0
  22. package/dist/chunks/{el-cIcxTp07.js → el-BpXtDTez.js} +2 -1
  23. package/dist/chunks/el-BpXtDTez.js.map +1 -0
  24. package/dist/chunks/el-CVG_1iKB.js +2 -0
  25. package/dist/chunks/el-CVG_1iKB.js.map +1 -0
  26. package/dist/chunks/{es-CJBC_jrV.js → es-B3P4nlMw.js} +3 -1
  27. package/dist/chunks/es-B3P4nlMw.js.map +1 -0
  28. package/dist/chunks/es-ri0uKzUW.js +2 -0
  29. package/dist/chunks/es-ri0uKzUW.js.map +1 -0
  30. package/dist/chunks/{fi-DyV7ynBf.js → fi-BbQ_Bs0Z.js} +2 -1
  31. package/dist/chunks/fi-BbQ_Bs0Z.js.map +1 -0
  32. package/dist/chunks/fi-CNZqWHjw.js +2 -0
  33. package/dist/chunks/fi-CNZqWHjw.js.map +1 -0
  34. package/dist/chunks/{fr-BLQ4AIu7.js → fr-BKDUXceO.js} +3 -1
  35. package/dist/chunks/fr-BKDUXceO.js.map +1 -0
  36. package/dist/chunks/fr-CfFOw4hD.js +2 -0
  37. package/dist/chunks/fr-CfFOw4hD.js.map +1 -0
  38. package/dist/chunks/{he-Bg-Bqi7r.js → he-BVCHlTtT.js} +2 -1
  39. package/dist/chunks/he-BVCHlTtT.js.map +1 -0
  40. package/dist/chunks/he-DN2JEtQb.js +2 -0
  41. package/dist/chunks/he-DN2JEtQb.js.map +1 -0
  42. package/dist/chunks/hi-DxfOerNP.js +2 -0
  43. package/dist/chunks/hi-DxfOerNP.js.map +1 -0
  44. package/dist/chunks/{hi-wQeE43oY.js → hi-H_Hshh-7.js} +4 -3
  45. package/dist/chunks/hi-H_Hshh-7.js.map +1 -0
  46. package/dist/chunks/hu-BTImywuV.js +2 -0
  47. package/dist/chunks/{hu-DXtscQ8_.js.map → hu-BTImywuV.js.map} +1 -1
  48. package/dist/chunks/{hu-D9qxzu0r.js → hu-ZWiNfzvN.js} +2 -1
  49. package/dist/chunks/{hu-D9qxzu0r.js.map → hu-ZWiNfzvN.js.map} +1 -1
  50. package/dist/chunks/{id-Rx_wYvqy.js → id-DeiRYsJ1.js} +2 -1
  51. package/dist/chunks/id-DeiRYsJ1.js.map +1 -0
  52. package/dist/chunks/id-YFuArJA6.js +2 -0
  53. package/dist/chunks/id-YFuArJA6.js.map +1 -0
  54. package/dist/chunks/{it-B1SRPZ3e.js → it-UH9OzFhg.js} +3 -1
  55. package/dist/chunks/it-UH9OzFhg.js.map +1 -0
  56. package/dist/chunks/it-mhkzXBM9.js +2 -0
  57. package/dist/chunks/it-mhkzXBM9.js.map +1 -0
  58. package/dist/chunks/{ja-CMC3Parn.js → ja-6l_z_G9k.js} +2 -2
  59. package/dist/chunks/ja-6l_z_G9k.js.map +1 -0
  60. package/dist/chunks/{ja-DiItm8te.js → ja-BYC8FRN8.js} +3 -1
  61. package/dist/chunks/ja-BYC8FRN8.js.map +1 -0
  62. package/dist/chunks/{ko-CdGFWAKX.js → ko-Bjs2ZRcF.js} +3 -1
  63. package/dist/chunks/ko-Bjs2ZRcF.js.map +1 -0
  64. package/dist/chunks/ko-YAl4XwHu.js +2 -0
  65. package/dist/chunks/ko-YAl4XwHu.js.map +1 -0
  66. package/dist/chunks/nl-C-9zHtfb.js +2 -0
  67. package/dist/chunks/nl-C-9zHtfb.js.map +1 -0
  68. package/dist/chunks/{nl-CmZ3vEvj.js → nl-Ch5HFWQO.js} +3 -1
  69. package/dist/chunks/nl-Ch5HFWQO.js.map +1 -0
  70. package/dist/chunks/{no-BuxByZpq.js → no-CljpinWz.js} +2 -1
  71. package/dist/chunks/no-CljpinWz.js.map +1 -0
  72. package/dist/chunks/no-qzPitLlx.js +2 -0
  73. package/dist/chunks/no-qzPitLlx.js.map +1 -0
  74. package/dist/chunks/{pl-jZFCnDb8.js → pl-CUcSS0zZ.js} +2 -1
  75. package/dist/chunks/pl-CUcSS0zZ.js.map +1 -0
  76. package/dist/chunks/pl-MAIYeuhW.js +2 -0
  77. package/dist/chunks/pl-MAIYeuhW.js.map +1 -0
  78. package/dist/chunks/{pt-Cld7MwIW.js → pt-BHK0LwkC.js} +3 -1
  79. package/dist/chunks/pt-BHK0LwkC.js.map +1 -0
  80. package/dist/chunks/pt-DqDabE4v.js +2 -0
  81. package/dist/chunks/pt-DqDabE4v.js.map +1 -0
  82. package/dist/chunks/ro-BVs-lHH-.js +2 -0
  83. package/dist/chunks/ro-BVs-lHH-.js.map +1 -0
  84. package/dist/chunks/{ro-CuKDqj3C.js → ro-Bj8cwU2n.js} +2 -1
  85. package/dist/chunks/ro-Bj8cwU2n.js.map +1 -0
  86. package/dist/chunks/{ru-B7cjqJUm.js → ru-CgqNy0Gb.js} +10 -1
  87. package/dist/chunks/ru-CgqNy0Gb.js.map +1 -0
  88. package/dist/chunks/ru-DP7qDAmE.js +2 -0
  89. package/dist/chunks/ru-DP7qDAmE.js.map +1 -0
  90. package/dist/chunks/sv-B3QEYGgd.js +2 -0
  91. package/dist/chunks/sv-B3QEYGgd.js.map +1 -0
  92. package/dist/chunks/{sv-D9y-M1Fo.js → sv-H7jroOQ5.js} +2 -1
  93. package/dist/chunks/sv-H7jroOQ5.js.map +1 -0
  94. package/dist/chunks/{th-D9umBjEy.js → th-Dqm-gpGe.js} +2 -1
  95. package/dist/chunks/th-Dqm-gpGe.js.map +1 -0
  96. package/dist/chunks/th-DzQau9aW.js +2 -0
  97. package/dist/chunks/th-DzQau9aW.js.map +1 -0
  98. package/dist/chunks/{tr-BddMywiw.js → tr-D3zPcNtT.js} +2 -1
  99. package/dist/chunks/tr-D3zPcNtT.js.map +1 -0
  100. package/dist/chunks/tr-cG1YuE1E.js +2 -0
  101. package/dist/chunks/tr-cG1YuE1E.js.map +1 -0
  102. package/dist/chunks/{uk-Dbd31hFt.js → uk-CoIIs3QI.js} +10 -1
  103. package/dist/chunks/uk-CoIIs3QI.js.map +1 -0
  104. package/dist/chunks/uk-Cvbo0IBW.js +2 -0
  105. package/dist/chunks/uk-Cvbo0IBW.js.map +1 -0
  106. package/dist/chunks/vi-BRtYSBUp.js +2 -0
  107. package/dist/chunks/{vi-CJefLP_g.js.map → vi-BRtYSBUp.js.map} +1 -1
  108. package/dist/chunks/{vi-Do3BMOdh.js → vi-C_fruIbh.js} +2 -1
  109. package/dist/chunks/{vi-Do3BMOdh.js.map → vi-C_fruIbh.js.map} +1 -1
  110. package/dist/chunks/zh-CwczPMPp.js +2 -0
  111. package/dist/chunks/zh-CwczPMPp.js.map +1 -0
  112. package/dist/chunks/{zh-gQSYLZI3.js → zh-LDkEV2D9.js} +3 -1
  113. package/dist/chunks/zh-LDkEV2D9.js.map +1 -0
  114. package/dist/core.cjs +1 -1
  115. package/dist/core.cjs.map +1 -1
  116. package/dist/core.js +20 -20
  117. package/dist/core.js.map +1 -1
  118. package/dist/index.cjs +1 -1
  119. package/dist/index.d.ts +31 -16
  120. package/dist/index.js +1 -1
  121. package/dist/ui.cjs +1 -1
  122. package/dist/ui.d.ts +31 -16
  123. package/dist/ui.js +1 -1
  124. package/package.json +1 -1
  125. package/dist/chunks/PaywallUI-BYquPomD.js.map +0 -1
  126. package/dist/chunks/PaywallUI-Cl9sz_xA.js +0 -26
  127. package/dist/chunks/PaywallUI-Cl9sz_xA.js.map +0 -1
  128. package/dist/chunks/ar-BUQInJ5a.js +0 -2
  129. package/dist/chunks/ar-BUQInJ5a.js.map +0 -1
  130. package/dist/chunks/ar-nh4l4WDE.js.map +0 -1
  131. package/dist/chunks/cs-2UYO2rWf.js.map +0 -1
  132. package/dist/chunks/cs-i5K4KTFV.js +0 -2
  133. package/dist/chunks/cs-i5K4KTFV.js.map +0 -1
  134. package/dist/chunks/da-BD0O_HfV.js.map +0 -1
  135. package/dist/chunks/da-CZbhtVJO.js +0 -2
  136. package/dist/chunks/da-CZbhtVJO.js.map +0 -1
  137. package/dist/chunks/de-Bc-GoLgC.js +0 -2
  138. package/dist/chunks/de-Bc-GoLgC.js.map +0 -1
  139. package/dist/chunks/de-BkCiXPsn.js.map +0 -1
  140. package/dist/chunks/el-CcMEbl_F.js +0 -2
  141. package/dist/chunks/el-CcMEbl_F.js.map +0 -1
  142. package/dist/chunks/el-cIcxTp07.js.map +0 -1
  143. package/dist/chunks/es-BvYmomAz.js +0 -2
  144. package/dist/chunks/es-BvYmomAz.js.map +0 -1
  145. package/dist/chunks/es-CJBC_jrV.js.map +0 -1
  146. package/dist/chunks/fi-DyV7ynBf.js.map +0 -1
  147. package/dist/chunks/fi-aZR-qmZN.js +0 -2
  148. package/dist/chunks/fi-aZR-qmZN.js.map +0 -1
  149. package/dist/chunks/fr-BLQ4AIu7.js.map +0 -1
  150. package/dist/chunks/fr-BgbFAgHx.js +0 -2
  151. package/dist/chunks/fr-BgbFAgHx.js.map +0 -1
  152. package/dist/chunks/he-Bg-Bqi7r.js.map +0 -1
  153. package/dist/chunks/he-CQ4yCuja.js +0 -2
  154. package/dist/chunks/he-CQ4yCuja.js.map +0 -1
  155. package/dist/chunks/hi-DtUsj1c-.js +0 -2
  156. package/dist/chunks/hi-DtUsj1c-.js.map +0 -1
  157. package/dist/chunks/hi-wQeE43oY.js.map +0 -1
  158. package/dist/chunks/hu-DXtscQ8_.js +0 -2
  159. package/dist/chunks/id-BByOYpeo.js +0 -2
  160. package/dist/chunks/id-BByOYpeo.js.map +0 -1
  161. package/dist/chunks/id-Rx_wYvqy.js.map +0 -1
  162. package/dist/chunks/it-52Ip42pa.js +0 -2
  163. package/dist/chunks/it-52Ip42pa.js.map +0 -1
  164. package/dist/chunks/it-B1SRPZ3e.js.map +0 -1
  165. package/dist/chunks/ja-CMC3Parn.js.map +0 -1
  166. package/dist/chunks/ja-DiItm8te.js.map +0 -1
  167. package/dist/chunks/ko-3qY21q40.js +0 -2
  168. package/dist/chunks/ko-3qY21q40.js.map +0 -1
  169. package/dist/chunks/ko-CdGFWAKX.js.map +0 -1
  170. package/dist/chunks/nl-Borc5nw1.js +0 -2
  171. package/dist/chunks/nl-Borc5nw1.js.map +0 -1
  172. package/dist/chunks/nl-CmZ3vEvj.js.map +0 -1
  173. package/dist/chunks/no-BuxByZpq.js.map +0 -1
  174. package/dist/chunks/no-Do2iGedg.js +0 -2
  175. package/dist/chunks/no-Do2iGedg.js.map +0 -1
  176. package/dist/chunks/pl-jZFCnDb8.js.map +0 -1
  177. package/dist/chunks/pl-mRaky_7k.js +0 -2
  178. package/dist/chunks/pl-mRaky_7k.js.map +0 -1
  179. package/dist/chunks/pt-Cld7MwIW.js.map +0 -1
  180. package/dist/chunks/pt-DilDTXfs.js +0 -2
  181. package/dist/chunks/pt-DilDTXfs.js.map +0 -1
  182. package/dist/chunks/ro-CuKDqj3C.js.map +0 -1
  183. package/dist/chunks/ro-DF2uzPIB.js +0 -2
  184. package/dist/chunks/ro-DF2uzPIB.js.map +0 -1
  185. package/dist/chunks/ru-B7cjqJUm.js.map +0 -1
  186. package/dist/chunks/ru-YeaXnTO-.js +0 -2
  187. package/dist/chunks/ru-YeaXnTO-.js.map +0 -1
  188. package/dist/chunks/sv-2pHEvuSe.js +0 -2
  189. package/dist/chunks/sv-2pHEvuSe.js.map +0 -1
  190. package/dist/chunks/sv-D9y-M1Fo.js.map +0 -1
  191. package/dist/chunks/th-D9umBjEy.js.map +0 -1
  192. package/dist/chunks/th-u2QSDF0G.js +0 -2
  193. package/dist/chunks/th-u2QSDF0G.js.map +0 -1
  194. package/dist/chunks/tr-BddMywiw.js.map +0 -1
  195. package/dist/chunks/tr-Bhgm6_ti.js +0 -2
  196. package/dist/chunks/tr-Bhgm6_ti.js.map +0 -1
  197. package/dist/chunks/uk-7vwqsaVK.js +0 -2
  198. package/dist/chunks/uk-7vwqsaVK.js.map +0 -1
  199. package/dist/chunks/uk-Dbd31hFt.js.map +0 -1
  200. package/dist/chunks/vi-CJefLP_g.js +0 -2
  201. package/dist/chunks/zh-D5C3BzYL.js +0 -2
  202. package/dist/chunks/zh-D5C3BzYL.js.map +0 -1
  203. package/dist/chunks/zh-gQSYLZI3.js.map +0 -1
@@ -1,26 +0,0 @@
1
- "use strict";const L=require("../core.cjs"),U=require("preact"),r=require("preact/jsx-runtime"),u=require("preact/hooks"),se=3600*1e3;function G(t){return`paywall-${t}-trial-time-first-open`}function W(t){return`paywall-${t}-skip-times`}class be{constructor(e,i,a){this.storage=e,this.paywallId=i,this.config=a}async check(){return this.config.mode==="time"?this.checkTime():this.checkOpens()}async recordBlock(){return this.config.mode==="time"?this.recordTime():this.recordOpens()}async reset(){await this.storage.removeItem(this.config.mode==="time"?G(this.paywallId):W(this.paywallId))}async checkTime(){const e=this.config.payload*se,i=await this.storage.getItem(G(this.paywallId)),a=i?Number(i):null;if(!a||!Number.isFinite(a))return{mode:"time",blocked:!0,startedAt:null,expiresAt:null,remainingMs:e,totalMs:e};const n=a+e,s=Math.max(0,n-Date.now());return{mode:"time",blocked:s>0,startedAt:a,expiresAt:n,remainingMs:s,totalMs:e}}async checkOpens(){const e=this.config.payload,i=await this.storage.getItem(W(this.paywallId)),a=i?Number(i):0,n=Number.isFinite(a)?a:0,s=n<e,o=Math.max(0,e-n);return{mode:"opens",blocked:s,remainingActions:o,totalActions:e}}async recordTime(){const e=this.config.payload*se,i=G(this.paywallId),a=await this.storage.getItem(i);let n=a?Number(a):null;(!n||!Number.isFinite(n))&&(n=Date.now(),await this.storage.setItem(i,String(n)));const s=n+e,o=Math.max(0,s-Date.now());return{mode:"time",blocked:o>0,startedAt:n,expiresAt:s,remainingMs:o,totalMs:e}}async recordOpens(){const e=this.config.payload,i=W(this.paywallId),a=await this.storage.getItem(i),n=a?Number(a):0,s=Number.isFinite(n)?n:0,o=Math.min(e,s+1);await this.storage.setItem(i,String(o));const l=Math.max(0,e-o);return{mode:"opens",blocked:o<e,remainingActions:l,totalActions:e}}}let oe=!1;class ze{constructor(e,i,a){oe||(oe=!0,console.warn('[paywall] trial.storage="server" is not implemented yet — falling back to client storage. State lives in localStorage; users can reset trial by clearing site data.')),this.fallback=new be(e,i,a)}check(){return this.fallback.check()}recordBlock(){return this.fallback.recordBlock()}reset(){return this.fallback.reset()}}function Be(t,e,i){return i.storage==="server"?new ze(t,e,i):new be(t,e,i)}const ve='/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{all:initial;color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*,:before,:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}button{cursor:pointer;font-family:inherit}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.-top-2{top:calc(var(--spacing) * -2)}.-top-\\[9px\\]{top:-9px}.-top-\\[10px\\]{top:-10px}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.-right-\\[6px\\]{right:-6px}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.left-1\\/2{left:50%}.z-10{z-index:10}.z-\\[1\\]{z-index:1}.z-\\[2147483647\\]{z-index:2147483647}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-mt-3{margin-top:calc(var(--spacing) * -3)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.-mb-2{margin-bottom:calc(var(--spacing) * -2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-1{height:calc(var(--spacing) * 1)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-6\\.5{height:calc(var(--spacing) * 6.5)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-\\[22px\\]{height:22px}.h-full{height:100%}.h-px{height:1px}.max-h-\\[calc\\(100dvh-1rem\\)\\]{max-height:calc(100dvh - 1rem)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-\\[2\\.4em\\]{min-height:2.4em}.min-h-\\[120px\\]{min-height:120px}.w-1{width:calc(var(--spacing) * 1)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-6\\.5{width:calc(var(--spacing) * 6.5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-full{width:100%}.max-w-\\[18rem\\]{max-width:18rem}.max-w-\\[20rem\\]{max-width:20rem}.max-w-\\[75\\%\\]{max-width:75%}.max-w-\\[320px\\]{max-width:320px}.max-w-\\[360px\\]{max-width:360px}.max-w-\\[400px\\]{max-width:400px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[pw-fade-in_180ms_ease-out\\]{animation:.18s ease-out pw-fade-in}.animate-\\[pw-scale-in_220ms_cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{animation:.22s cubic-bezier(.16,1,.3,1) pw-scale-in}.animate-ping{animation:var(--animate-ping)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-1\\.5{column-gap:calc(var(--spacing) * 1.5)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.self-center{align-self:center}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[9px\\]{border-radius:9px}.rounded-\\[11px\\]{border-radius:11px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.rounded-tl-xl{border-top-left-radius:var(--radius-xl)}.rounded-tr-xl{border-top-right-radius:var(--radius-xl)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[2\\.5px\\]{border-style:var(--tw-border-style);border-width:2.5px}.border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.border-\\[5px\\]{border-style:var(--tw-border-style);border-width:5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b,.border-b-1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\[var\\(--pw-accent\\)\\]{border-color:var(--pw-accent)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-white{border-color:var(--color-white)}.border-white\\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\\/40{border-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.border-t-\\[var\\(--pw-accent\\)\\]{border-top-color:var(--pw-accent)}.border-t-gray-700{border-top-color:var(--color-gray-700)}.border-t-white{border-top-color:var(--color-white)}.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:var(--pw-accent)}@supports (color:color-mix(in lab,red,red)){.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:color-mix(in srgb,var(--pw-accent) 6%,white)}}.bg-\\[var\\(--pw-accent\\)\\]{background-color:var(--pw-accent)}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/60{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/60{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-red-50{background-color:var(--color-red-50)}.bg-slate-950\\/50{background-color:#02061880}@supports (color:color-mix(in lab,red,red)){.bg-slate-950\\/50{background-color:color-mix(in oklab,var(--color-slate-950) 50%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.p-2{padding:calc(var(--spacing) * 2)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-3\\.5{padding-bottom:calc(var(--spacing) * 3.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.9375rem\\]{font-size:.9375rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[26px\\]{font-size:26px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--pw-accent\\)\\]{color:var(--pw-accent)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-700{color:var(--color-emerald-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-800\\/70{color:#1e2939b3}@supports (color:color-mix(in lab,red,red)){.text-gray-800\\/70{color:color-mix(in oklab,var(--color-gray-800) 70%,transparent)}}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-transparent{color:#0000}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.decoration-gray-400{-webkit-text-decoration-color:var(--color-gray-400);text-decoration-color:var(--color-gray-400)}.decoration-\\[1\\.5px\\]{text-decoration-thickness:1.5px}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_2px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#ef444480);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-8{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.\\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.placeholder\\:text-gray-500::placeholder{color:var(--color-gray-500)}@media(hover:hover){.hover\\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-50\\/60:hover{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-50\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-gray-200\\/60:hover{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-200\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}.hover\\:text-gray-900:hover{color:var(--color-gray-900)}.hover\\:text-red-600:hover{color:var(--color-red-600)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:opacity-90:hover{opacity:.9}.hover\\:brightness-105:hover{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\\:bg-gray-200\\/60:focus{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.focus\\:bg-gray-200\\/60:focus{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,var(--pw-accent))}@supports (color:color-mix(in lab,red,red)){.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,color-mix(in srgb,var(--pw-accent) 30%,transparent))}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:opacity-80:focus-visible{opacity:.8}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-\\[var\\(--pw-accent\\)\\]:focus-visible{--tw-ring-color:var(--pw-accent)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:scale-\\[0\\.98\\]:active{scale:.98}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-60:disabled{opacity:.6}@media(hover:hover){.disabled\\:hover\\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\\:hover\\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(min-width:40rem){.sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.sm\\:p-4{padding:calc(var(--spacing) * 4)}.sm\\:p-8{padding:calc(var(--spacing) * 8)}.sm\\:px-8{padding-inline:calc(var(--spacing) * 8)}.sm\\:pt-8{padding-top:calc(var(--spacing) * 8)}.sm\\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}}.pw-cta-shimmer:before{content:"";z-index:1;background:linear-gradient(90deg,#0000,#ffffff59 50%,#0000);width:100%;height:100%;animation:3s infinite pw-cta-shimmer;position:absolute;top:0;left:-100%}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}';let le=!1;function Re(){if(le||(le=!0,typeof CSS>"u"||typeof CSS.registerProperty!="function"))return;let t;try{const e=new CSSStyleSheet;e.replaceSync(ve),t=e.cssRules}catch{return}for(const e of t){if(e.constructor.name!=="CSSPropertyRule")continue;const i=e;try{CSS.registerProperty({name:i.name,syntax:i.syntax,inherits:i.inherits,...i.initialValue!=null?{initialValue:i.initialValue}:{}})}catch{}}}function Oe(t,e,i={}){if(typeof document>"u")throw new Error("mountShadow called in non-DOM environment");Re();const a=i.host??document.createElement("div");a.setAttribute("data-paywall-host",""),a.style.cssText=i.inline?"all: initial; position: absolute; inset: 0; z-index: 1; pointer-events: none;":"all: initial; position: fixed; inset: 0; z-index: 2147483647; pointer-events: none;",!a.isConnected&&!i.inline&&document.body.appendChild(a);const n=a.attachShadow({mode:i.shadowMode??"closed"}),s=`
2
- :host {
3
- all: initial !important;
4
- display: block !important;
5
- color: #111827 !important;
6
- font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
7
- font-size: 16px !important;
8
- font-weight: 400 !important;
9
- font-style: normal !important;
10
- line-height: 1.5 !important;
11
- letter-spacing: normal !important;
12
- text-transform: none !important;
13
- text-decoration: none !important;
14
- text-align: left !important;
15
- direction: ltr !important;
16
- cursor: auto !important;
17
- visibility: visible !important;
18
- }
19
- `,o=document.createElement("style");o.textContent=s+ve+(i.injectCss??""),n.appendChild(o);const l=document.createElement("div");l.style.pointerEvents="auto",n.appendChild(l);let d=e;return U.render(U.h(t,d),l),{shadowRoot:n,update(g){d={...d,...g},U.render(U.h(t,d),l)},unmount(){U.render(null,l),a.remove()}}}const Fe=(t,e,i)=>{const a=t[e];return a?typeof a=="function"?a():Promise.resolve(a):new Promise((n,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==i?". Note that variables only represent file names one level deep.":""))))})},Ue=["ru","uk","de","es","fr","it","pt","pl","cs","hu","ro","nl","sv","da","no","fi","el","tr","id","ar","ja","ko","zh","hi","th","vi","he"],ye=(t,e,i)=>_e(e,i),ke=U.createContext({t:ye,locale:"en"});function _e(t,e){if(!e)return t;let i=t;for(const[a,n]of Object.entries(e))i=i.split(`{${a}}`).join(String(n));return i}const Z=new Map,K=new Map;function je(t){return Ue.includes(t)}function qe(t){const e=[];if(typeof navigator<"u"&&navigator.language){e.push(navigator.language);const a=navigator.language.split("-")[0];a&&a!==navigator.language&&e.push(a)}const i=t.settings.locale_default;if(i){e.push(i);const a=i.split("-")[0];a&&a!==i&&e.push(a)}for(const a of e)if(je(a))return a;return null}function De(t){return!!t.locales&&Object.keys(t.locales).length>0}async function Ne(t){const e=Z.get(t);if(e)return e;const i=K.get(t);if(i)return i;const a=Fe(Object.assign({"./locales/ar.ts":()=>Promise.resolve().then(()=>require("./ar-BUQInJ5a.js")),"./locales/cs.ts":()=>Promise.resolve().then(()=>require("./cs-i5K4KTFV.js")),"./locales/da.ts":()=>Promise.resolve().then(()=>require("./da-CZbhtVJO.js")),"./locales/de.ts":()=>Promise.resolve().then(()=>require("./de-Bc-GoLgC.js")),"./locales/el.ts":()=>Promise.resolve().then(()=>require("./el-CcMEbl_F.js")),"./locales/es.ts":()=>Promise.resolve().then(()=>require("./es-BvYmomAz.js")),"./locales/fi.ts":()=>Promise.resolve().then(()=>require("./fi-aZR-qmZN.js")),"./locales/fr.ts":()=>Promise.resolve().then(()=>require("./fr-BgbFAgHx.js")),"./locales/he.ts":()=>Promise.resolve().then(()=>require("./he-CQ4yCuja.js")),"./locales/hi.ts":()=>Promise.resolve().then(()=>require("./hi-DtUsj1c-.js")),"./locales/hu.ts":()=>Promise.resolve().then(()=>require("./hu-DXtscQ8_.js")),"./locales/id.ts":()=>Promise.resolve().then(()=>require("./id-BByOYpeo.js")),"./locales/it.ts":()=>Promise.resolve().then(()=>require("./it-52Ip42pa.js")),"./locales/ja.ts":()=>Promise.resolve().then(()=>require("./ja-CMC3Parn.js")),"./locales/ko.ts":()=>Promise.resolve().then(()=>require("./ko-3qY21q40.js")),"./locales/nl.ts":()=>Promise.resolve().then(()=>require("./nl-Borc5nw1.js")),"./locales/no.ts":()=>Promise.resolve().then(()=>require("./no-Do2iGedg.js")),"./locales/pl.ts":()=>Promise.resolve().then(()=>require("./pl-mRaky_7k.js")),"./locales/pt.ts":()=>Promise.resolve().then(()=>require("./pt-DilDTXfs.js")),"./locales/ro.ts":()=>Promise.resolve().then(()=>require("./ro-DF2uzPIB.js")),"./locales/ru.ts":()=>Promise.resolve().then(()=>require("./ru-YeaXnTO-.js")),"./locales/sv.ts":()=>Promise.resolve().then(()=>require("./sv-2pHEvuSe.js")),"./locales/th.ts":()=>Promise.resolve().then(()=>require("./th-u2QSDF0G.js")),"./locales/tr.ts":()=>Promise.resolve().then(()=>require("./tr-Bhgm6_ti.js")),"./locales/uk.ts":()=>Promise.resolve().then(()=>require("./uk-7vwqsaVK.js")),"./locales/vi.ts":()=>Promise.resolve().then(()=>require("./vi-CJefLP_g.js")),"./locales/zh.ts":()=>Promise.resolve().then(()=>require("./zh-D5C3BzYL.js"))}),`./locales/${t}.ts`,3).then(n=>{const s=n.default??{};return Z.set(t,s),s}).catch(n=>{console.warn(`[paywall] failed to load locale chunk "${t}"`,n);const s={};return Z.set(t,s),s}).finally(()=>{K.delete(t)});return K.set(t,a),a}function He({bootstrap:t,forceLocale:e,children:i}){const[a,n]=u.useState("en"),[s,o]=u.useState(null);u.useEffect(()=>{const g=(e&&je(e)?e:null)??(!t||!De(t)?null:qe(t));if(!g){(s!==null||a!=="en")&&(n("en"),o(null));return}if(g===a&&s)return;let c=!1;return Ne(g).then(p=>{c||(n(g),o(p))}),()=>{c=!0}},[t,e]);const l={locale:a,t:s?(d,g,c)=>_e(s[d]??g,c):ye};return r.jsx(ke.Provider,{value:l,children:i})}function b(){return u.useContext(ke)}const ce='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ve({open:t,onClose:e,labelledBy:i,brandColor:a,topBanner:n,allowClose:s=!0,hideCloseButton:o=!1,inline:l=!1,children:d}){const{t:g}=b(),c=u.useRef(null),p=u.useRef(null);if(u.useEffect(()=>{if(!t)return;p.current=document.activeElement??null;const f=c.current;f&&(f.querySelector(ce)??f).focus({preventScroll:!0});const I=v=>{if(v.key==="Escape"){if(!s)return;v.stopPropagation(),e();return}if(v.key!=="Tab"||!c.current)return;const P=Array.from(c.current.querySelectorAll(ce)).filter(B=>!B.hasAttribute("disabled")&&B.tabIndex!==-1);if(P.length===0){v.preventDefault();return}const S=P[0],T=P[P.length-1],E=document.activeElement;v.shiftKey&&E===S?(v.preventDefault(),T.focus()):!v.shiftKey&&E===T&&(v.preventDefault(),S.focus())};document.addEventListener("keydown",I,!0);const M=document.body.style.overflow;return l||(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",I,!0),l||(document.body.style.overflow=M),p.current?.focus?.({preventScroll:!0})}},[t,e,s,l]),!t)return null;const m=f=>{s&&f.target===f.currentTarget&&e()},k=a??"#3b82f6",h=`${l?"absolute z-[1]":"fixed z-[2147483647]"} inset-0 flex items-center justify-center bg-slate-950/50 p-2 sm:p-4 backdrop-blur-md animate-[pw-fade-in_180ms_ease-out]`;return r.jsxs("div",{class:h,onClick:m,"data-pw-root":!0,children:[r.jsxs("div",{class:"relative flex w-full max-w-[400px] flex-col animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",style:{"--pw-accent":k},children:[n,r.jsxs("div",{ref:c,role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,class:"relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-xl bg-white outline-none",style:{boxShadow:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},children:[d,s&&!o?r.jsx("button",{type:"button",onClick:e,"aria-label":g("modal.close_aria","Close"),class:"absolute right-3 top-3 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-500 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:r.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round"})})}):null]})]}),r.jsx("style",{children:`
20
- @keyframes pw-fade-in { from { opacity: 0 } to { opacity: 1 } }
21
- @keyframes pw-scale-in {
22
- from { opacity: 0; transform: translateY(12px) scale(0.96) }
23
- to { opacity: 1; transform: none }
24
- }
25
- `})]})}function $e(t,e){switch(t){case"google":return e("auth.continue_with_google","Continue with Google");case"apple":return e("auth.continue_with_apple","Continue with Apple");case"github":return e("auth.continue_with_github","Continue with GitHub");case"facebook":return e("auth.continue_with_facebook","Continue with Facebook")}}function de(t,e,i){const a=e==="signup"?i("auth.signup_failed","Sign-up failed"):i("auth.signin_failed","Sign-in failed");if(!(t instanceof L.PaywallError))return a;switch(t.code){case"invalid_credentials":return i("auth.invalid_credentials","Invalid email or password");case"email_not_confirmed":return i("auth.email_not_confirmed","Please confirm your email before signing in.");case"email_exists":case"user_already_exists":return i("auth.email_exists","An account with this email already exists.");case"weak_password":return i("auth.weak_password","Password is too weak.");case"invalid_otp":case"otp_expired":case"token_expired":return i("auth.invalid_otp","The code is invalid or has expired.");case"over_email_send_rate_limit":case"over_request_rate_limit":case"rate_limited":case"http_429":return i("auth.rate_limited","Too many requests. Please try again in a moment.");case"network_error":return i("auth.network_error","Network error. Please check your connection and try again.");case"upstream":case"upstream_error":case"http_502":case"http_503":case"http_504":return i("auth.service_unavailable","Service is temporarily unavailable. Please try again.");default:return a}}function Se({block:t,ctx:e}){const i=e.auth,a=e.authSession,n=t.allow_signup!==!1,s=t.allow_password_reset!==!1,o=t.hide_when_authenticated!==!1;if(!i)return typeof console<"u"&&console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"),null;const l=a&&!a.user.is_anonymous?a:null;return l&&o?null:l?r.jsx(Ge,{email:l.user.email??"",onSignOut:()=>i.signOut().catch(()=>{})}):r.jsx(We,{block:t,allowSignup:n,allowReset:s,ctx:e})}function Ge({email:t,onSignOut:e}){const{t:i}=b();return r.jsxs("div",{class:"flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3",children:[r.jsxs("div",{class:"flex flex-col",children:[r.jsx("span",{class:"text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:i("auth.signed_in","Signed in")}),r.jsx("span",{class:"text-sm font-medium text-gray-900",children:t})]}),r.jsx("button",{type:"button",onClick:e,class:"rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-600 transition-colors hover:bg-white hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:i("auth.sign_out","Sign out")})]})}function We({block:t,allowSignup:e,allowReset:i,ctx:a}){const{t:n}=b(),s=a.auth,o=t.providers??[],[l,d]=u.useState("signin"),[g,c]=u.useState(""),[p,m]=u.useState(""),[k,h]=u.useState(""),[f,I]=u.useState(""),[M,v]=u.useState(null),[P,S]=u.useState(null),[T,E]=u.useState(null),[B,O]=u.useState(!1),[R,F]=u.useState(null);u.useEffect(()=>{if(typeof s.getLastLogin!="function")return;let _=!1;return s.getLastLogin().then(A=>{_||!A||(F(A),A.email&&c(D=>D===""?A.email:D))},()=>{}),()=>{_=!0}},[s]);const C=_=>{d(_),S(null),E(null),O(!1)},j=async _=>{if(_.preventDefault(),!M){if(S(null),E(null),l==="signup"&&!B){if(!g.trim())return;O(!0);return}if(l==="signup"&&p!==k){S(n("auth.passwords_mismatch","Passwords don't match"));return}v("email");try{l==="signin"?await s.signInWithEmail({email:g,password:p}):l==="signup"?(await s.signUp({email:g,password:p})).kind==="confirmation_required"&&(d("reset_verify"),E(n("auth.check_email_message","Check your email for a confirmation code."))):l==="forgot"?(await s.requestPasswordReset({email:g}),d("reset_sent"),E(n("auth.reset_sent_message","If that email exists, a reset code has been sent."))):l==="reset_verify"&&(await s.verifyOtp({email:g,token:f,type:p?"recovery":"email"}),p&&await s.updatePassword({password:p}))}catch(A){S(de(A,l==="signup"?"signup":l==="reset_verify"?"otp":l==="forgot"?"reset":"signin",n))}finally{v(null)}}},z=async _=>{if(!M){v(_),S(null),E(null);try{await s.signInWithOAuth({provider:_,onPopupOpened:()=>v(null)})}catch(A){if(A instanceof L.PaywallError&&(A.code==="oauth_cancelled"||A.code==="oauth_timeout"))return;S(de(A,"signin",n))}finally{v(null)}}},x=o.length>0&&(l==="signin"||l==="signup"),w=l==="signin"||l==="signup"||l==="forgot",y=l==="signin"||l==="signup"&&B;return r.jsxs("div",{class:"flex flex-col gap-5",children:[r.jsx(Ze,{mode:l,customHeading:t.heading,customSubheading:t.subheading}),x?r.jsxs("div",{class:"flex flex-col gap-2.5",children:[o.map(_=>r.jsxs("div",{class:"relative",children:[r.jsxs("button",{type:"button",onClick:()=>z(_),disabled:M!==null,class:"flex h-12 w-full items-center justify-center gap-2.5 rounded-full border-1 border-gray-200 bg-white px-5 text-base font-medium text-gray-900 transition-all hover:border-gray-300 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:[M===_?r.jsx("span",{class:"inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700"}):r.jsx(it,{provider:_}),r.jsx("span",{children:$e(_,n)})]}),R?.method===_?r.jsx(pe,{email:R.email}):null]},_)),r.jsx(rt,{})]}):null,r.jsxs("form",{onSubmit:j,class:"flex flex-col gap-3",children:[w&&r.jsx(ue,{type:"email",placeholder:n("auth.email","Email address"),value:g,onInput:c,autocomplete:"email",required:!0}),y&&r.jsx(Y,{placeholder:n("auth.password","Password"),value:p,onInput:m,autocomplete:l==="signin"?"current-password":"new-password",required:!0}),l==="signup"&&B&&r.jsx(Y,{placeholder:n("auth.repeat_password","Repeat password"),value:k,onInput:h,autocomplete:"new-password",required:!0}),l==="reset_verify"&&r.jsxs(r.Fragment,{children:[r.jsx(ue,{type:"text",placeholder:n("auth.confirmation_code","Confirmation code"),value:f,onInput:I,autocomplete:"one-time-code",inputMode:"numeric",required:!0}),r.jsx(Y,{placeholder:n("auth.new_password_optional","New password (optional — only for password reset)"),value:p,onInput:m,autocomplete:"new-password"})]}),l==="reset_sent"&&T&&r.jsx("p",{class:"rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600",children:T}),l==="signin"&&i&&r.jsx("div",{class:"flex justify-end text-sm",children:r.jsx($,{onClick:()=>C("forgot"),children:n("auth.forgot_password","Forgot password?")})}),P&&r.jsx("p",{class:"text-sm text-red-600",children:P}),T&&l!=="reset_sent"&&r.jsx("p",{class:"text-sm text-gray-500",children:T}),l!=="reset_sent"&&r.jsxs("div",{class:"relative",children:[r.jsx(Je,{busy:M==="email",label:Ye(l,B,t.submit_label??t.heading,n)}),l==="signin"&&R?.method==="email"?r.jsx(pe,{email:R.email}):null]})]}),r.jsx(Xe,{mode:l,allowSignup:e,onSwitch:C})]})}function Ze({mode:t,customHeading:e,customSubheading:i}){const{t:a}=b(),n=Ke(t,a),s=t==="signin"||t==="signup",o=s&&e?e:n.title,l=s&&i!==void 0?i||null:n.subtitle;return r.jsxs("div",{class:"flex flex-col gap-2",children:[r.jsx("h2",{class:"text-3xl font-bold tracking-tight text-gray-900",children:o}),l?r.jsx("p",{class:"text-base leading-relaxed text-gray-600",children:l}):null]})}function Ke(t,e){switch(t){case"signin":return{title:e("auth.welcome","Welcome back!"),subtitle:e("auth.default_subtitle","Sign in to access all features and sync your data.")};case"signup":return{title:e("auth.welcome_signup","Welcome!"),subtitle:e("auth.default_subtitle","Sign in to access all features and sync your data.")};case"forgot":return{title:e("auth.forgot_password_title","Forgot password?"),subtitle:e("auth.forgot_subtitle","Enter your email and we'll send you a password reset link.")};case"reset_sent":return{title:e("auth.check_email_title","Check your email"),subtitle:null};case"reset_verify":return{title:e("auth.reset_password_title","Reset password"),subtitle:e("auth.reset_password_subtitle","Enter the code from your email and a new password.")}}}function Ye(t,e,i,a){if(t==="signin"&&i)return i;switch(t){case"signin":return a("auth.log_in","Sign In");case"signup":return e?a("auth.create_account","Create Account"):a("auth.sign_up","Sign Up");case"forgot":return a("auth.send_reset","Send Reset Email");case"reset_verify":return a("auth.verify","Verify");default:return a("cta.continue","Continue")}}function Xe({mode:t,allowSignup:e,onSwitch:i}){const{t:a}=b();return t==="signin"&&e?r.jsxs("p",{class:"text-center text-sm text-gray-600",children:[a("auth.no_account","Don't have an account?")," ",r.jsx($,{onClick:()=>i("signup"),children:a("auth.sign_up_link","Sign Up")})]}):t==="signup"?r.jsxs("p",{class:"text-center text-sm text-gray-600",children:[a("auth.have_account","Already have an account?")," ",r.jsx($,{onClick:()=>i("signin"),children:a("auth.log_in_link","Log In")})]}):t==="forgot"||t==="reset_sent"||t==="reset_verify"?r.jsxs("p",{class:"text-center text-sm text-gray-600",children:[a("auth.no_account","Don't have an account?")," ",r.jsx($,{onClick:()=>i("signup"),children:a("auth.sign_up_link","Sign Up")})]}):null}function $({onClick:t,children:e}){return r.jsx("button",{type:"button",onClick:t,class:"font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",style:{color:"var(--pw-accent)"},children:e})}function Je({busy:t,label:e}){return r.jsx("button",{type:"submit",disabled:t,class:"pw-cta-shimmer relative mt-1 flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:t?r.jsx("span",{class:"relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}):r.jsx("span",{class:"relative z-10",children:e})})}function ue({type:t,placeholder:e,value:i,onInput:a,autocomplete:n,inputMode:s,required:o}){return r.jsx("input",{type:t,value:i,placeholder:e,onInput:l=>a(l.target.value),autocomplete:n,inputMode:s,required:o,class:"h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"})}function Y({placeholder:t,value:e,onInput:i,autocomplete:a,required:n}){const{t:s}=b(),[o,l]=u.useState(!1),d=u.useRef(null);u.useEffect(()=>{const p=d.current;p&&p.value!==e&&(p.value=e)},[o,e]);const g=s("auth.show_password","Show password"),c=s("auth.hide_password","Hide password");return r.jsxs("div",{class:"relative",children:[r.jsx("input",{ref:d,type:o?"text":"password",value:e,placeholder:t,onInput:p=>i(p.target.value),autocomplete:a,required:n,class:"h-14 w-full rounded-2xl bg-gray-100 pl-5 pr-12 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}),r.jsx("button",{type:"button",onClick:()=>l(p=>!p),"aria-label":o?c:g,tabIndex:-1,class:"absolute right-4 top-1/2 -translate-y-1/2 flex h-6 w-6 items-center justify-center rounded text-gray-500 transition-colors hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:o?r.jsx(et,{}):r.jsx(Qe,{})})]})}function Qe(){return r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M1.667 10S4.583 4.167 10 4.167 18.333 10 18.333 10 15.417 15.833 10 15.833 1.667 10 1.667 10Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),r.jsx("circle",{cx:"10",cy:"10",r:"2.5",stroke:"currentColor","stroke-width":"1.5"})]})}function et(){return r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M8.236 4.293A6.96 6.96 0 0 1 10 4.167C15.417 4.167 18.333 10 18.333 10a13.5 13.5 0 0 1-1.92 2.755M11.768 11.768A2.5 2.5 0 0 1 8.233 8.233",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),r.jsx("path",{d:"M14.953 14.953A8.84 8.84 0 0 1 10 15.833C4.583 15.833 1.667 10 1.667 10a13.5 13.5 0 0 1 3.38-3.953M1.667 1.667l16.666 16.666",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})}function pe({email:t}){const{t:e}=b(),i=t?e("auth.last_used","Last · {email}",{email:tt(t)}):e("auth.last_used_no_email","Last");return r.jsx("span",{class:"pointer-events-none absolute -top-2 right-3 max-w-[75%] truncate rounded-full bg-gray-900 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-white shadow-sm",children:i})}function tt(t){const[e,i]=t.split("@");return i?`${e.slice(0,3)}*****@${i}`:t}function rt(){const{t}=b();return r.jsxs("div",{class:"flex items-center gap-3 py-1 text-sm text-gray-400",children:[r.jsx("div",{class:"h-px flex-1 bg-gray-200"}),r.jsx("span",{children:t("auth.or","or")}),r.jsx("div",{class:"h-px flex-1 bg-gray-200"})]})}function it({provider:t}){return t==="google"?r.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 18 18","aria-hidden":"true",children:[r.jsx("path",{fill:"#4285F4",d:"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.49h4.84a4.14 4.14 0 0 1-1.79 2.71v2.26h2.9c1.7-1.56 2.69-3.87 2.69-6.62Z"}),r.jsx("path",{fill:"#34A853",d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.9-2.26c-.8.54-1.83.86-3.06.86-2.36 0-4.36-1.59-5.07-3.74H.92v2.33A9 9 0 0 0 9 18Z"}),r.jsx("path",{fill:"#FBBC05",d:"M3.93 10.68a5.4 5.4 0 0 1 0-3.36V4.99H.92a9 9 0 0 0 0 8.02l3-2.33Z"}),r.jsx("path",{fill:"#EA4335",d:"M9 3.58c1.32 0 2.5.45 3.44 1.34l2.58-2.58A9 9 0 0 0 .92 4.99l3.01 2.33C4.64 5.17 6.64 3.58 9 3.58Z"})]}):t==="apple"?r.jsx("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}):t==="github"?r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M8 0C3.6 0 0 3.6 0 8a8 8 0 0 0 5.5 7.6c.4.1.5-.2.5-.4v-1.5c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.2 1.9.9 2.4.7 0-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8a7.6 7.6 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.5.8 1.2.8 2.1 0 3.1-1.9 3.7-3.6 3.9.3.3.6.8.6 1.6V15c0 .2.1.5.6.4A8 8 0 0 0 16 8c0-4.4-3.6-8-8-8Z"})}):r.jsx("svg",{width:"18",height:"20",viewBox:"0 0 14 16",fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M14 2.7C14 1.2 12.8 0 11.3 0H2.7C1.2 0 0 1.2 0 2.7v10.6C0 14.8 1.2 16 2.7 16h4V9.8H4.7v-2H6.7V6.4c0-2 1.2-3.1 3-3.1.9 0 1.7.1 2 .2V5h-1.4c-.8 0-1 .4-1 1v1.5h2.4l-.3 2H9.3V16h2c1.5 0 2.7-1.2 2.7-2.7V2.7Z"})})}function nt({block:t,bootstrap:e,auth:i,authSession:a,onBack:n,showBack:s=!0,intent:o="preauth"}){const{t:l}=b(),d={bootstrap:e,selectedPriceId:null,setSelectedPriceId:()=>{},onAction:()=>{},auth:i,authSession:a},g=o==="restore"?{...t,heading:l("auth.restore_purchases_heading","Restore Purchases"),subheading:l("auth.restore_purchases_subheading","Please sign in to restore your purchases.")}:o==="preauth"?{...t,heading:l("auth.login_continue_purchase","Log in to continue your purchase"),subheading:l("auth.link_purchase_subheading","We'll link the purchase to your account to keep access."),submit_label:l("auth.log_in","Sign In")}:t;return r.jsxs("div",{class:"relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8",children:[s?r.jsx(at,{onClick:n,ariaLabel:l("nav.back_aria","Back")}):null,r.jsx(Se,{block:g,ctx:d})]})}function at({onClick:t,ariaLabel:e}){return r.jsx("button",{type:"button",onClick:t,"aria-label":e,class:"absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M5 8h8a4 4 0 0 1 0 8H9",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"}),r.jsx("path",{d:"M8 4 4 8l4 4",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"})]})})}function st({auth:t,onSuccess:e,onBack:i,heading:a,description:n}){const{t:s}=b(),o=a??s("anon.heading_default","Continue as guest"),l=n??s("anon.description_default","Setting up your guest session…"),[d,g]=u.useState({kind:"signing-in"}),c=u.useRef(!0);u.useEffect(()=>()=>{c.current=!1},[]);const p=()=>{g({kind:"signing-in"}),(async()=>{try{const m=await t.signInAnonymously();if(!c.current)return;e(m)}catch(m){if(!c.current)return;g({kind:"error",message:m instanceof Error?m.message:"Anonymous sign-in failed"})}})()};return u.useEffect(()=>{p()},[]),r.jsxs("div",{class:"flex flex-col gap-3",children:[i?r.jsx("button",{type:"button",onClick:i,class:"-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:s("nav.back","← Back")}):null,r.jsxs("div",{class:"flex flex-col gap-1",children:[r.jsx("h2",{class:"text-xl font-semibold text-gray-900",children:o}),r.jsx("p",{class:"text-sm text-gray-500",children:l})]}),d.kind==="signing-in"?r.jsx("div",{class:"flex items-center justify-center py-6",children:r.jsx(ot,{})}):null,d.kind==="error"?r.jsxs("div",{class:"flex flex-col gap-3",children:[r.jsx("div",{class:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700",children:d.message}),r.jsx("button",{type:"button",onClick:p,class:"self-start rounded-md bg-[var(--pw-accent)] px-3 py-1.5 text-sm font-medium text-white hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)] focus-visible:ring-offset-2",children:s("anon.try_again","Try again")})]}):null]})}function ot(){return r.jsxs("svg",{class:"h-5 w-5 animate-spin text-[var(--pw-accent)]",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"3","stroke-opacity":"0.2"}),r.jsx("path",{d:"M22 12a10 10 0 0 0-10-10",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round"})]})}const Ce=t=>`pw-offer-${t}-start`;function X(t){const e=t-Date.now();return e<=0?{days:0,hours:0,minutes:0,seconds:0,expired:!0}:{days:Math.floor(e/(1e3*60*60*24)),hours:Math.floor(e%(1e3*60*60*24)/(1e3*60*60)),minutes:Math.floor(e%(1e3*60*60)/(1e3*60)),seconds:Math.floor(e%(1e3*60)/1e3),expired:!1}}function lt(t){if(t.expires_at){const e=Date.parse(t.expires_at);return Number.isFinite(e)?e:null}if(t.duration_minutes&&t.duration_minutes>0){if(typeof window>"u")return null;try{const e=Ce(t.id);let i=window.localStorage.getItem(e);return i||(i=new Date().toISOString(),window.localStorage.setItem(e,i)),Date.parse(i)+t.duration_minutes*6e4}catch{return null}}return null}function Ie(t,e){if(!t||t.length===0)return null;if(e){const i=t.find(a=>a.id===e);if(i)return i}return t.find(i=>i.expires_at||i.duration_minutes)??null}function Pe(t){const e=t?lt(t):null,[i,a]=u.useState(()=>e!==null?X(e):null),n=u.useRef(e);return n.current=e,u.useEffect(()=>{if(e===null){a(null);return}a(X(e));const s=setInterval(()=>{const o=X(n.current??0);if(a(o),o.expired&&(clearInterval(s),t?.duration_minutes&&typeof window<"u"))try{window.localStorage.removeItem(Ce(t.id))}catch{}},1e3);return()=>clearInterval(s)},[e,t?.duration_minutes,t?.id]),i}function ct({block:t,ctx:e}){const{t:i}=b(),a=Ie(e.bootstrap.offers,t.offer_id),n=Pe(a);if(!a||n===null||n.expired&&!t.force)return null;const s=t.title??a.label??i("offer.limited_time","Limited-time offer"),o=a.discount_percent?`${s} ${a.discount_percent}%`:s;return r.jsxs("div",{class:"flex flex-wrap items-center justify-center gap-2 rounded-2xl px-4 py-3 text-[15px] font-semibold leading-tight text-white",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",textShadow:"0 0 2px rgba(0, 0, 0, 0.25)"},role:"status",children:[r.jsx(Me,{}),r.jsx("span",{children:o}),r.jsx(Ae,{value:n,t:i})]})}function Ae({value:t,t:e}){return r.jsxs("div",{class:"flex items-center gap-1 font-mono text-sm",children:[t.days>0?r.jsxs(r.Fragment,{children:[r.jsx(N,{children:String(t.days)}),r.jsx("span",{class:"text-xs",children:e("countdown.d","d")})]}):null,r.jsx(N,{children:String(t.hours).padStart(2,"0")}),r.jsx("span",{class:"text-xs",children:e("countdown.h","h")}),r.jsx(N,{children:String(t.minutes).padStart(2,"0")}),r.jsx("span",{class:"text-xs",children:e("countdown.m","m")}),r.jsx(N,{children:String(t.seconds).padStart(2,"0")}),r.jsx("span",{class:"text-xs",children:e("countdown.s","s")})]})}function N({children:t}){return r.jsx("span",{class:"rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold",children:t})}function dt({offer:t}){const{t:e}=b(),i=Pe(t);if(i===null||i.expired)return null;const a=t.label??e("offer.limited_time","Limited-time offer"),n=t.discount_percent?`${a} ${t.discount_percent}%`:a;return r.jsxs("div",{class:"-mb-2 flex flex-wrap items-center justify-center gap-2 rounded-t-xl px-4 pb-5 pt-3 text-[15px] font-semibold leading-tight text-white",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",textShadow:"0 0 2px rgba(0, 0, 0, 0.25)"},role:"status",children:[r.jsx(Me,{}),r.jsx("span",{children:n}),r.jsx(Ae,{value:i,t:e})]})}function Me(){return r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:r.jsx("path",{fill:"currentColor",d:"m9.44 5.359-2.394-.895.61-3.036c.062-.31-.345-.531-.57-.291L2.434 6.105a.336.336 0 0 0 .126.537l2.395.894-.61 3.037c-.062.31.345.53.57.29l4.653-4.968a.336.336 0 0 0-.126-.536Z"})})}const J=3,Q=200,ee=5e3,te=5,ut=10*1024*1024,he=["image/jpeg","image/png","image/webp"],ge=/.+@.+\..+/;function pt({client:t,authSession:e,origin:i,onBack:a}){const{t:n}=b(),s=e?.user.email??"",o=s||null,[l,d]=u.useState(s),[g,c]=u.useState(""),[p,m]=u.useState(""),[k,h]=u.useState([]),[f,I]=u.useState(!1),[M,v]=u.useState(null),[P,S]=u.useState({}),T=u.useMemo(()=>{const C=(o??l).trim().toLowerCase(),j=g.trim(),z=p.trim();return ge.test(C)&&j.length>=J&&j.length<=Q&&z.length>=1&&z.length<=ee},[o,l,g,p]),E=()=>{const C={},j=(o??l).trim(),z=g.trim(),x=p.trim();return j?ge.test(j.toLowerCase())||(C.email=n("support.invalid_email","Invalid email")):C.email=n("support.required","Required"),(z.length<J||z.length>Q)&&(C.subject=n("support.subject_length","{min}–{max} characters",{min:J,max:Q})),(x.length<1||x.length>ee)&&(C.message=n("support.message_length","{min}–{max} characters",{min:1,max:ee})),S(C),Object.keys(C).length===0},B=async C=>{if(C.preventDefault(),!f&&E()){I(!0),S(j=>({...j,submit:void 0}));try{const j=(o??l).trim();await t.createSupportTicket({subject:g.trim(),content:p.trim(),email:j||void 0,files:k.length>0?k:void 0}),v(j)}catch(j){const z=j instanceof L.PaywallError&&j.message||"Failed to send. Please try again.";S(x=>({...x,submit:z}))}finally{I(!1)}}},O=()=>{c(""),m(""),h([]),S({}),v(null)},R="flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8",F={boxShadow:"0 -4px 12px -4px rgba(15,23,42,0.06)"};return M?r.jsxs("div",{class:"relative flex-1 min-h-0 flex flex-col",children:[r.jsxs("div",{class:"flex-1 min-h-0 overflow-y-auto flex flex-col items-center gap-4 px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8 text-center",children:[r.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 85%, white), var(--pw-accent))",color:"#fff",boxShadow:"0 0 0 8px color-mix(in srgb, var(--pw-accent) 12%, transparent), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 45%, transparent)"},"aria-hidden":"true",children:r.jsx("svg",{viewBox:"0 0 24 24",class:"h-7 w-7",children:r.jsx("path",{fill:"currentColor",d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.93 8.2-6.85 9.29a1.01 1.01 0 0 1-1.43.19L5.76 13.77a1 1 0 1 1 1.25-1.56l4.08 3.26 6.23-8.45a1 1 0 1 1 1.61 1.18Z"})})}),r.jsx("div",{class:"text-lg font-semibold tracking-tight text-gray-900",children:n("support.success_heading","Request submitted")}),r.jsxs("div",{class:"max-w-[320px] text-sm leading-relaxed text-gray-500",children:[n("support.success_message_prefix","We've received your message and will respond to")," ",r.jsx("b",{class:"text-gray-700",children:M}),"."]})]}),r.jsx("div",{class:R,style:F,children:r.jsxs("div",{class:"flex items-center justify-center gap-3",children:[r.jsx("button",{type:"button",onClick:a,class:"rounded-xl px-3 py-2 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:i==="standalone"?n("support.done_button","Done"):n("nav.back_aria","Back")}),r.jsx("button",{type:"button",onClick:O,class:"flex h-10 items-center justify-center rounded-xl px-4 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:n("support.send_another","Send another request")})]})})]}):r.jsxs("form",{onSubmit:B,class:"relative flex-1 min-h-0 flex flex-col",children:[r.jsx(ht,{onClick:a,ariaLabel:n("nav.back_aria","Back")}),r.jsx("div",{class:"flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8",children:r.jsxs("div",{class:"flex flex-col gap-5",children:[r.jsxs("div",{class:"flex flex-col gap-2 pr-10",children:[r.jsx("h2",{class:"text-3xl font-bold tracking-tight text-gray-900",children:n("support.heading","Support")}),r.jsx("p",{class:"text-base leading-relaxed text-gray-600",children:n("support.instruction","Please fill out the form below to submit your support request.")})]}),r.jsxs("div",{class:"flex flex-col gap-3",children:[o?r.jsxs("div",{class:"rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600",children:[n("support.sending_as","Sending as")," ",r.jsx("b",{class:"font-medium text-gray-900",children:o})]}):r.jsx(fe,{type:"email",placeholder:n("support.email_placeholder","Enter your email *"),value:l,onInput:d,error:P.email,autocomplete:"email",required:!0}),r.jsx(fe,{type:"text",placeholder:n("support.subject_placeholder","Enter your subject *"),value:g,onInput:c,error:P.subject,required:!0}),r.jsx(gt,{placeholder:n("support.message_placeholder","Enter your message *"),value:p,onInput:m,error:P.message,required:!0}),r.jsx(ft,{files:k,onChange:h,disabled:f})]})]})}),r.jsxs("div",{class:R,style:F,children:[P.submit&&r.jsx("p",{class:"text-sm text-red-600",children:P.submit}),r.jsxs("div",{class:"flex items-center justify-end gap-3",children:[r.jsx("button",{type:"button",onClick:a,disabled:f,class:"rounded-full px-4 py-2 text-base font-medium text-gray-700 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:i==="standalone"?n("support.close_button","Close"):n("nav.back_aria","Back")}),r.jsx("button",{type:"submit",disabled:!T||f,class:"pw-cta-shimmer relative flex h-12 items-center justify-center overflow-hidden rounded-full px-8 text-base font-semibold text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:f?r.jsx("span",{class:"relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}):r.jsx("span",{class:"relative z-10",children:n("support.send_button","Send")})})]})]})]})}function ht({onClick:t,ariaLabel:e}){return r.jsx("button",{type:"button",onClick:t,"aria-label":e,class:"absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M5 8h8a4 4 0 0 1 0 8H9",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"}),r.jsx("path",{d:"M8 4 4 8l4 4",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"})]})})}function fe({type:t,placeholder:e,value:i,onInput:a,error:n,autocomplete:s,required:o}){return r.jsxs("div",{children:[r.jsx("input",{type:t,value:i,placeholder:e,onInput:l=>a(l.target.value),autocomplete:s,required:o,class:`h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${n?"shadow-[0_0_0_2px_rgba(239,68,68,0.5)]":"focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`}),n&&r.jsx("span",{class:"mt-1 ml-2 block text-sm text-red-600",children:n})]})}function gt({placeholder:t,value:e,onInput:i,error:a,required:n}){return r.jsxs("div",{children:[r.jsx("textarea",{value:e,placeholder:t,onInput:s=>i(s.target.value),required:n,rows:5,class:`min-h-[120px] w-full rounded-2xl bg-gray-100 px-5 py-3.5 text-base leading-relaxed text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${a?"shadow-[0_0_0_2px_rgba(239,68,68,0.5)]":"focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`}),a&&r.jsx("span",{class:"mt-1 ml-2 block text-sm text-red-600",children:a})]})}function ft({files:t,onChange:e,disabled:i}){const{t:a}=b(),n=u.useRef(null),[s,o]=u.useState(!1),[l,d]=u.useState(null),g=c=>{if(!c||i)return;d(null);const p=Array.from(c);if(t.length+p.length>te){d(a("support.too_many_files","Up to {max} files",{max:te}));return}const m=p.filter(k=>he.includes(k.type)&&k.size<=ut);if(m.length!==p.length){d(a("support.invalid_file","Only JPEG/PNG/WebP, ≤ 10MB each"));return}e([...t,...m])};return r.jsxs("div",{children:[r.jsx("span",{class:"text-xs font-medium text-gray-700",children:a("support.attachments_label","Attachments (optional)")}),r.jsxs("div",{role:"button",tabIndex:0,"aria-label":a("support.attachments_aria","Attachments upload"),onClick:()=>!i&&n.current?.click(),onDragOver:c=>{c.preventDefault(),i||o(!0)},onDragLeave:()=>o(!1),onDrop:c=>{c.preventDefault(),o(!1),g(c.dataTransfer?.files??null)},class:`mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${s?"border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]":"border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${i?"cursor-not-allowed opacity-60":""}`,children:[r.jsx("div",{class:"text-xs text-gray-500",children:a("support.dropzone_text","Drop images here or click to select")}),r.jsx("div",{class:"mt-0.5 text-[11px] text-gray-400",children:a("support.file_requirements","JPEG/PNG/WebP, up to {max} files, ≤ 10MB each",{max:te})})]}),r.jsx("input",{ref:n,type:"file",multiple:!0,accept:he.join(","),class:"hidden",onChange:c=>{g(c.target.files),c.currentTarget.value=""}}),l&&r.jsx("p",{class:"mt-1 text-xs text-red-600",children:l}),t.length>0&&r.jsx("ul",{class:"mt-2 flex flex-col gap-1",children:t.map((c,p)=>r.jsxs("li",{class:"flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",children:[r.jsx("span",{class:"truncate text-gray-700",children:c.name}),r.jsx("button",{type:"button",onClick:()=>{const m=[...t];m.splice(p,1),e(m)},disabled:i,class:"text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60","aria-label":a("support.remove_file_aria","Remove {filename}",{filename:c.name}),children:"✕"})]},`${c.name}-${c.size}-${p}`))})]})}const xt={day:"cta.get_plan_daily",week:"cta.get_plan_weekly",month:"cta.get_plan_monthly",year:"cta.get_plan_yearly"},wt={day:"Get Daily Plan",week:"Get Weekly Plan",month:"Get Monthly Plan",year:"Get Yearly Plan"};function mt(t,e,i,a){if(e==="close")return a("cta.close","Close");if(!t)return a("cta.continue","Continue");if(!i&&t.trial_days&&t.interval&&t.interval!=="lifetime")return a("cta.start_trial","Start {days}-Day Free Trial",{days:t.trial_days});if(!t.interval||t.interval==="lifetime")return a("cta.get_lifetime_access","Get Lifetime Access");const n=xt[t.interval];return n?a(n,wt[t.interval]):a("cta.get_plan_generic","Get {interval} Plan",{interval:bt(t.interval)})}function bt(t){return t.length?t[0].toUpperCase()+t.slice(1):t}function vt({block:t,ctx:e}){const{t:i}=b(),[a,n]=u.useState(!1),s=t.priceId??e.selectedPriceId,o=a||t.action==="checkout"&&!s,l=s?e.bootstrap.prices.find(p=>p.id===s)??null:null,d=e.bootstrap.user?.had_previous_trial??!1,g=t.label??mt(l,t.action,d,i),c=async()=>{if(!o){n(!0);try{await e.onAction(t.action,{priceId:s})}finally{n(!1)}}};return r.jsxs("button",{type:"button",disabled:o,onClick:c,class:"pw-cta-shimmer relative flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:[r.jsx("span",{class:"absolute inset-0 opacity-40",style:{background:"radial-gradient(circle at 50% 0%, color-mix(in srgb, white 40%, transparent) 0%, transparent 70%)"},"aria-hidden":"true"}),a?r.jsx("span",{class:"relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}):r.jsx("span",{class:"relative z-10",children:g})]})}function yt({ctx:t}){const{t:e}=b(),i=t.authSession,a=t.auth,[n,s]=u.useState(!1),o=()=>t.onAction("support");if(i&&!i.user.is_anonymous){const l=async()=>{if(!(!a||n)){s(!0);try{await a.signOut()}catch{}finally{s(!1)}}};return r.jsxs("div",{class:"-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500",children:[r.jsxs("span",{children:[e("session.signed_in_as_prefix","Signed in as")," ",r.jsx("b",{class:"font-medium text-gray-700",children:i.user.email})]}),r.jsxs("div",{class:"flex items-center justify-center gap-3",children:[r.jsx(H,{onClick:l,disabled:!a||n,children:n?e("session.signing_out","Signing out…"):e("session.sign_out","Sign Out")}),r.jsx(xe,{}),r.jsx(H,{onClick:o,children:e("session.contact_support","Contact Support")})]})]})}return r.jsxs("div",{class:"-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]",children:[r.jsx(H,{onClick:()=>t.onAction("restore"),children:e("session.restore_purchases","Restore purchases")}),r.jsx(xe,{}),r.jsx(H,{onClick:o,children:e("session.contact_support","Contact Support")})]})}function H({onClick:t,disabled:e,children:i}){return r.jsx("button",{type:"button",onClick:t,disabled:e,class:"font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",style:{color:"var(--pw-accent)"},children:i})}function xe(){return r.jsx("span",{class:"h-1 w-1 rounded-full bg-gray-300","aria-hidden":"true"})}function kt({block:t}){return t.items.length?r.jsx("ul",{class:"flex flex-col gap-2.5",role:"list",children:t.items.map(e=>r.jsxs("li",{class:"flex items-start gap-3 text-sm text-gray-700",children:[r.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",class:"mt-0.5 flex-shrink-0 text-emerald-500","aria-hidden":"true",children:r.jsx("path",{d:"M4 10.5l3.5 3.5 8.5-8.5",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})}),r.jsxs("div",{class:"flex flex-col gap-0.5",children:[r.jsx("span",{class:"font-medium leading-snug text-gray-900",children:e.name}),e.desc?r.jsx("span",{class:"text-xs leading-relaxed text-gray-400",children:e.desc}):null]})]},e.id))}):null}function _t({block:t}){const{t:e}=b(),i=t.title??e("pricing.money_back","30-day money-back guarantee"),a=t.subtitle,n=(t.icon??"dollar_shield")!=="none",s=jt(i);return r.jsxs("div",{class:"flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100",children:[r.jsxs("div",{class:"inline-flex items-center gap-2 text-[12px] text-gray-700",children:[n?r.jsx(St,{}):null,s?r.jsxs("span",{children:[r.jsx("b",{class:"font-bold text-gray-900",children:s.bold})," ",r.jsx("span",{class:"font-medium",children:s.rest})]}):r.jsx("span",{class:"font-medium",children:i})]}),a?r.jsx("span",{class:"text-center text-xs leading-relaxed text-gray-500",children:a}):null]})}function jt(t){const e=t.match(/^(\d+[-\s]?days?)\s+(.+)$/i);return e?{bold:e[1],rest:e[2]}:null}function St(){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"16",height:"16",class:"flex-shrink-0 text-emerald-500","aria-hidden":"true",children:[r.jsx("path",{d:"M12 2 4 5v6c0 5.25 3.5 9.5 8 11 4.5-1.5 8-5.75 8-11V5l-8-3Z",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"}),r.jsx("path",{d:"m9 12 2 2 4-4",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}const Le=24,Ct=16,It=2;function Pt(t,e){const i=e*It;let a=Le;for(t.style.fontSize=`${a}px`;t.scrollHeight>i&&a>Ct;)a-=1,t.style.fontSize=`${a}px`}function At({block:t,ctx:e}){const i=t.level??1,a=`h${i}`,n=i===1?"text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800":i===2?"text-xl font-semibold leading-snug text-gray-900 tracking-tight":"text-base font-medium text-gray-900",s=u.useRef(null),o=i===1&&!!e.bootstrap.settings.title_auto_fit;return u.useEffect(()=>{if(!o||!s.current)return;const l=getComputedStyle(s.current),d=parseFloat(l.lineHeight)||Le*1.5;Pt(s.current,d)},[o,t.text]),r.jsx(a,{ref:s,class:n,children:t.text})}function Mt(t){const e=t.local??{currency:t.currency,amount:t.amount};if(t.interval==="year"){const i=(t.interval_count??1)*12;return{amount:e.amount/i,currency:e.currency}}return{amount:e.amount,currency:e.currency}}function re(t,e){const i=t%1!==0?2:0;try{const a=new Intl.NumberFormat(void 0,{style:"currency",currency:e,currencyDisplay:"narrowSymbol",maximumFractionDigits:i,minimumFractionDigits:i}).formatToParts(t);let n="",s="";for(const o of a)o.type==="currency"?n=o.value:o.type!=="literal"&&(s+=o.value);return{currency:n||e,amount:s.trim()}}catch{return{currency:e,amount:String(t)}}}function ne(t,e){const{amount:i,currency:a}=Mt(t);if(!e){const{currency:l,amount:d}=re(i,a);return{currency:l,amount:d,originalAmount:null}}const n=i*(1-e/100),s=re(n,a),o=re(i,a);return{currency:s.currency,amount:s.amount,originalAmount:`${o.currency}${o.amount}`}}function V(t,e){if(!t||t.length===0)return null;const i=t.find(n=>n.price_id===e&&n.discount_percent&&n.discount_percent>0);return i||(t.find(n=>n.price_id==null&&n.discount_percent&&n.discount_percent>0)??null)}function Ee(t,e){if(t.label)return t.label.toUpperCase();if(!t.interval||t.interval==="lifetime")return e("pricing.plan_label.lifetime","LIFETIME");const a={day:{key:"pricing.plan_label.daily",fallback:"DAILY PLAN"},week:{key:"pricing.plan_label.weekly",fallback:"WEEKLY PLAN"},month:{key:"pricing.plan_label.monthly",fallback:"MONTHLY PLAN"},year:{key:"pricing.plan_label.yearly",fallback:"YEARLY PLAN"}}[t.interval];return a?e(a.key,a.fallback):`${t.interval.toUpperCase()} PLAN`}function ae(t,e){if(!t.interval||t.interval==="lifetime")return e("pricing.interval.lifetime_short","lifetime");if(t.interval==="year")return e("pricing.interval.month","month");const i=t.interval_count??1;return i===1?e(`pricing.interval.${t.interval}`,t.interval):`${i} ${t.interval}s`}function Lt({block:t,ctx:e}){const{t:i}=b(),a=t.priceIds&&t.priceIds.length>0?new Set(t.priceIds):null,n=e.bootstrap.prices.filter(o=>!a||a.has(o.id));if(n.length===0)return r.jsx("p",{class:"text-sm text-gray-500",children:i("pricing.no_prices","No prices available.")});const s=t.popular_label??i("pricing.most_popular","Most popular");if(t.view==="compact")return r.jsx("div",{class:"flex w-full flex-col rounded-xl border border-gray-200 bg-gray-50",role:"radiogroup","aria-label":i("pricing.plans_aria","Plans"),children:n.map((o,l)=>r.jsx(Tt,{price:o,isLast:l===n.length-1,isPopular:t.popular_price_id===o.id,popularLabel:s,offer:V(e.bootstrap.offers,o.id),selected:e.selectedPriceId===o.id,onSelect:()=>{e.setSelectedPriceId(o.id),e.onAction("price_selected",{priceId:o.id,price:o})},t:i},o.id))});if(t.view==="horizontal"){const o=Math.min(n.length,3),l=n.some(d=>(V(e.bootstrap.offers,d.id)?.discount_percent??0)>0);return r.jsx("div",{class:"grid items-stretch gap-2",style:{gridTemplateColumns:`repeat(${o}, minmax(0, 1fr))`},role:"radiogroup","aria-label":i("pricing.plans_aria","Plans"),children:n.map(d=>r.jsx(zt,{price:d,isPopular:t.popular_price_id===d.id,popularLabel:s,offer:V(e.bootstrap.offers,d.id),reserveStrikeRow:l,selected:e.selectedPriceId===d.id,onSelect:()=>{e.setSelectedPriceId(d.id),e.onAction("price_selected",{priceId:d.id,price:d})},t:i},d.id))})}return r.jsx("div",{class:"flex flex-col gap-2",role:"radiogroup","aria-label":i("pricing.plans_aria","Plans"),children:n.map(o=>{const l=e.selectedPriceId===o.id,d=t.popular_price_id===o.id,c=V(e.bootstrap.offers,o.id)?.discount_percent??null,{currency:p,amount:m,originalAmount:k}=ne(o,c);return r.jsxs("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>{e.setSelectedPriceId(o.id),e.onAction("price_selected",{priceId:o.id,price:o})},class:["group relative inline-flex w-full mx-auto items-center justify-between flex-row-reverse gap-4 rounded-2xl border-2 px-4 py-3.5 text-left transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",l?"border-[var(--pw-accent)] bg-transparent":"border-gray-200 bg-transparent hover:bg-gray-50"].join(" "),children:[r.jsx("span",{class:["flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",l?"border-[var(--pw-accent)] text-white":"border-gray-300 bg-transparent text-transparent",d?"mt-3":""].join(" "),style:l?{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"}:void 0,"aria-hidden":"true",children:r.jsx("svg",{width:"14",height:"10",viewBox:"0 0 17 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:l?"opacity-100":"opacity-0",children:r.jsx("path",{d:"M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",fill:"currentColor"})})}),r.jsxs("div",{class:"flex flex-1 flex-col gap-0.5",children:[r.jsxs("div",{class:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[r.jsx("span",{class:"text-xs font-normal uppercase tracking-normal text-gray-800/70",children:Ee(o,i)}),k?r.jsx("span",{class:"text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]",children:k}):null,c?r.jsxs("span",{class:"rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700",children:["-",c,"%"]}):null]}),r.jsx("div",{class:"flex items-baseline gap-2 flex-wrap",children:r.jsxs("span",{class:"text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium",children:[r.jsx("span",{class:"opacity-90",children:p}),m,r.jsxs("span",{class:"text-sm font-normal text-gray-500",children:[" ","/ ",ae(o,i)]})]})}),o.description?r.jsx("span",{class:"mt-1 text-xs leading-relaxed text-gray-500",children:o.description}):null]}),d?r.jsx("span",{class:"absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",style:{background:"var(--pw-accent)"},children:s}):null]},o.id)})})}function Et(t,e){return t.label?t.label:!t.interval||t.interval==="lifetime"?e("pricing.interval.lifetime_short","lifetime"):e(`pricing.interval.${t.interval}`,t.interval)}function Tt({price:t,isLast:e,isPopular:i,popularLabel:a,offer:n,selected:s,onSelect:o,t:l}){const d=n?.discount_percent??null,{currency:g,amount:c,originalAmount:p}=ne(t,d);return r.jsxs("button",{type:"button",role:"radio","aria-checked":s,onClick:o,class:"group relative inline-flex w-full max-w-[360px] mx-auto items-center justify-between gap-4 px-4 pt-3.5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--pw-accent)]",children:[r.jsx("span",{class:["flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",s?"border-[var(--pw-accent)] text-white":"border-gray-300 bg-transparent text-transparent"].join(" "),style:s?{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"}:void 0,"aria-hidden":"true",children:r.jsx("svg",{width:"14",height:"10",viewBox:"0 0 17 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:s?"opacity-100":"opacity-0",children:r.jsx("path",{d:"M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",fill:"currentColor"})})}),r.jsxs("div",{class:["flex flex-1 items-center gap-1.5 pb-3.5",e?"":"border-b border-gray-200"].join(" "),children:[r.jsxs("div",{class:"flex flex-wrap items-center gap-1 gap-x-1.5",children:[r.jsx("span",{class:"text-base font-normal capitalize text-gray-800",children:Et(t,l)}),i?r.jsx("span",{class:"rounded-[9px] px-2 py-1 text-[10px] font-bold",style:{background:"linear-gradient(160deg, color-mix(in srgb, var(--pw-accent) 6%, white) 0%, color-mix(in srgb, var(--pw-accent) 15%, white) 100%)",color:"var(--pw-accent)"},children:a}):null,d?r.jsxs("span",{class:"rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700",children:["-",d,"%"]}):null]}),r.jsx("div",{class:"flex-1"}),r.jsxs("span",{class:"flex items-baseline gap-1.5 text-base font-normal text-gray-600",children:[p?r.jsx("span",{class:"text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]",children:p}):null,r.jsxs("span",{class:"whitespace-nowrap",children:[r.jsx("span",{class:"opacity-90",children:g}),c,r.jsxs("span",{class:"text-xs text-gray-400",children:[" ","/ ",ae(t,l)]})]})]})]})]})}function zt({price:t,isPopular:e,popularLabel:i,offer:a,reserveStrikeRow:n,selected:s,onSelect:o,t:l}){const d=a?.discount_percent??null,{currency:g,amount:c,originalAmount:p}=ne(t,d);return r.jsxs("button",{type:"button",role:"radio","aria-checked":s,onClick:o,class:["group relative flex h-full flex-col items-center justify-start gap-1 rounded-2xl border-2 px-3 pb-4 pt-3.5 text-center transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",s?"border-[var(--pw-accent)]":"border-gray-200 hover:bg-gray-50"].join(" "),style:s?{background:"color-mix(in srgb, var(--pw-accent) 6%, transparent)"}:void 0,children:[r.jsx("span",{class:"flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70",children:Ee(t,l)}),n?r.jsxs("div",{class:"flex h-[22px] items-center justify-center gap-1.5",children:[p?r.jsx("span",{class:"text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]",children:p}):null,d?r.jsxs("span",{class:"rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700",children:["-",d,"%"]}):null]}):null,r.jsxs("span",{class:"text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium",children:[r.jsx("span",{class:"opacity-90",children:g}),c]}),r.jsxs("span",{class:"text-xs font-normal text-gray-500",children:["/ ",ae(t,l)]}),e?r.jsx("span",{class:"absolute -top-[10px] left-1/2 -translate-x-1/2 whitespace-nowrap rounded-[11px] border-[3px] border-white px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",style:{background:"var(--pw-accent)"},children:i}):null]})}function Bt({block:t}){return r.jsx("p",{class:"text-[0.9375rem] leading-relaxed text-gray-600",children:t.text})}const Rt={week:.25,month:1,year:12};function Ot(t,e){return t?e(`pricing.interval.${t}`,t):e("pricing.interval.period","period")}function Ft({block:t,ctx:e}){const{t:i}=b();if(!t.queries.length)return null;const n=e.bootstrap.prices.find(o=>o.id===e.selectedPriceId)?.interval??null,s=n?Rt[n]:void 0;return r.jsxs("div",{class:"flex flex-col gap-2",children:[r.jsx("div",{class:"text-sm font-semibold text-gray-800",children:!n||n==="lifetime"?i("pricing.included_total","Included for lifetime:"):i("pricing.included_per","Included per {interval}:",{interval:Ot(n,i)})}),r.jsx("ul",{class:"flex flex-col gap-2",role:"list",children:t.queries.map(o=>{const l=Number.isFinite(o.count)?o.count:0,d=s!==void 0?Math.round(l*s):l;return r.jsxs("li",{class:`flex gap-3 ${o.desc?"items-start":"items-center"}`,children:[r.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",class:`flex-shrink-0 text-emerald-500 ${o.desc?"mt-0.5":""}`,"aria-hidden":"true",children:r.jsx("path",{d:"M4 10.5l3.5 3.5 8.5-8.5",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})}),r.jsxs("div",{children:[r.jsx("span",{class:"font-semibold text-gray-900 text-sm",children:d})," ",r.jsx("span",{class:"text-sm text-gray-800",children:o.name}),o.desc?r.jsxs(r.Fragment,{children:[r.jsx("br",{}),r.jsx("span",{class:"text-xs text-gray-400",children:o.desc})]}):null]})]},o.id)})})]})}const Te={heading:At,text:Bt,price_grid:Lt,cta_button:vt,auth_panel:Se,current_session:yt,features_list:kt,tokenization_gate:Ft,guarantee_badge:_t,offer_banner:ct};function Ut({layout:t,bootstrap:e,onAction:i,auth:a,authSession:n,hasTopBanner:s}){const o=u.useMemo(()=>{for(const h of t.blocks)if(h.type==="price_grid"&&h.popular_price_id&&e.prices.some(f=>f.id===h.popular_price_id))return h.popular_price_id;return e.prices[0]?.id??null},[t.blocks,e.prices]),[l,d]=u.useState(o),g={bootstrap:e,selectedPriceId:l,setSelectedPriceId:d,onAction:i,auth:a,authSession:n},c=t.blocks.findIndex(h=>h.type==="cta_button"),p=c===-1?t.blocks:t.blocks.slice(0,c),m=c===-1?[]:t.blocks.slice(c),k=(h,f)=>{const I=Te[h.type];return I?r.jsx(I,{block:h,ctx:g},`${h.type}-${f}`):(typeof console<"u"&&console.warn(`[paywall] unknown block type: ${h.type}`),null)};return r.jsxs(r.Fragment,{children:[r.jsx("div",{class:"flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8",children:r.jsx("div",{class:"flex flex-col gap-6",children:p.map(k)})}),m.length>0?r.jsx("div",{class:"flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",style:{boxShadow:"0 -4px 12px -4px rgba(15,23,42,0.06)"},children:m.map((h,f)=>k(h,p.length+f))}):null]})}function qt(t,e,i,a){return t?a?{open:!0,view:"purchased",error:null}:e.status==="idle"||e.status==="loading"?{open:!0,view:"loading",error:null}:e.status==="error"?{open:!0,view:"error",error:e.error}:i.kind==="support"?{open:!0,view:"support",error:null}:i.kind==="auth_gate"?{open:!0,view:"auth",error:null}:i.kind==="anon_gate"?{open:!0,view:"anon",error:null}:i.kind==="awaiting_payment"?{open:!0,view:"awaiting_payment",error:null}:i.kind==="popup_blocked"?{open:!0,view:"popup_blocked",error:null}:i.kind==="purchase_success"?{open:!0,view:"purchased",error:null}:i.kind==="verifying"?{open:!0,view:"loading",error:null}:{open:!0,view:"layout",error:null}:{open:!1,view:null,error:null}}function Dt(t,e){return t.open===e.open&&t.view===e.view&&t.error===e.error}function Nt({client:t,open:e,onClose:i,onEvent:a,initialView:n,purchased:s,renew:o,onState:l,inline:d,locale:g}){const[c,p]=u.useState({status:"idle"}),[m,k]=u.useState(()=>t.auth?.getCachedSession()??null),[h,f]=u.useState(()=>n==="support"?{kind:"support",origin:"standalone"}:n==="auth"?{kind:"auth_gate",origin:"standalone"}:n==="anon"?{kind:"anon_gate",origin:"standalone"}:{kind:"layout"}),I=u.useRef(!1),M=u.useRef(null);u.useEffect(()=>{if(!l)return;const x=qt(e,c,h,s),w=M.current;w&&Dt(w,x)||(M.current=x,l(x))},[e,c,h,s,l]),u.useEffect(()=>{if(t.auth)return t.auth.onAuthChange((x,w)=>k(w))},[t.auth]),u.useEffect(()=>{if(typeof t.onBootstrapChange=="function")return t.onBootstrapChange(x=>{p(w=>w.status==="ready"?{status:"ready",data:x}:w)})},[t]),u.useEffect(()=>{if(!e||c.status==="ready"||c.status==="loading")return;let x=!1;return p({status:"loading"}),t.bootstrap().then(w=>{x||(p({status:"ready",data:w}),a("ready",w),w.user?.has_active_subscription&&!o&&(a("purchase_completed",{priceId:null,sessionId:null,restored:!0}),f({kind:"purchase_success",restored:!0})))}).catch(w=>{if(x)return;const y=w instanceof L.PaywallError?w:new L.PaywallError("unknown","Failed to load paywall",{cause:w});p({status:"error",error:y}),a("error",y)}),()=>{x=!0}},[e,t]),u.useLayoutEffect(()=>{if(!e){f({kind:"layout"}),I.current=!1;return}n==="support"?f({kind:"support",origin:"standalone"}):n==="auth"?f({kind:"auth_gate",origin:"standalone"}):n==="anon"&&f({kind:"anon_gate",origin:"standalone"})},[e,n]);const v=async x=>{try{const w=await t.createCheckout({priceId:x,ignoreActivePurchase:o===!0});if(a("checkout_started",{priceId:x,url:w.url,acquiring:w.acquiring}),typeof window>"u"||!w.url)return;const y=window.open(w.url,"_blank");if(y){try{y.opener=null}catch{}f({kind:"awaiting_payment",priceId:x,url:w.url})}else f({kind:"popup_blocked",priceId:x,url:w.url})}catch(w){if(w instanceof L.PaywallError&&w.code==="already_purchased"){try{await t.getUser({force:!0})}catch{}a("purchase_completed",{priceId:x,sessionId:null,restored:!0}),f({kind:"purchase_success",restored:!0});return}const y=w instanceof L.PaywallError?w:new L.PaywallError("checkout_failed","Checkout failed",{cause:w});a("error",y),f({kind:"layout"})}},P=(x,w)=>{if(typeof window>"u")return;const y=window.open(w,"_blank");if(y){try{y.opener=null}catch{}f({kind:"awaiting_payment",priceId:x,url:w})}};u.useEffect(()=>{if(h.kind!=="auth_gate"||!m||m.user.is_anonymous||I.current)return;I.current=!0;const x=h.pendingCheckout,w=h.origin;f({kind:"verifying"}),(async()=>{if(!o)try{if((await t.getUser({force:!0})).has_active_subscription){a("purchase_completed",{priceId:x?.priceId??null,sessionId:null,restored:!0}),f({kind:"purchase_success",restored:!0});return}}catch{}if(!x){w==="standalone"?i():f({kind:"layout"});return}await v(x.priceId)})().finally(()=>{I.current=!1})},[m,h]);const S=async(x,w)=>{if(x==="close"){i();return}if(x==="price_selected"){a("price_selected",w);return}if(x==="restore"){if(!t.auth)return;const y=t.auth.getCachedSession();if(y&&!y.user.is_anonymous)return;f({kind:"auth_gate",intent:"restore"});return}if(x==="support"){f({kind:"support",origin:"layout"});return}if(x==="checkout"&&c.status==="ready"){const y=w?.priceId;if(!y){a("error",new L.PaywallError("no_price","No price selected"));return}const _=c.data.settings.checkout_mode??"guest",A=t.auth?.getCachedSession()??null,D=!!A&&!A.user.is_anonymous;if(_==="preauth"&&!!t.auth&&!D){f({kind:"auth_gate",pendingCheckout:{priceId:y}});return}await v(y)}},T=c.status==="ready"?c.data.settings.brand_color:null,E=c.status==="ready"?c.data.settings.allow_close!==!1:!0,O=h.kind==="layout"&&c.status==="ready"?Ie(c.data.offers):null,R=O?r.jsx(dt,{offer:O}):null,F={type:"auth_panel",allow_signup:!0,allow_password_reset:!0,hide_when_authenticated:!1,providers:c.status==="ready"?c.data.settings.auth_providers:void 0},C=h.kind==="support"?r.jsx(pt,{client:t,authSession:m,origin:h.origin,onBack:()=>{h.origin==="standalone"?i():f({kind:"layout"})}}):null,j=h.kind==="auth_gate"&&h.origin!=="standalone"||h.kind==="support",z=c.status==="ready"?c.data:null;return r.jsx(He,{bootstrap:z,forceLocale:g,children:r.jsx(Ve,{open:e,onClose:i,brandColor:T,topBanner:R,allowClose:E,hideCloseButton:j,inline:d,labelledBy:"pw-title",children:s?r.jsx(we,{onContinue:i}):h.kind==="purchase_success"?r.jsx(we,{restored:h.restored,onContinue:i}):C||(c.status==="loading"||c.status==="idle"||h.kind==="verifying"?r.jsx(Ht,{verifying:h.kind==="verifying"}):c.status==="error"?r.jsx(Vt,{message:c.error.message}):h.kind==="auth_gate"&&t.auth?r.jsx(nt,{block:F,bootstrap:c.data,auth:t.auth,authSession:m,showBack:h.origin!=="standalone",intent:h.intent??(h.origin==="standalone"?"standalone":"preauth"),onBack:()=>{h.origin==="standalone"?i():f({kind:"layout"})}}):h.kind==="anon_gate"&&t.auth?r.jsx(st,{auth:t.auth,onSuccess:()=>{h.origin==="standalone"?i():f({kind:"layout"})},onBack:h.origin==="standalone"?void 0:()=>f({kind:"layout"})}):h.kind==="awaiting_payment"?r.jsx(Gt,{client:t,onBack:()=>f({kind:"layout"}),onReopen:()=>{if(typeof window>"u")return;const x=window.open(h.url,"_blank");if(x)try{x.opener=null}catch{}},onRetry:()=>v(h.priceId)}):h.kind==="popup_blocked"?r.jsx($t,{onReopen:()=>P(h.priceId,h.url)}):r.jsx(Ut,{layout:c.data.layout,bootstrap:c.data,onAction:S,auth:t.auth,authSession:m}))})})}function Ht({verifying:t}){const{t:e}=b();return r.jsxs("div",{class:"flex flex-col items-center justify-center gap-3 py-12",children:[r.jsx("span",{class:"inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]"}),r.jsx("span",{class:"text-xs font-medium tracking-wide text-gray-500",children:t?e("modal.verifying_subscription","Checking your subscription…"):e("modal.loading","Loading…")})]})}function Vt({message:t}){const{t:e}=b();return r.jsxs("div",{class:"flex flex-col items-center gap-2 py-8 text-center",children:[r.jsx("div",{class:"flex h-11 w-11 items-center justify-center rounded-full bg-red-50",children:r.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M10 6v5M10 14h.01",stroke:"#dc2626","stroke-width":"2","stroke-linecap":"round"}),r.jsx("circle",{cx:"10",cy:"10",r:"8",stroke:"#dc2626","stroke-width":"1.75"})]})}),r.jsx("p",{class:"text-sm font-semibold tracking-tight text-gray-900",children:e("modal.error_generic","Something went wrong")}),r.jsx("p",{class:"text-xs leading-relaxed text-gray-500",children:t})]})}function $t({onReopen:t}){const{t:e}=b();return r.jsxs("div",{class:"flex flex-col items-center gap-3 py-8 text-center",children:[r.jsx("div",{class:"flex h-11 w-11 items-center justify-center rounded-full",style:{background:"color-mix(in srgb, var(--pw-accent) 12%, white)",color:"var(--pw-accent)"},"aria-hidden":"true",children:r.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[r.jsx("path",{d:"M4 5h12v10H4z",stroke:"currentColor","stroke-width":"1.75","stroke-linejoin":"round"}),r.jsx("path",{d:"M7 9l3 3 4-5",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"})]})}),r.jsx("p",{class:"text-sm font-semibold tracking-tight text-gray-900",children:e("payment.popup_blocked_title","Allow popups to continue")}),r.jsx("p",{class:"max-w-[18rem] text-xs leading-relaxed text-gray-500",children:e("payment.popup_blocked_message","Your browser blocked the checkout tab. Click below to open it.")}),r.jsx("button",{type:"button",onClick:t,class:"mt-1 rounded-xl px-4 py-2 text-xs font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:e("payment.open_checkout_button","Open checkout")})]})}function Gt({client:t,onBack:e,onReopen:i,onRetry:a}){const{t:n}=b(),[s,o]=u.useState(!1),[l,d]=u.useState(!1),g=u.useRef(null);u.useEffect(()=>()=>{g.current!==null&&clearTimeout(g.current)},[]);const c=async()=>{if(!s){o(!0),d(!1);try{if((await t.getUser({force:!0})).has_active_subscription){typeof window<"u"&&window.postMessage({type:"paywall_purchase"},"*");return}d(!0),g.current!==null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(!1),g.current=null},5e3)}catch{d(!0)}finally{o(!1)}}};return r.jsxs("div",{class:"flex flex-col gap-3",children:[r.jsx("button",{type:"button",onClick:e,class:"-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:n("nav.back","← Back")}),r.jsxs("div",{class:"flex flex-col items-center gap-3 py-6 text-center",children:[r.jsxs("div",{class:"relative flex h-12 w-12 items-center justify-center",children:[r.jsx("span",{class:"absolute inset-0 animate-ping rounded-full opacity-40",style:{background:"color-mix(in srgb, var(--pw-accent) 30%, transparent)"},"aria-hidden":"true"}),r.jsx("span",{class:"relative inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]"})]}),r.jsx("p",{class:"text-sm font-semibold tracking-tight text-gray-900",children:n("payment.awaiting_title","Complete payment in the new tab")}),r.jsx("p",{class:"max-w-[20rem] text-xs leading-relaxed text-gray-500",children:n("payment.awaiting_subtitle","We'll detect your payment automatically — or click below once you're done.")}),r.jsx("button",{type:"button",onClick:c,disabled:s,class:"mt-1 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:brightness-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:s?n("payment.checking","Checking…"):n("payment.ive_paid","I've paid")}),l?r.jsx("p",{class:"text-xs leading-relaxed text-gray-500",children:n("payment.still_processing","Payment is still being processed. Please try again in a moment.")}):null]}),r.jsxs("div",{class:"rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5",children:[r.jsx("p",{class:"text-xs leading-relaxed text-gray-600",children:n("payment.popup_help_text","Checkout window didn't open or got blocked? Click here to open it again.")}),r.jsx("button",{type:"button",onClick:i,class:"mt-2.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:n("payment.open_checkout_again","Open checkout again")})]}),r.jsx("button",{type:"button",onClick:a,class:"self-center rounded-md px-2 py-1 text-xs text-gray-500 underline-offset-2 hover:text-gray-900 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:n("payment.tab_closed_retry","Tab closed? Try again")})]})}function we({onContinue:t,restored:e=!1}){const{t:i}=b();return r.jsxs("div",{class:"flex flex-col items-center gap-3 py-8 text-center",children:[r.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full ring-8",style:{background:"linear-gradient(135deg, #4ade80, #16a34a)",color:"#fff",boxShadow:"0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"},"aria-hidden":"true",children:r.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",children:r.jsx("path",{d:"M5 13l4 4L19 7",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})})}),r.jsx("p",{id:"pw-title",class:"mt-1 text-lg font-semibold tracking-tight text-gray-900",children:e?i("modal.purchase_restored_title","Subscription restored"):i("modal.purchase_success_title","Payment received")}),r.jsx("p",{class:"text-sm leading-relaxed text-gray-500",children:e?i("modal.purchase_restored_subtitle","Welcome back — your subscription is already active."):i("modal.purchase_success_subtitle","Your subscription is now active.")}),r.jsx("button",{type:"button",onClick:t,class:"mt-3 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:i("modal.continue","Continue")})]})}const Wt=10*6e4,Zt=5e3,Kt=3e4;class Yt{constructor(e){this.timer=null,this.timeoutTimer=null,this.visibilityHandler=null,this.focusHandler=null,this.messageHandler=null,this.stopped=!1,this.checking=!1,this.opts={client:e.client,onActive:e.onActive,onTimeout:e.onTimeout??(()=>{}),timeoutMs:e.timeoutMs??Wt,visibleIntervalMs:e.visibleIntervalMs??Zt,hiddenIntervalMs:e.hiddenIntervalMs??Kt}}start(){this.stopped||typeof document>"u"||typeof window>"u"||(this.check(),this.scheduleNext(),this.visibilityHandler=()=>this.handleVisibilityChange(),document.addEventListener("visibilitychange",this.visibilityHandler),this.focusHandler=()=>void this.check(),window.addEventListener("focus",this.focusHandler),this.messageHandler=e=>this.handleMessage(e),window.addEventListener("message",this.messageHandler),this.timeoutTimer=setTimeout(()=>{this.stopped||(this.stop(),this.opts.onTimeout())},this.opts.timeoutMs))}stop(){this.stopped=!0,this.timer!==null&&clearTimeout(this.timer),this.timer=null,this.timeoutTimer!==null&&clearTimeout(this.timeoutTimer),this.timeoutTimer=null,typeof document<"u"&&this.visibilityHandler&&document.removeEventListener("visibilitychange",this.visibilityHandler),typeof window<"u"&&(this.focusHandler&&window.removeEventListener("focus",this.focusHandler),this.messageHandler&&window.removeEventListener("message",this.messageHandler)),this.visibilityHandler=null,this.focusHandler=null,this.messageHandler=null}async check(){if(!(this.stopped||this.checking)){this.checking=!0;try{const e=await this.opts.client.getUser({force:!0});if(this.stopped)return;e.has_active_subscription&&(this.stop(),this.opts.onActive(e))}catch{}finally{this.checking=!1}}}scheduleNext(){if(this.stopped)return;const i=typeof document<"u"&&document.visibilityState==="visible"?this.opts.visibleIntervalMs:this.opts.hiddenIntervalMs;this.timer=setTimeout(async()=>{await this.check(),this.scheduleNext()},i)}handleVisibilityChange(){typeof document>"u"||(document.visibilityState==="visible"&&this.check(),this.timer!==null&&(clearTimeout(this.timer),this.timer=null),this.scheduleNext())}handleMessage(e){const i=e.data;!i||typeof i!="object"||i.type==="paywall_purchase"&&this.check()}}function Xt(){return!(typeof document>"u"||typeof window>"u"||typeof location<"u"&&location.protocol==="chrome-extension:")}const ie={open:!1,view:null,error:null},q={status:"paywall_status",priceId:"paywall_price_id",sessionId:"paywall_session_id"};class Jt{constructor(e){this.handle=null,this.isOpen=!1,this.listeners=new Map,this.userUnsub=null,this.authUnsub=null,this.watcher=null,this.tracker=null,this.purchased=!1,this.trialStore=null,this.trialStoreConfig=null,this.lastTrialStatus=null,this.trialExpiredFired=!1,this.lastVisibility=null,this.currentState=ie,this.stateListeners=new Set;const{auth:i,ownsAuth:a}=Qt(e);this.auth=i,this.ownsAuth=a,this.billing=e.client??new L.BillingClient({...e,auth:this.auth}),this.host=e.host,this.shadowMode=e.shadowMode??"closed",this.mountThenLoad=e.mountThenLoad??!0,this.inline=e.inline===!0,this.forceLocale=e.locale??null,this.userUnsub=this.billing.onUserChange(n=>{this.emit("userChange",n)}),this.auth&&(this.authUnsub=this.auth.onAuthChange((n,s)=>{this.emit("authChange",{event:n,session:s})})),this.initTracker(e.analytics),e.autoDetectReturn!==!1&&typeof window<"u"&&queueMicrotask(()=>this.checkReturn())}initTracker(e){if(e===!1)return;const i=typeof e=="object"&&e!==null?e:{};if(i.enabled===!1)return;const a=i.endpoint??`${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;this.tracker=new L.EventTracker({endpoint:a,paywallId:this.billing.paywallId,capabilities:this.billing.capabilities,getVisitorId:()=>this.billing.getVisitorId(),getCachedVisitorId:()=>this.billing.getCachedVisitorId(),getUserId:()=>this.billing.getIdentity()?.userId??null,flushIntervalMs:i.flushIntervalMs,maxBufferSize:i.maxBufferSize,fetch:i.fetch,sendBeacon:i.sendBeacon}),this.on("open",()=>this.tracker?.track("paywall_opened")),this.on("ready",n=>this.tracker?.track("paywall_viewed",{is_test_mode:n.settings.is_test_mode,prices_count:n.prices.length,offers_count:n.offers.length})),this.on("price_selected",n=>this.tracker?.track("price_selected",{price_id:n.priceId})),this.on("checkout_started",n=>this.tracker?.track("checkout_started",{price_id:n.priceId,acquiring:n.acquiring})),this.on("purchase_completed",n=>this.tracker?.track("purchase_completed",{price_id:n.priceId,session_id:n.sessionId})),this.on("purchase_failed",n=>this.tracker?.track("purchase_failed",{reason:n.reason})),this.on("close",()=>this.tracker?.track("paywall_closed")),this.on("trial_blocked",n=>this.tracker?.track("trial_blocked",{mode:n.mode,...n.mode==="time"?{remaining_ms:n.remainingMs,total_ms:n.totalMs}:n.mode==="opens"?{remaining_actions:n.remainingActions,total_actions:n.totalActions}:{}})),this.on("trial_expired",()=>this.tracker?.track("trial_expired")),this.on("visibility_blocked",n=>this.tracker?.track("visibility_blocked",{reason:n.reason,country:n.country,tier:n.tier})),this.on("error",n=>this.tracker?.track("error",{code:n.code,message:n.message}))}track(e,i){this.tracker?.track(e,i)}onUserChange(e){return this.on("userChange",e)}setBootstrap(e){this.billing.setBootstrap(e)}setLocale(e){const i=e??null;i!==this.forceLocale&&(this.forceLocale=i,this.handle&&this.handle.update({locale:i}))}on(e,i){let a=this.listeners.get(e);return a||(a=new Set,this.listeners.set(e,a)),a.add(i),()=>a.delete(i)}off(e,i){this.listeners.get(e)?.delete(i)}emit(e,...i){const a=this.listeners.get(e);if(!a)return;const n=i[0];for(const s of a)try{s(n)}catch(o){typeof console<"u"&&console.error("[paywall] listener error",o)}}open(e={}){this.openInternal("layout",e)}async preload(e={}){try{await this.billing.bootstrap({signal:e.signal}),this.billing.auth&&await this.billing.getBalances({signal:e.signal})}catch{}}openSupport(e={}){this.openInternal("support",e)}openAuth(e={}){this.auth&&this.openInternal("auth",{...e,skipTrial:!0})}openAnonGate(e={}){this.auth&&this.openInternal("anon",{...e,skipTrial:!0,skipVisibility:!0})}openInternal(e,i){i.identity&&this.billing.setIdentity(i.identity),this.purchased=!1;const a=i.skipTrial===!0||e==="support",n=i.skipVisibility===!0||e==="support"||e==="auth"||e==="anon",s=i.renew===!0;if(a&&n){this.mountAndShow(e,{renew:s});return}const o=this.billing.getCachedBootstrap();if(o){this.runOpenGates(e,o,{skipTrial:a,skipVisibility:n,renew:s});return}if(this.mountThenLoad){this.mountAndShow(e,{renew:s}),this.billing.bootstrap().then(l=>this.runDelayedGates(l,{skipTrial:a,skipVisibility:n})).catch(()=>{});return}this.billing.bootstrap().then(l=>this.runOpenGates(e,l,{skipTrial:a,skipVisibility:n,renew:s})).catch(()=>{this.mountAndShow(e,{renew:s})})}runDelayedGates(e,i){if(!this.isOpen)return;if(!i.skipVisibility){const s=e.settings.visibility;if(s&&(this.lastVisibility=s,!s.visible)){this.close(),this.emit("visibility_blocked",s);return}}if(i.skipTrial)return;const a=e.settings.trial;if(!a)return;const n=this.ensureTrialStore(a);n.check().then(async s=>{if(this.isOpen&&(this.lastTrialStatus=s,s.mode!=="none")){if(s.blocked){const o=await n.recordBlock();if(this.lastTrialStatus=o,!this.isOpen)return;this.close(),this.emit("trial_blocked",o);return}this.trialExpiredFired||(this.trialExpiredFired=!0,this.emit("trial_expired"))}}).catch(s=>{typeof console<"u"&&console.warn("[paywall] trial check failed",s)})}runOpenGates(e,i,a){if(!a.skipVisibility){const n=i.settings.visibility;if(n&&(this.lastVisibility=n,!n.visible)){this.emit("visibility_blocked",n);return}}if(a.skipTrial){this.mountAndShow(e,{renew:a.renew});return}this.gateThroughTrial(e,i,a.renew)}gateThroughTrial(e,i,a){const n=i.settings.trial;if(!n){this.mountAndShow(e,{renew:a});return}const s=this.ensureTrialStore(n);s.check().then(async o=>{if(this.lastTrialStatus=o,o.mode==="none"){this.mountAndShow(e,{renew:a});return}if(o.blocked){const l=await s.recordBlock();this.lastTrialStatus=l,this.emit("trial_blocked",l);return}this.trialExpiredFired||(this.trialExpiredFired=!0,this.emit("trial_expired")),this.mountAndShow(e,{renew:a})}).catch(o=>{typeof console<"u"&&console.warn("[paywall] trial check failed",o),this.mountAndShow(e,{renew:a})})}ensureTrialStore(e){if(this.trialStore&&this.trialStoreConfig&&rr(this.trialStoreConfig,e))return this.trialStore;this.trialStoreConfig=e;const i=this.billing.createTrialStore;return this.trialStore=typeof i=="function"?i.call(this.billing,e):Be(this.billing.getStorage(),this.billing.paywallId,e),this.trialStore}mountAndShow(e,i={}){const a=i.renew===!0;if(this.handle){this.isOpen=!0,this.handle.update({open:!0,initialView:e,purchased:!1,renew:a}),this.emit("open");return}this.isOpen=!0,this.handle=Oe(Nt,{client:this.billing,open:!0,initialView:e,purchased:!1,renew:a,onClose:()=>this.close(),onEvent:(n,s)=>{this.emit(n,s),n==="checkout_started"&&this.startUserWatcher()},onState:n=>this.applyState(n),inline:this.inline,locale:this.forceLocale},{host:this.host,shadowMode:this.shadowMode,inline:this.inline}),this.emit("open")}applyState(e){if(!tr(this.currentState,e)){this.currentState=e;for(const i of this.stateListeners)try{i(e)}catch(a){console.warn("[paywall] onStateChange listener threw",a)}}}getState(){return this.currentState}onStateChange(e,i={}){this.stateListeners.add(e);const a=i.immediate??"microtask";if(a!=="none"){const n=this.currentState;if(a==="sync")try{e(n)}catch(s){console.warn("[paywall] onStateChange initial sync threw",s)}else queueMicrotask(()=>{this.stateListeners.has(e)&&e(n)})}return()=>{this.stateListeners.delete(e)}}getTrialStatus(){return this.lastTrialStatus}getVisibility(){return this.lastVisibility}getPrices(e={}){return this.billing.getPrices(e)}getCachedPrices(){return this.billing.getCachedPrices()}getUserLanguage(){return this.billing.getUserLanguage()}async getAccess(e={}){let i=this.billing.getCachedBootstrap();if(!i)try{i=await this.billing.bootstrap({signal:e.signal})}catch{const o=this.billing.getCachedUser();return o?.has_active_subscription?{access:"granted",reason:"has_subscription",visibility:null,trial:null,user:o}:{access:"blocked",reason:"no_subscription",visibility:null,trial:null,user:o}}const a=i.user??null;if(a?.has_active_subscription)return{access:"granted",reason:"has_subscription",visibility:i.settings.visibility??null,trial:null,user:a};let n=null;if(!e.skipVisibility){const o=i.settings.visibility;if(o&&(n=o,this.lastVisibility=o,!o.visible))return{access:"granted",reason:"visibility_blocked",visibility:n,trial:null,user:a}}let s=null;if(!e.skipTrial){const o=i.settings.trial;if(o)try{if(s=await this.ensureTrialStore(o).check(),this.lastTrialStatus=s,s.blocked)return{access:"granted",reason:"trial_blocked",visibility:n,trial:s,user:a}}catch(l){typeof console<"u"&&console.warn("[paywall] getAccess: trial check failed",l)}}return{access:"blocked",reason:"no_subscription",visibility:n,trial:s,user:a}}async resetTrial(){this.trialStore&&(await this.trialStore.reset(),this.lastTrialStatus=null,this.trialExpiredFired=!1)}startUserWatcher(){this.watcher||Xt()&&(this.watcher=new Yt({client:this.billing,onActive:e=>{this.watcher=null,this.emit("purchase_completed",{priceId:null,sessionId:null});const i=this.billing.getCachedBootstrap()?.settings.success_redirect_url;if(i&&typeof window<"u")try{window.location.assign(i);return}catch{}this.isOpen&&this.handle&&(this.purchased=!0,this.handle.update({purchased:!0}))},onTimeout:()=>{this.watcher=null}}),this.watcher.start())}close(){!this.isOpen||!this.handle||(this.isOpen=!1,this.purchased=!1,this.handle.update({open:!1,purchased:!1}),this.applyState(ie),this.emit("close"))}checkReturn(){if(typeof window>"u")return;const e=new URL(window.location.href),i=me(e.hash.replace(/^#/,"")),a=me(e.search.replace(/^\?/,"")),n=i??a;n&&(n.status==="paid"?(this.emit("purchase_completed",{priceId:n.priceId,sessionId:n.sessionId}),ir(n)):(n.status==="failed"||n.status==="cancelled")&&this.emit("purchase_failed",{reason:n.status}),nr(e))}destroy(){this.tracker?.destroy(),this.tracker=null,this.listeners.clear(),this.stateListeners.clear(),this.watcher?.stop(),this.watcher=null,this.userUnsub?.(),this.userUnsub=null,this.authUnsub?.(),this.authUnsub=null,this.ownsAuth&&this.auth&&this.auth.destroy?.(),this.ownsAuth=!1,this.billing.destroy?.(),this.handle?.unmount(),this.handle=null,this.isOpen=!1,this.currentState=ie}}function Qt(t){if(!t.auth)return{auth:void 0,ownsAuth:!1};if(t.auth instanceof L.AuthClient||er(t.auth))return{auth:t.auth,ownsAuth:!1};const e=t.auth===!0?{}:t.auth;return{auth:new L.AuthClient({paywallId:t.paywallId,apiOrigin:e.apiOrigin??t.apiOrigin,storage:e.storage??t.storage,fetch:e.fetch??t.fetch,openPopup:e.openPopup}),ownsAuth:!0}}function er(t){if(typeof t!="object"||t===null)return!1;const e=t;return typeof e.onAuthChange=="function"&&typeof e.getCachedSession=="function"&&typeof e.signOut=="function"}function tr(t,e){return t.open===e.open&&t.view===e.view&&t.error===e.error}function rr(t,e){return t.mode===e.mode&&t.payload===e.payload&&t.storage===e.storage}function me(t){if(!t)return null;const e=new URLSearchParams(t),i=e.get(q.status);return i?{status:i,priceId:e.get(q.priceId),sessionId:e.get(q.sessionId)}:null}function ir(t){if(!(typeof window>"u"||!window.opener))try{window.opener.postMessage({type:"paywall_purchase",status:t.status,priceId:t.priceId,sessionId:t.sessionId},"*")}catch{}}function nr(t){const e=(a,n)=>{if(!a)return"";const s=new URLSearchParams(a.replace(/^[?#]/,""));s.delete(q.status),s.delete(q.priceId),s.delete(q.sessionId);const o=s.toString();return o?n+o:""},i=t.pathname+e(t.search,"?")+e(t.hash,"#");window.history.replaceState(null,"",i)}exports.PaywallUI=Jt;exports.blockRegistry=Te;
26
- //# sourceMappingURL=PaywallUI-Cl9sz_xA.js.map