@monetize.software/sdk 3.0.0-alpha.8 → 3.0.0-beta.0

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 (213) hide show
  1. package/dist/chunks/PaywallUI-CCwYgagL.js +26 -0
  2. package/dist/chunks/PaywallUI-CCwYgagL.js.map +1 -0
  3. package/dist/chunks/PaywallUI-CDlJL5Em.js +3599 -0
  4. package/dist/chunks/PaywallUI-CDlJL5Em.js.map +1 -0
  5. package/dist/chunks/ar-CViBaj16.js +2 -0
  6. package/dist/chunks/ar-CViBaj16.js.map +1 -0
  7. package/dist/chunks/{ar-CHae8g-2.js → ar-ClwBmll7.js} +6 -2
  8. package/dist/chunks/ar-ClwBmll7.js.map +1 -0
  9. package/dist/chunks/{cs-eZTedzaK.js → cs-Cc_D0W4S.js} +6 -2
  10. package/dist/chunks/cs-Cc_D0W4S.js.map +1 -0
  11. package/dist/chunks/cs-DQJWP65K.js +2 -0
  12. package/dist/chunks/cs-DQJWP65K.js.map +1 -0
  13. package/dist/chunks/{da-Dca6j8fp.js → da-BtKcMSxH.js} +6 -2
  14. package/dist/chunks/da-BtKcMSxH.js.map +1 -0
  15. package/dist/chunks/da-Cyr_IXhb.js +2 -0
  16. package/dist/chunks/da-Cyr_IXhb.js.map +1 -0
  17. package/dist/chunks/de-BOCUj1pF.js +2 -0
  18. package/dist/chunks/de-BOCUj1pF.js.map +1 -0
  19. package/dist/chunks/{de-BCjn3PUI.js → de-iwQW5eYl.js} +6 -2
  20. package/dist/chunks/de-iwQW5eYl.js.map +1 -0
  21. package/dist/chunks/{el-BpXtDTez.js → el-BoH65CeJ.js} +6 -2
  22. package/dist/chunks/el-BoH65CeJ.js.map +1 -0
  23. package/dist/chunks/el-C6jLHiEF.js +2 -0
  24. package/dist/chunks/el-C6jLHiEF.js.map +1 -0
  25. package/dist/chunks/es-CARHLxHR.js +2 -0
  26. package/dist/chunks/es-CARHLxHR.js.map +1 -0
  27. package/dist/chunks/{es-B3P4nlMw.js → es-CkP16_8K.js} +6 -2
  28. package/dist/chunks/es-CkP16_8K.js.map +1 -0
  29. package/dist/chunks/fi-B8OhRbwY.js +2 -0
  30. package/dist/chunks/fi-B8OhRbwY.js.map +1 -0
  31. package/dist/chunks/{fi-BbQ_Bs0Z.js → fi-yUXSmK1E.js} +6 -2
  32. package/dist/chunks/fi-yUXSmK1E.js.map +1 -0
  33. package/dist/chunks/fr-CoM18zzM.js +2 -0
  34. package/dist/chunks/fr-CoM18zzM.js.map +1 -0
  35. package/dist/chunks/{fr-BKDUXceO.js → fr-DSZRGsxI.js} +6 -2
  36. package/dist/chunks/fr-DSZRGsxI.js.map +1 -0
  37. package/dist/chunks/he-DTDVc3lA.js +2 -0
  38. package/dist/chunks/he-DTDVc3lA.js.map +1 -0
  39. package/dist/chunks/{he-BVCHlTtT.js → he-ZUo7cQjk.js} +8 -4
  40. package/dist/chunks/he-ZUo7cQjk.js.map +1 -0
  41. package/dist/chunks/hi-BjnS9UeE.js +2 -0
  42. package/dist/chunks/hi-BjnS9UeE.js.map +1 -0
  43. package/dist/chunks/{hi-H_Hshh-7.js → hi-CEutBKiG.js} +6 -2
  44. package/dist/chunks/hi-CEutBKiG.js.map +1 -0
  45. package/dist/chunks/hu-CN06FMhV.js +2 -0
  46. package/dist/chunks/hu-CN06FMhV.js.map +1 -0
  47. package/dist/chunks/{hu-ZWiNfzvN.js → hu-DvEAWGS7.js} +6 -2
  48. package/dist/chunks/hu-DvEAWGS7.js.map +1 -0
  49. package/dist/chunks/id-BITgaBxq.js +2 -0
  50. package/dist/chunks/id-BITgaBxq.js.map +1 -0
  51. package/dist/chunks/{id-DeiRYsJ1.js → id-_eEMrYMW.js} +6 -2
  52. package/dist/chunks/id-_eEMrYMW.js.map +1 -0
  53. package/dist/chunks/index-CLB1AgLg.js +2074 -0
  54. package/dist/chunks/index-CLB1AgLg.js.map +1 -0
  55. package/dist/chunks/index-CzDSBl4d.js +2 -0
  56. package/dist/chunks/index-CzDSBl4d.js.map +1 -0
  57. package/dist/chunks/{it-UH9OzFhg.js → it-BAmsQbIl.js} +6 -2
  58. package/dist/chunks/it-BAmsQbIl.js.map +1 -0
  59. package/dist/chunks/it-DVcsq015.js +2 -0
  60. package/dist/chunks/it-DVcsq015.js.map +1 -0
  61. package/dist/chunks/ja-Bim7Ok2e.js +2 -0
  62. package/dist/chunks/ja-Bim7Ok2e.js.map +1 -0
  63. package/dist/chunks/{ja-BYC8FRN8.js → ja-BqCZWVKK.js} +8 -4
  64. package/dist/chunks/ja-BqCZWVKK.js.map +1 -0
  65. package/dist/chunks/{ko-Bjs2ZRcF.js → ko-CkIzeOzb.js} +8 -4
  66. package/dist/chunks/ko-CkIzeOzb.js.map +1 -0
  67. package/dist/chunks/ko-DqEfcVCB.js +2 -0
  68. package/dist/chunks/ko-DqEfcVCB.js.map +1 -0
  69. package/dist/chunks/nl-DSNuJWIo.js +2 -0
  70. package/dist/chunks/nl-DSNuJWIo.js.map +1 -0
  71. package/dist/chunks/{nl-Ch5HFWQO.js → nl-Mu_KNzli.js} +6 -2
  72. package/dist/chunks/nl-Mu_KNzli.js.map +1 -0
  73. package/dist/chunks/{no-CljpinWz.js → no-9HMjljBs.js} +6 -2
  74. package/dist/chunks/no-9HMjljBs.js.map +1 -0
  75. package/dist/chunks/no-B5HY_A8_.js +2 -0
  76. package/dist/chunks/no-B5HY_A8_.js.map +1 -0
  77. package/dist/chunks/{pl-CUcSS0zZ.js → pl-Cbr2qDwv.js} +6 -2
  78. package/dist/chunks/pl-Cbr2qDwv.js.map +1 -0
  79. package/dist/chunks/pl-ChGLn9Sy.js +2 -0
  80. package/dist/chunks/pl-ChGLn9Sy.js.map +1 -0
  81. package/dist/chunks/pt-CDLEktT9.js +2 -0
  82. package/dist/chunks/pt-CDLEktT9.js.map +1 -0
  83. package/dist/chunks/{pt-BHK0LwkC.js → pt-_jirA6IR.js} +6 -2
  84. package/dist/chunks/pt-_jirA6IR.js.map +1 -0
  85. package/dist/chunks/ro-BHCHiXY3.js +2 -0
  86. package/dist/chunks/ro-BHCHiXY3.js.map +1 -0
  87. package/dist/chunks/{ro-Bj8cwU2n.js → ro-oZLxhwHc.js} +6 -2
  88. package/dist/chunks/ro-oZLxhwHc.js.map +1 -0
  89. package/dist/chunks/ru-B6HgmINj.js +2 -0
  90. package/dist/chunks/ru-B6HgmINj.js.map +1 -0
  91. package/dist/chunks/{ru-CgqNy0Gb.js → ru-C2-sqY7B.js} +6 -2
  92. package/dist/chunks/ru-C2-sqY7B.js.map +1 -0
  93. package/dist/chunks/sv-DoSs4a9n.js +2 -0
  94. package/dist/chunks/sv-DoSs4a9n.js.map +1 -0
  95. package/dist/chunks/{sv-H7jroOQ5.js → sv-y385MWVy.js} +6 -2
  96. package/dist/chunks/sv-y385MWVy.js.map +1 -0
  97. package/dist/chunks/{th-Dqm-gpGe.js → th-Bjbv4M1s.js} +6 -2
  98. package/dist/chunks/th-Bjbv4M1s.js.map +1 -0
  99. package/dist/chunks/th-UeweOhwg.js +2 -0
  100. package/dist/chunks/th-UeweOhwg.js.map +1 -0
  101. package/dist/chunks/tr-BbBr5tyB.js +2 -0
  102. package/dist/chunks/tr-BbBr5tyB.js.map +1 -0
  103. package/dist/chunks/{tr-D3zPcNtT.js → tr-DmHo9F8i.js} +8 -4
  104. package/dist/chunks/tr-DmHo9F8i.js.map +1 -0
  105. package/dist/chunks/uk-CJTA1SJK.js +2 -0
  106. package/dist/chunks/uk-CJTA1SJK.js.map +1 -0
  107. package/dist/chunks/{uk-CoIIs3QI.js → uk-DwvAoTe5.js} +6 -2
  108. package/dist/chunks/uk-DwvAoTe5.js.map +1 -0
  109. package/dist/chunks/{vi-C_fruIbh.js → vi-BEpwsVLR.js} +6 -2
  110. package/dist/chunks/vi-BEpwsVLR.js.map +1 -0
  111. package/dist/chunks/vi-ZvBo7PbB.js +2 -0
  112. package/dist/chunks/vi-ZvBo7PbB.js.map +1 -0
  113. package/dist/chunks/zh-CPZBEb3d.js +2 -0
  114. package/dist/chunks/zh-CPZBEb3d.js.map +1 -0
  115. package/dist/chunks/{zh-LDkEV2D9.js → zh-DrG18oGe.js} +7 -3
  116. package/dist/chunks/zh-DrG18oGe.js.map +1 -0
  117. package/dist/core.cjs +1 -1
  118. package/dist/core.cjs.map +1 -1
  119. package/dist/core.d.ts +110 -17
  120. package/dist/core.js +17 -1984
  121. package/dist/core.js.map +1 -1
  122. package/dist/index.cjs +1 -1
  123. package/dist/index.d.ts +209 -18
  124. package/dist/index.js +17 -13
  125. package/dist/ui.cjs +1 -1
  126. package/dist/ui.d.ts +174 -17
  127. package/dist/ui.js +1 -1
  128. package/package.json +1 -1
  129. package/dist/chunks/PaywallUI-BrDiS6zg.js +0 -3219
  130. package/dist/chunks/PaywallUI-BrDiS6zg.js.map +0 -1
  131. package/dist/chunks/PaywallUI-Bvx8nRL0.js +0 -26
  132. package/dist/chunks/PaywallUI-Bvx8nRL0.js.map +0 -1
  133. package/dist/chunks/ar-CHae8g-2.js.map +0 -1
  134. package/dist/chunks/ar-E1mc8SO_.js +0 -2
  135. package/dist/chunks/ar-E1mc8SO_.js.map +0 -1
  136. package/dist/chunks/cs-Dccq6LAT.js +0 -2
  137. package/dist/chunks/cs-Dccq6LAT.js.map +0 -1
  138. package/dist/chunks/cs-eZTedzaK.js.map +0 -1
  139. package/dist/chunks/da-C_4MbEh5.js +0 -2
  140. package/dist/chunks/da-C_4MbEh5.js.map +0 -1
  141. package/dist/chunks/da-Dca6j8fp.js.map +0 -1
  142. package/dist/chunks/de-BCjn3PUI.js.map +0 -1
  143. package/dist/chunks/de-DulxcJj-.js +0 -2
  144. package/dist/chunks/de-DulxcJj-.js.map +0 -1
  145. package/dist/chunks/el-BpXtDTez.js.map +0 -1
  146. package/dist/chunks/el-CVG_1iKB.js +0 -2
  147. package/dist/chunks/el-CVG_1iKB.js.map +0 -1
  148. package/dist/chunks/es-B3P4nlMw.js.map +0 -1
  149. package/dist/chunks/es-ri0uKzUW.js +0 -2
  150. package/dist/chunks/es-ri0uKzUW.js.map +0 -1
  151. package/dist/chunks/fi-BbQ_Bs0Z.js.map +0 -1
  152. package/dist/chunks/fi-CNZqWHjw.js +0 -2
  153. package/dist/chunks/fi-CNZqWHjw.js.map +0 -1
  154. package/dist/chunks/fr-BKDUXceO.js.map +0 -1
  155. package/dist/chunks/fr-CfFOw4hD.js +0 -2
  156. package/dist/chunks/fr-CfFOw4hD.js.map +0 -1
  157. package/dist/chunks/he-BVCHlTtT.js.map +0 -1
  158. package/dist/chunks/he-DN2JEtQb.js +0 -2
  159. package/dist/chunks/he-DN2JEtQb.js.map +0 -1
  160. package/dist/chunks/hi-DxfOerNP.js +0 -2
  161. package/dist/chunks/hi-DxfOerNP.js.map +0 -1
  162. package/dist/chunks/hi-H_Hshh-7.js.map +0 -1
  163. package/dist/chunks/hu-BTImywuV.js +0 -2
  164. package/dist/chunks/hu-BTImywuV.js.map +0 -1
  165. package/dist/chunks/hu-ZWiNfzvN.js.map +0 -1
  166. package/dist/chunks/id-DeiRYsJ1.js.map +0 -1
  167. package/dist/chunks/id-YFuArJA6.js +0 -2
  168. package/dist/chunks/id-YFuArJA6.js.map +0 -1
  169. package/dist/chunks/it-UH9OzFhg.js.map +0 -1
  170. package/dist/chunks/it-mhkzXBM9.js +0 -2
  171. package/dist/chunks/it-mhkzXBM9.js.map +0 -1
  172. package/dist/chunks/ja-6l_z_G9k.js +0 -2
  173. package/dist/chunks/ja-6l_z_G9k.js.map +0 -1
  174. package/dist/chunks/ja-BYC8FRN8.js.map +0 -1
  175. package/dist/chunks/ko-Bjs2ZRcF.js.map +0 -1
  176. package/dist/chunks/ko-YAl4XwHu.js +0 -2
  177. package/dist/chunks/ko-YAl4XwHu.js.map +0 -1
  178. package/dist/chunks/nl-C-9zHtfb.js +0 -2
  179. package/dist/chunks/nl-C-9zHtfb.js.map +0 -1
  180. package/dist/chunks/nl-Ch5HFWQO.js.map +0 -1
  181. package/dist/chunks/no-CljpinWz.js.map +0 -1
  182. package/dist/chunks/no-qzPitLlx.js +0 -2
  183. package/dist/chunks/no-qzPitLlx.js.map +0 -1
  184. package/dist/chunks/pl-CUcSS0zZ.js.map +0 -1
  185. package/dist/chunks/pl-MAIYeuhW.js +0 -2
  186. package/dist/chunks/pl-MAIYeuhW.js.map +0 -1
  187. package/dist/chunks/pt-BHK0LwkC.js.map +0 -1
  188. package/dist/chunks/pt-DqDabE4v.js +0 -2
  189. package/dist/chunks/pt-DqDabE4v.js.map +0 -1
  190. package/dist/chunks/ro-BVs-lHH-.js +0 -2
  191. package/dist/chunks/ro-BVs-lHH-.js.map +0 -1
  192. package/dist/chunks/ro-Bj8cwU2n.js.map +0 -1
  193. package/dist/chunks/ru-CgqNy0Gb.js.map +0 -1
  194. package/dist/chunks/ru-DP7qDAmE.js +0 -2
  195. package/dist/chunks/ru-DP7qDAmE.js.map +0 -1
  196. package/dist/chunks/sv-B3QEYGgd.js +0 -2
  197. package/dist/chunks/sv-B3QEYGgd.js.map +0 -1
  198. package/dist/chunks/sv-H7jroOQ5.js.map +0 -1
  199. package/dist/chunks/th-Dqm-gpGe.js.map +0 -1
  200. package/dist/chunks/th-DzQau9aW.js +0 -2
  201. package/dist/chunks/th-DzQau9aW.js.map +0 -1
  202. package/dist/chunks/tr-D3zPcNtT.js.map +0 -1
  203. package/dist/chunks/tr-cG1YuE1E.js +0 -2
  204. package/dist/chunks/tr-cG1YuE1E.js.map +0 -1
  205. package/dist/chunks/uk-CoIIs3QI.js.map +0 -1
  206. package/dist/chunks/uk-Cvbo0IBW.js +0 -2
  207. package/dist/chunks/uk-Cvbo0IBW.js.map +0 -1
  208. package/dist/chunks/vi-BRtYSBUp.js +0 -2
  209. package/dist/chunks/vi-BRtYSBUp.js.map +0 -1
  210. package/dist/chunks/vi-C_fruIbh.js.map +0 -1
  211. package/dist/chunks/zh-CwczPMPp.js +0 -2
  212. package/dist/chunks/zh-CwczPMPp.js.map +0 -1
  213. package/dist/chunks/zh-LDkEV2D9.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={"anon.description_default":"正在设置访客会话…","anon.heading_default":"以访客身份继续","anon.try_again":"重试","auth.back_to_login":"返回登录","auth.check_email_message":"请查看邮件以获取确认码。","auth.check_email_title":"请查看邮件","auth.confirm_email_subtitle":"请输入我们发送到您邮箱的代码以完成注册。","auth.confirm_email_title":"确认您的邮箱","auth.confirmation_code":"确认码","auth.continue_with_apple":"使用 Apple 继续","auth.continue_with_facebook":"使用 Facebook 继续","auth.continue_with_github":"使用 GitHub 继续","auth.continue_with_google":"使用 Google 继续","auth.create_account":"创建账户","auth.default_subtitle":"登录以访问所有功能并同步您的数据。","auth.email":"邮箱地址","auth.email_exists":"该邮箱已注册账户。","auth.email_not_confirmed":"请先确认您的邮箱。","auth.forgot_password":"忘记密码?","auth.forgot_password_title":"忘记密码?","auth.forgot_subtitle":"输入您的邮箱,我们将向您发送密码重置链接。","auth.generic_error":"出错了","auth.have_account":"已有账户?","auth.hide_password":"隐藏密码","auth.invalid_credentials":"邮箱或密码错误","auth.invalid_otp":"验证码无效或已过期。","auth.last_used":"最近 · {email}","auth.last_used_no_email":"最近","auth.link_purchase_subheading":"我们将把购买关联到您的账户以保留访问权限。","auth.log_in":"登录","auth.log_in_link":"登录","auth.login_continue_purchase":"登录以继续购买","auth.network_error":"网络错误。请检查连接后重试。","auth.new_password_optional":"新密码(可选 — 仅用于密码重置)","auth.no_account":"没有账户?","auth.or":"或","auth.password":"密码","auth.passwords_mismatch":"密码不匹配","auth.rate_limited":"请求过多,请稍后再试。","auth.repeat_password":"重复密码","auth.reset_link_valid":"链接有效期为 1 小时。","auth.reset_password_subtitle":"请输入邮件中的代码和新密码。","auth.reset_password_title":"重置密码","auth.reset_sent_message":"如果该邮箱存在,已发送重置码。","auth.reset_sent_subtitle":"我们已发送密码重置链接。请按邮件中的说明操作。","auth.signup_sent_subtitle":"我们已向您的邮箱发送了确认链接。点击它激活您的账户,然后登录。","auth.restore_purchases_heading":"恢复购买","auth.restore_purchases_subheading":"请登录以恢复您的购买。","auth.send_reset":"发送重置邮件","auth.service_unavailable":"服务暂时不可用,请稍后再试。","auth.show_password":"显示密码","auth.sign_out":"退出","auth.sign_up":"注册","auth.sign_up_link":"注册","auth.signed_in":"已登录","auth.signin_failed":"登录失败","auth.signup_failed":"注册失败","auth.verify":"验证","auth.weak_password":"密码强度太弱。","auth.welcome":"欢迎!","auth.welcome_signup":"欢迎!","countdown.d":"天","countdown.h":"小时","countdown.m":"分","countdown.s":"秒","cta.close":"关闭","cta.continue":"继续","cta.get_lifetime_access":"获取终身访问","cta.get_plan_daily":"获取日付计划","cta.get_plan_generic":"获取 {interval} 计划","cta.get_plan_monthly":"获取每月计划","cta.get_plan_weekly":"获取每周计划","cta.get_plan_yearly":"获取年度计划","cta.start_trial":"开始{days}天免费试用","modal.close_aria":"关闭","modal.continue":"继续","modal.error_generic":"出错了","modal.loading":"加载中…","modal.purchase_restored_subtitle":"欢迎回来 — 您的订阅已激活。","modal.purchase_restored_title":"订阅已恢复","modal.purchase_success_subtitle":"您的订阅已激活。","modal.purchase_success_title":"已收到付款","modal.verifying_subscription":"正在检查您的订阅…","nav.back":"← 返回","nav.back_aria":"返回","offer.limited_time":"限时优惠","payment.awaiting_subtitle":"我们将自动检测付款 — 或在完成后点击下方按钮。","payment.awaiting_title":"在新标签页中完成付款","payment.checking":"正在检查…","payment.ive_paid":"我已付款","payment.open_checkout_again":"重新打开结账","payment.open_checkout_button":"打开结账","payment.popup_blocked_message":"您的浏览器阻止了结账标签页。点击下方打开。","payment.popup_blocked_title":"允许弹出窗口以继续","payment.popup_help_text":"结账窗口未打开或被阻止?点击此处重新打开。","payment.still_processing":"付款仍在处理中。请稍后再试。","payment.tab_closed_retry":"关闭了标签页?重试","pricing.free_trial_days":"{days}天免费试用","pricing.included_per":"每{interval}包含:","pricing.interval.day":"天","pricing.interval.lifetime_short":"永久","pricing.interval.month":"月","pricing.interval.period":"周期","pricing.interval.week":"周","pricing.interval.year":"年","pricing.money_back":"30天退款保证","pricing.most_popular":"最受欢迎","pricing.no_prices":"暂无价格。","pricing.plan_label.daily":"日付计划","pricing.plan_label.lifetime":"终身","pricing.plan_label.monthly":"每月套餐","pricing.plan_label.weekly":"每周套餐","pricing.plan_label.yearly":"每年套餐","pricing.plans_aria":"计划","session.contact_support":"联系支持","session.restore_purchases":"恢复购买","session.sign_out":"退出","session.signed_in_as_prefix":"已登录为","session.signing_out":"退出中…","support.attachments_aria":"上传附件","support.attachments_label":"附件","support.close_button":"关闭","support.done_button":"完成","support.dropzone_text":"将图片拖放到此处或点击选择","support.email_placeholder":"输入您的邮箱","support.file_requirements":"JPEG/PNG/WebP,最多 {max} 个文件,每个 ≤ 10MB","support.heading":"支持","support.instruction":"请填写下方表单以提交您的支持请求。","support.invalid_email":"无效的邮箱","support.invalid_file":"仅限 JPEG/PNG/WebP,每个 ≤ 10MB","support.message_length":"1-5000个字符","support.message_placeholder":"输入您的消息","support.remove_file_aria":"移除 {filename}","support.required":"必填","support.send_another":"发送另一个请求","support.send_button":"发送","support.sending":"发送中…","support.sending_as":"以以下身份发送","support.subject_length":"3-200个字符","support.subject_placeholder":"输入主题","support.success_heading":"请求已提交","support.success_message_prefix":"我们已收到您的消息,将回复至","support.too_many_files":"最多 {max} 个文件"};exports.default=t;
2
+ //# sourceMappingURL=zh-CPZBEb3d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-CPZBEb3d.js","sources":["../../src/ui/i18n/locales/zh.ts"],"sourcesContent":["/**\n * Static-translations для zh. Сгенерировано из:\n * - `online/lang/static-translations.ts` (legacy, через KEY_MAP)\n * - `tools/sdk-translations.mjs` (SDK-specific строки)\n *\n * Не править вручную — изменения теряются при следующем `node tools/gen-locales.mjs`.\n * Чтобы исправить перевод — править legacy/sdk-translations.mjs и регенерить.\n */\nconst zh = {\n 'anon.description_default': '正在设置访客会话…',\n 'anon.heading_default': '以访客身份继续',\n 'anon.try_again': '重试',\n 'auth.back_to_login': '返回登录',\n 'auth.check_email_message': '请查看邮件以获取确认码。',\n 'auth.check_email_title': '请查看邮件',\n 'auth.confirm_email_subtitle': '请输入我们发送到您邮箱的代码以完成注册。',\n 'auth.confirm_email_title': '确认您的邮箱',\n 'auth.confirmation_code': '确认码',\n 'auth.continue_with_apple': '使用 Apple 继续',\n 'auth.continue_with_facebook': '使用 Facebook 继续',\n 'auth.continue_with_github': '使用 GitHub 继续',\n 'auth.continue_with_google': '使用 Google 继续',\n 'auth.create_account': '创建账户',\n 'auth.default_subtitle': '登录以访问所有功能并同步您的数据。',\n 'auth.email': '邮箱地址',\n 'auth.email_exists': '该邮箱已注册账户。',\n 'auth.email_not_confirmed': '请先确认您的邮箱。',\n 'auth.forgot_password': '忘记密码?',\n 'auth.forgot_password_title': '忘记密码?',\n 'auth.forgot_subtitle': '输入您的邮箱,我们将向您发送密码重置链接。',\n 'auth.generic_error': '出错了',\n 'auth.have_account': '已有账户?',\n 'auth.hide_password': '隐藏密码',\n 'auth.invalid_credentials': '邮箱或密码错误',\n 'auth.invalid_otp': '验证码无效或已过期。',\n 'auth.last_used': '最近 · {email}',\n 'auth.last_used_no_email': '最近',\n 'auth.link_purchase_subheading': '我们将把购买关联到您的账户以保留访问权限。',\n 'auth.log_in': '登录',\n 'auth.log_in_link': '登录',\n 'auth.login_continue_purchase': '登录以继续购买',\n 'auth.network_error': '网络错误。请检查连接后重试。',\n 'auth.new_password_optional': '新密码(可选 — 仅用于密码重置)',\n 'auth.no_account': '没有账户?',\n 'auth.or': '或',\n 'auth.password': '密码',\n 'auth.passwords_mismatch': '密码不匹配',\n 'auth.rate_limited': '请求过多,请稍后再试。',\n 'auth.repeat_password': '重复密码',\n 'auth.reset_link_valid': '链接有效期为 1 小时。',\n 'auth.reset_password_subtitle': '请输入邮件中的代码和新密码。',\n 'auth.reset_password_title': '重置密码',\n 'auth.reset_sent_message': '如果该邮箱存在,已发送重置码。',\n 'auth.reset_sent_subtitle': '我们已发送密码重置链接。请按邮件中的说明操作。',\n 'auth.signup_sent_subtitle': '我们已向您的邮箱发送了确认链接。点击它激活您的账户,然后登录。',\n 'auth.restore_purchases_heading': '恢复购买',\n 'auth.restore_purchases_subheading': '请登录以恢复您的购买。',\n 'auth.send_reset': '发送重置邮件',\n 'auth.service_unavailable': '服务暂时不可用,请稍后再试。',\n 'auth.show_password': '显示密码',\n 'auth.sign_out': '退出',\n 'auth.sign_up': '注册',\n 'auth.sign_up_link': '注册',\n 'auth.signed_in': '已登录',\n 'auth.signin_failed': '登录失败',\n 'auth.signup_failed': '注册失败',\n 'auth.verify': '验证',\n 'auth.weak_password': '密码强度太弱。',\n 'auth.welcome': '欢迎!',\n 'auth.welcome_signup': '欢迎!',\n 'countdown.d': '天',\n 'countdown.h': '小时',\n 'countdown.m': '分',\n 'countdown.s': '秒',\n 'cta.close': '关闭',\n 'cta.continue': '继续',\n 'cta.get_lifetime_access': '获取终身访问',\n 'cta.get_plan_daily': '获取日付计划',\n 'cta.get_plan_generic': '获取 {interval} 计划',\n 'cta.get_plan_monthly': '获取每月计划',\n 'cta.get_plan_weekly': '获取每周计划',\n 'cta.get_plan_yearly': '获取年度计划',\n 'cta.start_trial': '开始{days}天免费试用',\n 'modal.close_aria': '关闭',\n 'modal.continue': '继续',\n 'modal.error_generic': '出错了',\n 'modal.loading': '加载中…',\n 'modal.purchase_restored_subtitle': '欢迎回来 — 您的订阅已激活。',\n 'modal.purchase_restored_title': '订阅已恢复',\n 'modal.purchase_success_subtitle': '您的订阅已激活。',\n 'modal.purchase_success_title': '已收到付款',\n 'modal.verifying_subscription': '正在检查您的订阅…',\n 'nav.back': '← 返回',\n 'nav.back_aria': '返回',\n 'offer.limited_time': '限时优惠',\n 'payment.awaiting_subtitle': '我们将自动检测付款 — 或在完成后点击下方按钮。',\n 'payment.awaiting_title': '在新标签页中完成付款',\n 'payment.checking': '正在检查…',\n 'payment.ive_paid': '我已付款',\n 'payment.open_checkout_again': '重新打开结账',\n 'payment.open_checkout_button': '打开结账',\n 'payment.popup_blocked_message': '您的浏览器阻止了结账标签页。点击下方打开。',\n 'payment.popup_blocked_title': '允许弹出窗口以继续',\n 'payment.popup_help_text': '结账窗口未打开或被阻止?点击此处重新打开。',\n 'payment.still_processing': '付款仍在处理中。请稍后再试。',\n 'payment.tab_closed_retry': '关闭了标签页?重试',\n 'pricing.free_trial_days': '{days}天免费试用',\n 'pricing.included_per': '每{interval}包含:',\n 'pricing.interval.day': '天',\n 'pricing.interval.lifetime_short': '永久',\n 'pricing.interval.month': '月',\n 'pricing.interval.period': '周期',\n 'pricing.interval.week': '周',\n 'pricing.interval.year': '年',\n 'pricing.money_back': '30天退款保证',\n 'pricing.most_popular': '最受欢迎',\n 'pricing.no_prices': '暂无价格。',\n 'pricing.plan_label.daily': '日付计划',\n 'pricing.plan_label.lifetime': '终身',\n 'pricing.plan_label.monthly': '每月套餐',\n 'pricing.plan_label.weekly': '每周套餐',\n 'pricing.plan_label.yearly': '每年套餐',\n 'pricing.plans_aria': '计划',\n 'session.contact_support': '联系支持',\n 'session.restore_purchases': '恢复购买',\n 'session.sign_out': '退出',\n 'session.signed_in_as_prefix': '已登录为',\n 'session.signing_out': '退出中…',\n 'support.attachments_aria': '上传附件',\n 'support.attachments_label': '附件',\n 'support.close_button': '关闭',\n 'support.done_button': '完成',\n 'support.dropzone_text': '将图片拖放到此处或点击选择',\n 'support.email_placeholder': '输入您的邮箱',\n 'support.file_requirements': 'JPEG/PNG/WebP,最多 {max} 个文件,每个 ≤ 10MB',\n 'support.heading': '支持',\n 'support.instruction': '请填写下方表单以提交您的支持请求。',\n 'support.invalid_email': '无效的邮箱',\n 'support.invalid_file': '仅限 JPEG/PNG/WebP,每个 ≤ 10MB',\n 'support.message_length': '1-5000个字符',\n 'support.message_placeholder': '输入您的消息',\n 'support.remove_file_aria': '移除 {filename}',\n 'support.required': '必填',\n 'support.send_another': '发送另一个请求',\n 'support.send_button': '发送',\n 'support.sending': '发送中…',\n 'support.sending_as': '以以下身份发送',\n 'support.subject_length': '3-200个字符',\n 'support.subject_placeholder': '输入主题',\n 'support.success_heading': '请求已提交',\n 'support.success_message_prefix': '我们已收到您的消息,将回复至',\n 'support.too_many_files': '最多 {max} 个文件'\n} as const;\n\nexport default zh;\n"],"names":["zh"],"mappings":"gFAQA,MAAMA,EAAK,CACT,2BAA4B,YAC5B,uBAAwB,UACxB,iBAAkB,KAClB,qBAAsB,OACtB,2BAA4B,eAC5B,yBAA0B,QAC1B,8BAA+B,uBAC/B,2BAA4B,SAC5B,yBAA0B,MAC1B,2BAA4B,cAC5B,8BAA+B,iBAC/B,4BAA6B,eAC7B,4BAA6B,eAC7B,sBAAuB,OACvB,wBAAyB,oBACzB,aAAc,OACd,oBAAqB,YACrB,2BAA4B,YAC5B,uBAAwB,QACxB,6BAA8B,QAC9B,uBAAwB,wBACxB,qBAAsB,MACtB,oBAAqB,QACrB,qBAAsB,OACtB,2BAA4B,UAC5B,mBAAoB,aACpB,iBAAkB,eAClB,0BAA2B,KAC3B,gCAAiC,wBACjC,cAAe,KACf,mBAAoB,KACpB,+BAAgC,UAChC,qBAAsB,iBACtB,6BAA8B,oBAC9B,kBAAmB,QACnB,UAAW,IACX,gBAAiB,KACjB,0BAA2B,QAC3B,oBAAqB,cACrB,uBAAwB,OACxB,wBAAyB,eACzB,+BAAgC,iBAChC,4BAA6B,OAC7B,0BAA2B,kBAC3B,2BAA4B,0BAC5B,4BAA6B,kCAC7B,iCAAkC,OAClC,oCAAqC,cACrC,kBAAmB,SACnB,2BAA4B,iBAC5B,qBAAsB,OACtB,gBAAiB,KACjB,eAAgB,KAChB,oBAAqB,KACrB,iBAAkB,MAClB,qBAAsB,OACtB,qBAAsB,OACtB,cAAe,KACf,qBAAsB,UACtB,eAAgB,MAChB,sBAAuB,MACvB,cAAe,IACf,cAAe,KACf,cAAe,IACf,cAAe,IACf,YAAa,KACb,eAAgB,KAChB,0BAA2B,SAC3B,qBAAsB,SACtB,uBAAwB,mBACxB,uBAAwB,SACxB,sBAAuB,SACvB,sBAAuB,SACvB,kBAAmB,gBACnB,mBAAoB,KACpB,iBAAkB,KAClB,sBAAuB,MACvB,gBAAiB,OACjB,mCAAoC,kBACpC,gCAAiC,QACjC,kCAAmC,WACnC,+BAAgC,QAChC,+BAAgC,YAChC,WAAY,OACZ,gBAAiB,KACjB,qBAAsB,OACtB,4BAA6B,2BAC7B,yBAA0B,aAC1B,mBAAoB,QACpB,mBAAoB,OACpB,8BAA+B,SAC/B,+BAAgC,OAChC,gCAAiC,wBACjC,8BAA+B,YAC/B,0BAA2B,wBAC3B,2BAA4B,iBAC5B,2BAA4B,YAC5B,0BAA2B,cAC3B,uBAAwB,iBACxB,uBAAwB,IACxB,kCAAmC,KACnC,yBAA0B,IAC1B,0BAA2B,KAC3B,wBAAyB,IACzB,wBAAyB,IACzB,qBAAsB,UACtB,uBAAwB,OACxB,oBAAqB,QACrB,2BAA4B,OAC5B,8BAA+B,KAC/B,6BAA8B,OAC9B,4BAA6B,OAC7B,4BAA6B,OAC7B,qBAAsB,KACtB,0BAA2B,OAC3B,4BAA6B,OAC7B,mBAAoB,KACpB,8BAA+B,OAC/B,sBAAuB,OACvB,2BAA4B,OAC5B,4BAA6B,KAC7B,uBAAwB,KACxB,sBAAuB,KACvB,wBAAyB,gBACzB,4BAA6B,SAC7B,4BAA6B,uCAC7B,kBAAmB,KACnB,sBAAuB,oBACvB,wBAAyB,QACzB,uBAAwB,6BACxB,yBAA0B,YAC1B,8BAA+B,SAC/B,2BAA4B,gBAC5B,mBAAoB,KACpB,uBAAwB,UACxB,sBAAuB,KACvB,kBAAmB,OACnB,qBAAsB,UACtB,yBAA0B,WAC1B,8BAA+B,OAC/B,0BAA2B,QAC3B,iCAAkC,iBAClC,yBAA0B,cAC5B"}
@@ -1,7 +1,8 @@
1
- const e = {
1
+ const t = {
2
2
  "anon.description_default": "正在设置访客会话…",
3
3
  "anon.heading_default": "以访客身份继续",
4
4
  "anon.try_again": "重试",
5
+ "auth.back_to_login": "返回登录",
5
6
  "auth.check_email_message": "请查看邮件以获取确认码。",
6
7
  "auth.check_email_title": "请查看邮件",
7
8
  "auth.confirm_email_subtitle": "请输入我们发送到您邮箱的代码以完成注册。",
@@ -38,9 +39,12 @@ const e = {
38
39
  "auth.passwords_mismatch": "密码不匹配",
39
40
  "auth.rate_limited": "请求过多,请稍后再试。",
40
41
  "auth.repeat_password": "重复密码",
42
+ "auth.reset_link_valid": "链接有效期为 1 小时。",
41
43
  "auth.reset_password_subtitle": "请输入邮件中的代码和新密码。",
42
44
  "auth.reset_password_title": "重置密码",
43
45
  "auth.reset_sent_message": "如果该邮箱存在,已发送重置码。",
46
+ "auth.reset_sent_subtitle": "我们已发送密码重置链接。请按邮件中的说明操作。",
47
+ "auth.signup_sent_subtitle": "我们已向您的邮箱发送了确认链接。点击它激活您的账户,然后登录。",
44
48
  "auth.restore_purchases_heading": "恢复购买",
45
49
  "auth.restore_purchases_subheading": "请登录以恢复您的购买。",
46
50
  "auth.send_reset": "发送重置邮件",
@@ -140,6 +144,6 @@ const e = {
140
144
  "support.too_many_files": "最多 {max} 个文件"
141
145
  };
142
146
  export {
143
- e as default
147
+ t as default
144
148
  };
145
- //# sourceMappingURL=zh-LDkEV2D9.js.map
149
+ //# sourceMappingURL=zh-DrG18oGe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-DrG18oGe.js","sources":["../../src/ui/i18n/locales/zh.ts"],"sourcesContent":["/**\n * Static-translations для zh. Сгенерировано из:\n * - `online/lang/static-translations.ts` (legacy, через KEY_MAP)\n * - `tools/sdk-translations.mjs` (SDK-specific строки)\n *\n * Не править вручную — изменения теряются при следующем `node tools/gen-locales.mjs`.\n * Чтобы исправить перевод — править legacy/sdk-translations.mjs и регенерить.\n */\nconst zh = {\n 'anon.description_default': '正在设置访客会话…',\n 'anon.heading_default': '以访客身份继续',\n 'anon.try_again': '重试',\n 'auth.back_to_login': '返回登录',\n 'auth.check_email_message': '请查看邮件以获取确认码。',\n 'auth.check_email_title': '请查看邮件',\n 'auth.confirm_email_subtitle': '请输入我们发送到您邮箱的代码以完成注册。',\n 'auth.confirm_email_title': '确认您的邮箱',\n 'auth.confirmation_code': '确认码',\n 'auth.continue_with_apple': '使用 Apple 继续',\n 'auth.continue_with_facebook': '使用 Facebook 继续',\n 'auth.continue_with_github': '使用 GitHub 继续',\n 'auth.continue_with_google': '使用 Google 继续',\n 'auth.create_account': '创建账户',\n 'auth.default_subtitle': '登录以访问所有功能并同步您的数据。',\n 'auth.email': '邮箱地址',\n 'auth.email_exists': '该邮箱已注册账户。',\n 'auth.email_not_confirmed': '请先确认您的邮箱。',\n 'auth.forgot_password': '忘记密码?',\n 'auth.forgot_password_title': '忘记密码?',\n 'auth.forgot_subtitle': '输入您的邮箱,我们将向您发送密码重置链接。',\n 'auth.generic_error': '出错了',\n 'auth.have_account': '已有账户?',\n 'auth.hide_password': '隐藏密码',\n 'auth.invalid_credentials': '邮箱或密码错误',\n 'auth.invalid_otp': '验证码无效或已过期。',\n 'auth.last_used': '最近 · {email}',\n 'auth.last_used_no_email': '最近',\n 'auth.link_purchase_subheading': '我们将把购买关联到您的账户以保留访问权限。',\n 'auth.log_in': '登录',\n 'auth.log_in_link': '登录',\n 'auth.login_continue_purchase': '登录以继续购买',\n 'auth.network_error': '网络错误。请检查连接后重试。',\n 'auth.new_password_optional': '新密码(可选 — 仅用于密码重置)',\n 'auth.no_account': '没有账户?',\n 'auth.or': '或',\n 'auth.password': '密码',\n 'auth.passwords_mismatch': '密码不匹配',\n 'auth.rate_limited': '请求过多,请稍后再试。',\n 'auth.repeat_password': '重复密码',\n 'auth.reset_link_valid': '链接有效期为 1 小时。',\n 'auth.reset_password_subtitle': '请输入邮件中的代码和新密码。',\n 'auth.reset_password_title': '重置密码',\n 'auth.reset_sent_message': '如果该邮箱存在,已发送重置码。',\n 'auth.reset_sent_subtitle': '我们已发送密码重置链接。请按邮件中的说明操作。',\n 'auth.signup_sent_subtitle': '我们已向您的邮箱发送了确认链接。点击它激活您的账户,然后登录。',\n 'auth.restore_purchases_heading': '恢复购买',\n 'auth.restore_purchases_subheading': '请登录以恢复您的购买。',\n 'auth.send_reset': '发送重置邮件',\n 'auth.service_unavailable': '服务暂时不可用,请稍后再试。',\n 'auth.show_password': '显示密码',\n 'auth.sign_out': '退出',\n 'auth.sign_up': '注册',\n 'auth.sign_up_link': '注册',\n 'auth.signed_in': '已登录',\n 'auth.signin_failed': '登录失败',\n 'auth.signup_failed': '注册失败',\n 'auth.verify': '验证',\n 'auth.weak_password': '密码强度太弱。',\n 'auth.welcome': '欢迎!',\n 'auth.welcome_signup': '欢迎!',\n 'countdown.d': '天',\n 'countdown.h': '小时',\n 'countdown.m': '分',\n 'countdown.s': '秒',\n 'cta.close': '关闭',\n 'cta.continue': '继续',\n 'cta.get_lifetime_access': '获取终身访问',\n 'cta.get_plan_daily': '获取日付计划',\n 'cta.get_plan_generic': '获取 {interval} 计划',\n 'cta.get_plan_monthly': '获取每月计划',\n 'cta.get_plan_weekly': '获取每周计划',\n 'cta.get_plan_yearly': '获取年度计划',\n 'cta.start_trial': '开始{days}天免费试用',\n 'modal.close_aria': '关闭',\n 'modal.continue': '继续',\n 'modal.error_generic': '出错了',\n 'modal.loading': '加载中…',\n 'modal.purchase_restored_subtitle': '欢迎回来 — 您的订阅已激活。',\n 'modal.purchase_restored_title': '订阅已恢复',\n 'modal.purchase_success_subtitle': '您的订阅已激活。',\n 'modal.purchase_success_title': '已收到付款',\n 'modal.verifying_subscription': '正在检查您的订阅…',\n 'nav.back': '← 返回',\n 'nav.back_aria': '返回',\n 'offer.limited_time': '限时优惠',\n 'payment.awaiting_subtitle': '我们将自动检测付款 — 或在完成后点击下方按钮。',\n 'payment.awaiting_title': '在新标签页中完成付款',\n 'payment.checking': '正在检查…',\n 'payment.ive_paid': '我已付款',\n 'payment.open_checkout_again': '重新打开结账',\n 'payment.open_checkout_button': '打开结账',\n 'payment.popup_blocked_message': '您的浏览器阻止了结账标签页。点击下方打开。',\n 'payment.popup_blocked_title': '允许弹出窗口以继续',\n 'payment.popup_help_text': '结账窗口未打开或被阻止?点击此处重新打开。',\n 'payment.still_processing': '付款仍在处理中。请稍后再试。',\n 'payment.tab_closed_retry': '关闭了标签页?重试',\n 'pricing.free_trial_days': '{days}天免费试用',\n 'pricing.included_per': '每{interval}包含:',\n 'pricing.interval.day': '天',\n 'pricing.interval.lifetime_short': '永久',\n 'pricing.interval.month': '月',\n 'pricing.interval.period': '周期',\n 'pricing.interval.week': '周',\n 'pricing.interval.year': '年',\n 'pricing.money_back': '30天退款保证',\n 'pricing.most_popular': '最受欢迎',\n 'pricing.no_prices': '暂无价格。',\n 'pricing.plan_label.daily': '日付计划',\n 'pricing.plan_label.lifetime': '终身',\n 'pricing.plan_label.monthly': '每月套餐',\n 'pricing.plan_label.weekly': '每周套餐',\n 'pricing.plan_label.yearly': '每年套餐',\n 'pricing.plans_aria': '计划',\n 'session.contact_support': '联系支持',\n 'session.restore_purchases': '恢复购买',\n 'session.sign_out': '退出',\n 'session.signed_in_as_prefix': '已登录为',\n 'session.signing_out': '退出中…',\n 'support.attachments_aria': '上传附件',\n 'support.attachments_label': '附件',\n 'support.close_button': '关闭',\n 'support.done_button': '完成',\n 'support.dropzone_text': '将图片拖放到此处或点击选择',\n 'support.email_placeholder': '输入您的邮箱',\n 'support.file_requirements': 'JPEG/PNG/WebP,最多 {max} 个文件,每个 ≤ 10MB',\n 'support.heading': '支持',\n 'support.instruction': '请填写下方表单以提交您的支持请求。',\n 'support.invalid_email': '无效的邮箱',\n 'support.invalid_file': '仅限 JPEG/PNG/WebP,每个 ≤ 10MB',\n 'support.message_length': '1-5000个字符',\n 'support.message_placeholder': '输入您的消息',\n 'support.remove_file_aria': '移除 {filename}',\n 'support.required': '必填',\n 'support.send_another': '发送另一个请求',\n 'support.send_button': '发送',\n 'support.sending': '发送中…',\n 'support.sending_as': '以以下身份发送',\n 'support.subject_length': '3-200个字符',\n 'support.subject_placeholder': '输入主题',\n 'support.success_heading': '请求已提交',\n 'support.success_message_prefix': '我们已收到您的消息,将回复至',\n 'support.too_many_files': '最多 {max} 个文件'\n} as const;\n\nexport default zh;\n"],"names":["zh"],"mappings":"AAQA,MAAMA,IAAK;AAAA,EACT,4BAA4B;AAAA,EAC5B,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,0BAA0B;AAAA,EAC1B,+BAA+B;AAAA,EAC/B,4BAA4B;AAAA,EAC5B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,uBAAuB;AAAA,EACvB,yBAAyB;AAAA,EACzB,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,4BAA4B;AAAA,EAC5B,wBAAwB;AAAA,EACxB,8BAA8B;AAAA,EAC9B,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,iCAAiC;AAAA,EACjC,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,gCAAgC;AAAA,EAChC,sBAAsB;AAAA,EACtB,8BAA8B;AAAA,EAC9B,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,2BAA2B;AAAA,EAC3B,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,6BAA6B;AAAA,EAC7B,kCAAkC;AAAA,EAClC,qCAAqC;AAAA,EACrC,mBAAmB;AAAA,EACnB,4BAA4B;AAAA,EAC5B,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AAAA,EACf,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,2BAA2B;AAAA,EAC3B,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,oCAAoC;AAAA,EACpC,iCAAiC;AAAA,EACjC,mCAAmC;AAAA,EACnC,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,6BAA6B;AAAA,EAC7B,0BAA0B;AAAA,EAC1B,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,+BAA+B;AAAA,EAC/B,gCAAgC;AAAA,EAChC,iCAAiC;AAAA,EACjC,+BAA+B;AAAA,EAC/B,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,4BAA4B;AAAA,EAC5B,2BAA2B;AAAA,EAC3B,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,mCAAmC;AAAA,EACnC,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,qBAAqB;AAAA,EACrB,4BAA4B;AAAA,EAC5B,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,oBAAoB;AAAA,EACpB,+BAA+B;AAAA,EAC/B,uBAAuB;AAAA,EACvB,4BAA4B;AAAA,EAC5B,6BAA6B;AAAA,EAC7B,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,yBAAyB;AAAA,EACzB,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B,+BAA+B;AAAA,EAC/B,4BAA4B;AAAA,EAC5B,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,+BAA+B;AAAA,EAC/B,2BAA2B;AAAA,EAC3B,kCAAkC;AAAA,EAClC,0BAA0B;AAC5B;"}
package/dist/core.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class n extends Error{constructor(t,e,s={}){super(e),this.name="PaywallError",this.code=t,this.status=s.status,this.cause=s.cause}}class N extends n{constructor(t){super("not_enough_queries",t.message??"Not enough queries",{status:402}),this.name="QuotaExceededError",this.balances=t.balances,this.queryType=t.queryType,this.currentBalance=t.currentBalance}}const g="3.0.0-alpha.0";class b{constructor(t){this.opts=t}async request(t,e={}){const s=new URL(t,this.opts.apiOrigin).toString(),a=this.opts.fetch??fetch,r=new Headers(e.headers);r.set("Accept","application/json"),r.set("X-SDK-Version",g),r.set("X-Paywall-Id",this.opts.paywallId),this.opts.capabilities?.length&&r.set("X-SDK-Capabilities",this.opts.capabilities.join(","));const o=await this.opts.getAuthToken?.();o&&r.set("Authorization",`Bearer ${o}`);const d=typeof FormData<"u"&&e.body instanceof FormData;e.body&&!r.has("Content-Type")&&!d&&r.set("Content-Type","application/json");let u;try{u=await a(s,{...e,headers:r,credentials:"omit"})}catch(c){throw(c&&typeof c=="object"&&"name"in c?c.name:void 0)==="AbortError"?new n("aborted","Request aborted",{cause:c}):new n("network_error","Network request failed",{cause:c})}const y=(u.headers.get("content-type")??"").includes("application/json")?await u.json().catch(()=>null):null;if(!u.ok){const c=y&&typeof y=="object"&&"code"in y&&String(y.code)||`http_${u.status}`,w=y&&typeof y=="object"&&"message"in y&&String(y.message)||u.statusText||"Request failed";throw new n(c,w,{status:u.status,cause:y})}return y}}class P{constructor(t){if(!t.paywallId)throw new n("invalid_config","paywallId is required");if(!t.apiOrigin)throw new n("invalid_config","apiOrigin is required. Pass the paywall custom_domain configured in the platform.");this.paywallId=t.paywallId,this.apiOrigin=t.apiOrigin,this.auth=t.auth,this.userId=t.userId,this.capabilities=t.capabilities,this.customFetch=t.fetch,this.onChargeSuccess=t.onChargeSuccess,this.onQuotaExceeded=t.onQuotaExceeded,t.userId&&!t.auth&&typeof window<"u"&&typeof window.document<"u"&&console.warn("[paywall] WARNING: ApiGatewayClient.userId set without auth in browser. Client can spoof userId. Use AuthClient + Bearer for trusted user.id.")}async call(t){const e=t.path?t.path.replace(/^\/+/,""):"",s=new URL(`/api/v1/api-gateway/${encodeURIComponent(t.providerId)}${e?`/${e}`:""}`,this.apiOrigin);s.searchParams.set("paywall_id",this.paywallId);const a=new Headers(t.headers);a.set("X-SDK-Version",g),a.set("X-Paywall-Id",this.paywallId),this.capabilities?.length&&a.set("X-SDK-Capabilities",this.capabilities.join(","));const r=await this.auth?.getAccessToken();r?a.set("Authorization",`Bearer ${r}`):this.userId&&a.set("X-User-ID",this.userId);const o=typeof FormData<"u"&&t.body instanceof FormData,d=typeof Blob<"u"&&t.body instanceof Blob,u=typeof ReadableStream<"u"&&t.body instanceof ReadableStream,f=typeof t.body=="string";let h;t.body===void 0||t.body===null?h=void 0:o||d||u||f?h=t.body:(h=JSON.stringify(t.body),a.has("Content-Type")||a.set("Content-Type","application/json"));const y=this.customFetch??fetch;let c;try{c=await y(s.toString(),{method:t.method??"POST",headers:a,body:h,signal:t.signal,credentials:"omit"})}catch(p){const K=p instanceof Error?p.message:String(p);throw new n("network_error",`Network request failed: ${K}`,{cause:p})}if(c.status===402){const p=await q(c);throw this.onQuotaExceeded?.(p),p}if(!c.ok){const p=await $(c.clone());throw new n(p??`http_${c.status}`,c.statusText||"Gateway request failed",{status:c.status})}const w=c.headers.get("X-Query-Type")??void 0;return this.onChargeSuccess?.(w),c}}async function q(i){let t={};try{t=await i.json()}catch{}const e=t.details?.balances;let s=[];if(Array.isArray(e)){const a=e[0];Array.isArray(a)?s=a:a&&Array.isArray(a.balances)&&(s=a.balances)}return new N({balances:s,queryType:t.details?.queryType??"",currentBalance:t.details?.currentBalance??null})}async function $(i){if(!(i.headers.get("content-type")??"").includes("application/json"))return null;try{const e=await i.json();return e.code||e.error||null}catch{return null}}function F(){return typeof chrome<"u"&&!!chrome?.storage?.local&&!!chrome?.runtime?.id}const M={getItem(i){return new Promise(t=>{chrome.storage.local.get([i],e=>{const s=e[i];t(typeof s=="string"?s:null)})})},setItem(i,t){return new Promise(e=>{chrome.storage.local.set({[i]:t},()=>e())})},removeItem(i){return new Promise(t=>{chrome.storage.local.remove([i],()=>t())})},watch(i,t){const e=chrome?.storage?.onChanged;if(!e)return()=>{};const s=(a,r)=>{if(r!=="local")return;const o=a[i];o&&t(typeof o.newValue=="string"?o.newValue:null)};return e.addListener(s),()=>e.removeListener(s)}},x={async getItem(i){try{return window.localStorage.getItem(i)}catch{return null}},async setItem(i,t){try{window.localStorage.setItem(i,t)}catch{}},async removeItem(i){try{window.localStorage.removeItem(i)}catch{}},watch(i,t){if(typeof window>"u")return()=>{};const e=s=>{s.storageArea===window.localStorage&&s.key===i&&t(s.newValue)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}},S=new Map,J={async getItem(i){return S.get(i)??null},async setItem(i,t){S.set(i,t)},async removeItem(i){S.delete(i)}};function _(i){return i||(F()?M:typeof window<"u"&&"localStorage"in window?x:J)}const l={visitorId:"pw-visitor-id",lastLoginMethod:i=>`pw-${i}-last-login-method`,lastLoginEmail:i=>`pw-${i}-last-login-email`,userState:(i,t)=>`pw-${i}-${t}-user-v1`,authSession:i=>`pw-${i}-auth-v1`,anonRefreshToken:i=>`pw-${i}-anon-rt-v1`,bootstrap:i=>`pw-${i}-bootstrap-v1`,balances:(i,t)=>`pw-${i}-${t}-balances-v1`};function B(){const i=typeof globalThis<"u"?globalThis.crypto:void 0;if(i&&typeof i.randomUUID=="function")return i.randomUUID();const t=new Uint8Array(16);if(i&&typeof i.getRandomValues=="function")i.getRandomValues(t);else for(let s=0;s<16;s++)t[s]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const e=Array.from(t,s=>s.toString(16).padStart(2,"0")).join("");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20)}`}async function I(i){try{const e=await i.getItem(l.visitorId);if(e&&typeof e=="string"&&e.length>=16)return e}catch{}const t=B();try{await i.setItem(l.visitorId,t)}catch{}return t}const V=5e3,H=30*6e4,T=60*6e4,j=5*6e4,v={has_active_subscription:!1,purchases:[],trial:null,had_previous_trial:!1};function O(i){return i&&(i.email||i.userId||i.anonymousId)||"guest"}function G(i,t){return i===t?!0:!i||!t?!1:JSON.stringify(i)===JSON.stringify(t)}const X=5e3,U=5*6e4,z=3e4;function Q(i,t){if(i===t)return!0;if(!i||!t||i.length!==t.length)return!1;for(let e=0;e<i.length;e++)if(i[e].type!==t[e].type||i[e].count!==t[e].count)return!1;return!0}class W{constructor(t){if(this.cachedBootstrap=null,this.cachedBootstrapAt=0,this.inflightBootstrap=null,this.bootstrapListeners=new Set,this.bootstrapStorageUnwatch=null,this.authUnsubscribe=null,this.cachedUser=null,this.cachedUserAt=0,this.inflightUser=null,this.userListeners=new Set,this.visitorIdPromise=null,this.visitorId=null,this.inflightCheckouts=new Map,this.cachedBalances=null,this.cachedBalancesAt=0,this.balancesStorageUnwatch=null,this.inflightBalances=null,this.balanceListeners=new Set,this.previewVersionCounter=0,!t.paywallId)throw new n("invalid_config","paywallId is required");if(!t.apiOrigin)throw new n("invalid_config",'apiOrigin is required. Pass the paywall custom_domain configured in the platform (e.g. "https://pay.your-domain.com"). The legacy "appbox.space" fallback is not used in SDK 3.0.');this.paywallId=t.paywallId,this.apiOrigin=t.apiOrigin,this.capabilities=t.capabilities,this.auth=t.auth,this.previewMode=t.preview===!0;const e=t.auth?.getCachedUser();this.identity=t.identity??(e?k(e):void 0),this.apiKey=t.apiKey,this.fetchImpl=t.fetch,t.apiKey&&typeof window<"u"&&typeof window.document<"u"&&console.error("[paywall] SECURITY: BillingClient.apiKey detected in browser context. This is a server-SDK key and exposes your account. Remove apiKey or move BillingClient to a trusted backend."),this.storage=_(t.storage),this.api=new b({apiOrigin:this.apiOrigin,paywallId:t.paywallId,capabilities:t.capabilities,fetch:t.fetch,getAuthToken:t.auth?()=>t.auth.getAccessToken():void 0}),t.auth&&(this.authUnsubscribe=t.auth.onAuthChange((s,a)=>{const r=a?k(a.user):void 0;Y(this.identity,r)||this.setIdentity(r)})),this.hydrateUserFromStorage(),this.hydrateBootstrapFromStorage(),this.subscribeBootstrapStorage(),this.hydrateBalancesFromStorage(),this.subscribeBalancesStorage(),this.visitorIdPromise=I(this.storage).then(s=>(this.visitorId=s,s))}async getVisitorId(){return this.visitorId?this.visitorId:(this.visitorIdPromise||(this.visitorIdPromise=I(this.storage).then(t=>(this.visitorId=t,t))),this.visitorIdPromise)}getCachedVisitorId(){return this.visitorId}setIdentity(t){this.identity=t,this.cachedUser=null,this.cachedUserAt=0,this.inflightUser=null,this.cachedBalances=null,this.cachedBalancesAt=0,this.inflightBalances=null,this.balancesStorageUnwatch&&(this.balancesStorageUnwatch(),this.balancesStorageUnwatch=null),this.hydrateBalancesFromStorage(),this.subscribeBalancesStorage(),this.hydrateUserFromStorage(),t?this.getUser({force:!0}).catch(()=>{}):(this.applyUser(v),this.applyBalances([]))}destroy(){this.authUnsubscribe&&(this.authUnsubscribe(),this.authUnsubscribe=null),this.bootstrapStorageUnwatch&&(this.bootstrapStorageUnwatch(),this.bootstrapStorageUnwatch=null),this.balancesStorageUnwatch&&(this.balancesStorageUnwatch(),this.balancesStorageUnwatch=null),this.userListeners.clear(),this.balanceListeners.clear(),this.bootstrapListeners.clear()}getIdentity(){return this.identity}getStorage(){return this.storage}async bootstrap(t=!1){const e=typeof t=="boolean"?{force:t}:t;if(this.previewMode){if(this.cachedBootstrap)return this.cachedBootstrap;throw new n("invalid_config","BillingClient in preview mode but cachedBootstrap is not seeded. Call setBootstrap(bootstrap) before open().")}const s=Date.now(),a=this.cachedBootstrap&&this.cachedBootstrapAt>0&&s-this.cachedBootstrapAt<T;return!e.force&&a?(s-this.cachedBootstrapAt>j&&this.revalidateBootstrap(e.signal).catch(()=>{}),{...this.cachedBootstrap,user:this.cachedUser??void 0}):this.inflightBootstrap?this.inflightBootstrap:(this.inflightBootstrap=this.fetchBootstrap({ifVersion:e.force?void 0:this.cachedBootstrap?.version,signal:e.signal}).finally(()=>{this.inflightBootstrap=null}),this.inflightBootstrap)}onBootstrapChange(t){return this.bootstrapListeners.add(t),()=>{this.bootstrapListeners.delete(t)}}setBootstrap(t){const e=this.cachedBootstrap??{settings:{id:this.paywallId,name:""},prices:[],offers:[]},s={...e,...t,settings:t.settings!==void 0?{...e.settings,...t.settings}:e.settings,prices:t.prices!==void 0?t.prices:e.prices,offers:t.offers!==void 0?t.offers:e.offers,version:`preview:${++this.previewVersionCounter}`};s.layout||(s.layout=L(s.settings,s.prices)),m(s),this.cachedBootstrap=s,this.cachedBootstrapAt=Date.now();for(const a of this.bootstrapListeners)try{a(s)}catch(r){console.warn("[paywall] onBootstrapChange listener threw",r)}}async fetchBootstrap(t){const e={};this.identity?.email&&(e["X-User-Email"]=this.identity.email);const s=t.ifVersion?`/api/v1/paywall/${this.paywallId}/bootstrap?if_version=${encodeURIComponent(t.ifVersion)}`:`/api/v1/paywall/${this.paywallId}/bootstrap`,a=await this.api.request(s,{...Object.keys(e).length?{headers:e}:{},signal:t.signal});if("unchanged"in a&&a.unchanged)return this.cachedBootstrap?(this.cachedBootstrapAt=Date.now(),a.user&&this.applyUser(a.user),this.cachedBootstrap):this.fetchBootstrap({signal:t.signal});const r=a;return Z(r.settings.custom_domain,this.apiOrigin),r.layout||(r.layout=L(r.settings,r.prices)),m(r),this.applyBootstrap(r,{persist:!0}),r.user&&this.applyUser(r.user),r}revalidateBootstrap(t){return this.inflightBootstrap?this.inflightBootstrap:(this.inflightBootstrap=this.fetchBootstrap({ifVersion:this.cachedBootstrap?.version,signal:t}).finally(()=>{this.inflightBootstrap=null}),this.inflightBootstrap)}applyBootstrap(t,{persist:e}){const s=!this.cachedBootstrap||this.cachedBootstrap.version!==t.version;if(this.cachedBootstrap=t,this.cachedBootstrapAt=Date.now(),e&&this.persistBootstrap(t),s)for(const a of this.bootstrapListeners)try{a(t)}catch(r){console.warn("[paywall] onBootstrapChange listener threw",r)}}async hydrateBootstrapFromStorage(){if(!this.cachedBootstrap)try{const t=await this.storage.getItem(l.bootstrap(this.paywallId));if(!t)return;const e=JSON.parse(t);if(!e?.bootstrap||Date.now()-e.at>T||this.cachedBootstrap)return;m(e.bootstrap),this.cachedBootstrap=e.bootstrap,this.cachedBootstrapAt=e.at;for(const s of this.bootstrapListeners)try{s(e.bootstrap)}catch(a){console.warn("[paywall] onBootstrapChange listener threw",a)}}catch{}}async persistBootstrap(t){if(t.version)try{const{user:e,...s}=t;await this.storage.setItem(l.bootstrap(this.paywallId),JSON.stringify({at:Date.now(),bootstrap:s}))}catch{}}subscribeBootstrapStorage(){typeof this.storage.watch=="function"&&(this.bootstrapStorageUnwatch=this.storage.watch(l.bootstrap(this.paywallId),t=>{if(t)try{const e=JSON.parse(t);if(!e?.bootstrap)return;if(this.cachedBootstrap?.version&&this.cachedBootstrap.version===e.bootstrap.version){this.cachedBootstrapAt=e.at;return}m(e.bootstrap),this.applyBootstrap(e.bootstrap,{persist:!1})}catch{}}))}getCachedBootstrap(){return this.cachedBootstrap}async getPrices(t={}){return(await this.bootstrap(t)).prices}getCachedPrices(){return this.cachedBootstrap?.prices??null}getUserLanguage(){const t=typeof navigator<"u"&&navigator.language?navigator.language:null,e=this.cachedBootstrap?.settings.locale_default??null,s=this.cachedBootstrap?R(this.cachedBootstrap):null;return{tag:s??t??e,applied:s,browserLanguage:t,countryLanguage:e}}async getUser({force:t=!1,signal:e}={}){return!t&&this.cachedUser&&Date.now()-this.cachedUserAt<V?this.cachedUser:this.inflightUser?this.inflightUser:(this.inflightUser=(async()=>{try{if(!this.identity?.email)return this.applyUser(v),v;const s=await this.api.request(`/api/v1/paywall/${this.paywallId}/user-state`,{headers:{"X-User-Email":this.identity.email},signal:e});return this.applyUser(s),s}finally{this.inflightUser=null}})(),this.inflightUser)}onUserChange(t,e={}){this.userListeners.add(t);const s=e.immediate??"microtask";if(this.cachedUser&&s!=="none"){const a=this.cachedUser;if(s==="sync")try{t(a)}catch(r){console.warn("[paywall] onUserChange initial sync threw",r)}else queueMicrotask(()=>{this.userListeners.has(t)&&t(a)})}return()=>{this.userListeners.delete(t)}}getCachedUser(){return this.cachedUser}applyUser(t){const e=!G(this.cachedUser,t);if(this.cachedUser=t,this.cachedUserAt=Date.now(),e){this.persistUser(t);for(const s of this.userListeners)try{s(t)}catch(a){console.warn("[paywall] onUserChange listener threw",a)}}}storageKey(){return l.userState(this.paywallId,O(this.identity))}async hydrateUserFromStorage(){if(!this.cachedUser)try{const t=await this.storage.getItem(this.storageKey());if(!t)return;const e=JSON.parse(t);if(!e?.user||Date.now()-e.at>H||this.cachedUser)return;this.applyUser(e.user)}catch{}}async persistUser(t){try{await this.storage.setItem(this.storageKey(),JSON.stringify({at:Date.now(),user:t}))}catch{}}async getBalances({force:t=!1,signal:e}={}){const s=Date.now(),a=this.cachedBalances?s-this.cachedBalancesAt:1/0;return!t&&this.cachedBalances&&(a<X||a<z)?this.cachedBalances:!t&&this.cachedBalances&&a<U?(this.fetchBalances({signal:e}).catch(()=>{}),this.cachedBalances):this.inflightBalances?this.inflightBalances:this.fetchBalances({signal:e})}fetchBalances({signal:t}={}){return this.inflightBalances?this.inflightBalances:(this.inflightBalances=(async()=>{try{if(!this.auth)return this.applyBalances([]),[];const e=await this.api.request(`/api/v1/paywall/${this.paywallId}/balances`,{signal:t}),s=Array.isArray(e.balances)?e.balances:[];return this.applyBalances(s),s}finally{this.inflightBalances=null}})(),this.inflightBalances)}getCachedBalances(){return this.cachedBalances}onBalanceChange(t,e={}){this.balanceListeners.add(t);const s=e.immediate??"microtask";if(this.cachedBalances&&s!=="none"){const a=this.cachedBalances;if(s==="sync")try{t(a)}catch(r){console.warn("[paywall] onBalanceChange initial sync threw",r)}else queueMicrotask(()=>{this.balanceListeners.has(t)&&t(a)})}return()=>{this.balanceListeners.delete(t)}}decrementBalanceLocal(t){if(!t){this.getBalances({force:!0});return}if(!this.cachedBalances)return;const e=this.cachedBalances.findIndex(r=>r.type===t);if(e<0||this.cachedBalances[e].count<=0)return;const a=this.cachedBalances.map((r,o)=>o===e?{...r,count:r.count-1}:r);this.applyBalances(a)}refreshBalances(){return this.getBalances({force:!0})}createApiGatewayClient(t={}){const e=t.onChargeSuccess,s=t.onQuotaExceeded;return new P({paywallId:this.paywallId,apiOrigin:this.apiOrigin,auth:this.auth,userId:this.auth?void 0:this.identity?.userId,capabilities:this.capabilities,fetch:this.fetchImpl,...t,onChargeSuccess:a=>{this.decrementBalanceLocal(a),e?.(a)},onQuotaExceeded:a=>{this.refreshBalances(),s?.(a)}})}applyBalances(t,{persist:e=!0}={}){const s=!Q(this.cachedBalances,t);if(this.cachedBalances=t,this.cachedBalancesAt=Date.now(),e&&this.persistBalances(t),s)for(const a of this.balanceListeners)try{a(t)}catch(r){console.warn("[paywall] onBalanceChange listener threw",r)}}balancesStorageKey(){return l.balances(this.paywallId,O(this.identity))}async hydrateBalancesFromStorage(){if(!this.cachedBalances)try{const t=await this.storage.getItem(this.balancesStorageKey());if(!t)return;const e=JSON.parse(t);if(!e?.balances||!Array.isArray(e.balances)||Date.now()-e.at>U||this.cachedBalances)return;this.cachedBalances=e.balances,this.cachedBalancesAt=e.at;for(const s of this.balanceListeners)try{s(e.balances)}catch(a){console.warn("[paywall] onBalanceChange listener threw",a)}}catch{}}async persistBalances(t){try{await this.storage.setItem(this.balancesStorageKey(),JSON.stringify({at:Date.now(),balances:t}))}catch{}}subscribeBalancesStorage(){typeof this.storage.watch=="function"&&(this.balancesStorageUnwatch=this.storage.watch(this.balancesStorageKey(),t=>{if(t)try{const e=JSON.parse(t);if(!e?.balances||!Array.isArray(e.balances)||e.at<=this.cachedBalancesAt)return;this.applyBalances(e.balances,{persist:!1})}catch{}}))}async createCheckout(t){if(!this.identity?.email)throw new n("identity_required","createCheckout requires identity with email");const e=t.idempotencyKey??`auto:${t.priceId}`,s=this.inflightCheckouts.get(e);if(s)return s;const r={"Idempotency-Key":t.idempotencyKey??B()};this.apiKey&&(r["X-Api-Key"]=this.apiKey);const o=this.cachedBootstrap?.settings,d=t.successUrl??o?.success_redirect_url??void 0,u=t.shopUrl??o?.checkout_shop_url??void 0,f=this.api.request(`/api/v1/paywall/${this.paywallId}/start-checkout`,{method:"POST",headers:r,signal:t.signal,body:JSON.stringify({email:this.identity.email,priceId:Number(t.priceId),successUrl:d,errorUrl:t.errorUrl,shopUrl:u,productName:o?.checkout_product_name??void 0,trial_days:t.trialDays,ignoreActivePurchase:t.ignoreActivePurchase?!0:void 0,userMeta:this.identity.userId?{userId:this.identity.userId}:void 0})}).then(h=>({url:h.checkoutUrl,acquiring:h.acquiring})).catch(h=>{throw h instanceof n&&h.status===409&&h.cause&&typeof h.cause=="object"&&h.cause.hasActivePurchase===!0?new n("already_purchased","You already have an active subscription",{status:409,cause:h.cause}):h});return this.inflightCheckouts.set(e,f),f.finally(()=>{this.inflightCheckouts.get(e)===f&&this.inflightCheckouts.delete(e)}).catch(()=>{}),f}async getCustomerPortalUrl(t={}){if(!this.auth&&!this.apiKey&&!this.identity?.email)throw new n("identity_required","getCustomerPortalUrl requires auth, apiKey, or identity.email");const e={};this.apiKey&&(e["X-Api-Key"]=this.apiKey);const s=this.auth&&this.auth.getCachedSession()?{}:{email:this.identity?.email,userMeta:this.identity?.userId?{userId:this.identity.userId}:void 0};return{url:(await this.api.request(`/api/v1/paywall/${this.paywallId}/get-customer-portal`,{method:"POST",headers:Object.keys(e).length?e:void 0,body:JSON.stringify(s),signal:t.signal})).url}}async listPurchases(t={}){if(!this.auth)throw new n("auth_required","listPurchases requires AuthClient (Bearer auth)");return(await this.api.request(`/api/v1/paywall/${this.paywallId}/user`,{method:"GET",signal:t.signal})).purchases??[]}async cancelSubscription(t){if(!this.auth)throw new n("auth_required","cancelSubscription requires AuthClient (Bearer auth)");return this.api.request("/api/paywall/cancel-subscription",{method:"POST",body:JSON.stringify({subscriptionId:t.subscriptionId,paywallId:this.paywallId,cancellationReason:t.reason}),signal:t.signal})}async createSupportTicket(t){const e=t.email??this.identity?.email??null,s=`/api/v1/paywall/${this.paywallId}/support/ticket`;if(!!t.files&&t.files.length>0){const r=new FormData;r.set("subject",t.subject),r.set("content",t.content),e&&r.set("customer_email",e);for(const o of t.files)r.append("files",o);return this.api.request(s,{method:"POST",body:r})}return this.api.request(s,{method:"POST",body:JSON.stringify({subject:t.subject,content:t.content,customer_email:e})})}}function k(i){return{email:i.email,userId:i.id}}function Y(i,t){return i===t?!0:!i||!t?!1:i.email===t.email&&i.userId===t.userId&&i.anonymousId===t.anonymousId}function E(i){if(!i)return null;const t=i.trim();if(!t)return null;try{return new URL(t.includes("://")?t:`https://${t}`).origin}catch{return null}}function Z(i,t){const e=E(i);if(!(!e||E(t)===e))throw new n("invalid_config",`apiOrigin mismatch: SDK initialized with "${t}" but paywall is configured with custom_domain "${i}". Use the custom_domain from the platform paywall settings.`)}function L(i,t){return{type:"modal",blocks:[{type:"heading",text:i.name||"Upgrade",level:1},{type:"price_grid",priceIds:t.map(e=>e.id)},{type:"cta_button",action:"checkout"},{type:"guarantee_badge"},{type:"current_session"}]}}function R(i){const t=i.locales;if(!t)return null;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 s=i.settings.locale_default;s&&e.push(s);for(const a of e)if(a&&Object.prototype.hasOwnProperty.call(t,a))return a;return null}function m(i){const t=R(i);if(!t)return;const e=i.locales?.[t];e&&(e.layout&&(i.layout=e.layout),e.prices&&(i.prices=i.prices.map(s=>{const a=e.prices?.[s.id];if(!a)return s;const r={...s};return"label"in a&&(r.label=a.label??null),"description"in a&&(r.description=a.description??null),r})))}function D(i){const t=new Uint8Array(i),e=typeof globalThis<"u"?globalThis.crypto:void 0;if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let s=0;s<i;s++)t[s]=Math.floor(Math.random()*256);return t}function A(i){let t="";for(let e=0;e<i.length;e++)t+=String.fromCharCode(i[e]);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function tt(){return A(D(64))}async function et(i){const t=new TextEncoder().encode(i),e=globalThis.crypto;if(!e?.subtle?.digest)throw new Error("crypto.subtle is required for PKCE");const s=await e.subtle.digest("SHA-256",t);return A(new Uint8Array(s))}function st(){return A(D(16))}const it=6e4,at=600*1e3;class rt{constructor(t){if(this.session=null,this.inflightRefresh=null,this.inflightAnonSignin=null,this.listeners=new Set,this.storageUnwatch=null,this.destroyed=!1,this.oauthFlows=new Map,!t.paywallId)throw new n("invalid_config","paywallId is required");if(!t.apiOrigin)throw new n("invalid_config","apiOrigin is required. Pass the paywall custom_domain configured in the platform.");this.paywallId=t.paywallId,this.apiOrigin=t.apiOrigin,this.storage=_(t.storage),this.api=new b({apiOrigin:this.apiOrigin,paywallId:t.paywallId,fetch:t.fetch}),this.openPopup=t.openPopup??((e,s)=>typeof window>"u"?null:window.open(e,s,"width=480,height=640,popup=yes")),this.hydrated=this.hydrate(),this.startStorageWatch()}startStorageWatch(){typeof this.storage.watch=="function"&&(this.storageUnwatch=this.storage.watch(this.storageKey(),t=>{this.applyExternalSession(t)}))}async applyExternalSession(t){if(!this.destroyed&&(await this.hydrated,!this.destroyed)){if(t==null){this.session&&this.setSession(null,{skipPersist:!0,event:"SIGNED_OUT"});return}try{const e=JSON.parse(t);if(!e||typeof e.access_token!="string"||typeof e.refresh_token!="string"||typeof e.expires_at!="number"||!e.user)return;const s=!this.session||this.session.user.id!==e.user.id?"SIGNED_IN":"TOKEN_REFRESHED";this.setSession(e,{skipPersist:!0,event:s})}catch{}}}ready(){return this.hydrated}getCachedSession(){return this.session}getCachedUser(){return this.session?.user??null}async getAccessToken(){if(await this.hydrated,!this.session&&(await this.rehydrateFromStorage(),!this.session))return null;if(this.isFresh(this.session))return this.session.access_token;try{return(await this.refresh())?.access_token??null}catch{return this.session?.access_token??null}}async signInWithEmail(t){await this.hydrated;const e=await this.readVisitorId(),s={};t.idempotencyKey&&(s["Idempotency-Key"]=t.idempotencyKey);const a=await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/email/signin`,{method:"POST",headers:Object.keys(s).length?s:void 0,body:JSON.stringify({email:t.email,password:t.password,visitor_id:e,user_meta:t.userMeta})}),r=this.toSession(a,a.user);return this.setSession(r,{event:"SIGNED_IN"}),this.recordLastLogin("email",t.email),r}async signUp(t){await this.hydrated;const e=await this.readVisitorId(),s={};t.idempotencyKey&&(s["Idempotency-Key"]=t.idempotencyKey);const a=await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/email/signup`,{method:"POST",headers:Object.keys(s).length?s:void 0,body:JSON.stringify({email:t.email,password:t.password,visitor_id:e,user_meta:t.userMeta})});if(a.status==="confirmation_required")return this.recordLastLogin("email",t.email),{kind:"confirmation_required",user:a.user};const r=this.toSession(a,a.user);return this.setSession(r,{event:"SIGNED_IN"}),this.recordLastLogin("email",t.email),{kind:"signed_in",session:r}}async resendConfirmation(t){await this.hydrated;const e={};t.idempotencyKey&&(e["Idempotency-Key"]=t.idempotencyKey),await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/email/resend`,{method:"POST",headers:Object.keys(e).length?e:void 0,body:JSON.stringify({email:t.email})})}async sendOtp(t){await this.hydrated,await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/otp/send`,{method:"POST",body:JSON.stringify({email:t.email,create_user:t.createUser??!0,user_meta:t.userMeta})})}async verifyOtp(t){await this.hydrated;const e=await this.readVisitorId(),s=await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/otp/verify`,{method:"POST",body:JSON.stringify({email:t.email,token:t.token,type:t.type??"email",visitor_id:e,user_meta:t.userMeta})}),a=this.toSession(s,s.user),r=t.type==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN";return this.setSession(a,{event:r}),a}async requestPasswordReset(t){await this.hydrated,await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/password/request-reset`,{method:"POST",body:JSON.stringify({email:t.email})})}async updatePassword(t){await this.hydrated;const e=await this.getAccessToken();if(!e)throw new n("not_authenticated","no active session");await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/password/update`,{method:"POST",headers:{Authorization:`Bearer ${e}`},body:JSON.stringify({password:t.password})})}async signInAnonymously(t={}){if(this.inflightAnonSignin)return this.inflightAnonSignin;this.inflightAnonSignin=(async()=>{if(await this.hydrated,!t.forceCaptcha&&this.session?.user.is_anonymous===!0)return this.session;if(!t.forceCaptcha){const o=await this.resumeAnonymous();if(o)return o}const e=await this.readVisitorId(),s=await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/anonymous/signin`,{method:"POST",body:JSON.stringify({...t.captchaToken?{captcha_token:t.captchaToken}:{},visitor_id:e,user_meta:t.userMeta})}),a={...s.user,email:s.user.email??null,is_anonymous:!0},r=this.toSession(s,a);return this.setSession(r,{event:"SIGNED_IN"}),await this.writeAnonRefreshToken(r.refresh_token),r})();try{return await this.inflightAnonSignin}finally{this.inflightAnonSignin=null}}async resumeAnonymous(){const t=await this.readAnonRefreshToken();if(!t)return null;try{const e=await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/refresh`,{method:"POST",body:JSON.stringify({refresh_token:t})}),s=this.session?.user.is_anonymous===!0?this.session.user:{id:"",email:null,is_anonymous:!0},a=this.toSession(e,s);return this.setSession(a,{event:"SIGNED_IN"}),await this.writeAnonRefreshToken(a.refresh_token),a}catch(e){if(e instanceof n&&e.status===401)return await this.clearAnonRefreshToken(),null;throw e}}async upgradeAnonymousToEmail(t){await this.hydrated;const e=await this.getAccessToken();if(!e)throw new n("not_authenticated","no active session");const s={Authorization:`Bearer ${e}`};t.idempotencyKey&&(s["Idempotency-Key"]=t.idempotencyKey);const a=await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/anonymous/upgrade`,{method:"POST",headers:s,body:JSON.stringify({email:t.email,password:t.password,user_meta:t.userMeta})});if(a.status==="confirmation_required")return{kind:"confirmation_required",email:a.email};const r=this.session;if(!r)throw new n("not_authenticated","session disappeared during upgrade");const o={...r.user,id:a.user.id,email:a.user.email,is_anonymous:a.user.is_anonymous??!1},d={...r,user:o};return this.setSession(d,{event:"USER_UPDATED"}),await this.clearAnonRefreshToken(),{kind:"updated",session:d}}async signInWithOAuth(t){if(typeof window>"u")throw new n("oauth_unavailable","window is required for OAuth");const{authorize_url:e,state:s}=await this.startOAuthFlow({provider:t.provider,scopes:t.scopes,userMeta:t.userMeta}),a=this.openPopup(e,`pw-oauth-${s}`);if(!a)throw this.oauthFlows.delete(s),new n("popup_blocked","browser blocked auth popup — call from a user gesture");t.onPopupOpened?.();const r=await ht(a,s);if(this.destroyed)throw this.oauthFlows.delete(s),new n("aborted","AuthClient destroyed mid-flow");return this.completeOAuthFlow({state:s,code:r})}async startOAuthFlow(t){await this.hydrated,this.gcOAuthFlows();const e=tt(),s=await et(e),a=st(),r={},o=await this.getAccessToken().catch(()=>null);o&&(r.Authorization=`Bearer ${o}`);const{authorize_url:d}=await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/oauth/init`,{method:"POST",headers:Object.keys(r).length?r:void 0,body:JSON.stringify({provider:t.provider,code_challenge:s,code_challenge_method:"s256",scopes:t.scopes})});return this.oauthFlows.set(a,{verifier:e,userMeta:t.userMeta,provider:t.provider,startedAt:Date.now()}),this.recordLastLoginMethod(t.provider),{authorize_url:d,state:a}}async completeOAuthFlow(t){await this.hydrated;const e=this.oauthFlows.get(t.state);if(!e)throw new n("oauth_invalid_state","OAuth flow not found — start with startOAuthFlow first or check TTL");this.oauthFlows.delete(t.state);const s=await this.readVisitorId(),a=await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/oauth/exchange`,{method:"POST",body:JSON.stringify({auth_code:t.code,code_verifier:e.verifier,visitor_id:s,user_meta:e.userMeta})});if(this.destroyed)throw new n("aborted","AuthClient destroyed mid-flow");const r=this.toSession(a,a.user);return this.setSession(r,{event:"SIGNED_IN"}),r.user.email&&this.recordLastLoginEmail(r.user.email),r}gcOAuthFlows(){const t=Date.now()-at;for(const[e,s]of this.oauthFlows)s.startedAt<t&&this.oauthFlows.delete(e)}async refresh(){if(await this.hydrated,!this.session)return null;if(this.inflightRefresh)return this.inflightRefresh;const t=this.session.refresh_token,e=this.session.user;return this.inflightRefresh=(async()=>{try{const s=await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/refresh`,{method:"POST",body:JSON.stringify({refresh_token:t})}),a=this.toSession(s,e);return this.setSession(a,{event:"TOKEN_REFRESHED"}),e.is_anonymous===!0&&await this.writeAnonRefreshToken(a.refresh_token),a}catch(s){if(s instanceof n&&s.status===401)return e.is_anonymous===!0&&await this.clearAnonRefreshToken(),this.setSession(null,{event:"SIGNED_OUT"}),null;throw s}finally{this.inflightRefresh=null}})(),this.inflightRefresh}async revokeAllSessions(){await this.hydrated;const t=this.session?.access_token;if(!t)throw new n("not_authenticated","no active session");await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/revoke-all`,{method:"POST",headers:{Authorization:`Bearer ${t}`}}),this.setSession(null,{event:"SIGNED_OUT"})}async signOut(t={}){await this.hydrated;const e=this.session?.access_token,s=this.session?.user.is_anonymous===!0;if(this.setSession(null,{event:"SIGNED_OUT"}),t.forgetAnonymous&&await this.clearAnonRefreshToken(),!!e&&!(s&&!t.forgetAnonymous))try{await this.api.request(`/api/v1/paywall/${this.paywallId}/auth/signout`,{method:"POST",headers:{Authorization:`Bearer ${e}`}})}catch{}}onAuthChange(t){return this.listeners.add(t),this.hydrated.then(()=>{if(this.destroyed||!this.listeners.has(t))return;const e=this.session;try{t("INITIAL_SESSION",e)}catch(s){console.warn("[paywall] onAuthChange INITIAL_SESSION threw",s)}}),()=>{this.listeners.delete(t)}}isFresh(t){return t.expires_at-Date.now()>it}toSession(t,e){const s=t.expires_at!=null?t.expires_at*1e3:Date.now()+t.expires_in*1e3;return{access_token:t.access_token,refresh_token:t.refresh_token,expires_at:s,user:e}}setSession(t,e){if(this.destroyed)return;const s=this.session;this.session=t,e.skipPersist||this.persist(),lt(s,t)||this.emit(e.event)}emit(t){for(const e of this.listeners)try{e(t,this.session)}catch(s){console.warn("[paywall] onAuthChange listener threw",s)}}storageKey(){return l.authSession(this.paywallId)}async hydrate(){try{const t=await this.storage.getItem(this.storageKey());if(!t)return;const e=JSON.parse(t);if(!e||typeof e.access_token!="string"||typeof e.refresh_token!="string"||typeof e.expires_at!="number"||!e.user)return;this.session=e}catch{}}async rehydrateFromStorage(){try{const t=await this.storage.getItem(this.storageKey());if(!t)return;const e=JSON.parse(t);if(!e||typeof e.access_token!="string"||typeof e.refresh_token!="string"||typeof e.expires_at!="number"||!e.user)return;this.setSession(e,{skipPersist:!0,event:"SIGNED_IN"})}catch{}}destroy(){this.destroyed=!0,this.storageUnwatch&&(this.storageUnwatch(),this.storageUnwatch=null),this.listeners.clear(),this.inflightRefresh=null}isDestroyed(){return this.destroyed}async persist(){try{this.session?await this.storage.setItem(this.storageKey(),JSON.stringify(this.session)):await this.storage.removeItem(this.storageKey())}catch{}}async readAnonRefreshToken(){try{const t=await this.storage.getItem(l.anonRefreshToken(this.paywallId));return typeof t=="string"&&t.length>0?t:null}catch{return null}}async writeAnonRefreshToken(t){try{await this.storage.setItem(l.anonRefreshToken(this.paywallId),t)}catch{}}async clearAnonRefreshToken(){try{await this.storage.removeItem(l.anonRefreshToken(this.paywallId))}catch{}}async getLastLogin(){try{const[t,e]=await Promise.all([this.storage.getItem(l.lastLoginMethod(this.paywallId)),this.storage.getItem(l.lastLoginEmail(this.paywallId))]);return!t||!ct(t)?null:{method:t,email:typeof e=="string"&&e?e:null}}catch{return null}}recordLastLogin(t,e){this.recordLastLoginMethod(t),e&&this.recordLastLoginEmail(e)}recordLastLoginMethod(t){this.storage.setItem(l.lastLoginMethod(this.paywallId),t).catch(()=>{})}recordLastLoginEmail(t){this.storage.setItem(l.lastLoginEmail(this.paywallId),t).catch(()=>{})}async readVisitorId(){try{const t=await this.storage.getItem(l.visitorId);return typeof t=="string"&&t.length>=16?t:void 0}catch{return}}}const nt=5*6e4,ot=500;function ht(i,t){return new Promise((e,s)=>{let a=!1;const r=()=>{a=!0,window.removeEventListener("message",o),clearInterval(d),clearTimeout(u)},o=f=>{if(a)return;const h=f.data;if(!(!h||h.type!=="pw-oauth")&&h.messageId===t){if(h.status==="success"&&h.code){r();try{i.close()}catch{}e(h.code)}else if(h.status==="error"){r();try{i.close()}catch{}s(new n("oauth_failed",h.description||h.error||"OAuth provider returned error"))}}},d=setInterval(()=>{if(a)return;let f;try{f=i.closed}catch{return}f&&(r(),s(new n("oauth_cancelled","auth popup was closed")))},ot),u=setTimeout(()=>{if(!a){r();try{i.close()}catch{}s(new n("oauth_timeout","OAuth flow timed out"))}},nt);window.addEventListener("message",o)})}function ct(i){return i==="google"||i==="apple"||i==="github"||i==="facebook"||i==="email"}function lt(i,t){return i===t?!0:!i||!t?!1:i.access_token===t.access_token&&i.refresh_token===t.refresh_token&&i.expires_at===t.expires_at&&i.user.id===t.user.id&&i.user.email===t.user.email}const ut=1500,dt=20,C=200;class ft{constructor(t){this.buffer=[],this.flushTimer=null,this.destroyed=!1,this.unloadHandler=null,this.visibilityHandler=null,this.opts=t,this.isEnabled()&&this.attachUnloadHandlers()}isEnabled(){return this.opts.enabled!==!1}track(t,e){if(this.destroyed||!this.isEnabled()||typeof t!="string"||t.length===0)return;this.buffer.push({type:t,ts:Date.now(),props:e});const s=this.opts.maxBufferSize??dt;if(this.buffer.length>=s){this.flush();return}this.buffer.length>C&&(this.buffer=this.buffer.slice(-C)),this.scheduleFlush()}scheduleFlush(){if(this.flushTimer||this.destroyed)return;const t=this.opts.flushIntervalMs??ut;this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},t)}async flush(){if(this.buffer.length===0)return;this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null);const t=this.buffer;this.buffer=[];try{const e=await this.opts.getVisitorId(),s=this.opts.getUserId?.()??null,a=JSON.stringify({events:t}),r=this.opts.fetch??(typeof fetch<"u"?fetch:void 0);if(!r)return;await r(this.opts.endpoint,{method:"POST",credentials:"omit",keepalive:!0,headers:this.buildHeaders(e,s),body:a})}catch{}}flushBeacon(){if(this.buffer.length===0)return;const t=this.buffer;this.buffer=[];const e=this.opts.getCachedVisitorId?.()??null,s=this.opts.getUserId?.()??null;if(!e){this.buffer.unshift(...t),this.flush();return}const a=JSON.stringify({events:t,visitor_id:e,user_id:s,sdk_version:g,paywall_id:this.opts.paywallId,capabilities:this.opts.capabilities?.join(",")??""}),r=this.opts.sendBeacon??(typeof navigator<"u"&&typeof navigator.sendBeacon=="function"?navigator.sendBeacon.bind(navigator):null);if(!r){this.buffer.unshift(...t),this.flush();return}try{r(this.opts.endpoint,a)||(this.buffer.unshift(...t),this.flush())}catch{this.buffer.unshift(...t),this.flush()}}buildHeaders(t,e){const s={"Content-Type":"application/json","X-SDK-Version":g,"X-Paywall-Id":this.opts.paywallId,"X-Visitor-Id":t};return this.opts.capabilities?.length&&(s["X-SDK-Capabilities"]=this.opts.capabilities.join(",")),e&&(s["X-User-Id"]=e),s}attachUnloadHandlers(){typeof window>"u"||(this.unloadHandler=()=>this.flushBeacon(),this.visibilityHandler=()=>{typeof document<"u"&&document.visibilityState==="hidden"&&this.flushBeacon()},window.addEventListener("pagehide",this.unloadHandler),typeof document<"u"&&document.addEventListener("visibilitychange",this.visibilityHandler))}detachUnloadHandlers(){typeof window>"u"||(this.unloadHandler&&window.removeEventListener("pagehide",this.unloadHandler),this.visibilityHandler&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.visibilityHandler),this.unloadHandler=null,this.visibilityHandler=null)}destroy(){this.destroyed||(this.destroyed=!0,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.flush(),this.detachUnloadHandlers())}}exports.ApiClient=b;exports.ApiGatewayClient=P;exports.AuthClient=rt;exports.BillingClient=W;exports.EventTracker=ft;exports.PaywallError=n;exports.QuotaExceededError=N;exports.SDK_VERSION=g;exports.STORAGE_KEYS=l;exports.createStorage=_;exports.ensureVisitorId=I;exports.generateVisitorId=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CzDSBl4d.js");exports.ApiClient=e.ApiClient;exports.ApiGatewayClient=e.ApiGatewayClient;exports.AuthClient=e.AuthClient;exports.BillingClient=e.BillingClient;exports.EventTracker=e.EventTracker;exports.PaywallError=e.PaywallError;exports.QuotaExceededError=e.QuotaExceededError;exports.SDK_VERSION=e.SDK_VERSION;exports.STORAGE_KEYS=e.STORAGE_KEYS;exports.createStorage=e.createStorage;exports.ensureVisitorId=e.ensureVisitorId;exports.findApplicableOffer=e.findApplicableOffer;exports.generateVisitorId=e.generateVisitorId;exports.offerStartStorageKey=e.offerStartStorageKey;exports.readBrowserOfferStart=e.readBrowserOfferStart;exports.resolveOffer=e.resolveOffer;
2
2
  //# sourceMappingURL=core.cjs.map