@monetize.software/sdk-extension 3.0.0-alpha.5 → 3.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/ar-BUQInJ5a.js +2 -0
- package/dist/chunks/ar-BUQInJ5a.js.map +1 -0
- package/dist/chunks/ar-nh4l4WDE.js +125 -0
- package/dist/chunks/ar-nh4l4WDE.js.map +1 -0
- package/dist/chunks/{chrome-port-rPi6zrjD.js → chrome-port-CxW3Pwc2.js} +145 -107
- package/dist/chunks/chrome-port-CxW3Pwc2.js.map +1 -0
- package/dist/chunks/chrome-port-PhlW29BV.js +2 -0
- package/dist/chunks/chrome-port-PhlW29BV.js.map +1 -0
- package/dist/chunks/cs-2UYO2rWf.js +121 -0
- package/dist/chunks/cs-2UYO2rWf.js.map +1 -0
- package/dist/chunks/cs-i5K4KTFV.js +2 -0
- package/dist/chunks/cs-i5K4KTFV.js.map +1 -0
- package/dist/chunks/da-BD0O_HfV.js +121 -0
- package/dist/chunks/da-BD0O_HfV.js.map +1 -0
- package/dist/chunks/da-CZbhtVJO.js +2 -0
- package/dist/chunks/da-CZbhtVJO.js.map +1 -0
- package/dist/chunks/de-Bc-GoLgC.js +2 -0
- package/dist/chunks/de-Bc-GoLgC.js.map +1 -0
- package/dist/chunks/de-BkCiXPsn.js +139 -0
- package/dist/chunks/de-BkCiXPsn.js.map +1 -0
- package/dist/chunks/el-CcMEbl_F.js +2 -0
- package/dist/chunks/el-CcMEbl_F.js.map +1 -0
- package/dist/chunks/el-cIcxTp07.js +125 -0
- package/dist/chunks/el-cIcxTp07.js.map +1 -0
- package/dist/chunks/es-BvYmomAz.js +2 -0
- package/dist/chunks/es-BvYmomAz.js.map +1 -0
- package/dist/chunks/es-CJBC_jrV.js +139 -0
- package/dist/chunks/es-CJBC_jrV.js.map +1 -0
- package/dist/chunks/fi-DyV7ynBf.js +121 -0
- package/dist/chunks/fi-DyV7ynBf.js.map +1 -0
- package/dist/chunks/fi-aZR-qmZN.js +2 -0
- package/dist/chunks/fi-aZR-qmZN.js.map +1 -0
- package/dist/chunks/fr-BLQ4AIu7.js +139 -0
- package/dist/chunks/fr-BLQ4AIu7.js.map +1 -0
- package/dist/chunks/fr-BgbFAgHx.js +2 -0
- package/dist/chunks/fr-BgbFAgHx.js.map +1 -0
- package/dist/chunks/he-Bg-Bqi7r.js +125 -0
- package/dist/chunks/he-Bg-Bqi7r.js.map +1 -0
- package/dist/chunks/he-CQ4yCuja.js +2 -0
- package/dist/chunks/he-CQ4yCuja.js.map +1 -0
- package/dist/chunks/hi-DtUsj1c-.js +2 -0
- package/dist/chunks/hi-DtUsj1c-.js.map +1 -0
- package/dist/chunks/hi-wQeE43oY.js +125 -0
- package/dist/chunks/hi-wQeE43oY.js.map +1 -0
- package/dist/chunks/hu-D9qxzu0r.js +121 -0
- package/dist/chunks/hu-D9qxzu0r.js.map +1 -0
- package/dist/chunks/hu-DXtscQ8_.js +2 -0
- package/dist/chunks/hu-DXtscQ8_.js.map +1 -0
- package/dist/chunks/id-BByOYpeo.js +2 -0
- package/dist/chunks/id-BByOYpeo.js.map +1 -0
- package/dist/chunks/id-Rx_wYvqy.js +121 -0
- package/dist/chunks/id-Rx_wYvqy.js.map +1 -0
- package/dist/chunks/it-52Ip42pa.js +2 -0
- package/dist/chunks/it-52Ip42pa.js.map +1 -0
- package/dist/chunks/it-B1SRPZ3e.js +139 -0
- package/dist/chunks/it-B1SRPZ3e.js.map +1 -0
- package/dist/chunks/ja-CMC3Parn.js +2 -0
- package/dist/chunks/ja-CMC3Parn.js.map +1 -0
- package/dist/chunks/ja-DiItm8te.js +143 -0
- package/dist/chunks/ja-DiItm8te.js.map +1 -0
- package/dist/chunks/ko-3qY21q40.js +2 -0
- package/dist/chunks/ko-3qY21q40.js.map +1 -0
- package/dist/chunks/ko-CdGFWAKX.js +143 -0
- package/dist/chunks/ko-CdGFWAKX.js.map +1 -0
- package/dist/chunks/nl-Borc5nw1.js +2 -0
- package/dist/chunks/nl-Borc5nw1.js.map +1 -0
- package/dist/chunks/nl-CmZ3vEvj.js +139 -0
- package/dist/chunks/nl-CmZ3vEvj.js.map +1 -0
- package/dist/chunks/no-BuxByZpq.js +121 -0
- package/dist/chunks/no-BuxByZpq.js.map +1 -0
- package/dist/chunks/no-Do2iGedg.js +2 -0
- package/dist/chunks/no-Do2iGedg.js.map +1 -0
- package/dist/chunks/pl-jZFCnDb8.js +121 -0
- package/dist/chunks/pl-jZFCnDb8.js.map +1 -0
- package/dist/chunks/pl-mRaky_7k.js +2 -0
- package/dist/chunks/pl-mRaky_7k.js.map +1 -0
- package/dist/chunks/pt-Cld7MwIW.js +139 -0
- package/dist/chunks/pt-Cld7MwIW.js.map +1 -0
- package/dist/chunks/pt-DilDTXfs.js +2 -0
- package/dist/chunks/pt-DilDTXfs.js.map +1 -0
- package/dist/chunks/ro-CuKDqj3C.js +121 -0
- package/dist/chunks/ro-CuKDqj3C.js.map +1 -0
- package/dist/chunks/ro-DF2uzPIB.js +2 -0
- package/dist/chunks/ro-DF2uzPIB.js.map +1 -0
- package/dist/chunks/ru-B7cjqJUm.js +135 -0
- package/dist/chunks/ru-B7cjqJUm.js.map +1 -0
- package/dist/chunks/ru-YeaXnTO-.js +2 -0
- package/dist/chunks/ru-YeaXnTO-.js.map +1 -0
- package/dist/chunks/sv-2pHEvuSe.js +2 -0
- package/dist/chunks/sv-2pHEvuSe.js.map +1 -0
- package/dist/chunks/sv-D9y-M1Fo.js +121 -0
- package/dist/chunks/sv-D9y-M1Fo.js.map +1 -0
- package/dist/chunks/th-D9umBjEy.js +125 -0
- package/dist/chunks/th-D9umBjEy.js.map +1 -0
- package/dist/chunks/th-u2QSDF0G.js +2 -0
- package/dist/chunks/th-u2QSDF0G.js.map +1 -0
- package/dist/chunks/tr-BddMywiw.js +121 -0
- package/dist/chunks/tr-BddMywiw.js.map +1 -0
- package/dist/chunks/tr-Bhgm6_ti.js +2 -0
- package/dist/chunks/tr-Bhgm6_ti.js.map +1 -0
- package/dist/chunks/uk-7vwqsaVK.js +2 -0
- package/dist/chunks/uk-7vwqsaVK.js.map +1 -0
- package/dist/chunks/uk-Dbd31hFt.js +135 -0
- package/dist/chunks/uk-Dbd31hFt.js.map +1 -0
- package/dist/chunks/vi-CJefLP_g.js +2 -0
- package/dist/chunks/vi-CJefLP_g.js.map +1 -0
- package/dist/chunks/vi-Do3BMOdh.js +121 -0
- package/dist/chunks/vi-Do3BMOdh.js.map +1 -0
- package/dist/chunks/zh-D5C3BzYL.js +2 -0
- package/dist/chunks/zh-D5C3BzYL.js.map +1 -0
- package/dist/chunks/zh-gQSYLZI3.js +143 -0
- package/dist/chunks/zh-gQSYLZI3.js.map +1 -0
- package/dist/content/RemoteAuthClient.d.ts +5 -1
- package/dist/content/RemoteAuthClient.d.ts.map +1 -1
- package/dist/content/RemoteAuthClient.test-d.d.ts +2 -0
- package/dist/content/RemoteAuthClient.test-d.d.ts.map +1 -0
- package/dist/content/RemoteBillingClient.d.ts +29 -0
- package/dist/content/RemoteBillingClient.d.ts.map +1 -1
- package/dist/content/RemoteBillingClient.test-d.d.ts +2 -0
- package/dist/content/RemoteBillingClient.test-d.d.ts.map +1 -0
- package/dist/content.cjs +3 -3
- package/dist/content.cjs.map +1 -1
- package/dist/content.js +1977 -949
- package/dist/content.js.map +1 -1
- package/dist/offscreen/server.d.ts.map +1 -1
- package/dist/offscreen.cjs +1 -1
- package/dist/offscreen.cjs.map +1 -1
- package/dist/offscreen.js +5 -2
- package/dist/offscreen.js.map +1 -1
- package/dist/shared/messages.d.ts +21 -1
- package/dist/shared/messages.d.ts.map +1 -1
- package/dist/shared/protocol.d.ts +1 -1
- package/dist/shared/protocol.d.ts.map +1 -1
- package/package.json +7 -6
- package/dist/chunks/chrome-port-rPi6zrjD.js.map +0 -1
- package/dist/chunks/chrome-port-vdrVaWql.js +0 -2
- package/dist/chunks/chrome-port-vdrVaWql.js.map +0 -1
package/dist/content.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import { render as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { P as
|
|
6
|
-
const ie = '@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --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-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --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-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --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 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--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:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--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:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}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{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}: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: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,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-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]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@source "../**/*.{ts,tsx,js,jsx}";@layer base{:host{all:initial;color-scheme:light;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}.pw-cta-shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35) 50%,transparent);animation:pw-cta-shimmer 3s infinite;z-index:1}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}';
|
|
7
|
-
let
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
1
|
+
import { P as j, B as Re, E as ze, c as De, A as ue, w as qe, a as K, r as Ne, b as Fe } from "./chunks/chrome-port-CxW3Pwc2.js";
|
|
2
|
+
import { render as X, h as de, createContext as Ve } from "preact";
|
|
3
|
+
import { jsx as o, jsxs as c, Fragment as Y } from "preact/jsx-runtime";
|
|
4
|
+
import { useState as x, useEffect as T, useContext as $e, useRef as z, useMemo as _e, useLayoutEffect as He } from "preact/hooks";
|
|
5
|
+
import { P as Ge } from "./chunks/port-name-BPfQKtdb.js";
|
|
6
|
+
const Se = '@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --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-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --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-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --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 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--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:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--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:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}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{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}: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: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,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-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]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@source "../**/*.{ts,tsx,js,jsx}";@layer base{:host{all:initial;color-scheme:light;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}*,*:before,*:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}.pw-cta-shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35) 50%,transparent);animation:pw-cta-shimmer 3s infinite;z-index:1}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}';
|
|
7
|
+
let he = !1;
|
|
8
|
+
function We() {
|
|
9
|
+
if (he || (he = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
|
|
10
10
|
let r;
|
|
11
11
|
try {
|
|
12
12
|
const e = new CSSStyleSheet();
|
|
13
|
-
e.replaceSync(
|
|
13
|
+
e.replaceSync(Se), r = e.cssRules;
|
|
14
14
|
} catch {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
@@ -28,10 +28,10 @@ function fe() {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ze(r, e, t = {}) {
|
|
32
32
|
if (typeof document > "u")
|
|
33
33
|
throw new Error("mountShadow called in non-DOM environment");
|
|
34
|
-
|
|
34
|
+
We();
|
|
35
35
|
const n = t.host ?? document.createElement("div");
|
|
36
36
|
n.setAttribute("data-paywall-host", ""), n.style.cssText = t.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;", !n.isConnected && !t.inline && document.body.appendChild(n);
|
|
37
37
|
const i = n.attachShadow({ mode: t.shadowMode ?? "closed" }), s = `
|
|
@@ -52,130 +52,229 @@ function ge(r, e, t = {}) {
|
|
|
52
52
|
cursor: auto !important;
|
|
53
53
|
visibility: visible !important;
|
|
54
54
|
}
|
|
55
|
-
`,
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
return
|
|
55
|
+
`, a = document.createElement("style");
|
|
56
|
+
a.textContent = s + Se + (t.injectCss ?? ""), i.appendChild(a);
|
|
57
|
+
const l = document.createElement("div");
|
|
58
|
+
l.style.pointerEvents = "auto", i.appendChild(l);
|
|
59
|
+
let d = e;
|
|
60
|
+
return X(de(r, d), l), {
|
|
61
61
|
shadowRoot: i,
|
|
62
|
-
update(
|
|
63
|
-
|
|
62
|
+
update(p) {
|
|
63
|
+
d = { ...d, ...p }, X(de(r, d), l);
|
|
64
64
|
},
|
|
65
65
|
unmount() {
|
|
66
|
-
|
|
66
|
+
X(null, l), n.remove();
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
70
|
+
const Ye = (r, e, t) => {
|
|
71
|
+
const n = r[e];
|
|
72
|
+
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, s) => {
|
|
73
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
74
|
+
s.bind(
|
|
75
|
+
null,
|
|
76
|
+
new Error(
|
|
77
|
+
"Unknown variable dynamic import: " + e + (e.split("/").length !== t ? ". Note that variables only represent file names one level deep." : "")
|
|
78
|
+
)
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
}, Ke = [
|
|
83
|
+
"ru",
|
|
84
|
+
"uk",
|
|
85
|
+
"de",
|
|
86
|
+
"es",
|
|
87
|
+
"fr",
|
|
88
|
+
"it",
|
|
89
|
+
"pt",
|
|
90
|
+
"pl",
|
|
91
|
+
"cs",
|
|
92
|
+
"hu",
|
|
93
|
+
"ro",
|
|
94
|
+
"nl",
|
|
95
|
+
"sv",
|
|
96
|
+
"da",
|
|
97
|
+
"no",
|
|
98
|
+
"fi",
|
|
99
|
+
"el",
|
|
100
|
+
"tr",
|
|
101
|
+
"id",
|
|
102
|
+
"ar",
|
|
103
|
+
"ja",
|
|
104
|
+
"ko",
|
|
105
|
+
"zh",
|
|
106
|
+
"hi",
|
|
107
|
+
"th",
|
|
108
|
+
"vi",
|
|
109
|
+
"he"
|
|
110
|
+
], Ce = (r, e, t) => Le(e, t), Ie = Ve({ t: Ce, locale: "en" });
|
|
111
|
+
function Le(r, e) {
|
|
112
|
+
if (!e) return r;
|
|
113
|
+
let t = r;
|
|
114
|
+
for (const [n, i] of Object.entries(e))
|
|
115
|
+
t = t.split(`{${n}}`).join(String(i));
|
|
116
|
+
return t;
|
|
117
|
+
}
|
|
118
|
+
const J = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map();
|
|
119
|
+
function Ae(r) {
|
|
120
|
+
return Ke.includes(r);
|
|
121
|
+
}
|
|
122
|
+
function Xe(r) {
|
|
123
|
+
const e = [];
|
|
124
|
+
if (typeof navigator < "u" && navigator.language) {
|
|
125
|
+
e.push(navigator.language);
|
|
126
|
+
const n = navigator.language.split("-")[0];
|
|
127
|
+
n && n !== navigator.language && e.push(n);
|
|
128
|
+
}
|
|
129
|
+
const t = r.settings.locale_default;
|
|
130
|
+
if (t) {
|
|
131
|
+
e.push(t);
|
|
132
|
+
const n = t.split("-")[0];
|
|
133
|
+
n && n !== t && e.push(n);
|
|
134
|
+
}
|
|
135
|
+
for (const n of e)
|
|
136
|
+
if (Ae(n)) return n;
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
function Je(r) {
|
|
140
|
+
return !!r.locales && Object.keys(r.locales).length > 0;
|
|
141
|
+
}
|
|
142
|
+
async function Qe(r) {
|
|
143
|
+
const e = J.get(r);
|
|
144
|
+
if (e) return e;
|
|
145
|
+
const t = Q.get(r);
|
|
146
|
+
if (t) return t;
|
|
147
|
+
const n = Ye(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./chunks/ar-nh4l4WDE.js"), "./locales/cs.ts": () => import("./chunks/cs-2UYO2rWf.js"), "./locales/da.ts": () => import("./chunks/da-BD0O_HfV.js"), "./locales/de.ts": () => import("./chunks/de-BkCiXPsn.js"), "./locales/el.ts": () => import("./chunks/el-cIcxTp07.js"), "./locales/es.ts": () => import("./chunks/es-CJBC_jrV.js"), "./locales/fi.ts": () => import("./chunks/fi-DyV7ynBf.js"), "./locales/fr.ts": () => import("./chunks/fr-BLQ4AIu7.js"), "./locales/he.ts": () => import("./chunks/he-Bg-Bqi7r.js"), "./locales/hi.ts": () => import("./chunks/hi-wQeE43oY.js"), "./locales/hu.ts": () => import("./chunks/hu-D9qxzu0r.js"), "./locales/id.ts": () => import("./chunks/id-Rx_wYvqy.js"), "./locales/it.ts": () => import("./chunks/it-B1SRPZ3e.js"), "./locales/ja.ts": () => import("./chunks/ja-DiItm8te.js"), "./locales/ko.ts": () => import("./chunks/ko-CdGFWAKX.js"), "./locales/nl.ts": () => import("./chunks/nl-CmZ3vEvj.js"), "./locales/no.ts": () => import("./chunks/no-BuxByZpq.js"), "./locales/pl.ts": () => import("./chunks/pl-jZFCnDb8.js"), "./locales/pt.ts": () => import("./chunks/pt-Cld7MwIW.js"), "./locales/ro.ts": () => import("./chunks/ro-CuKDqj3C.js"), "./locales/ru.ts": () => import("./chunks/ru-B7cjqJUm.js"), "./locales/sv.ts": () => import("./chunks/sv-D9y-M1Fo.js"), "./locales/th.ts": () => import("./chunks/th-D9umBjEy.js"), "./locales/tr.ts": () => import("./chunks/tr-BddMywiw.js"), "./locales/uk.ts": () => import("./chunks/uk-Dbd31hFt.js"), "./locales/vi.ts": () => import("./chunks/vi-Do3BMOdh.js"), "./locales/zh.ts": () => import("./chunks/zh-gQSYLZI3.js") }), `./locales/${r}.ts`, 3).then((i) => {
|
|
148
|
+
const s = i.default ?? {};
|
|
149
|
+
return J.set(r, s), s;
|
|
150
|
+
}).catch((i) => {
|
|
151
|
+
console.warn(`[paywall] failed to load locale chunk "${r}"`, i);
|
|
152
|
+
const s = {};
|
|
153
|
+
return J.set(r, s), s;
|
|
154
|
+
}).finally(() => {
|
|
155
|
+
Q.delete(r);
|
|
156
|
+
});
|
|
157
|
+
return Q.set(r, n), n;
|
|
158
|
+
}
|
|
159
|
+
function et({ bootstrap: r, forceLocale: e, children: t }) {
|
|
160
|
+
const [n, i] = x("en"), [s, a] = x(null);
|
|
161
|
+
T(() => {
|
|
162
|
+
const p = (e && Ae(e) ? e : null) ?? (!r || !Je(r) ? null : Xe(r));
|
|
163
|
+
if (!p) {
|
|
164
|
+
(s !== null || n !== "en") && (i("en"), a(null));
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (p === n && s) return;
|
|
168
|
+
let u = !1;
|
|
169
|
+
return Qe(p).then((h) => {
|
|
170
|
+
u || (i(p), a(h));
|
|
171
|
+
}), () => {
|
|
172
|
+
u = !0;
|
|
173
|
+
};
|
|
174
|
+
}, [r, e]);
|
|
175
|
+
const l = {
|
|
176
|
+
locale: n,
|
|
177
|
+
t: s ? (d, p, u) => Le(s[d] ?? p, u) : Ce
|
|
178
|
+
};
|
|
179
|
+
return /* @__PURE__ */ o(Ie.Provider, { value: l, children: t });
|
|
180
|
+
}
|
|
181
|
+
function w() {
|
|
182
|
+
return $e(Ie);
|
|
183
|
+
}
|
|
184
|
+
const pe = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
185
|
+
function tt({
|
|
72
186
|
open: r,
|
|
73
187
|
onClose: e,
|
|
74
188
|
labelledBy: t,
|
|
75
189
|
brandColor: n,
|
|
76
|
-
|
|
190
|
+
topBanner: i,
|
|
77
191
|
allowClose: s = !0,
|
|
192
|
+
hideCloseButton: a = !1,
|
|
78
193
|
inline: l = !1,
|
|
79
|
-
children:
|
|
194
|
+
children: d
|
|
80
195
|
}) {
|
|
81
|
-
const
|
|
82
|
-
return
|
|
196
|
+
const { t: p } = w(), u = z(null), h = z(null);
|
|
197
|
+
return T(() => {
|
|
83
198
|
if (!r) return;
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
199
|
+
h.current = document.activeElement ?? null;
|
|
200
|
+
const g = u.current;
|
|
201
|
+
g && (g.querySelector(pe) ?? g).focus({ preventScroll: !0 });
|
|
202
|
+
const A = (k) => {
|
|
203
|
+
if (k.key === "Escape") {
|
|
89
204
|
if (!s) return;
|
|
90
|
-
|
|
205
|
+
k.stopPropagation(), e();
|
|
91
206
|
return;
|
|
92
207
|
}
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
).filter((
|
|
97
|
-
if (
|
|
98
|
-
|
|
208
|
+
if (k.key !== "Tab" || !u.current) return;
|
|
209
|
+
const E = Array.from(
|
|
210
|
+
u.current.querySelectorAll(pe)
|
|
211
|
+
).filter((R) => !R.hasAttribute("disabled") && R.tabIndex !== -1);
|
|
212
|
+
if (E.length === 0) {
|
|
213
|
+
k.preventDefault();
|
|
99
214
|
return;
|
|
100
215
|
}
|
|
101
|
-
const
|
|
102
|
-
|
|
216
|
+
const I = E[0], O = E[E.length - 1], B = document.activeElement;
|
|
217
|
+
k.shiftKey && B === I ? (k.preventDefault(), O.focus()) : !k.shiftKey && B === O && (k.preventDefault(), I.focus());
|
|
103
218
|
};
|
|
104
|
-
document.addEventListener("keydown",
|
|
105
|
-
const
|
|
219
|
+
document.addEventListener("keydown", A, !0);
|
|
220
|
+
const M = document.body.style.overflow;
|
|
106
221
|
return l || (document.body.style.overflow = "hidden"), () => {
|
|
107
|
-
document.removeEventListener("keydown",
|
|
222
|
+
document.removeEventListener("keydown", A, !0), l || (document.body.style.overflow = M), h.current?.focus?.({ preventScroll: !0 });
|
|
108
223
|
};
|
|
109
224
|
}, [r, e, s, l]), r ? /* @__PURE__ */ c(
|
|
110
225
|
"div",
|
|
111
226
|
{
|
|
112
227
|
class: `${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]`,
|
|
113
|
-
onClick: (
|
|
114
|
-
s &&
|
|
228
|
+
onClick: (g) => {
|
|
229
|
+
s && g.target === g.currentTarget && e();
|
|
115
230
|
},
|
|
116
231
|
"data-pw-root": !0,
|
|
117
232
|
children: [
|
|
118
|
-
/* @__PURE__ */ c(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
),
|
|
142
|
-
/* @__PURE__ */ c(
|
|
143
|
-
"div",
|
|
144
|
-
{
|
|
145
|
-
ref: h,
|
|
146
|
-
role: "dialog",
|
|
147
|
-
"aria-modal": "true",
|
|
148
|
-
"aria-labelledby": t,
|
|
149
|
-
tabIndex: -1,
|
|
150
|
-
class: "relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-3xl bg-white outline-none ring-1 ring-black/5",
|
|
151
|
-
style: {
|
|
152
|
-
"--pw-accent": n ?? "#3b82f6",
|
|
153
|
-
boxShadow: "0 1px 2px rgba(15,23,42,0.04), 0 12px 32px -8px rgba(15,23,42,0.18), 0 24px 64px -16px rgba(15,23,42,0.22)"
|
|
154
|
-
},
|
|
155
|
-
children: [
|
|
156
|
-
/* @__PURE__ */ o("div", { class: "flex-1 overflow-y-auto p-8", children: a }),
|
|
157
|
-
s ? /* @__PURE__ */ o(
|
|
158
|
-
"button",
|
|
159
|
-
{
|
|
160
|
-
type: "button",
|
|
161
|
-
onClick: e,
|
|
162
|
-
"aria-label": "Close",
|
|
163
|
-
class: "absolute right-3 top-3 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-400 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
164
|
-
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
165
|
-
"path",
|
|
233
|
+
/* @__PURE__ */ c(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
class: "relative flex w-full max-w-[400px] flex-col animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",
|
|
237
|
+
style: { "--pw-accent": n ?? "#3b82f6" },
|
|
238
|
+
children: [
|
|
239
|
+
i,
|
|
240
|
+
/* @__PURE__ */ c(
|
|
241
|
+
"div",
|
|
242
|
+
{
|
|
243
|
+
ref: u,
|
|
244
|
+
role: "dialog",
|
|
245
|
+
"aria-modal": "true",
|
|
246
|
+
"aria-labelledby": t,
|
|
247
|
+
tabIndex: -1,
|
|
248
|
+
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",
|
|
249
|
+
style: {
|
|
250
|
+
boxShadow: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
|
|
251
|
+
},
|
|
252
|
+
children: [
|
|
253
|
+
d,
|
|
254
|
+
s && !a ? /* @__PURE__ */ o(
|
|
255
|
+
"button",
|
|
166
256
|
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"
|
|
170
|
-
"
|
|
257
|
+
type: "button",
|
|
258
|
+
onClick: e,
|
|
259
|
+
"aria-label": p("modal.close_aria", "Close"),
|
|
260
|
+
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)]",
|
|
261
|
+
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
262
|
+
"path",
|
|
263
|
+
{
|
|
264
|
+
d: "M3 3l10 10M13 3L3 13",
|
|
265
|
+
stroke: "currentColor",
|
|
266
|
+
"stroke-width": "1.75",
|
|
267
|
+
"stroke-linecap": "round"
|
|
268
|
+
}
|
|
269
|
+
) })
|
|
171
270
|
}
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
271
|
+
) : null
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
),
|
|
179
278
|
/* @__PURE__ */ o("style", { children: `
|
|
180
279
|
@keyframes pw-fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
181
280
|
@keyframes pw-scale-in {
|
|
@@ -187,20 +286,60 @@ function me({
|
|
|
187
286
|
}
|
|
188
287
|
) : null;
|
|
189
288
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
289
|
+
function rt(r, e) {
|
|
290
|
+
switch (r) {
|
|
291
|
+
case "google":
|
|
292
|
+
return e("auth.continue_with_google", "Continue with Google");
|
|
293
|
+
case "apple":
|
|
294
|
+
return e("auth.continue_with_apple", "Continue with Apple");
|
|
295
|
+
case "github":
|
|
296
|
+
return e("auth.continue_with_github", "Continue with GitHub");
|
|
297
|
+
case "facebook":
|
|
298
|
+
return e("auth.continue_with_facebook", "Continue with Facebook");
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function fe(r, e, t) {
|
|
302
|
+
const n = e === "signup" ? t("auth.signup_failed", "Sign-up failed") : t("auth.signin_failed", "Sign-in failed");
|
|
303
|
+
if (!(r instanceof j)) return n;
|
|
304
|
+
switch (r.code) {
|
|
305
|
+
case "invalid_credentials":
|
|
306
|
+
return t("auth.invalid_credentials", "Invalid email or password");
|
|
307
|
+
case "email_not_confirmed":
|
|
308
|
+
return t("auth.email_not_confirmed", "Please confirm your email before signing in.");
|
|
309
|
+
case "email_exists":
|
|
310
|
+
case "user_already_exists":
|
|
311
|
+
return t("auth.email_exists", "An account with this email already exists.");
|
|
312
|
+
case "weak_password":
|
|
313
|
+
return t("auth.weak_password", "Password is too weak.");
|
|
314
|
+
case "invalid_otp":
|
|
315
|
+
case "otp_expired":
|
|
316
|
+
case "token_expired":
|
|
317
|
+
return t("auth.invalid_otp", "The code is invalid or has expired.");
|
|
318
|
+
case "over_email_send_rate_limit":
|
|
319
|
+
case "over_request_rate_limit":
|
|
320
|
+
case "rate_limited":
|
|
321
|
+
case "http_429":
|
|
322
|
+
return t("auth.rate_limited", "Too many requests. Please try again in a moment.");
|
|
323
|
+
case "network_error":
|
|
324
|
+
return t("auth.network_error", "Network error. Please check your connection and try again.");
|
|
325
|
+
case "upstream":
|
|
326
|
+
case "upstream_error":
|
|
327
|
+
case "http_502":
|
|
328
|
+
case "http_503":
|
|
329
|
+
case "http_504":
|
|
330
|
+
return t("auth.service_unavailable", "Service is temporarily unavailable. Please try again.");
|
|
331
|
+
default:
|
|
332
|
+
return n;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
function Ee({ block: r, ctx: e }) {
|
|
336
|
+
const t = e.auth, n = e.authSession, i = r.allow_signup !== !1, s = r.allow_password_reset !== !1, a = r.hide_when_authenticated !== !1;
|
|
198
337
|
if (!t)
|
|
199
338
|
return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
|
|
200
|
-
const
|
|
201
|
-
return
|
|
339
|
+
const l = n && !n.user.is_anonymous ? n : null;
|
|
340
|
+
return l && a ? null : l ? /* @__PURE__ */ o(nt, { email: l.user.email ?? "", onSignOut: () => t.signOut().catch(() => {
|
|
202
341
|
}) }) : /* @__PURE__ */ o(
|
|
203
|
-
|
|
342
|
+
it,
|
|
204
343
|
{
|
|
205
344
|
block: r,
|
|
206
345
|
allowSignup: i,
|
|
@@ -209,10 +348,11 @@ function oe({ block: r, ctx: e }) {
|
|
|
209
348
|
}
|
|
210
349
|
);
|
|
211
350
|
}
|
|
212
|
-
function
|
|
213
|
-
|
|
351
|
+
function nt({ email: r, onSignOut: e }) {
|
|
352
|
+
const { t } = w();
|
|
353
|
+
return /* @__PURE__ */ c("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
|
|
214
354
|
/* @__PURE__ */ c("div", { class: "flex flex-col", children: [
|
|
215
|
-
/* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: "Signed in" }),
|
|
355
|
+
/* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: t("auth.signed_in", "Signed in") }),
|
|
216
356
|
/* @__PURE__ */ o("span", { class: "text-sm font-medium text-gray-900", children: r })
|
|
217
357
|
] }),
|
|
218
358
|
/* @__PURE__ */ o(
|
|
@@ -221,245 +361,506 @@ function xe({ email: r, onSignOut: e }) {
|
|
|
221
361
|
type: "button",
|
|
222
362
|
onClick: e,
|
|
223
363
|
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)]",
|
|
224
|
-
children: "Sign out"
|
|
364
|
+
children: t("auth.sign_out", "Sign out")
|
|
225
365
|
}
|
|
226
366
|
)
|
|
227
367
|
] });
|
|
228
368
|
}
|
|
229
|
-
function
|
|
230
|
-
const i = n.auth,
|
|
231
|
-
|
|
232
|
-
|
|
369
|
+
function it({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
|
|
370
|
+
const { t: i } = w(), s = n.auth, a = r.providers ?? [], [l, d] = x("signin"), [p, u] = x(""), [h, b] = x(""), [_, f] = x(""), [g, A] = x(""), [M, k] = x(null), [E, I] = x(null), [O, B] = x(null), [R, q] = x(!1), [D, N] = x(null);
|
|
371
|
+
T(() => {
|
|
372
|
+
if (typeof s.getLastLogin != "function") return;
|
|
373
|
+
let S = !1;
|
|
374
|
+
return s.getLastLogin().then(
|
|
375
|
+
(P) => {
|
|
376
|
+
S || !P || (N(P), P.email && u((V) => V === "" ? P.email : V));
|
|
377
|
+
},
|
|
378
|
+
() => {
|
|
379
|
+
}
|
|
380
|
+
), () => {
|
|
381
|
+
S = !0;
|
|
382
|
+
};
|
|
383
|
+
}, [s]);
|
|
384
|
+
const L = (S) => {
|
|
385
|
+
d(S), I(null), B(null), q(!1);
|
|
386
|
+
}, C = async (S) => {
|
|
387
|
+
if (S.preventDefault(), !M) {
|
|
388
|
+
if (I(null), B(null), l === "signup" && !R) {
|
|
389
|
+
if (!p.trim()) return;
|
|
390
|
+
q(!0);
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
if (l === "signup" && h !== _) {
|
|
394
|
+
I(i("auth.passwords_mismatch", "Passwords don't match"));
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
k("email");
|
|
233
398
|
try {
|
|
234
|
-
l === "signin" ? await
|
|
235
|
-
email
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
399
|
+
l === "signin" ? await s.signInWithEmail({ email: p, password: h }) : l === "signup" ? (await s.signUp({ email: p, password: h })).kind === "confirmation_required" && (d("reset_verify"), B(i("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await s.requestPasswordReset({ email: p }), d("reset_sent"), B(
|
|
400
|
+
i("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
|
|
401
|
+
)) : l === "reset_verify" && (await s.verifyOtp({
|
|
402
|
+
email: p,
|
|
403
|
+
token: g,
|
|
404
|
+
type: h ? "recovery" : "email"
|
|
405
|
+
}), h && await s.updatePassword({ password: h }));
|
|
406
|
+
} catch (P) {
|
|
407
|
+
I(fe(P, l === "signup" ? "signup" : l === "reset_verify" ? "otp" : l === "forgot" ? "reset" : "signin", i));
|
|
242
408
|
} finally {
|
|
243
|
-
|
|
409
|
+
k(null);
|
|
244
410
|
}
|
|
245
411
|
}
|
|
246
|
-
},
|
|
247
|
-
if (!
|
|
248
|
-
|
|
412
|
+
}, U = async (S) => {
|
|
413
|
+
if (!M) {
|
|
414
|
+
k(S), I(null), B(null);
|
|
249
415
|
try {
|
|
250
|
-
await
|
|
251
|
-
provider:
|
|
252
|
-
onPopupOpened: () =>
|
|
416
|
+
await s.signInWithOAuth({
|
|
417
|
+
provider: S,
|
|
418
|
+
onPopupOpened: () => k(null)
|
|
253
419
|
});
|
|
254
|
-
} catch (
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
} else
|
|
259
|
-
b("Sign-in failed");
|
|
420
|
+
} catch (P) {
|
|
421
|
+
if (P instanceof j && (P.code === "oauth_cancelled" || P.code === "oauth_timeout"))
|
|
422
|
+
return;
|
|
423
|
+
I(fe(P, "signin", i));
|
|
260
424
|
} finally {
|
|
261
|
-
|
|
425
|
+
k(null);
|
|
262
426
|
}
|
|
263
427
|
}
|
|
264
|
-
};
|
|
265
|
-
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
428
|
+
}, m = a.length > 0 && (l === "signin" || l === "signup"), y = l === "signin" || l === "signup" || l === "forgot", v = l === "signin" || l === "signup" && R;
|
|
429
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-5", children: [
|
|
430
|
+
/* @__PURE__ */ o(ot, { mode: l, customHeading: r.heading, customSubheading: r.subheading }),
|
|
431
|
+
m ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-2.5", children: [
|
|
432
|
+
a.map((S) => /* @__PURE__ */ c("div", { class: "relative", children: [
|
|
433
|
+
/* @__PURE__ */ c(
|
|
434
|
+
"button",
|
|
435
|
+
{
|
|
436
|
+
type: "button",
|
|
437
|
+
onClick: () => U(S),
|
|
438
|
+
disabled: M !== null,
|
|
439
|
+
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)]",
|
|
440
|
+
children: [
|
|
441
|
+
M === S ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ o(ft, { provider: S }),
|
|
442
|
+
/* @__PURE__ */ o("span", { children: rt(S, i) })
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
),
|
|
446
|
+
D?.method === S ? /* @__PURE__ */ o(me, { email: D.email }) : null
|
|
447
|
+
] }, S)),
|
|
448
|
+
/* @__PURE__ */ o(pt, {})
|
|
283
449
|
] }) : null,
|
|
284
|
-
/* @__PURE__ */ c("form", { onSubmit:
|
|
285
|
-
|
|
286
|
-
|
|
450
|
+
/* @__PURE__ */ c("form", { onSubmit: C, class: "flex flex-col gap-3", children: [
|
|
451
|
+
y && /* @__PURE__ */ o(
|
|
452
|
+
ge,
|
|
287
453
|
{
|
|
288
454
|
type: "email",
|
|
289
|
-
|
|
290
|
-
value:
|
|
455
|
+
placeholder: i("auth.email", "Email address"),
|
|
456
|
+
value: p,
|
|
291
457
|
onInput: u,
|
|
292
458
|
autocomplete: "email",
|
|
293
459
|
required: !0
|
|
294
460
|
}
|
|
295
461
|
),
|
|
296
|
-
|
|
297
|
-
|
|
462
|
+
v && /* @__PURE__ */ o(
|
|
463
|
+
ee,
|
|
298
464
|
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
onInput: x,
|
|
465
|
+
placeholder: i("auth.password", "Password"),
|
|
466
|
+
value: h,
|
|
467
|
+
onInput: b,
|
|
303
468
|
autocomplete: l === "signin" ? "current-password" : "new-password",
|
|
304
469
|
required: !0
|
|
305
470
|
}
|
|
306
471
|
),
|
|
307
|
-
l === "
|
|
472
|
+
l === "signup" && R && /* @__PURE__ */ o(
|
|
473
|
+
ee,
|
|
474
|
+
{
|
|
475
|
+
placeholder: i("auth.repeat_password", "Repeat password"),
|
|
476
|
+
value: _,
|
|
477
|
+
onInput: f,
|
|
478
|
+
autocomplete: "new-password",
|
|
479
|
+
required: !0
|
|
480
|
+
}
|
|
481
|
+
),
|
|
482
|
+
l === "reset_verify" && /* @__PURE__ */ c(Y, { children: [
|
|
308
483
|
/* @__PURE__ */ o(
|
|
309
|
-
|
|
484
|
+
ge,
|
|
310
485
|
{
|
|
311
486
|
type: "text",
|
|
312
|
-
|
|
313
|
-
value:
|
|
314
|
-
onInput:
|
|
487
|
+
placeholder: i("auth.confirmation_code", "Confirmation code"),
|
|
488
|
+
value: g,
|
|
489
|
+
onInput: A,
|
|
315
490
|
autocomplete: "one-time-code",
|
|
316
491
|
inputMode: "numeric",
|
|
317
492
|
required: !0
|
|
318
493
|
}
|
|
319
494
|
),
|
|
320
495
|
/* @__PURE__ */ o(
|
|
321
|
-
|
|
496
|
+
ee,
|
|
322
497
|
{
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
498
|
+
placeholder: i(
|
|
499
|
+
"auth.new_password_optional",
|
|
500
|
+
"New password (optional — only for password reset)"
|
|
501
|
+
),
|
|
502
|
+
value: h,
|
|
503
|
+
onInput: b,
|
|
327
504
|
autocomplete: "new-password"
|
|
328
505
|
}
|
|
329
506
|
)
|
|
330
507
|
] }),
|
|
331
|
-
l === "reset_sent" &&
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
l !== "reset_sent" && /* @__PURE__ */ o(
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
)
|
|
508
|
+
l === "reset_sent" && O && /* @__PURE__ */ o("p", { class: "rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600", children: O }),
|
|
509
|
+
l === "signin" && t && /* @__PURE__ */ o("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ o(Z, { onClick: () => L("forgot"), children: i("auth.forgot_password", "Forgot password?") }) }),
|
|
510
|
+
E && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: E }),
|
|
511
|
+
O && l !== "reset_sent" && /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: O }),
|
|
512
|
+
l !== "reset_sent" && /* @__PURE__ */ c("div", { class: "relative", children: [
|
|
513
|
+
/* @__PURE__ */ o(
|
|
514
|
+
ct,
|
|
515
|
+
{
|
|
516
|
+
busy: M === "email",
|
|
517
|
+
label: at(l, R, r.submit_label ?? r.heading, i)
|
|
518
|
+
}
|
|
519
|
+
),
|
|
520
|
+
l === "signin" && D?.method === "email" ? /* @__PURE__ */ o(me, { email: D.email }) : null
|
|
521
|
+
] })
|
|
347
522
|
] }),
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
523
|
+
/* @__PURE__ */ o(
|
|
524
|
+
lt,
|
|
525
|
+
{
|
|
526
|
+
mode: l,
|
|
527
|
+
allowSignup: e,
|
|
528
|
+
onSwitch: L
|
|
529
|
+
}
|
|
530
|
+
)
|
|
355
531
|
] });
|
|
356
532
|
}
|
|
357
|
-
function
|
|
533
|
+
function ot({
|
|
534
|
+
mode: r,
|
|
535
|
+
customHeading: e,
|
|
536
|
+
customSubheading: t
|
|
537
|
+
}) {
|
|
538
|
+
const { t: n } = w(), i = st(r, n), s = r === "signin" || r === "signup", a = s && e ? e : i.title, l = s && t !== void 0 ? t || null : i.subtitle;
|
|
539
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
|
|
540
|
+
/* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: a }),
|
|
541
|
+
l ? /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: l }) : null
|
|
542
|
+
] });
|
|
543
|
+
}
|
|
544
|
+
function st(r, e) {
|
|
545
|
+
switch (r) {
|
|
546
|
+
case "signin":
|
|
547
|
+
return {
|
|
548
|
+
title: e("auth.welcome", "Welcome back!"),
|
|
549
|
+
subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
|
|
550
|
+
};
|
|
551
|
+
case "signup":
|
|
552
|
+
return {
|
|
553
|
+
title: e("auth.welcome_signup", "Welcome!"),
|
|
554
|
+
subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
|
|
555
|
+
};
|
|
556
|
+
case "forgot":
|
|
557
|
+
return {
|
|
558
|
+
title: e("auth.forgot_password_title", "Forgot password?"),
|
|
559
|
+
subtitle: e(
|
|
560
|
+
"auth.forgot_subtitle",
|
|
561
|
+
"Enter your email and we'll send you a password reset link."
|
|
562
|
+
)
|
|
563
|
+
};
|
|
564
|
+
case "reset_sent":
|
|
565
|
+
return {
|
|
566
|
+
title: e("auth.check_email_title", "Check your email"),
|
|
567
|
+
subtitle: null
|
|
568
|
+
};
|
|
569
|
+
case "reset_verify":
|
|
570
|
+
return {
|
|
571
|
+
title: e("auth.reset_password_title", "Reset password"),
|
|
572
|
+
subtitle: e(
|
|
573
|
+
"auth.reset_password_subtitle",
|
|
574
|
+
"Enter the code from your email and a new password."
|
|
575
|
+
)
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
function at(r, e, t, n) {
|
|
580
|
+
if (r === "signin" && t) return t;
|
|
358
581
|
switch (r) {
|
|
359
582
|
case "signin":
|
|
360
|
-
return "Sign
|
|
583
|
+
return n("auth.log_in", "Sign In");
|
|
361
584
|
case "signup":
|
|
362
|
-
return "Create
|
|
585
|
+
return e ? n("auth.create_account", "Create Account") : n("auth.sign_up", "Sign Up");
|
|
363
586
|
case "forgot":
|
|
364
|
-
return "Send
|
|
587
|
+
return n("auth.send_reset", "Send Reset Email");
|
|
365
588
|
case "reset_verify":
|
|
366
|
-
return "Verify";
|
|
589
|
+
return n("auth.verify", "Verify");
|
|
367
590
|
default:
|
|
368
|
-
return "Continue";
|
|
591
|
+
return n("cta.continue", "Continue");
|
|
369
592
|
}
|
|
370
593
|
}
|
|
371
|
-
function
|
|
372
|
-
r
|
|
594
|
+
function lt({
|
|
595
|
+
mode: r,
|
|
596
|
+
allowSignup: e,
|
|
597
|
+
onSwitch: t
|
|
598
|
+
}) {
|
|
599
|
+
const { t: n } = w();
|
|
600
|
+
return r === "signin" && e ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
|
|
601
|
+
n("auth.no_account", "Don't have an account?"),
|
|
602
|
+
" ",
|
|
603
|
+
/* @__PURE__ */ o(Z, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
|
|
604
|
+
] }) : r === "signup" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
|
|
605
|
+
n("auth.have_account", "Already have an account?"),
|
|
606
|
+
" ",
|
|
607
|
+
/* @__PURE__ */ o(Z, { onClick: () => t("signin"), children: n("auth.log_in_link", "Log In") })
|
|
608
|
+
] }) : r === "forgot" || r === "reset_sent" || r === "reset_verify" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
|
|
609
|
+
n("auth.no_account", "Don't have an account?"),
|
|
610
|
+
" ",
|
|
611
|
+
/* @__PURE__ */ o(Z, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
|
|
612
|
+
] }) : null;
|
|
613
|
+
}
|
|
614
|
+
function Z({
|
|
615
|
+
onClick: r,
|
|
616
|
+
children: e
|
|
617
|
+
}) {
|
|
618
|
+
return /* @__PURE__ */ o(
|
|
619
|
+
"button",
|
|
620
|
+
{
|
|
621
|
+
type: "button",
|
|
622
|
+
onClick: r,
|
|
623
|
+
class: "font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",
|
|
624
|
+
style: { color: "var(--pw-accent)" },
|
|
625
|
+
children: e
|
|
626
|
+
}
|
|
627
|
+
);
|
|
373
628
|
}
|
|
374
|
-
function
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
-
|
|
629
|
+
function ct({ busy: r, label: e }) {
|
|
630
|
+
return /* @__PURE__ */ o(
|
|
631
|
+
"button",
|
|
632
|
+
{
|
|
633
|
+
type: "submit",
|
|
634
|
+
disabled: r,
|
|
635
|
+
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)]",
|
|
636
|
+
style: {
|
|
637
|
+
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%)",
|
|
638
|
+
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)"
|
|
639
|
+
},
|
|
640
|
+
children: r ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: e })
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
function ge({ type: r, placeholder: e, value: t, onInput: n, autocomplete: i, inputMode: s, required: a }) {
|
|
645
|
+
return /* @__PURE__ */ o(
|
|
646
|
+
"input",
|
|
647
|
+
{
|
|
648
|
+
type: r,
|
|
649
|
+
value: t,
|
|
650
|
+
placeholder: e,
|
|
651
|
+
onInput: (l) => n(l.target.value),
|
|
652
|
+
autocomplete: i,
|
|
653
|
+
inputMode: s,
|
|
654
|
+
required: a,
|
|
655
|
+
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)]"
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
function ee({ placeholder: r, value: e, onInput: t, autocomplete: n, required: i }) {
|
|
660
|
+
const { t: s } = w(), [a, l] = x(!1), d = z(null);
|
|
661
|
+
T(() => {
|
|
662
|
+
const h = d.current;
|
|
663
|
+
h && h.value !== e && (h.value = e);
|
|
664
|
+
}, [a, e]);
|
|
665
|
+
const p = s("auth.show_password", "Show password"), u = s("auth.hide_password", "Hide password");
|
|
666
|
+
return /* @__PURE__ */ c("div", { class: "relative", children: [
|
|
377
667
|
/* @__PURE__ */ o(
|
|
378
668
|
"input",
|
|
379
669
|
{
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
670
|
+
ref: d,
|
|
671
|
+
type: a ? "text" : "password",
|
|
672
|
+
value: e,
|
|
673
|
+
placeholder: r,
|
|
674
|
+
onInput: (h) => t(h.target.value),
|
|
675
|
+
autocomplete: n,
|
|
676
|
+
required: i,
|
|
677
|
+
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)]"
|
|
678
|
+
}
|
|
679
|
+
),
|
|
680
|
+
/* @__PURE__ */ o(
|
|
681
|
+
"button",
|
|
682
|
+
{
|
|
683
|
+
type: "button",
|
|
684
|
+
onClick: () => l((h) => !h),
|
|
685
|
+
"aria-label": a ? u : p,
|
|
686
|
+
tabIndex: -1,
|
|
687
|
+
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)]",
|
|
688
|
+
children: a ? /* @__PURE__ */ o(dt, {}) : /* @__PURE__ */ o(ut, {})
|
|
387
689
|
}
|
|
388
690
|
)
|
|
389
691
|
] });
|
|
390
692
|
}
|
|
391
|
-
function
|
|
392
|
-
return /* @__PURE__ */ c("
|
|
393
|
-
/* @__PURE__ */ o(
|
|
394
|
-
|
|
395
|
-
|
|
693
|
+
function ut() {
|
|
694
|
+
return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
695
|
+
/* @__PURE__ */ o(
|
|
696
|
+
"path",
|
|
697
|
+
{
|
|
698
|
+
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",
|
|
699
|
+
stroke: "currentColor",
|
|
700
|
+
"stroke-width": "1.5",
|
|
701
|
+
"stroke-linecap": "round",
|
|
702
|
+
"stroke-linejoin": "round"
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
|
|
706
|
+
] });
|
|
707
|
+
}
|
|
708
|
+
function dt() {
|
|
709
|
+
return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
710
|
+
/* @__PURE__ */ o(
|
|
711
|
+
"path",
|
|
712
|
+
{
|
|
713
|
+
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",
|
|
714
|
+
stroke: "currentColor",
|
|
715
|
+
"stroke-width": "1.5",
|
|
716
|
+
"stroke-linecap": "round",
|
|
717
|
+
"stroke-linejoin": "round"
|
|
718
|
+
}
|
|
719
|
+
),
|
|
720
|
+
/* @__PURE__ */ o(
|
|
721
|
+
"path",
|
|
722
|
+
{
|
|
723
|
+
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",
|
|
724
|
+
stroke: "currentColor",
|
|
725
|
+
"stroke-width": "1.5",
|
|
726
|
+
"stroke-linecap": "round",
|
|
727
|
+
"stroke-linejoin": "round"
|
|
728
|
+
}
|
|
729
|
+
)
|
|
396
730
|
] });
|
|
397
731
|
}
|
|
398
|
-
function
|
|
399
|
-
|
|
732
|
+
function me({ email: r }) {
|
|
733
|
+
const { t: e } = w(), t = r ? e("auth.last_used", "Last · {email}", { email: ht(r) }) : e("auth.last_used_no_email", "Last");
|
|
734
|
+
return /* @__PURE__ */ o("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: t });
|
|
735
|
+
}
|
|
736
|
+
function ht(r) {
|
|
737
|
+
const [e, t] = r.split("@");
|
|
738
|
+
return t ? `${e.slice(0, 3)}*****@${t}` : r;
|
|
739
|
+
}
|
|
740
|
+
function pt() {
|
|
741
|
+
const { t: r } = w();
|
|
742
|
+
return /* @__PURE__ */ c("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
|
|
743
|
+
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" }),
|
|
744
|
+
/* @__PURE__ */ o("span", { children: r("auth.or", "or") }),
|
|
745
|
+
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" })
|
|
746
|
+
] });
|
|
747
|
+
}
|
|
748
|
+
function ft({ provider: r }) {
|
|
749
|
+
return r === "google" ? /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
|
|
400
750
|
/* @__PURE__ */ o("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" }),
|
|
401
751
|
/* @__PURE__ */ o("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" }),
|
|
402
752
|
/* @__PURE__ */ o("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" }),
|
|
403
753
|
/* @__PURE__ */ o("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" })
|
|
404
|
-
] }) : r === "apple" ?
|
|
754
|
+
] }) : r === "apple" ? (
|
|
755
|
+
// viewBox 0 0 24 24 даёт воздух сверху/снизу пути, поэтому визуально
|
|
756
|
+
// Apple-яблоко выглядит меньше Google. Компенсируем увеличенным
|
|
757
|
+
// width/height — 26×26 даёт примерно equal optical size с Google 20×20.
|
|
758
|
+
/* @__PURE__ */ o("svg", { width: "26", height: "26", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("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" }) })
|
|
759
|
+
) : r === "github" ? /* @__PURE__ */ o("svg", { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("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" }) }) : /* @__PURE__ */ o("svg", { width: "18", height: "20", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("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" }) });
|
|
405
760
|
}
|
|
406
|
-
function
|
|
761
|
+
function gt({
|
|
407
762
|
block: r,
|
|
408
763
|
bootstrap: e,
|
|
409
764
|
auth: t,
|
|
410
765
|
authSession: n,
|
|
411
766
|
onBack: i,
|
|
412
|
-
showBack: s = !0
|
|
767
|
+
showBack: s = !0,
|
|
768
|
+
intent: a = "preauth"
|
|
413
769
|
}) {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
770
|
+
const { t: l } = w(), d = {
|
|
771
|
+
bootstrap: e,
|
|
772
|
+
selectedPriceId: null,
|
|
773
|
+
setSelectedPriceId: () => {
|
|
774
|
+
},
|
|
775
|
+
onAction: () => {
|
|
776
|
+
},
|
|
777
|
+
auth: t,
|
|
778
|
+
authSession: n
|
|
779
|
+
}, p = a === "restore" ? {
|
|
780
|
+
...r,
|
|
781
|
+
heading: l("auth.restore_purchases_heading", "Restore Purchases"),
|
|
782
|
+
subheading: l(
|
|
783
|
+
"auth.restore_purchases_subheading",
|
|
784
|
+
"Please sign in to restore your purchases."
|
|
785
|
+
)
|
|
786
|
+
} : a === "preauth" ? {
|
|
787
|
+
...r,
|
|
788
|
+
heading: l("auth.login_continue_purchase", "Log in to continue your purchase"),
|
|
789
|
+
subheading: l(
|
|
790
|
+
"auth.link_purchase_subheading",
|
|
791
|
+
"We'll link the purchase to your account to keep access."
|
|
792
|
+
),
|
|
793
|
+
// Preauth heading — descriptive sentence ("Log in to continue your
|
|
794
|
+
// purchase"), а не action verb. Длинные локализации (RU: "Войдите,
|
|
795
|
+
// чтобы продолжить покупку") в pill-кнопку h-12 не помещаются и
|
|
796
|
+
// переносятся на 2 строки. Явный короткий submit_label решает.
|
|
797
|
+
submit_label: l("auth.log_in", "Sign In")
|
|
798
|
+
} : r;
|
|
799
|
+
return /* @__PURE__ */ c("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
|
|
800
|
+
s ? /* @__PURE__ */ o(mt, { onClick: i, ariaLabel: l("nav.back_aria", "Back") }) : null,
|
|
801
|
+
/* @__PURE__ */ o(Ee, { block: p, ctx: d })
|
|
434
802
|
] });
|
|
435
803
|
}
|
|
436
|
-
function
|
|
804
|
+
function mt({ onClick: r, ariaLabel: e }) {
|
|
805
|
+
return /* @__PURE__ */ o(
|
|
806
|
+
"button",
|
|
807
|
+
{
|
|
808
|
+
type: "button",
|
|
809
|
+
onClick: r,
|
|
810
|
+
"aria-label": e,
|
|
811
|
+
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)]",
|
|
812
|
+
children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
813
|
+
/* @__PURE__ */ o(
|
|
814
|
+
"path",
|
|
815
|
+
{
|
|
816
|
+
d: "M5 8h8a4 4 0 0 1 0 8H9",
|
|
817
|
+
stroke: "currentColor",
|
|
818
|
+
"stroke-width": "1.75",
|
|
819
|
+
"stroke-linecap": "round",
|
|
820
|
+
"stroke-linejoin": "round"
|
|
821
|
+
}
|
|
822
|
+
),
|
|
823
|
+
/* @__PURE__ */ o(
|
|
824
|
+
"path",
|
|
825
|
+
{
|
|
826
|
+
d: "M8 4 4 8l4 4",
|
|
827
|
+
stroke: "currentColor",
|
|
828
|
+
"stroke-width": "1.75",
|
|
829
|
+
"stroke-linecap": "round",
|
|
830
|
+
"stroke-linejoin": "round"
|
|
831
|
+
}
|
|
832
|
+
)
|
|
833
|
+
] })
|
|
834
|
+
}
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
function yt({
|
|
437
838
|
auth: r,
|
|
438
839
|
onSuccess: e,
|
|
439
840
|
onBack: t,
|
|
440
|
-
heading: n
|
|
441
|
-
description: i
|
|
841
|
+
heading: n,
|
|
842
|
+
description: i
|
|
442
843
|
}) {
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
|
|
844
|
+
const { t: s } = w(), a = n ?? s("anon.heading_default", "Continue as guest"), l = i ?? s("anon.description_default", "Setting up your guest session…"), [d, p] = x({ kind: "signing-in" }), u = z(!0);
|
|
845
|
+
T(() => () => {
|
|
846
|
+
u.current = !1;
|
|
446
847
|
}, []);
|
|
447
848
|
const h = () => {
|
|
448
|
-
|
|
849
|
+
p({ kind: "signing-in" }), (async () => {
|
|
449
850
|
try {
|
|
450
|
-
const
|
|
451
|
-
if (!
|
|
452
|
-
e(
|
|
453
|
-
} catch (
|
|
454
|
-
if (!
|
|
455
|
-
|
|
851
|
+
const b = await r.signInAnonymously();
|
|
852
|
+
if (!u.current) return;
|
|
853
|
+
e(b);
|
|
854
|
+
} catch (b) {
|
|
855
|
+
if (!u.current) return;
|
|
856
|
+
p({
|
|
456
857
|
kind: "error",
|
|
457
|
-
message:
|
|
858
|
+
message: b instanceof Error ? b.message : "Anonymous sign-in failed"
|
|
458
859
|
});
|
|
459
860
|
}
|
|
460
861
|
})();
|
|
461
862
|
};
|
|
462
|
-
return
|
|
863
|
+
return T(() => {
|
|
463
864
|
h();
|
|
464
865
|
}, []), /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
465
866
|
t ? /* @__PURE__ */ o(
|
|
@@ -468,289 +869,476 @@ function Se({
|
|
|
468
869
|
type: "button",
|
|
469
870
|
onClick: t,
|
|
470
871
|
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)]",
|
|
471
|
-
children: "← Back"
|
|
872
|
+
children: s("nav.back", "← Back")
|
|
472
873
|
}
|
|
473
874
|
) : null,
|
|
474
875
|
/* @__PURE__ */ c("div", { class: "flex flex-col gap-1", children: [
|
|
475
|
-
/* @__PURE__ */ o("h2", { class: "text-xl font-semibold text-gray-900", children:
|
|
476
|
-
/* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children:
|
|
876
|
+
/* @__PURE__ */ o("h2", { class: "text-xl font-semibold text-gray-900", children: a }),
|
|
877
|
+
/* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: l })
|
|
477
878
|
] }),
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
/* @__PURE__ */ o("div", { class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700", children:
|
|
879
|
+
d.kind === "signing-in" ? /* @__PURE__ */ o("div", { class: "flex items-center justify-center py-6", children: /* @__PURE__ */ o(xt, {}) }) : null,
|
|
880
|
+
d.kind === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
881
|
+
/* @__PURE__ */ o("div", { class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700", children: d.message }),
|
|
481
882
|
/* @__PURE__ */ o(
|
|
482
883
|
"button",
|
|
483
884
|
{
|
|
484
885
|
type: "button",
|
|
485
886
|
onClick: h,
|
|
486
887
|
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",
|
|
487
|
-
children: "Try again"
|
|
888
|
+
children: s("anon.try_again", "Try again")
|
|
488
889
|
}
|
|
489
890
|
)
|
|
490
891
|
] }) : null
|
|
491
892
|
] });
|
|
492
893
|
}
|
|
493
|
-
function
|
|
894
|
+
function xt() {
|
|
494
895
|
return /* @__PURE__ */ c("svg", { class: "h-5 w-5 animate-spin text-[var(--pw-accent)]", viewBox: "0 0 24 24", fill: "none", children: [
|
|
495
896
|
/* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "3", "stroke-opacity": "0.2" }),
|
|
496
897
|
/* @__PURE__ */ o("path", { d: "M22 12a10 10 0 0 0-10-10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" })
|
|
497
898
|
] });
|
|
498
899
|
}
|
|
499
|
-
const
|
|
500
|
-
function
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
900
|
+
const Pe = (r) => `pw-offer-${r}-start`;
|
|
901
|
+
function te(r) {
|
|
902
|
+
const e = r - Date.now();
|
|
903
|
+
return e <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
|
|
904
|
+
days: Math.floor(e / (1e3 * 60 * 60 * 24)),
|
|
905
|
+
hours: Math.floor(e % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
|
|
906
|
+
minutes: Math.floor(e % (1e3 * 60 * 60) / (1e3 * 60)),
|
|
907
|
+
seconds: Math.floor(e % (1e3 * 60) / 1e3),
|
|
908
|
+
expired: !1
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
function bt(r) {
|
|
912
|
+
if (r.expires_at) {
|
|
913
|
+
const e = Date.parse(r.expires_at);
|
|
914
|
+
return Number.isFinite(e) ? e : null;
|
|
915
|
+
}
|
|
916
|
+
if (r.duration_minutes && r.duration_minutes > 0) {
|
|
917
|
+
if (typeof window > "u") return null;
|
|
918
|
+
try {
|
|
919
|
+
const e = Pe(r.id);
|
|
920
|
+
let t = window.localStorage.getItem(e);
|
|
921
|
+
return t || (t = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(e, t)), Date.parse(t) + r.duration_minutes * 6e4;
|
|
922
|
+
} catch {
|
|
923
|
+
return null;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
return null;
|
|
927
|
+
}
|
|
928
|
+
function Te(r, e) {
|
|
929
|
+
if (!r || r.length === 0) return null;
|
|
930
|
+
if (e) {
|
|
931
|
+
const t = r.find((n) => n.id === e);
|
|
932
|
+
if (t) return t;
|
|
933
|
+
}
|
|
934
|
+
return r.find((t) => t.expires_at || t.duration_minutes) ?? null;
|
|
935
|
+
}
|
|
936
|
+
function Me(r) {
|
|
937
|
+
const e = r ? bt(r) : null, [t, n] = x(
|
|
938
|
+
() => e !== null ? te(e) : null
|
|
939
|
+
), i = z(e);
|
|
940
|
+
return i.current = e, T(() => {
|
|
941
|
+
if (e === null) {
|
|
942
|
+
n(null);
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
n(te(e));
|
|
946
|
+
const s = setInterval(() => {
|
|
947
|
+
const a = te(i.current ?? 0);
|
|
948
|
+
if (n(a), a.expired && (clearInterval(s), r?.duration_minutes && typeof window < "u"))
|
|
949
|
+
try {
|
|
950
|
+
window.localStorage.removeItem(Pe(r.id));
|
|
951
|
+
} catch {
|
|
952
|
+
}
|
|
953
|
+
}, 1e3);
|
|
954
|
+
return () => clearInterval(s);
|
|
955
|
+
}, [e, r?.duration_minutes, r?.id]), t;
|
|
956
|
+
}
|
|
957
|
+
function wt({ block: r, ctx: e }) {
|
|
958
|
+
const { t } = w(), n = Te(e.bootstrap.offers, r.offer_id), i = Me(n);
|
|
959
|
+
if (!n || i === null || i.expired && !r.force) return null;
|
|
960
|
+
const s = r.title ?? n.label ?? t("offer.limited_time", "Limited-time offer"), a = n.discount_percent ? `${s} ${n.discount_percent}%` : s;
|
|
961
|
+
return /* @__PURE__ */ c(
|
|
962
|
+
"div",
|
|
963
|
+
{
|
|
964
|
+
class: "flex flex-wrap items-center justify-center gap-2 rounded-2xl px-4 py-3 text-[15px] font-semibold leading-tight text-white",
|
|
965
|
+
style: {
|
|
966
|
+
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%)",
|
|
967
|
+
textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
|
|
968
|
+
},
|
|
969
|
+
role: "status",
|
|
970
|
+
children: [
|
|
971
|
+
/* @__PURE__ */ o(Oe, {}),
|
|
972
|
+
/* @__PURE__ */ o("span", { children: a }),
|
|
973
|
+
/* @__PURE__ */ o(Be, { value: i, t })
|
|
974
|
+
]
|
|
975
|
+
}
|
|
976
|
+
);
|
|
977
|
+
}
|
|
978
|
+
function Be({ value: r, t: e }) {
|
|
979
|
+
return /* @__PURE__ */ c("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
|
|
980
|
+
r.days > 0 ? /* @__PURE__ */ c(Y, { children: [
|
|
981
|
+
/* @__PURE__ */ o($, { children: String(r.days) }),
|
|
982
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.d", "d") })
|
|
983
|
+
] }) : null,
|
|
984
|
+
/* @__PURE__ */ o($, { children: String(r.hours).padStart(2, "0") }),
|
|
985
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.h", "h") }),
|
|
986
|
+
/* @__PURE__ */ o($, { children: String(r.minutes).padStart(2, "0") }),
|
|
987
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.m", "m") }),
|
|
988
|
+
/* @__PURE__ */ o($, { children: String(r.seconds).padStart(2, "0") }),
|
|
989
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.s", "s") })
|
|
990
|
+
] });
|
|
991
|
+
}
|
|
992
|
+
function $({ children: r }) {
|
|
993
|
+
return /* @__PURE__ */ o("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: r });
|
|
994
|
+
}
|
|
995
|
+
function kt({ offer: r }) {
|
|
996
|
+
const { t: e } = w(), t = Me(r);
|
|
997
|
+
if (t === null || t.expired) return null;
|
|
998
|
+
const n = r.label ?? e("offer.limited_time", "Limited-time offer"), i = r.discount_percent ? `${n} ${r.discount_percent}%` : n;
|
|
999
|
+
return /* @__PURE__ */ c(
|
|
1000
|
+
"div",
|
|
1001
|
+
{
|
|
1002
|
+
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",
|
|
1003
|
+
style: {
|
|
1004
|
+
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%)",
|
|
1005
|
+
textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
|
|
1006
|
+
},
|
|
1007
|
+
role: "status",
|
|
1008
|
+
children: [
|
|
1009
|
+
/* @__PURE__ */ o(Oe, {}),
|
|
1010
|
+
/* @__PURE__ */ o("span", { children: i }),
|
|
1011
|
+
/* @__PURE__ */ o(Be, { value: t, t: e })
|
|
1012
|
+
]
|
|
1013
|
+
}
|
|
1014
|
+
);
|
|
1015
|
+
}
|
|
1016
|
+
function Oe() {
|
|
1017
|
+
return /* @__PURE__ */ o(
|
|
1018
|
+
"svg",
|
|
1019
|
+
{
|
|
1020
|
+
width: "16",
|
|
1021
|
+
height: "16",
|
|
1022
|
+
viewBox: "0 0 12 12",
|
|
1023
|
+
fill: "none",
|
|
1024
|
+
"aria-hidden": "true",
|
|
1025
|
+
children: /* @__PURE__ */ o(
|
|
1026
|
+
"path",
|
|
1027
|
+
{
|
|
1028
|
+
fill: "currentColor",
|
|
1029
|
+
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"
|
|
1030
|
+
}
|
|
1031
|
+
)
|
|
1032
|
+
}
|
|
1033
|
+
);
|
|
1034
|
+
}
|
|
1035
|
+
const re = 3, ne = 200, ie = 5e3, oe = 5, vt = 10 * 1024 * 1024, ye = ["image/jpeg", "image/png", "image/webp"], xe = /.+@.+\..+/;
|
|
1036
|
+
function _t({ client: r, authSession: e, origin: t, onBack: n }) {
|
|
1037
|
+
const { t: i } = w(), s = e?.user.email ?? "", a = s || null, [l, d] = x(s), [p, u] = x(""), [h, b] = x(""), [_, f] = x([]), [g, A] = x(!1), [M, k] = x(null), [E, I] = x({}), O = _e(() => {
|
|
1038
|
+
const L = (a ?? l).trim().toLowerCase(), C = p.trim(), U = h.trim();
|
|
1039
|
+
return xe.test(L) && C.length >= re && C.length <= ne && U.length >= 1 && U.length <= ie;
|
|
1040
|
+
}, [a, l, p, h]), B = () => {
|
|
1041
|
+
const L = {}, C = (a ?? l).trim(), U = p.trim(), m = h.trim();
|
|
1042
|
+
return C ? xe.test(C.toLowerCase()) || (L.email = i("support.invalid_email", "Invalid email")) : L.email = i("support.required", "Required"), (U.length < re || U.length > ne) && (L.subject = i("support.subject_length", "{min}–{max} characters", {
|
|
1043
|
+
min: re,
|
|
1044
|
+
max: ne
|
|
1045
|
+
})), (m.length < 1 || m.length > ie) && (L.message = i("support.message_length", "{min}–{max} characters", {
|
|
1046
|
+
min: 1,
|
|
1047
|
+
max: ie
|
|
1048
|
+
})), I(L), Object.keys(L).length === 0;
|
|
1049
|
+
}, R = async (L) => {
|
|
1050
|
+
if (L.preventDefault(), !g && B()) {
|
|
1051
|
+
A(!0), I((C) => ({ ...C, submit: void 0 }));
|
|
510
1052
|
try {
|
|
511
|
-
const
|
|
1053
|
+
const C = (a ?? l).trim();
|
|
512
1054
|
await r.createSupportTicket({
|
|
513
|
-
subject:
|
|
514
|
-
content:
|
|
515
|
-
email:
|
|
516
|
-
files:
|
|
517
|
-
}),
|
|
518
|
-
} catch (
|
|
519
|
-
const
|
|
520
|
-
|
|
1055
|
+
subject: p.trim(),
|
|
1056
|
+
content: h.trim(),
|
|
1057
|
+
email: C || void 0,
|
|
1058
|
+
files: _.length > 0 ? _ : void 0
|
|
1059
|
+
}), k(C);
|
|
1060
|
+
} catch (C) {
|
|
1061
|
+
const U = C instanceof j && C.message || "Failed to send. Please try again.";
|
|
1062
|
+
I((m) => ({ ...m, submit: U }));
|
|
521
1063
|
} finally {
|
|
522
|
-
|
|
1064
|
+
A(!1);
|
|
523
1065
|
}
|
|
524
1066
|
}
|
|
525
|
-
},
|
|
526
|
-
u(""),
|
|
527
|
-
};
|
|
528
|
-
return
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
"
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
"
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
1067
|
+
}, q = () => {
|
|
1068
|
+
u(""), b(""), f([]), I({}), k(null);
|
|
1069
|
+
}, D = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", N = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
|
|
1070
|
+
return M ? /* @__PURE__ */ c("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1071
|
+
/* @__PURE__ */ c("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: [
|
|
1072
|
+
/* @__PURE__ */ o(
|
|
1073
|
+
"div",
|
|
1074
|
+
{
|
|
1075
|
+
class: "flex h-14 w-14 items-center justify-center rounded-full",
|
|
1076
|
+
style: {
|
|
1077
|
+
background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 85%, white), var(--pw-accent))",
|
|
1078
|
+
color: "#fff",
|
|
1079
|
+
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)"
|
|
1080
|
+
},
|
|
1081
|
+
"aria-hidden": "true",
|
|
1082
|
+
children: /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", class: "h-7 w-7", children: /* @__PURE__ */ o(
|
|
1083
|
+
"path",
|
|
1084
|
+
{
|
|
1085
|
+
fill: "currentColor",
|
|
1086
|
+
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"
|
|
1087
|
+
}
|
|
1088
|
+
) })
|
|
1089
|
+
}
|
|
1090
|
+
),
|
|
1091
|
+
/* @__PURE__ */ o("div", { class: "text-lg font-semibold tracking-tight text-gray-900", children: i("support.success_heading", "Request submitted") }),
|
|
1092
|
+
/* @__PURE__ */ c("div", { class: "max-w-[320px] text-sm leading-relaxed text-gray-500", children: [
|
|
1093
|
+
i(
|
|
1094
|
+
"support.success_message_prefix",
|
|
1095
|
+
"We've received your message and will respond to"
|
|
1096
|
+
),
|
|
1097
|
+
" ",
|
|
1098
|
+
/* @__PURE__ */ o("b", { class: "text-gray-700", children: M }),
|
|
1099
|
+
"."
|
|
1100
|
+
] })
|
|
554
1101
|
] }),
|
|
555
|
-
/* @__PURE__ */ c("div", { class: "
|
|
1102
|
+
/* @__PURE__ */ o("div", { class: D, style: N, children: /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
|
|
556
1103
|
/* @__PURE__ */ o(
|
|
557
1104
|
"button",
|
|
558
1105
|
{
|
|
559
1106
|
type: "button",
|
|
560
1107
|
onClick: n,
|
|
561
1108
|
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)]",
|
|
562
|
-
children: t === "standalone" ? "Done" : "Back"
|
|
1109
|
+
children: t === "standalone" ? i("support.done_button", "Done") : i("nav.back_aria", "Back")
|
|
563
1110
|
}
|
|
564
1111
|
),
|
|
565
1112
|
/* @__PURE__ */ o(
|
|
566
1113
|
"button",
|
|
567
1114
|
{
|
|
568
1115
|
type: "button",
|
|
569
|
-
onClick:
|
|
1116
|
+
onClick: q,
|
|
570
1117
|
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)]",
|
|
571
1118
|
style: {
|
|
572
1119
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
573
1120
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
574
1121
|
},
|
|
575
|
-
children: "Send another request"
|
|
1122
|
+
children: i("support.send_another", "Send another request")
|
|
576
1123
|
}
|
|
577
1124
|
)
|
|
578
|
-
] })
|
|
579
|
-
] }) : /* @__PURE__ */ c("
|
|
580
|
-
/* @__PURE__ */ o(
|
|
581
|
-
|
|
582
|
-
{
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
),
|
|
631
|
-
/* @__PURE__ */ o(Te, { files: A, onChange: f, disabled: g }),
|
|
632
|
-
S.submit && /* @__PURE__ */ o("p", { class: "text-xs text-red-600", children: S.submit }),
|
|
633
|
-
/* @__PURE__ */ c("div", { class: "mt-1 flex items-center justify-end gap-2", children: [
|
|
1125
|
+
] }) })
|
|
1126
|
+
] }) : /* @__PURE__ */ c("form", { onSubmit: R, class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1127
|
+
/* @__PURE__ */ o(St, { onClick: n, ariaLabel: i("nav.back_aria", "Back") }),
|
|
1128
|
+
/* @__PURE__ */ o("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: /* @__PURE__ */ c("div", { class: "flex flex-col gap-5", children: [
|
|
1129
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col gap-2 pr-10", children: [
|
|
1130
|
+
/* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: i("support.heading", "Support") }),
|
|
1131
|
+
/* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: i("support.instruction", "Please fill out the form below to submit your support request.") })
|
|
1132
|
+
] }),
|
|
1133
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
1134
|
+
a ? /* @__PURE__ */ c("div", { class: "rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600", children: [
|
|
1135
|
+
i("support.sending_as", "Sending as"),
|
|
1136
|
+
" ",
|
|
1137
|
+
/* @__PURE__ */ o("b", { class: "font-medium text-gray-900", children: a })
|
|
1138
|
+
] }) : /* @__PURE__ */ o(
|
|
1139
|
+
be,
|
|
1140
|
+
{
|
|
1141
|
+
type: "email",
|
|
1142
|
+
placeholder: i("support.email_placeholder", "Enter your email *"),
|
|
1143
|
+
value: l,
|
|
1144
|
+
onInput: d,
|
|
1145
|
+
error: E.email,
|
|
1146
|
+
autocomplete: "email",
|
|
1147
|
+
required: !0
|
|
1148
|
+
}
|
|
1149
|
+
),
|
|
1150
|
+
/* @__PURE__ */ o(
|
|
1151
|
+
be,
|
|
1152
|
+
{
|
|
1153
|
+
type: "text",
|
|
1154
|
+
placeholder: i("support.subject_placeholder", "Enter your subject *"),
|
|
1155
|
+
value: p,
|
|
1156
|
+
onInput: u,
|
|
1157
|
+
error: E.subject,
|
|
1158
|
+
required: !0
|
|
1159
|
+
}
|
|
1160
|
+
),
|
|
1161
|
+
/* @__PURE__ */ o(
|
|
1162
|
+
Ct,
|
|
1163
|
+
{
|
|
1164
|
+
placeholder: i("support.message_placeholder", "Enter your message *"),
|
|
1165
|
+
value: h,
|
|
1166
|
+
onInput: b,
|
|
1167
|
+
error: E.message,
|
|
1168
|
+
required: !0
|
|
1169
|
+
}
|
|
1170
|
+
),
|
|
1171
|
+
/* @__PURE__ */ o(It, { files: _, onChange: f, disabled: g })
|
|
1172
|
+
] })
|
|
1173
|
+
] }) }),
|
|
1174
|
+
/* @__PURE__ */ c("div", { class: D, style: N, children: [
|
|
1175
|
+
E.submit && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: E.submit }),
|
|
1176
|
+
/* @__PURE__ */ c("div", { class: "flex items-center justify-end gap-3", children: [
|
|
634
1177
|
/* @__PURE__ */ o(
|
|
635
1178
|
"button",
|
|
636
1179
|
{
|
|
637
1180
|
type: "button",
|
|
638
1181
|
onClick: n,
|
|
639
1182
|
disabled: g,
|
|
640
|
-
class: "rounded-
|
|
641
|
-
children: t === "standalone" ? "Close" : "Back"
|
|
1183
|
+
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)]",
|
|
1184
|
+
children: t === "standalone" ? i("support.close_button", "Close") : i("nav.back_aria", "Back")
|
|
642
1185
|
}
|
|
643
1186
|
),
|
|
644
1187
|
/* @__PURE__ */ o(
|
|
645
1188
|
"button",
|
|
646
1189
|
{
|
|
647
1190
|
type: "submit",
|
|
648
|
-
disabled: !
|
|
649
|
-
class: "flex h-
|
|
1191
|
+
disabled: !O || g,
|
|
1192
|
+
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)]",
|
|
650
1193
|
style: {
|
|
651
|
-
background: "linear-gradient(
|
|
652
|
-
boxShadow: "0
|
|
1194
|
+
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%)",
|
|
1195
|
+
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)"
|
|
653
1196
|
},
|
|
654
|
-
children: g ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : "Send"
|
|
1197
|
+
children: g ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: i("support.send_button", "Send") })
|
|
1198
|
+
}
|
|
1199
|
+
)
|
|
1200
|
+
] })
|
|
1201
|
+
] })
|
|
1202
|
+
] });
|
|
1203
|
+
}
|
|
1204
|
+
function St({ onClick: r, ariaLabel: e }) {
|
|
1205
|
+
return /* @__PURE__ */ o(
|
|
1206
|
+
"button",
|
|
1207
|
+
{
|
|
1208
|
+
type: "button",
|
|
1209
|
+
onClick: r,
|
|
1210
|
+
"aria-label": e,
|
|
1211
|
+
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)]",
|
|
1212
|
+
children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1213
|
+
/* @__PURE__ */ o(
|
|
1214
|
+
"path",
|
|
1215
|
+
{
|
|
1216
|
+
d: "M5 8h8a4 4 0 0 1 0 8H9",
|
|
1217
|
+
stroke: "currentColor",
|
|
1218
|
+
"stroke-width": "1.75",
|
|
1219
|
+
"stroke-linecap": "round",
|
|
1220
|
+
"stroke-linejoin": "round"
|
|
1221
|
+
}
|
|
1222
|
+
),
|
|
1223
|
+
/* @__PURE__ */ o(
|
|
1224
|
+
"path",
|
|
1225
|
+
{
|
|
1226
|
+
d: "M8 4 4 8l4 4",
|
|
1227
|
+
stroke: "currentColor",
|
|
1228
|
+
"stroke-width": "1.75",
|
|
1229
|
+
"stroke-linecap": "round",
|
|
1230
|
+
"stroke-linejoin": "round"
|
|
655
1231
|
}
|
|
656
1232
|
)
|
|
657
1233
|
] })
|
|
658
|
-
|
|
659
|
-
|
|
1234
|
+
}
|
|
1235
|
+
);
|
|
660
1236
|
}
|
|
661
|
-
function
|
|
662
|
-
|
|
663
|
-
|
|
1237
|
+
function be({
|
|
1238
|
+
type: r,
|
|
1239
|
+
placeholder: e,
|
|
1240
|
+
value: t,
|
|
1241
|
+
onInput: n,
|
|
1242
|
+
error: i,
|
|
1243
|
+
autocomplete: s,
|
|
1244
|
+
required: a
|
|
1245
|
+
}) {
|
|
1246
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
664
1247
|
/* @__PURE__ */ o(
|
|
665
1248
|
"input",
|
|
666
1249
|
{
|
|
667
1250
|
type: r,
|
|
668
1251
|
value: t,
|
|
669
|
-
|
|
1252
|
+
placeholder: e,
|
|
1253
|
+
onInput: (l) => n(l.target.value),
|
|
670
1254
|
autocomplete: s,
|
|
671
|
-
required:
|
|
672
|
-
class: `h-
|
|
1255
|
+
required: a,
|
|
1256
|
+
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 ${i ? "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)]"}`
|
|
673
1257
|
}
|
|
674
1258
|
),
|
|
675
|
-
i && /* @__PURE__ */ o("span", { class: "text-
|
|
1259
|
+
i && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: i })
|
|
676
1260
|
] });
|
|
677
1261
|
}
|
|
678
|
-
function
|
|
679
|
-
|
|
680
|
-
|
|
1262
|
+
function Ct({
|
|
1263
|
+
placeholder: r,
|
|
1264
|
+
value: e,
|
|
1265
|
+
onInput: t,
|
|
1266
|
+
error: n,
|
|
1267
|
+
required: i
|
|
1268
|
+
}) {
|
|
1269
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
681
1270
|
/* @__PURE__ */ o(
|
|
682
1271
|
"textarea",
|
|
683
1272
|
{
|
|
684
1273
|
value: e,
|
|
1274
|
+
placeholder: r,
|
|
685
1275
|
onInput: (s) => t(s.target.value),
|
|
686
1276
|
required: i,
|
|
687
|
-
rows:
|
|
688
|
-
class: `min-h-[
|
|
1277
|
+
rows: 5,
|
|
1278
|
+
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 ${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)]"}`
|
|
689
1279
|
}
|
|
690
1280
|
),
|
|
691
|
-
n && /* @__PURE__ */ o("span", { class: "text-
|
|
1281
|
+
n && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: n })
|
|
692
1282
|
] });
|
|
693
1283
|
}
|
|
694
|
-
function
|
|
695
|
-
const n =
|
|
1284
|
+
function It({ files: r, onChange: e, disabled: t }) {
|
|
1285
|
+
const { t: n } = w(), i = z(null), [s, a] = x(!1), [l, d] = x(null), p = (u) => {
|
|
696
1286
|
if (!u || t) return;
|
|
697
|
-
|
|
698
|
-
const
|
|
699
|
-
if (r.length +
|
|
700
|
-
|
|
1287
|
+
d(null);
|
|
1288
|
+
const h = Array.from(u);
|
|
1289
|
+
if (r.length + h.length > oe) {
|
|
1290
|
+
d(n("support.too_many_files", "Up to {max} files", { max: oe }));
|
|
701
1291
|
return;
|
|
702
1292
|
}
|
|
703
|
-
const
|
|
704
|
-
(
|
|
1293
|
+
const b = h.filter(
|
|
1294
|
+
(_) => ye.includes(_.type) && _.size <= vt
|
|
705
1295
|
);
|
|
706
|
-
if (
|
|
707
|
-
|
|
1296
|
+
if (b.length !== h.length) {
|
|
1297
|
+
d(n("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
|
|
708
1298
|
return;
|
|
709
1299
|
}
|
|
710
|
-
e([...r, ...
|
|
1300
|
+
e([...r, ...b]);
|
|
711
1301
|
};
|
|
712
1302
|
return /* @__PURE__ */ c("div", { children: [
|
|
713
|
-
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: "Attachments (optional)" }),
|
|
1303
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: n("support.attachments_label", "Attachments (optional)") }),
|
|
714
1304
|
/* @__PURE__ */ c(
|
|
715
1305
|
"div",
|
|
716
1306
|
{
|
|
717
1307
|
role: "button",
|
|
718
1308
|
tabIndex: 0,
|
|
719
|
-
"aria-label": "Attachments upload",
|
|
720
|
-
onClick: () => !t &&
|
|
1309
|
+
"aria-label": n("support.attachments_aria", "Attachments upload"),
|
|
1310
|
+
onClick: () => !t && i.current?.click(),
|
|
721
1311
|
onDragOver: (u) => {
|
|
722
|
-
u.preventDefault(), t ||
|
|
1312
|
+
u.preventDefault(), t || a(!0);
|
|
723
1313
|
},
|
|
724
|
-
onDragLeave: () =>
|
|
1314
|
+
onDragLeave: () => a(!1),
|
|
725
1315
|
onDrop: (u) => {
|
|
726
|
-
u.preventDefault(),
|
|
1316
|
+
u.preventDefault(), a(!1), p(u.dataTransfer?.files ?? null);
|
|
727
1317
|
},
|
|
728
|
-
class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${
|
|
1318
|
+
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"} ${t ? "cursor-not-allowed opacity-60" : ""}`,
|
|
729
1319
|
children: [
|
|
730
|
-
/* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: "Drop images here or click to select" }),
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
" files, ≤ 10MB each"
|
|
735
|
-
] })
|
|
1320
|
+
/* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: n("support.dropzone_text", "Drop images here or click to select") }),
|
|
1321
|
+
/* @__PURE__ */ o("div", { class: "mt-0.5 text-[11px] text-gray-400", children: n("support.file_requirements", "JPEG/PNG/WebP, up to {max} files, ≤ 10MB each", {
|
|
1322
|
+
max: oe
|
|
1323
|
+
}) })
|
|
736
1324
|
]
|
|
737
1325
|
}
|
|
738
1326
|
),
|
|
739
1327
|
/* @__PURE__ */ o(
|
|
740
1328
|
"input",
|
|
741
1329
|
{
|
|
742
|
-
ref:
|
|
1330
|
+
ref: i,
|
|
743
1331
|
type: "file",
|
|
744
1332
|
multiple: !0,
|
|
745
|
-
accept:
|
|
1333
|
+
accept: ye.join(","),
|
|
746
1334
|
class: "hidden",
|
|
747
1335
|
onChange: (u) => {
|
|
748
|
-
|
|
1336
|
+
p(u.target.files), u.currentTarget.value = "";
|
|
749
1337
|
}
|
|
750
1338
|
}
|
|
751
1339
|
),
|
|
752
1340
|
l && /* @__PURE__ */ o("p", { class: "mt-1 text-xs text-red-600", children: l }),
|
|
753
|
-
r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((u,
|
|
1341
|
+
r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((u, h) => /* @__PURE__ */ c(
|
|
754
1342
|
"li",
|
|
755
1343
|
{
|
|
756
1344
|
class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
|
|
@@ -761,81 +1349,119 @@ function Te({ files: r, onChange: e, disabled: t }) {
|
|
|
761
1349
|
{
|
|
762
1350
|
type: "button",
|
|
763
1351
|
onClick: () => {
|
|
764
|
-
const
|
|
765
|
-
|
|
1352
|
+
const b = [...r];
|
|
1353
|
+
b.splice(h, 1), e(b);
|
|
766
1354
|
},
|
|
767
1355
|
disabled: t,
|
|
768
1356
|
class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
|
|
769
|
-
"aria-label":
|
|
1357
|
+
"aria-label": n("support.remove_file_aria", "Remove {filename}", { filename: u.name }),
|
|
770
1358
|
children: "✕"
|
|
771
1359
|
}
|
|
772
1360
|
)
|
|
773
1361
|
]
|
|
774
1362
|
},
|
|
775
|
-
`${u.name}-${u.size}-${
|
|
1363
|
+
`${u.name}-${u.size}-${h}`
|
|
776
1364
|
)) })
|
|
777
1365
|
] });
|
|
778
1366
|
}
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
1367
|
+
const Lt = {
|
|
1368
|
+
day: "cta.get_plan_daily",
|
|
1369
|
+
week: "cta.get_plan_weekly",
|
|
1370
|
+
month: "cta.get_plan_monthly",
|
|
1371
|
+
year: "cta.get_plan_yearly"
|
|
1372
|
+
}, At = {
|
|
1373
|
+
day: "Get Daily Plan",
|
|
1374
|
+
week: "Get Weekly Plan",
|
|
1375
|
+
month: "Get Monthly Plan",
|
|
1376
|
+
year: "Get Yearly Plan"
|
|
1377
|
+
};
|
|
1378
|
+
function Et(r, e, t, n) {
|
|
1379
|
+
if (e === "close") return n("cta.close", "Close");
|
|
1380
|
+
if (!r) return n("cta.continue", "Continue");
|
|
1381
|
+
if (!t && r.trial_days && r.interval && r.interval !== "lifetime")
|
|
1382
|
+
return n("cta.start_trial", "Start {days}-Day Free Trial", { days: r.trial_days });
|
|
1383
|
+
if (!r.interval || r.interval === "lifetime")
|
|
1384
|
+
return n("cta.get_lifetime_access", "Get Lifetime Access");
|
|
1385
|
+
const i = Lt[r.interval];
|
|
1386
|
+
return i ? n(i, At[r.interval]) : n("cta.get_plan_generic", "Get {interval} Plan", {
|
|
1387
|
+
interval: Pt(r.interval)
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
function Pt(r) {
|
|
1391
|
+
return r.length ? r[0].toUpperCase() + r.slice(1) : r;
|
|
1392
|
+
}
|
|
1393
|
+
function Tt({ block: r, ctx: e }) {
|
|
1394
|
+
const { t } = w(), [n, i] = x(!1), s = r.priceId ?? e.selectedPriceId, a = n || r.action === "checkout" && !s, l = s ? e.bootstrap.prices.find((h) => h.id === s) ?? null : null, d = e.bootstrap.user?.had_previous_trial ?? !1, p = r.label ?? Et(l, r.action, d, t);
|
|
1395
|
+
return /* @__PURE__ */ c(
|
|
782
1396
|
"button",
|
|
783
1397
|
{
|
|
784
1398
|
type: "button",
|
|
785
|
-
disabled:
|
|
1399
|
+
disabled: a,
|
|
786
1400
|
onClick: async () => {
|
|
787
|
-
if (!
|
|
788
|
-
|
|
1401
|
+
if (!a) {
|
|
1402
|
+
i(!0);
|
|
789
1403
|
try {
|
|
790
|
-
await e.onAction(r.action, { priceId:
|
|
1404
|
+
await e.onAction(r.action, { priceId: s });
|
|
791
1405
|
} finally {
|
|
792
|
-
|
|
1406
|
+
i(!1);
|
|
793
1407
|
}
|
|
794
1408
|
}
|
|
795
1409
|
},
|
|
796
|
-
class: "pw-cta-shimmer relative
|
|
1410
|
+
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)]",
|
|
797
1411
|
style: {
|
|
798
1412
|
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%)",
|
|
799
|
-
boxShadow: "0 0
|
|
1413
|
+
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)"
|
|
800
1414
|
},
|
|
801
|
-
children:
|
|
1415
|
+
children: [
|
|
1416
|
+
/* @__PURE__ */ o(
|
|
1417
|
+
"span",
|
|
1418
|
+
{
|
|
1419
|
+
class: "absolute inset-0 opacity-40",
|
|
1420
|
+
style: {
|
|
1421
|
+
background: "radial-gradient(circle at 50% 0%, color-mix(in srgb, white 40%, transparent) 0%, transparent 70%)"
|
|
1422
|
+
},
|
|
1423
|
+
"aria-hidden": "true"
|
|
1424
|
+
}
|
|
1425
|
+
),
|
|
1426
|
+
n ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: p })
|
|
1427
|
+
]
|
|
802
1428
|
}
|
|
803
1429
|
);
|
|
804
1430
|
}
|
|
805
|
-
function
|
|
806
|
-
const e = r.authSession,
|
|
807
|
-
if (
|
|
1431
|
+
function Mt({ ctx: r }) {
|
|
1432
|
+
const { t: e } = w(), t = r.authSession, n = r.auth, [i, s] = x(!1), a = () => r.onAction("support");
|
|
1433
|
+
if (t && !t.user.is_anonymous) {
|
|
808
1434
|
const l = async () => {
|
|
809
|
-
if (!(!
|
|
810
|
-
|
|
1435
|
+
if (!(!n || i)) {
|
|
1436
|
+
s(!0);
|
|
811
1437
|
try {
|
|
812
|
-
await
|
|
1438
|
+
await n.signOut();
|
|
813
1439
|
} catch {
|
|
814
1440
|
} finally {
|
|
815
|
-
|
|
1441
|
+
s(!1);
|
|
816
1442
|
}
|
|
817
1443
|
}
|
|
818
1444
|
};
|
|
819
1445
|
return /* @__PURE__ */ c("div", { class: "-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500", children: [
|
|
820
1446
|
/* @__PURE__ */ c("span", { children: [
|
|
821
|
-
"Signed in as",
|
|
1447
|
+
e("session.signed_in_as_prefix", "Signed in as"),
|
|
822
1448
|
" ",
|
|
823
|
-
/* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children:
|
|
1449
|
+
/* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: t.user.email })
|
|
824
1450
|
] }),
|
|
825
1451
|
/* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
|
|
826
|
-
/* @__PURE__ */ o(
|
|
827
|
-
/* @__PURE__ */ o(
|
|
828
|
-
/* @__PURE__ */ o(
|
|
1452
|
+
/* @__PURE__ */ o(H, { onClick: l, disabled: !n || i, children: i ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
|
|
1453
|
+
/* @__PURE__ */ o(we, {}),
|
|
1454
|
+
/* @__PURE__ */ o(H, { onClick: a, children: e("session.contact_support", "Contact Support") })
|
|
829
1455
|
] })
|
|
830
1456
|
] });
|
|
831
1457
|
}
|
|
832
1458
|
return /* @__PURE__ */ c("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
|
|
833
|
-
/* @__PURE__ */ o(
|
|
834
|
-
/* @__PURE__ */ o(
|
|
835
|
-
/* @__PURE__ */ o(
|
|
1459
|
+
/* @__PURE__ */ o(H, { onClick: () => r.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
|
|
1460
|
+
/* @__PURE__ */ o(we, {}),
|
|
1461
|
+
/* @__PURE__ */ o(H, { onClick: a, children: e("session.contact_support", "Contact Support") })
|
|
836
1462
|
] });
|
|
837
1463
|
}
|
|
838
|
-
function
|
|
1464
|
+
function H({
|
|
839
1465
|
onClick: r,
|
|
840
1466
|
disabled: e,
|
|
841
1467
|
children: t
|
|
@@ -846,190 +1472,338 @@ function z({
|
|
|
846
1472
|
type: "button",
|
|
847
1473
|
onClick: r,
|
|
848
1474
|
disabled: e,
|
|
849
|
-
class: "font-semibold
|
|
1475
|
+
class: "font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
|
|
850
1476
|
style: { color: "var(--pw-accent)" },
|
|
851
1477
|
children: t
|
|
852
1478
|
}
|
|
853
1479
|
);
|
|
854
1480
|
}
|
|
855
|
-
function
|
|
1481
|
+
function we() {
|
|
856
1482
|
return /* @__PURE__ */ o("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
|
|
857
1483
|
}
|
|
858
|
-
function
|
|
1484
|
+
function Bt({ block: r }) {
|
|
859
1485
|
return r.items.length ? /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2.5", role: "list", children: r.items.map((e) => /* @__PURE__ */ c("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
|
|
860
1486
|
/* @__PURE__ */ o(
|
|
861
|
-
"
|
|
1487
|
+
"svg",
|
|
862
1488
|
{
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
1489
|
+
width: "18",
|
|
1490
|
+
height: "18",
|
|
1491
|
+
viewBox: "0 0 20 20",
|
|
1492
|
+
fill: "none",
|
|
1493
|
+
class: "mt-0.5 flex-shrink-0 text-emerald-500",
|
|
868
1494
|
"aria-hidden": "true",
|
|
869
|
-
children: /* @__PURE__ */ o(
|
|
1495
|
+
children: /* @__PURE__ */ o(
|
|
870
1496
|
"path",
|
|
871
1497
|
{
|
|
872
|
-
d: "
|
|
1498
|
+
d: "M4 10.5l3.5 3.5 8.5-8.5",
|
|
873
1499
|
stroke: "currentColor",
|
|
874
1500
|
"stroke-width": "2.5",
|
|
875
1501
|
"stroke-linecap": "round",
|
|
876
1502
|
"stroke-linejoin": "round"
|
|
877
1503
|
}
|
|
878
|
-
)
|
|
1504
|
+
)
|
|
879
1505
|
}
|
|
880
1506
|
),
|
|
881
1507
|
/* @__PURE__ */ c("div", { class: "flex flex-col gap-0.5", children: [
|
|
882
1508
|
/* @__PURE__ */ o("span", { class: "font-medium leading-snug text-gray-900", children: e.name }),
|
|
883
|
-
e.desc ? /* @__PURE__ */ o("span", { class: "text-xs leading-relaxed text-gray-
|
|
1509
|
+
e.desc ? /* @__PURE__ */ o("span", { class: "text-xs leading-relaxed text-gray-400", children: e.desc }) : null
|
|
884
1510
|
] })
|
|
885
1511
|
] }, e.id)) }) : null;
|
|
886
1512
|
}
|
|
887
|
-
function
|
|
888
|
-
const
|
|
889
|
-
return /* @__PURE__ */ c("div", { class: "
|
|
890
|
-
/* @__PURE__ */ c("div", { class: "flex items-center
|
|
891
|
-
|
|
892
|
-
/* @__PURE__ */
|
|
1513
|
+
function Ot({ block: r }) {
|
|
1514
|
+
const { t: e } = w(), t = r.title ?? e("pricing.money_back", "30-day money-back guarantee"), n = r.subtitle, i = (r.icon ?? "dollar_shield") !== "none", s = Ut(t);
|
|
1515
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100", children: [
|
|
1516
|
+
/* @__PURE__ */ c("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
|
|
1517
|
+
i ? /* @__PURE__ */ o(jt, {}) : null,
|
|
1518
|
+
s ? /* @__PURE__ */ c("span", { children: [
|
|
1519
|
+
/* @__PURE__ */ o("b", { class: "font-bold text-gray-900", children: s.bold }),
|
|
1520
|
+
" ",
|
|
1521
|
+
/* @__PURE__ */ o("span", { class: "font-medium", children: s.rest })
|
|
1522
|
+
] }) : /* @__PURE__ */ o("span", { class: "font-medium", children: t })
|
|
893
1523
|
] }),
|
|
894
|
-
|
|
1524
|
+
n ? /* @__PURE__ */ o("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: n }) : null
|
|
895
1525
|
] });
|
|
896
1526
|
}
|
|
897
|
-
function
|
|
898
|
-
|
|
1527
|
+
function Ut(r) {
|
|
1528
|
+
const e = r.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
|
|
1529
|
+
return e ? { bold: e[1], rest: e[2] } : null;
|
|
1530
|
+
}
|
|
1531
|
+
function jt() {
|
|
1532
|
+
return /* @__PURE__ */ c(
|
|
899
1533
|
"svg",
|
|
900
1534
|
{
|
|
901
1535
|
xmlns: "http://www.w3.org/2000/svg",
|
|
902
|
-
viewBox: "0 0
|
|
903
|
-
fill: "
|
|
904
|
-
width: "
|
|
905
|
-
height: "
|
|
906
|
-
class: "text-emerald-500",
|
|
1536
|
+
viewBox: "0 0 24 24",
|
|
1537
|
+
fill: "none",
|
|
1538
|
+
width: "16",
|
|
1539
|
+
height: "16",
|
|
1540
|
+
class: "flex-shrink-0 text-emerald-500",
|
|
907
1541
|
"aria-hidden": "true",
|
|
908
|
-
children:
|
|
1542
|
+
children: [
|
|
1543
|
+
/* @__PURE__ */ o(
|
|
1544
|
+
"path",
|
|
1545
|
+
{
|
|
1546
|
+
d: "M12 2 4 5v6c0 5.25 3.5 9.5 8 11 4.5-1.5 8-5.75 8-11V5l-8-3Z",
|
|
1547
|
+
stroke: "currentColor",
|
|
1548
|
+
"stroke-width": "2",
|
|
1549
|
+
"stroke-linejoin": "round"
|
|
1550
|
+
}
|
|
1551
|
+
),
|
|
1552
|
+
/* @__PURE__ */ o(
|
|
1553
|
+
"path",
|
|
1554
|
+
{
|
|
1555
|
+
d: "m9 12 2 2 4-4",
|
|
1556
|
+
stroke: "currentColor",
|
|
1557
|
+
"stroke-width": "2",
|
|
1558
|
+
"stroke-linecap": "round",
|
|
1559
|
+
"stroke-linejoin": "round"
|
|
1560
|
+
}
|
|
1561
|
+
)
|
|
1562
|
+
]
|
|
909
1563
|
}
|
|
910
1564
|
);
|
|
911
1565
|
}
|
|
912
|
-
const
|
|
913
|
-
function
|
|
914
|
-
const t = e *
|
|
915
|
-
let n =
|
|
916
|
-
for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n >
|
|
1566
|
+
const Ue = 24, Rt = 16, zt = 2;
|
|
1567
|
+
function Dt(r, e) {
|
|
1568
|
+
const t = e * zt;
|
|
1569
|
+
let n = Ue;
|
|
1570
|
+
for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n > Rt; )
|
|
917
1571
|
n -= 1, r.style.fontSize = `${n}px`;
|
|
918
1572
|
}
|
|
919
|
-
function
|
|
920
|
-
const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[
|
|
921
|
-
return
|
|
922
|
-
if (!
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
}, [
|
|
1573
|
+
function qt({ block: r, ctx: e }) {
|
|
1574
|
+
const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : t === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = z(null), a = t === 1 && !!e.bootstrap.settings.title_auto_fit;
|
|
1575
|
+
return T(() => {
|
|
1576
|
+
if (!a || !s.current) return;
|
|
1577
|
+
const l = getComputedStyle(s.current), d = parseFloat(l.lineHeight) || Ue * 1.5;
|
|
1578
|
+
Dt(s.current, d);
|
|
1579
|
+
}, [a, r.text]), /* @__PURE__ */ o(n, { ref: s, class: i, children: r.text });
|
|
926
1580
|
}
|
|
927
|
-
function
|
|
1581
|
+
function Nt(r) {
|
|
928
1582
|
const e = r.local ?? { currency: r.currency, amount: r.amount };
|
|
1583
|
+
if (r.interval === "year") {
|
|
1584
|
+
const t = (r.interval_count ?? 1) * 12;
|
|
1585
|
+
return { amount: e.amount / t, currency: e.currency };
|
|
1586
|
+
}
|
|
1587
|
+
return { amount: e.amount, currency: e.currency };
|
|
1588
|
+
}
|
|
1589
|
+
function se(r, e) {
|
|
1590
|
+
const t = r % 1 !== 0 ? 2 : 0;
|
|
929
1591
|
try {
|
|
930
|
-
const
|
|
1592
|
+
const n = new Intl.NumberFormat(void 0, {
|
|
931
1593
|
style: "currency",
|
|
932
|
-
currency: e
|
|
1594
|
+
currency: e,
|
|
933
1595
|
currencyDisplay: "narrowSymbol",
|
|
934
|
-
maximumFractionDigits:
|
|
935
|
-
minimumFractionDigits:
|
|
936
|
-
}).formatToParts(
|
|
937
|
-
let
|
|
938
|
-
for (const
|
|
939
|
-
|
|
940
|
-
return { currency:
|
|
1596
|
+
maximumFractionDigits: t,
|
|
1597
|
+
minimumFractionDigits: t
|
|
1598
|
+
}).formatToParts(r);
|
|
1599
|
+
let i = "", s = "";
|
|
1600
|
+
for (const a of n)
|
|
1601
|
+
a.type === "currency" ? i = a.value : a.type !== "literal" && (s += a.value);
|
|
1602
|
+
return { currency: i || e, amount: s.trim() };
|
|
941
1603
|
} catch {
|
|
942
|
-
return { currency: e
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
function
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
}
|
|
958
|
-
function
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1604
|
+
return { currency: e, amount: String(r) };
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
function le(r, e) {
|
|
1608
|
+
const { amount: t, currency: n } = Nt(r);
|
|
1609
|
+
if (!e) {
|
|
1610
|
+
const { currency: l, amount: d } = se(t, n);
|
|
1611
|
+
return { currency: l, amount: d, originalAmount: null };
|
|
1612
|
+
}
|
|
1613
|
+
const i = t * (1 - e / 100), s = se(i, n), a = se(t, n);
|
|
1614
|
+
return {
|
|
1615
|
+
currency: s.currency,
|
|
1616
|
+
amount: s.amount,
|
|
1617
|
+
originalAmount: `${a.currency}${a.amount}`
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
function G(r, e) {
|
|
1621
|
+
if (!r || r.length === 0) return null;
|
|
1622
|
+
const t = r.find(
|
|
1623
|
+
(i) => i.price_id === e && i.discount_percent && i.discount_percent > 0
|
|
1624
|
+
);
|
|
1625
|
+
return t || (r.find(
|
|
1626
|
+
(i) => i.price_id == null && i.discount_percent && i.discount_percent > 0
|
|
1627
|
+
) ?? null);
|
|
1628
|
+
}
|
|
1629
|
+
function je(r, e) {
|
|
1630
|
+
if (r.label) return r.label.toUpperCase();
|
|
1631
|
+
if (!r.interval || r.interval === "lifetime")
|
|
1632
|
+
return e("pricing.plan_label.lifetime", "LIFETIME");
|
|
1633
|
+
const n = {
|
|
1634
|
+
day: { key: "pricing.plan_label.daily", fallback: "DAILY PLAN" },
|
|
1635
|
+
week: { key: "pricing.plan_label.weekly", fallback: "WEEKLY PLAN" },
|
|
1636
|
+
month: { key: "pricing.plan_label.monthly", fallback: "MONTHLY PLAN" },
|
|
1637
|
+
year: { key: "pricing.plan_label.yearly", fallback: "YEARLY PLAN" }
|
|
1638
|
+
}[r.interval];
|
|
1639
|
+
return n ? e(n.key, n.fallback) : `${r.interval.toUpperCase()} PLAN`;
|
|
1640
|
+
}
|
|
1641
|
+
function ce(r, e) {
|
|
1642
|
+
if (!r.interval || r.interval === "lifetime")
|
|
1643
|
+
return e("pricing.interval.lifetime_short", "lifetime");
|
|
1644
|
+
if (r.interval === "year") return e("pricing.interval.month", "month");
|
|
1645
|
+
const t = r.interval_count ?? 1;
|
|
1646
|
+
return t === 1 ? e(`pricing.interval.${r.interval}`, r.interval) : `${t} ${r.interval}s`;
|
|
1647
|
+
}
|
|
1648
|
+
function Ft({ block: r, ctx: e }) {
|
|
1649
|
+
const { t } = w(), n = r.priceIds && r.priceIds.length > 0 ? new Set(r.priceIds) : null, i = e.bootstrap.prices.filter((a) => !n || n.has(a.id));
|
|
1650
|
+
if (i.length === 0)
|
|
1651
|
+
return /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: t("pricing.no_prices", "No prices available.") });
|
|
1652
|
+
const s = r.popular_label ?? t("pricing.most_popular", "Most popular");
|
|
1653
|
+
if (r.view === "compact")
|
|
1654
|
+
return /* @__PURE__ */ o(
|
|
1655
|
+
"div",
|
|
1656
|
+
{
|
|
1657
|
+
class: "flex w-full flex-col rounded-xl border border-gray-200 bg-gray-50",
|
|
1658
|
+
role: "radiogroup",
|
|
1659
|
+
"aria-label": t("pricing.plans_aria", "Plans"),
|
|
1660
|
+
children: i.map((a, l) => /* @__PURE__ */ o(
|
|
1661
|
+
$t,
|
|
1662
|
+
{
|
|
1663
|
+
price: a,
|
|
1664
|
+
isLast: l === i.length - 1,
|
|
1665
|
+
isPopular: r.popular_price_id === a.id,
|
|
1666
|
+
popularLabel: s,
|
|
1667
|
+
offer: G(e.bootstrap.offers, a.id),
|
|
1668
|
+
selected: e.selectedPriceId === a.id,
|
|
1669
|
+
onSelect: () => {
|
|
1670
|
+
e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
|
|
1671
|
+
},
|
|
1672
|
+
t
|
|
1673
|
+
},
|
|
1674
|
+
a.id
|
|
1675
|
+
))
|
|
1676
|
+
}
|
|
1677
|
+
);
|
|
1678
|
+
if (r.view === "horizontal") {
|
|
1679
|
+
const a = Math.min(i.length, 3), l = i.some(
|
|
1680
|
+
(d) => (G(e.bootstrap.offers, d.id)?.discount_percent ?? 0) > 0
|
|
1681
|
+
);
|
|
1682
|
+
return /* @__PURE__ */ o(
|
|
1683
|
+
"div",
|
|
1684
|
+
{
|
|
1685
|
+
class: "grid items-stretch gap-2",
|
|
1686
|
+
style: { gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))` },
|
|
1687
|
+
role: "radiogroup",
|
|
1688
|
+
"aria-label": t("pricing.plans_aria", "Plans"),
|
|
1689
|
+
children: i.map((d) => /* @__PURE__ */ o(
|
|
1690
|
+
Ht,
|
|
1691
|
+
{
|
|
1692
|
+
price: d,
|
|
1693
|
+
isPopular: r.popular_price_id === d.id,
|
|
1694
|
+
popularLabel: s,
|
|
1695
|
+
offer: G(e.bootstrap.offers, d.id),
|
|
1696
|
+
reserveStrikeRow: l,
|
|
1697
|
+
selected: e.selectedPriceId === d.id,
|
|
1698
|
+
onSelect: () => {
|
|
1699
|
+
e.setSelectedPriceId(d.id), e.onAction("price_selected", { priceId: d.id, price: d });
|
|
1700
|
+
},
|
|
1701
|
+
t
|
|
1702
|
+
},
|
|
1703
|
+
d.id
|
|
1704
|
+
))
|
|
1705
|
+
}
|
|
1706
|
+
);
|
|
1707
|
+
}
|
|
963
1708
|
return /* @__PURE__ */ o(
|
|
964
1709
|
"div",
|
|
965
1710
|
{
|
|
966
|
-
class:
|
|
967
|
-
style: i ? { gridTemplateColumns: `repeat(${l}, minmax(0, 1fr))` } : void 0,
|
|
1711
|
+
class: "flex flex-col gap-2",
|
|
968
1712
|
role: "radiogroup",
|
|
969
|
-
"aria-label": "Plans",
|
|
970
|
-
children:
|
|
971
|
-
const
|
|
1713
|
+
"aria-label": t("pricing.plans_aria", "Plans"),
|
|
1714
|
+
children: i.map((a) => {
|
|
1715
|
+
const l = e.selectedPriceId === a.id, d = r.popular_price_id === a.id, u = G(e.bootstrap.offers, a.id)?.discount_percent ?? null, { currency: h, amount: b, originalAmount: _ } = le(a, u);
|
|
972
1716
|
return /* @__PURE__ */ c(
|
|
973
1717
|
"button",
|
|
974
1718
|
{
|
|
975
1719
|
type: "button",
|
|
976
1720
|
role: "radio",
|
|
977
|
-
"aria-checked":
|
|
1721
|
+
"aria-checked": l,
|
|
978
1722
|
onClick: () => {
|
|
979
1723
|
e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
|
|
980
1724
|
},
|
|
981
1725
|
class: [
|
|
982
|
-
"group relative flex w-full items-center gap-
|
|
983
|
-
|
|
984
|
-
|
|
1726
|
+
"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)]",
|
|
1727
|
+
// Везде border 2px — selection выражается только цветом, layout
|
|
1728
|
+
// не прыгает (равная толщина у selected/unselected). Цветовая
|
|
1729
|
+
// разница accent vs gray достаточно сильная для visual hierarchy.
|
|
1730
|
+
l ? "border-[var(--pw-accent)] bg-transparent" : "border-gray-200 bg-transparent hover:bg-gray-50"
|
|
985
1731
|
].join(" "),
|
|
986
1732
|
children: [
|
|
987
|
-
|
|
1733
|
+
/* @__PURE__ */ o(
|
|
988
1734
|
"span",
|
|
989
1735
|
{
|
|
990
|
-
class:
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1736
|
+
class: [
|
|
1737
|
+
"flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
1738
|
+
l ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent",
|
|
1739
|
+
// Popular-label badge сидит absolute сверху-справа карточки и
|
|
1740
|
+
// визуально сдвигает центр content'а вниз. flex items-center
|
|
1741
|
+
// на карточке держит галочку по геометрическому центру, что
|
|
1742
|
+
// делает её визуально выше — компенсируем небольшим mt'ом.
|
|
1743
|
+
d ? "mt-3" : ""
|
|
1744
|
+
].join(" "),
|
|
1745
|
+
style: l ? {
|
|
1746
|
+
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%)"
|
|
1747
|
+
} : void 0,
|
|
1748
|
+
"aria-hidden": "true",
|
|
1749
|
+
children: /* @__PURE__ */ o(
|
|
1750
|
+
"svg",
|
|
1751
|
+
{
|
|
1752
|
+
width: "14",
|
|
1753
|
+
height: "10",
|
|
1754
|
+
viewBox: "0 0 17 12",
|
|
1755
|
+
fill: "none",
|
|
1756
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1757
|
+
class: l ? "opacity-100" : "opacity-0",
|
|
1758
|
+
children: /* @__PURE__ */ o(
|
|
1759
|
+
"path",
|
|
1760
|
+
{
|
|
1761
|
+
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",
|
|
1762
|
+
fill: "currentColor"
|
|
1763
|
+
}
|
|
1764
|
+
)
|
|
1765
|
+
}
|
|
1766
|
+
)
|
|
995
1767
|
}
|
|
996
|
-
)
|
|
1768
|
+
),
|
|
997
1769
|
/* @__PURE__ */ c("div", { class: "flex flex-1 flex-col gap-0.5", children: [
|
|
998
|
-
/* @__PURE__ */
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1770
|
+
/* @__PURE__ */ c("div", { class: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
1771
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: je(a, t) }),
|
|
1772
|
+
_ ? (
|
|
1773
|
+
// opacity-60 приглушает strike: глаз сначала ловит label
|
|
1774
|
+
// и discount-badge, потом main price; original «бывшая цена»
|
|
1775
|
+
// — третичная информация, не должна конкурировать с label.
|
|
1776
|
+
/* @__PURE__ */ o("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: _ })
|
|
1777
|
+
) : null,
|
|
1778
|
+
u ? (
|
|
1779
|
+
// Emerald pill — фиксированный «успех/выгода», не зависит от
|
|
1780
|
+
// brand_color. Читается даже на тёмных бренд-акцентах.
|
|
1781
|
+
/* @__PURE__ */ c("span", { class: "rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700", children: [
|
|
1782
|
+
"-",
|
|
1783
|
+
u,
|
|
1784
|
+
"%"
|
|
1785
|
+
] })
|
|
1786
|
+
) : null
|
|
1787
|
+
] }),
|
|
1788
|
+
/* @__PURE__ */ o("div", { class: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ c("span", { class: "text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium", children: [
|
|
1789
|
+
/* @__PURE__ */ o("span", { class: "opacity-90", children: h }),
|
|
1790
|
+
b,
|
|
1791
|
+
/* @__PURE__ */ c("span", { class: "text-sm font-normal text-gray-500", children: [
|
|
1792
|
+
" ",
|
|
1003
1793
|
"/ ",
|
|
1004
|
-
|
|
1794
|
+
ce(a, t)
|
|
1005
1795
|
] })
|
|
1006
|
-
] }),
|
|
1007
|
-
a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null
|
|
1008
|
-
a.trial_days ? /* @__PURE__ */ c("span", { class: "mt-1 text-xs font-medium text-[var(--pw-accent)]", children: [
|
|
1009
|
-
a.trial_days,
|
|
1010
|
-
"-day free trial"
|
|
1011
|
-
] }) : null
|
|
1796
|
+
] }) }),
|
|
1797
|
+
a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null
|
|
1012
1798
|
] }),
|
|
1013
|
-
/* @__PURE__ */ o(
|
|
1799
|
+
d ? /* @__PURE__ */ o(
|
|
1014
1800
|
"span",
|
|
1015
1801
|
{
|
|
1016
|
-
class: [
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
].join(" "),
|
|
1020
|
-
"aria-hidden": "true",
|
|
1021
|
-
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ o(
|
|
1022
|
-
"path",
|
|
1023
|
-
{
|
|
1024
|
-
d: "M3.5 8.5l3 3 6-7",
|
|
1025
|
-
stroke: "currentColor",
|
|
1026
|
-
"stroke-width": "2",
|
|
1027
|
-
"stroke-linecap": "round",
|
|
1028
|
-
"stroke-linejoin": "round"
|
|
1029
|
-
}
|
|
1030
|
-
) })
|
|
1802
|
+
class: "absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",
|
|
1803
|
+
style: { background: "var(--pw-accent)" },
|
|
1804
|
+
children: s
|
|
1031
1805
|
}
|
|
1032
|
-
)
|
|
1806
|
+
) : null
|
|
1033
1807
|
]
|
|
1034
1808
|
},
|
|
1035
1809
|
a.id
|
|
@@ -1038,194 +1812,374 @@ function Fe({ block: r, ctx: e }) {
|
|
|
1038
1812
|
}
|
|
1039
1813
|
);
|
|
1040
1814
|
}
|
|
1041
|
-
function
|
|
1815
|
+
function Vt(r, e) {
|
|
1816
|
+
return r.label ? r.label : !r.interval || r.interval === "lifetime" ? e("pricing.interval.lifetime_short", "lifetime") : e(`pricing.interval.${r.interval}`, r.interval);
|
|
1817
|
+
}
|
|
1818
|
+
function $t({
|
|
1819
|
+
price: r,
|
|
1820
|
+
isLast: e,
|
|
1821
|
+
isPopular: t,
|
|
1822
|
+
popularLabel: n,
|
|
1823
|
+
offer: i,
|
|
1824
|
+
selected: s,
|
|
1825
|
+
onSelect: a,
|
|
1826
|
+
t: l
|
|
1827
|
+
}) {
|
|
1828
|
+
const d = i?.discount_percent ?? null, { currency: p, amount: u, originalAmount: h } = le(r, d);
|
|
1829
|
+
return /* @__PURE__ */ c(
|
|
1830
|
+
"button",
|
|
1831
|
+
{
|
|
1832
|
+
type: "button",
|
|
1833
|
+
role: "radio",
|
|
1834
|
+
"aria-checked": s,
|
|
1835
|
+
onClick: a,
|
|
1836
|
+
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)]",
|
|
1837
|
+
children: [
|
|
1838
|
+
/* @__PURE__ */ o(
|
|
1839
|
+
"span",
|
|
1840
|
+
{
|
|
1841
|
+
class: [
|
|
1842
|
+
"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",
|
|
1843
|
+
s ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent"
|
|
1844
|
+
].join(" "),
|
|
1845
|
+
style: s ? {
|
|
1846
|
+
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%)"
|
|
1847
|
+
} : void 0,
|
|
1848
|
+
"aria-hidden": "true",
|
|
1849
|
+
children: /* @__PURE__ */ o(
|
|
1850
|
+
"svg",
|
|
1851
|
+
{
|
|
1852
|
+
width: "14",
|
|
1853
|
+
height: "10",
|
|
1854
|
+
viewBox: "0 0 17 12",
|
|
1855
|
+
fill: "none",
|
|
1856
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1857
|
+
class: s ? "opacity-100" : "opacity-0",
|
|
1858
|
+
children: /* @__PURE__ */ o(
|
|
1859
|
+
"path",
|
|
1860
|
+
{
|
|
1861
|
+
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",
|
|
1862
|
+
fill: "currentColor"
|
|
1863
|
+
}
|
|
1864
|
+
)
|
|
1865
|
+
}
|
|
1866
|
+
)
|
|
1867
|
+
}
|
|
1868
|
+
),
|
|
1869
|
+
/* @__PURE__ */ c(
|
|
1870
|
+
"div",
|
|
1871
|
+
{
|
|
1872
|
+
class: [
|
|
1873
|
+
"flex flex-1 items-center gap-1.5 pb-3.5",
|
|
1874
|
+
e ? "" : "border-b border-gray-200"
|
|
1875
|
+
].join(" "),
|
|
1876
|
+
children: [
|
|
1877
|
+
/* @__PURE__ */ c("div", { class: "flex flex-wrap items-center gap-1 gap-x-1.5", children: [
|
|
1878
|
+
/* @__PURE__ */ o("span", { class: "text-base font-normal capitalize text-gray-800", children: Vt(r, l) }),
|
|
1879
|
+
t ? (
|
|
1880
|
+
// Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
|
|
1881
|
+
// Низкий visual weight: pill про "имя плана" (most popular), а не
|
|
1882
|
+
// про savings — не должна конкурировать с -X% discount-pill.
|
|
1883
|
+
/* @__PURE__ */ o(
|
|
1884
|
+
"span",
|
|
1885
|
+
{
|
|
1886
|
+
class: "rounded-[9px] px-2 py-1 text-[10px] font-bold",
|
|
1887
|
+
style: {
|
|
1888
|
+
background: "linear-gradient(160deg, color-mix(in srgb, var(--pw-accent) 6%, white) 0%, color-mix(in srgb, var(--pw-accent) 15%, white) 100%)",
|
|
1889
|
+
color: "var(--pw-accent)"
|
|
1890
|
+
},
|
|
1891
|
+
children: n
|
|
1892
|
+
}
|
|
1893
|
+
)
|
|
1894
|
+
) : null,
|
|
1895
|
+
d ? /* @__PURE__ */ c("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
|
|
1896
|
+
"-",
|
|
1897
|
+
d,
|
|
1898
|
+
"%"
|
|
1899
|
+
] }) : null
|
|
1900
|
+
] }),
|
|
1901
|
+
/* @__PURE__ */ o("div", { class: "flex-1" }),
|
|
1902
|
+
/* @__PURE__ */ c("span", { class: "flex items-baseline gap-1.5 text-base font-normal text-gray-600", children: [
|
|
1903
|
+
h ? /* @__PURE__ */ o("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: h }) : null,
|
|
1904
|
+
/* @__PURE__ */ c("span", { class: "whitespace-nowrap", children: [
|
|
1905
|
+
/* @__PURE__ */ o("span", { class: "opacity-90", children: p }),
|
|
1906
|
+
u,
|
|
1907
|
+
/* @__PURE__ */ c("span", { class: "text-xs text-gray-400", children: [
|
|
1908
|
+
" ",
|
|
1909
|
+
"/ ",
|
|
1910
|
+
ce(r, l)
|
|
1911
|
+
] })
|
|
1912
|
+
] })
|
|
1913
|
+
] })
|
|
1914
|
+
]
|
|
1915
|
+
}
|
|
1916
|
+
)
|
|
1917
|
+
]
|
|
1918
|
+
}
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
function Ht({
|
|
1922
|
+
price: r,
|
|
1923
|
+
isPopular: e,
|
|
1924
|
+
popularLabel: t,
|
|
1925
|
+
offer: n,
|
|
1926
|
+
reserveStrikeRow: i,
|
|
1927
|
+
selected: s,
|
|
1928
|
+
onSelect: a,
|
|
1929
|
+
t: l
|
|
1930
|
+
}) {
|
|
1931
|
+
const d = n?.discount_percent ?? null, { currency: p, amount: u, originalAmount: h } = le(r, d);
|
|
1932
|
+
return /* @__PURE__ */ c(
|
|
1933
|
+
"button",
|
|
1934
|
+
{
|
|
1935
|
+
type: "button",
|
|
1936
|
+
role: "radio",
|
|
1937
|
+
"aria-checked": s,
|
|
1938
|
+
onClick: a,
|
|
1939
|
+
class: [
|
|
1940
|
+
"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)]",
|
|
1941
|
+
s ? "border-[var(--pw-accent)]" : "border-gray-200 hover:bg-gray-50"
|
|
1942
|
+
].join(" "),
|
|
1943
|
+
style: s ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
|
|
1944
|
+
children: [
|
|
1945
|
+
/* @__PURE__ */ o("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: je(r, l) }),
|
|
1946
|
+
i ? /* @__PURE__ */ c("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
|
|
1947
|
+
h ? /* @__PURE__ */ o("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: h }) : null,
|
|
1948
|
+
d ? /* @__PURE__ */ c("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
|
|
1949
|
+
"-",
|
|
1950
|
+
d,
|
|
1951
|
+
"%"
|
|
1952
|
+
] }) : null
|
|
1953
|
+
] }) : null,
|
|
1954
|
+
/* @__PURE__ */ c("span", { class: "text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium", children: [
|
|
1955
|
+
/* @__PURE__ */ o("span", { class: "opacity-90", children: p }),
|
|
1956
|
+
u
|
|
1957
|
+
] }),
|
|
1958
|
+
/* @__PURE__ */ c("span", { class: "text-xs font-normal text-gray-500", children: [
|
|
1959
|
+
"/ ",
|
|
1960
|
+
ce(r, l)
|
|
1961
|
+
] }),
|
|
1962
|
+
e ? /* @__PURE__ */ o(
|
|
1963
|
+
"span",
|
|
1964
|
+
{
|
|
1965
|
+
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",
|
|
1966
|
+
style: { background: "var(--pw-accent)" },
|
|
1967
|
+
children: t
|
|
1968
|
+
}
|
|
1969
|
+
) : null
|
|
1970
|
+
]
|
|
1971
|
+
}
|
|
1972
|
+
);
|
|
1973
|
+
}
|
|
1974
|
+
function Gt({ block: r }) {
|
|
1042
1975
|
return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: r.text });
|
|
1043
1976
|
}
|
|
1044
|
-
const
|
|
1977
|
+
const Wt = {
|
|
1045
1978
|
week: 0.25,
|
|
1046
1979
|
month: 1,
|
|
1047
1980
|
year: 12
|
|
1048
1981
|
};
|
|
1049
|
-
function
|
|
1050
|
-
return r
|
|
1982
|
+
function Zt(r, e) {
|
|
1983
|
+
return r ? e(`pricing.interval.${r}`, r) : e("pricing.interval.period", "period");
|
|
1051
1984
|
}
|
|
1052
|
-
function
|
|
1985
|
+
function Yt({ block: r, ctx: e }) {
|
|
1986
|
+
const { t } = w();
|
|
1053
1987
|
if (!r.queries.length) return null;
|
|
1054
|
-
const
|
|
1988
|
+
const i = e.bootstrap.prices.find((a) => a.id === e.selectedPriceId)?.interval ?? null, s = i ? Wt[i] : void 0;
|
|
1055
1989
|
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
const l = Number.isFinite(s.count) ? s.count : 0, a = i !== void 0 ? Math.round(l * i) : l;
|
|
1063
|
-
return /* @__PURE__ */ c("li", { class: `flex gap-2 ${s.desc ? "" : "items-center"}`, children: [
|
|
1990
|
+
/* @__PURE__ */ o("div", { class: "text-sm font-semibold text-gray-800", children: !i || i === "lifetime" ? t("pricing.included_total", "Included for lifetime:") : t("pricing.included_per", "Included per {interval}:", {
|
|
1991
|
+
interval: Zt(i, t)
|
|
1992
|
+
}) }),
|
|
1993
|
+
/* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: r.queries.map((a) => {
|
|
1994
|
+
const l = Number.isFinite(a.count) ? a.count : 0, d = s !== void 0 ? Math.round(l * s) : l;
|
|
1995
|
+
return /* @__PURE__ */ c("li", { class: `flex gap-3 ${a.desc ? "items-start" : "items-center"}`, children: [
|
|
1064
1996
|
/* @__PURE__ */ o(
|
|
1065
|
-
"
|
|
1997
|
+
"svg",
|
|
1066
1998
|
{
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
}
|
|
1999
|
+
width: "18",
|
|
2000
|
+
height: "18",
|
|
2001
|
+
viewBox: "0 0 20 20",
|
|
2002
|
+
fill: "none",
|
|
2003
|
+
class: `flex-shrink-0 text-emerald-500 ${a.desc ? "mt-0.5" : ""}`,
|
|
1072
2004
|
"aria-hidden": "true",
|
|
1073
|
-
children: /* @__PURE__ */ o(
|
|
2005
|
+
children: /* @__PURE__ */ o(
|
|
1074
2006
|
"path",
|
|
1075
2007
|
{
|
|
1076
|
-
d: "
|
|
2008
|
+
d: "M4 10.5l3.5 3.5 8.5-8.5",
|
|
1077
2009
|
stroke: "currentColor",
|
|
1078
|
-
"stroke-width": "2.
|
|
2010
|
+
"stroke-width": "2.5",
|
|
1079
2011
|
"stroke-linecap": "round",
|
|
1080
2012
|
"stroke-linejoin": "round"
|
|
1081
2013
|
}
|
|
1082
|
-
)
|
|
2014
|
+
)
|
|
1083
2015
|
}
|
|
1084
2016
|
),
|
|
1085
2017
|
/* @__PURE__ */ c("div", { children: [
|
|
1086
|
-
/* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children:
|
|
2018
|
+
/* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: d }),
|
|
1087
2019
|
" ",
|
|
1088
|
-
/* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children:
|
|
1089
|
-
|
|
2020
|
+
/* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children: a.name }),
|
|
2021
|
+
a.desc ? /* @__PURE__ */ c(Y, { children: [
|
|
1090
2022
|
/* @__PURE__ */ o("br", {}),
|
|
1091
|
-
/* @__PURE__ */ o("span", { class: "text-xs text-gray-
|
|
2023
|
+
/* @__PURE__ */ o("span", { class: "text-xs text-gray-400", children: a.desc })
|
|
1092
2024
|
] }) : null
|
|
1093
2025
|
] })
|
|
1094
|
-
] },
|
|
2026
|
+
] }, a.id);
|
|
1095
2027
|
}) })
|
|
1096
2028
|
] });
|
|
1097
2029
|
}
|
|
1098
|
-
const
|
|
1099
|
-
heading:
|
|
1100
|
-
text:
|
|
1101
|
-
price_grid:
|
|
1102
|
-
cta_button:
|
|
1103
|
-
auth_panel:
|
|
1104
|
-
current_session:
|
|
1105
|
-
features_list:
|
|
1106
|
-
tokenization_gate:
|
|
1107
|
-
guarantee_badge:
|
|
2030
|
+
const Kt = {
|
|
2031
|
+
heading: qt,
|
|
2032
|
+
text: Gt,
|
|
2033
|
+
price_grid: Ft,
|
|
2034
|
+
cta_button: Tt,
|
|
2035
|
+
auth_panel: Ee,
|
|
2036
|
+
current_session: Mt,
|
|
2037
|
+
features_list: Bt,
|
|
2038
|
+
tokenization_gate: Yt,
|
|
2039
|
+
guarantee_badge: Ot,
|
|
2040
|
+
offer_banner: wt
|
|
1108
2041
|
};
|
|
1109
|
-
function
|
|
1110
|
-
const
|
|
2042
|
+
function Xt({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i, hasTopBanner: s }) {
|
|
2043
|
+
const a = _e(() => {
|
|
2044
|
+
for (const f of r.blocks)
|
|
2045
|
+
if (f.type === "price_grid" && f.popular_price_id && e.prices.some((g) => g.id === f.popular_price_id))
|
|
2046
|
+
return f.popular_price_id;
|
|
2047
|
+
return e.prices[0]?.id ?? null;
|
|
2048
|
+
}, [r.blocks, e.prices]), [l, d] = x(a), p = {
|
|
1111
2049
|
bootstrap: e,
|
|
1112
2050
|
selectedPriceId: l,
|
|
1113
|
-
setSelectedPriceId:
|
|
2051
|
+
setSelectedPriceId: d,
|
|
1114
2052
|
onAction: t,
|
|
1115
2053
|
auth: n,
|
|
1116
2054
|
authSession: i
|
|
2055
|
+
}, u = r.blocks.findIndex((f) => f.type === "cta_button"), h = u === -1 ? r.blocks : r.blocks.slice(0, u), b = u === -1 ? [] : r.blocks.slice(u), _ = (f, g) => {
|
|
2056
|
+
const A = Kt[f.type];
|
|
2057
|
+
return A ? /* @__PURE__ */ o(A, { block: f, ctx: p }, `${f.type}-${g}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${f.type}`), null);
|
|
1117
2058
|
};
|
|
1118
|
-
return /* @__PURE__ */
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
2059
|
+
return /* @__PURE__ */ c(Y, { children: [
|
|
2060
|
+
/* @__PURE__ */ o("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: /* @__PURE__ */ o("div", { class: "flex flex-col gap-6", children: h.map(_) }) }),
|
|
2061
|
+
b.length > 0 ? (
|
|
2062
|
+
// Тонкий shadow-top вместо border-t — создаёт depth, читается как
|
|
2063
|
+
// «footer закреплён к низу dialog'а». Линия выглядела как divider
|
|
2064
|
+
// в обычном flow, не передавала sticky-character.
|
|
2065
|
+
/* @__PURE__ */ o(
|
|
2066
|
+
"div",
|
|
2067
|
+
{
|
|
2068
|
+
class: "flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",
|
|
2069
|
+
style: { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" },
|
|
2070
|
+
children: b.map((f, g) => _(f, h.length + g))
|
|
2071
|
+
}
|
|
2072
|
+
)
|
|
2073
|
+
) : null
|
|
2074
|
+
] });
|
|
1122
2075
|
}
|
|
1123
|
-
function
|
|
2076
|
+
function Jt(r, e, t, n) {
|
|
1124
2077
|
return r ? n ? { 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 } : t.kind === "support" ? { open: !0, view: "support", error: null } : t.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : t.kind === "anon_gate" ? { open: !0, view: "anon", error: null } : t.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : t.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : t.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : t.kind === "verifying" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
|
|
1125
2078
|
}
|
|
1126
|
-
function
|
|
2079
|
+
function Qt(r, e) {
|
|
1127
2080
|
return r.open === e.open && r.view === e.view && r.error === e.error;
|
|
1128
2081
|
}
|
|
1129
|
-
function
|
|
2082
|
+
function er({
|
|
1130
2083
|
client: r,
|
|
1131
2084
|
open: e,
|
|
1132
2085
|
onClose: t,
|
|
1133
2086
|
onEvent: n,
|
|
1134
2087
|
initialView: i,
|
|
1135
2088
|
purchased: s,
|
|
1136
|
-
renew:
|
|
1137
|
-
onState:
|
|
1138
|
-
inline:
|
|
2089
|
+
renew: a,
|
|
2090
|
+
onState: l,
|
|
2091
|
+
inline: d,
|
|
2092
|
+
locale: p
|
|
1139
2093
|
}) {
|
|
1140
|
-
const [u,
|
|
2094
|
+
const [u, h] = x({ status: "idle" }), [b, _] = x(
|
|
1141
2095
|
() => r.auth?.getCachedSession() ?? null
|
|
1142
|
-
), [f, g] =
|
|
1143
|
-
|
|
1144
|
-
if (!
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1147
|
-
}, [e, u, f, s,
|
|
2096
|
+
), [f, g] = x(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? { kind: "auth_gate", origin: "standalone" } : i === "anon" ? { kind: "anon_gate", origin: "standalone" } : { kind: "layout" }), A = z(!1), M = z(null);
|
|
2097
|
+
T(() => {
|
|
2098
|
+
if (!l) return;
|
|
2099
|
+
const m = Jt(e, u, f, s), y = M.current;
|
|
2100
|
+
y && Qt(y, m) || (M.current = m, l(m));
|
|
2101
|
+
}, [e, u, f, s, l]), T(() => {
|
|
1148
2102
|
if (r.auth)
|
|
1149
|
-
return r.auth.onAuthChange((
|
|
1150
|
-
}, [r.auth]),
|
|
2103
|
+
return r.auth.onAuthChange((m, y) => _(y));
|
|
2104
|
+
}, [r.auth]), T(() => {
|
|
1151
2105
|
if (typeof r.onBootstrapChange == "function")
|
|
1152
|
-
return r.onBootstrapChange((
|
|
1153
|
-
|
|
1154
|
-
(
|
|
2106
|
+
return r.onBootstrapChange((m) => {
|
|
2107
|
+
h(
|
|
2108
|
+
(y) => y.status === "ready" ? { status: "ready", data: m } : y
|
|
1155
2109
|
);
|
|
1156
2110
|
});
|
|
1157
|
-
}, [r]),
|
|
2111
|
+
}, [r]), T(() => {
|
|
1158
2112
|
if (!e || u.status === "ready" || u.status === "loading") return;
|
|
1159
|
-
let
|
|
1160
|
-
return
|
|
1161
|
-
|
|
2113
|
+
let m = !1;
|
|
2114
|
+
return h({ status: "loading" }), r.bootstrap().then((y) => {
|
|
2115
|
+
m || (h({ status: "ready", data: y }), n("ready", y), y.user?.has_active_subscription && !a && (n("purchase_completed", {
|
|
1162
2116
|
priceId: null,
|
|
1163
2117
|
sessionId: null,
|
|
1164
2118
|
restored: !0
|
|
1165
2119
|
}), g({ kind: "purchase_success", restored: !0 })));
|
|
1166
|
-
}).catch((
|
|
1167
|
-
if (
|
|
1168
|
-
const
|
|
1169
|
-
|
|
2120
|
+
}).catch((y) => {
|
|
2121
|
+
if (m) return;
|
|
2122
|
+
const v = y instanceof j ? y : new j("unknown", "Failed to load paywall", { cause: y });
|
|
2123
|
+
h({ status: "error", error: v }), n("error", v);
|
|
1170
2124
|
}), () => {
|
|
1171
|
-
|
|
2125
|
+
m = !0;
|
|
1172
2126
|
};
|
|
1173
|
-
}, [e, r]),
|
|
2127
|
+
}, [e, r]), He(() => {
|
|
1174
2128
|
if (!e) {
|
|
1175
|
-
g({ kind: "layout" }),
|
|
2129
|
+
g({ kind: "layout" }), A.current = !1;
|
|
1176
2130
|
return;
|
|
1177
2131
|
}
|
|
1178
2132
|
i === "support" ? g({ kind: "support", origin: "standalone" }) : i === "auth" ? g({ kind: "auth_gate", origin: "standalone" }) : i === "anon" && g({ kind: "anon_gate", origin: "standalone" });
|
|
1179
2133
|
}, [e, i]);
|
|
1180
|
-
const
|
|
2134
|
+
const k = async (m) => {
|
|
1181
2135
|
try {
|
|
1182
|
-
const
|
|
1183
|
-
priceId:
|
|
1184
|
-
ignoreActivePurchase:
|
|
2136
|
+
const y = await r.createCheckout({
|
|
2137
|
+
priceId: m,
|
|
2138
|
+
ignoreActivePurchase: a === !0
|
|
1185
2139
|
});
|
|
1186
|
-
if (n("checkout_started", { priceId:
|
|
1187
|
-
const
|
|
1188
|
-
if (
|
|
2140
|
+
if (n("checkout_started", { priceId: m, url: y.url, acquiring: y.acquiring }), typeof window > "u" || !y.url) return;
|
|
2141
|
+
const v = window.open(y.url, "_blank");
|
|
2142
|
+
if (v) {
|
|
1189
2143
|
try {
|
|
1190
|
-
|
|
2144
|
+
v.opener = null;
|
|
1191
2145
|
} catch {
|
|
1192
2146
|
}
|
|
1193
|
-
g({ kind: "awaiting_payment", priceId:
|
|
2147
|
+
g({ kind: "awaiting_payment", priceId: m, url: y.url });
|
|
1194
2148
|
} else
|
|
1195
|
-
g({ kind: "popup_blocked", priceId:
|
|
1196
|
-
} catch (
|
|
1197
|
-
if (
|
|
2149
|
+
g({ kind: "popup_blocked", priceId: m, url: y.url });
|
|
2150
|
+
} catch (y) {
|
|
2151
|
+
if (y instanceof j && y.code === "already_purchased") {
|
|
1198
2152
|
try {
|
|
1199
2153
|
await r.getUser({ force: !0 });
|
|
1200
2154
|
} catch {
|
|
1201
2155
|
}
|
|
1202
|
-
n("purchase_completed", { priceId:
|
|
2156
|
+
n("purchase_completed", { priceId: m, sessionId: null, restored: !0 }), g({ kind: "purchase_success", restored: !0 });
|
|
1203
2157
|
return;
|
|
1204
2158
|
}
|
|
1205
|
-
const
|
|
1206
|
-
n("error",
|
|
2159
|
+
const v = y instanceof j ? y : new j("checkout_failed", "Checkout failed", { cause: y });
|
|
2160
|
+
n("error", v), g({ kind: "layout" });
|
|
1207
2161
|
}
|
|
1208
|
-
},
|
|
2162
|
+
}, E = (m, y) => {
|
|
1209
2163
|
if (typeof window > "u") return;
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
2164
|
+
const v = window.open(y, "_blank");
|
|
2165
|
+
if (v) {
|
|
1212
2166
|
try {
|
|
1213
|
-
|
|
2167
|
+
v.opener = null;
|
|
1214
2168
|
} catch {
|
|
1215
2169
|
}
|
|
1216
|
-
g({ kind: "awaiting_payment", priceId:
|
|
2170
|
+
g({ kind: "awaiting_payment", priceId: m, url: y });
|
|
1217
2171
|
}
|
|
1218
2172
|
};
|
|
1219
|
-
|
|
1220
|
-
if (f.kind !== "auth_gate" || !
|
|
1221
|
-
|
|
1222
|
-
const
|
|
2173
|
+
T(() => {
|
|
2174
|
+
if (f.kind !== "auth_gate" || !b || b.user.is_anonymous || A.current) return;
|
|
2175
|
+
A.current = !0;
|
|
2176
|
+
const m = f.pendingCheckout, y = f.origin;
|
|
1223
2177
|
g({ kind: "verifying" }), (async () => {
|
|
1224
|
-
if (!
|
|
2178
|
+
if (!a)
|
|
1225
2179
|
try {
|
|
1226
2180
|
if ((await r.getUser({ force: !0 })).has_active_subscription) {
|
|
1227
2181
|
n("purchase_completed", {
|
|
1228
|
-
priceId:
|
|
2182
|
+
priceId: m?.priceId ?? null,
|
|
1229
2183
|
sessionId: null,
|
|
1230
2184
|
restored: !0
|
|
1231
2185
|
}), g({ kind: "purchase_success", restored: !0 });
|
|
@@ -1233,107 +2187,95 @@ function Ke({
|
|
|
1233
2187
|
}
|
|
1234
2188
|
} catch {
|
|
1235
2189
|
}
|
|
1236
|
-
if (!
|
|
1237
|
-
|
|
2190
|
+
if (!m) {
|
|
2191
|
+
y === "standalone" ? t() : g({ kind: "layout" });
|
|
1238
2192
|
return;
|
|
1239
2193
|
}
|
|
1240
|
-
await
|
|
2194
|
+
await k(m.priceId);
|
|
1241
2195
|
})().finally(() => {
|
|
1242
|
-
|
|
2196
|
+
A.current = !1;
|
|
1243
2197
|
});
|
|
1244
|
-
}, [
|
|
1245
|
-
const
|
|
1246
|
-
if (
|
|
2198
|
+
}, [b, f]);
|
|
2199
|
+
const I = async (m, y) => {
|
|
2200
|
+
if (m === "close") {
|
|
1247
2201
|
t();
|
|
1248
2202
|
return;
|
|
1249
2203
|
}
|
|
1250
|
-
if (
|
|
1251
|
-
n("price_selected",
|
|
2204
|
+
if (m === "price_selected") {
|
|
2205
|
+
n("price_selected", y);
|
|
1252
2206
|
return;
|
|
1253
2207
|
}
|
|
1254
|
-
if (
|
|
1255
|
-
if (!r.auth
|
|
1256
|
-
|
|
2208
|
+
if (m === "restore") {
|
|
2209
|
+
if (!r.auth) return;
|
|
2210
|
+
const v = r.auth.getCachedSession();
|
|
2211
|
+
if (v && !v.user.is_anonymous) return;
|
|
2212
|
+
g({ kind: "auth_gate", intent: "restore" });
|
|
1257
2213
|
return;
|
|
1258
2214
|
}
|
|
1259
|
-
if (
|
|
2215
|
+
if (m === "support") {
|
|
1260
2216
|
g({ kind: "support", origin: "layout" });
|
|
1261
2217
|
return;
|
|
1262
2218
|
}
|
|
1263
|
-
if (
|
|
1264
|
-
const
|
|
1265
|
-
if (!
|
|
1266
|
-
n("error", new
|
|
2219
|
+
if (m === "checkout" && u.status === "ready") {
|
|
2220
|
+
const v = y?.priceId;
|
|
2221
|
+
if (!v) {
|
|
2222
|
+
n("error", new j("no_price", "No price selected"));
|
|
1267
2223
|
return;
|
|
1268
2224
|
}
|
|
1269
|
-
|
|
1270
|
-
|
|
2225
|
+
const S = u.data.settings.checkout_mode ?? "guest", P = r.auth?.getCachedSession() ?? null, V = !!P && !P.user.is_anonymous;
|
|
2226
|
+
if (S === "preauth" && !!r.auth && !V) {
|
|
2227
|
+
g({ kind: "auth_gate", pendingCheckout: { priceId: v } });
|
|
1271
2228
|
return;
|
|
1272
2229
|
}
|
|
1273
|
-
await
|
|
2230
|
+
await k(v);
|
|
1274
2231
|
}
|
|
1275
|
-
},
|
|
2232
|
+
}, O = u.status === "ready" ? u.data.settings.brand_color : null, B = u.status === "ready" ? u.data.settings.allow_close !== !1 : !0, q = f.kind === "layout" && u.status === "ready" ? Te(u.data.offers) : null, D = q ? /* @__PURE__ */ o(kt, { offer: q }) : null, N = {
|
|
1276
2233
|
type: "auth_panel",
|
|
1277
|
-
|
|
2234
|
+
// Заголовок не задаём — AuthGate сам решит по intent'у (restore →
|
|
2235
|
+
// "Restore Purchases", остальные → дефолтный "Welcome back!").
|
|
1278
2236
|
allow_signup: !0,
|
|
1279
2237
|
allow_password_reset: !0,
|
|
1280
2238
|
// Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
|
|
1281
2239
|
// чем хотим показывать "Signed in as ..." промежуточным экраном.
|
|
1282
2240
|
hide_when_authenticated: !1,
|
|
1283
2241
|
providers: u.status === "ready" ? u.data.settings.auth_providers : void 0
|
|
1284
|
-
},
|
|
1285
|
-
|
|
2242
|
+
}, L = f.kind === "support" ? /* @__PURE__ */ o(
|
|
2243
|
+
_t,
|
|
1286
2244
|
{
|
|
1287
2245
|
client: r,
|
|
1288
|
-
authSession:
|
|
2246
|
+
authSession: b,
|
|
1289
2247
|
origin: f.origin,
|
|
1290
2248
|
onBack: () => {
|
|
1291
2249
|
f.origin === "standalone" ? t() : g({ kind: "layout" });
|
|
1292
2250
|
}
|
|
1293
2251
|
}
|
|
1294
|
-
) : null;
|
|
1295
|
-
return /* @__PURE__ */ o(
|
|
1296
|
-
|
|
2252
|
+
) : null, C = f.kind === "auth_gate" && f.origin !== "standalone" || f.kind === "support", U = u.status === "ready" ? u.data : null;
|
|
2253
|
+
return /* @__PURE__ */ o(et, { bootstrap: U, forceLocale: p, children: /* @__PURE__ */ o(
|
|
2254
|
+
tt,
|
|
1297
2255
|
{
|
|
1298
2256
|
open: e,
|
|
1299
2257
|
onClose: t,
|
|
1300
|
-
brandColor:
|
|
1301
|
-
|
|
1302
|
-
allowClose:
|
|
1303
|
-
|
|
2258
|
+
brandColor: O,
|
|
2259
|
+
topBanner: D,
|
|
2260
|
+
allowClose: B,
|
|
2261
|
+
hideCloseButton: C,
|
|
2262
|
+
inline: d,
|
|
1304
2263
|
labelledBy: "pw-title",
|
|
1305
|
-
children: s ? /* @__PURE__ */ o(
|
|
1306
|
-
|
|
1307
|
-
/* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: f.kind === "verifying" ? "Checking your subscription…" : "Loading…" })
|
|
1308
|
-
] }) : u.status === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
1309
|
-
/* @__PURE__ */ o("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1310
|
-
/* @__PURE__ */ o(
|
|
1311
|
-
"path",
|
|
1312
|
-
{
|
|
1313
|
-
d: "M10 6v5M10 14h.01",
|
|
1314
|
-
stroke: "#dc2626",
|
|
1315
|
-
"stroke-width": "2",
|
|
1316
|
-
"stroke-linecap": "round"
|
|
1317
|
-
}
|
|
1318
|
-
),
|
|
1319
|
-
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
|
|
1320
|
-
] }) }),
|
|
1321
|
-
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Something went wrong" }),
|
|
1322
|
-
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: u.error.message })
|
|
1323
|
-
] }) : f.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
|
|
1324
|
-
_e,
|
|
2264
|
+
children: s ? /* @__PURE__ */ o(ke, { onContinue: t }) : f.kind === "purchase_success" ? /* @__PURE__ */ o(ke, { restored: f.restored, onContinue: t }) : L || (u.status === "loading" || u.status === "idle" || f.kind === "verifying" ? /* @__PURE__ */ o(tr, { verifying: f.kind === "verifying" }) : u.status === "error" ? /* @__PURE__ */ o(rr, { message: u.error.message }) : f.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
|
|
2265
|
+
gt,
|
|
1325
2266
|
{
|
|
1326
|
-
block:
|
|
2267
|
+
block: N,
|
|
1327
2268
|
bootstrap: u.data,
|
|
1328
2269
|
auth: r.auth,
|
|
1329
|
-
authSession:
|
|
2270
|
+
authSession: b,
|
|
1330
2271
|
showBack: f.origin !== "standalone",
|
|
2272
|
+
intent: f.intent ?? (f.origin === "standalone" ? "standalone" : "preauth"),
|
|
1331
2273
|
onBack: () => {
|
|
1332
2274
|
f.origin === "standalone" ? t() : g({ kind: "layout" });
|
|
1333
2275
|
}
|
|
1334
2276
|
}
|
|
1335
2277
|
) : f.kind === "anon_gate" && r.auth ? /* @__PURE__ */ o(
|
|
1336
|
-
|
|
2278
|
+
yt,
|
|
1337
2279
|
{
|
|
1338
2280
|
auth: r.auth,
|
|
1339
2281
|
onSuccess: () => {
|
|
@@ -1342,87 +2284,120 @@ function Ke({
|
|
|
1342
2284
|
onBack: f.origin === "standalone" ? void 0 : () => g({ kind: "layout" })
|
|
1343
2285
|
}
|
|
1344
2286
|
) : f.kind === "awaiting_payment" ? /* @__PURE__ */ o(
|
|
1345
|
-
|
|
2287
|
+
ir,
|
|
1346
2288
|
{
|
|
1347
2289
|
client: r,
|
|
1348
2290
|
onBack: () => g({ kind: "layout" }),
|
|
1349
2291
|
onReopen: () => {
|
|
1350
2292
|
if (typeof window > "u") return;
|
|
1351
|
-
const
|
|
1352
|
-
if (
|
|
2293
|
+
const m = window.open(f.url, "_blank");
|
|
2294
|
+
if (m)
|
|
1353
2295
|
try {
|
|
1354
|
-
|
|
2296
|
+
m.opener = null;
|
|
1355
2297
|
} catch {
|
|
1356
2298
|
}
|
|
1357
2299
|
},
|
|
1358
|
-
onRetry: () =>
|
|
2300
|
+
onRetry: () => k(f.priceId)
|
|
1359
2301
|
}
|
|
1360
|
-
) : f.kind === "popup_blocked" ? /* @__PURE__ */
|
|
1361
|
-
|
|
1362
|
-
"div",
|
|
1363
|
-
{
|
|
1364
|
-
class: "flex h-11 w-11 items-center justify-center rounded-full",
|
|
1365
|
-
style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
|
|
1366
|
-
"aria-hidden": "true",
|
|
1367
|
-
children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
1368
|
-
/* @__PURE__ */ o(
|
|
1369
|
-
"path",
|
|
1370
|
-
{
|
|
1371
|
-
d: "M4 5h12v10H4z",
|
|
1372
|
-
stroke: "currentColor",
|
|
1373
|
-
"stroke-width": "1.75",
|
|
1374
|
-
"stroke-linejoin": "round"
|
|
1375
|
-
}
|
|
1376
|
-
),
|
|
1377
|
-
/* @__PURE__ */ o("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
|
|
1378
|
-
] })
|
|
1379
|
-
}
|
|
1380
|
-
),
|
|
1381
|
-
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Allow popups to continue" }),
|
|
1382
|
-
/* @__PURE__ */ o("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: "Your browser blocked the checkout tab. Click below to open it." }),
|
|
1383
|
-
/* @__PURE__ */ o(
|
|
1384
|
-
"button",
|
|
1385
|
-
{
|
|
1386
|
-
type: "button",
|
|
1387
|
-
onClick: () => S(f.priceId, f.url),
|
|
1388
|
-
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)]",
|
|
1389
|
-
style: {
|
|
1390
|
-
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1391
|
-
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1392
|
-
},
|
|
1393
|
-
children: "Open checkout"
|
|
1394
|
-
}
|
|
1395
|
-
)
|
|
1396
|
-
] }) : /* @__PURE__ */ o(
|
|
1397
|
-
Ze,
|
|
2302
|
+
) : f.kind === "popup_blocked" ? /* @__PURE__ */ o(nr, { onReopen: () => E(f.priceId, f.url) }) : /* @__PURE__ */ o(
|
|
2303
|
+
Xt,
|
|
1398
2304
|
{
|
|
1399
2305
|
layout: u.data.layout,
|
|
1400
2306
|
bootstrap: u.data,
|
|
1401
|
-
onAction:
|
|
2307
|
+
onAction: I,
|
|
1402
2308
|
auth: r.auth,
|
|
1403
|
-
authSession:
|
|
2309
|
+
authSession: b
|
|
1404
2310
|
}
|
|
1405
2311
|
))
|
|
1406
2312
|
}
|
|
1407
|
-
);
|
|
2313
|
+
) });
|
|
2314
|
+
}
|
|
2315
|
+
function tr({ verifying: r }) {
|
|
2316
|
+
const { t: e } = w();
|
|
2317
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
|
|
2318
|
+
/* @__PURE__ */ o("span", { class: "inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" }),
|
|
2319
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: r ? e("modal.verifying_subscription", "Checking your subscription…") : e("modal.loading", "Loading…") })
|
|
2320
|
+
] });
|
|
2321
|
+
}
|
|
2322
|
+
function rr({ message: r }) {
|
|
2323
|
+
const { t: e } = w();
|
|
2324
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
2325
|
+
/* @__PURE__ */ o("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2326
|
+
/* @__PURE__ */ o("path", { d: "M10 6v5M10 14h.01", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round" }),
|
|
2327
|
+
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
|
|
2328
|
+
] }) }),
|
|
2329
|
+
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("modal.error_generic", "Something went wrong") }),
|
|
2330
|
+
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: r })
|
|
2331
|
+
] });
|
|
2332
|
+
}
|
|
2333
|
+
function nr({ onReopen: r }) {
|
|
2334
|
+
const { t: e } = w();
|
|
2335
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
2336
|
+
/* @__PURE__ */ o(
|
|
2337
|
+
"div",
|
|
2338
|
+
{
|
|
2339
|
+
class: "flex h-11 w-11 items-center justify-center rounded-full",
|
|
2340
|
+
style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
|
|
2341
|
+
"aria-hidden": "true",
|
|
2342
|
+
children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
2343
|
+
/* @__PURE__ */ o("path", { d: "M4 5h12v10H4z", stroke: "currentColor", "stroke-width": "1.75", "stroke-linejoin": "round" }),
|
|
2344
|
+
/* @__PURE__ */ o("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
|
|
2345
|
+
] })
|
|
2346
|
+
}
|
|
2347
|
+
),
|
|
2348
|
+
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("payment.popup_blocked_title", "Allow popups to continue") }),
|
|
2349
|
+
/* @__PURE__ */ o("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.") }),
|
|
2350
|
+
/* @__PURE__ */ o(
|
|
2351
|
+
"button",
|
|
2352
|
+
{
|
|
2353
|
+
type: "button",
|
|
2354
|
+
onClick: r,
|
|
2355
|
+
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)]",
|
|
2356
|
+
style: {
|
|
2357
|
+
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
2358
|
+
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
2359
|
+
},
|
|
2360
|
+
children: e("payment.open_checkout_button", "Open checkout")
|
|
2361
|
+
}
|
|
2362
|
+
)
|
|
2363
|
+
] });
|
|
1408
2364
|
}
|
|
1409
|
-
function
|
|
2365
|
+
function ir({
|
|
1410
2366
|
client: r,
|
|
1411
2367
|
onBack: e,
|
|
1412
2368
|
onReopen: t,
|
|
1413
2369
|
onRetry: n
|
|
1414
2370
|
}) {
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
}, [])
|
|
2371
|
+
const { t: i } = w(), [s, a] = x(!1), [l, d] = x(!1), p = z(null);
|
|
2372
|
+
T(() => () => {
|
|
2373
|
+
p.current !== null && clearTimeout(p.current);
|
|
2374
|
+
}, []);
|
|
2375
|
+
const u = async () => {
|
|
2376
|
+
if (!s) {
|
|
2377
|
+
a(!0), d(!1);
|
|
2378
|
+
try {
|
|
2379
|
+
if ((await r.getUser({ force: !0 })).has_active_subscription) {
|
|
2380
|
+
typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
|
|
2381
|
+
return;
|
|
2382
|
+
}
|
|
2383
|
+
d(!0), p.current !== null && clearTimeout(p.current), p.current = setTimeout(() => {
|
|
2384
|
+
d(!1), p.current = null;
|
|
2385
|
+
}, 5e3);
|
|
2386
|
+
} catch {
|
|
2387
|
+
d(!0);
|
|
2388
|
+
} finally {
|
|
2389
|
+
a(!1);
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
};
|
|
2393
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
1419
2394
|
/* @__PURE__ */ o(
|
|
1420
2395
|
"button",
|
|
1421
2396
|
{
|
|
1422
2397
|
type: "button",
|
|
1423
2398
|
onClick: e,
|
|
1424
2399
|
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)]",
|
|
1425
|
-
children: "← Back"
|
|
2400
|
+
children: i("nav.back", "← Back")
|
|
1426
2401
|
}
|
|
1427
2402
|
),
|
|
1428
2403
|
/* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-6 text-center", children: [
|
|
@@ -1437,50 +2412,36 @@ function Je({
|
|
|
1437
2412
|
),
|
|
1438
2413
|
/* @__PURE__ */ o("span", { class: "relative inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" })
|
|
1439
2414
|
] }),
|
|
1440
|
-
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Complete payment in the new tab" }),
|
|
1441
|
-
/* @__PURE__ */ o("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children:
|
|
2415
|
+
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: i("payment.awaiting_title", "Complete payment in the new tab") }),
|
|
2416
|
+
/* @__PURE__ */ o("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children: i(
|
|
2417
|
+
"payment.awaiting_subtitle",
|
|
2418
|
+
"We'll detect your payment automatically — or click below once you're done."
|
|
2419
|
+
) }),
|
|
1442
2420
|
/* @__PURE__ */ o(
|
|
1443
2421
|
"button",
|
|
1444
2422
|
{
|
|
1445
2423
|
type: "button",
|
|
1446
|
-
onClick:
|
|
1447
|
-
|
|
1448
|
-
s(!0), a(!1);
|
|
1449
|
-
try {
|
|
1450
|
-
if ((await r.getUser({ force: !0 })).has_active_subscription) {
|
|
1451
|
-
typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
|
|
1452
|
-
return;
|
|
1453
|
-
}
|
|
1454
|
-
a(!0), h.current !== null && clearTimeout(h.current), h.current = setTimeout(() => {
|
|
1455
|
-
a(!1), h.current = null;
|
|
1456
|
-
}, 5e3);
|
|
1457
|
-
} catch {
|
|
1458
|
-
a(!0);
|
|
1459
|
-
} finally {
|
|
1460
|
-
s(!1);
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
},
|
|
1464
|
-
disabled: i,
|
|
2424
|
+
onClick: u,
|
|
2425
|
+
disabled: s,
|
|
1465
2426
|
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)]",
|
|
1466
2427
|
style: {
|
|
1467
2428
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1468
2429
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1469
2430
|
},
|
|
1470
|
-
children:
|
|
2431
|
+
children: s ? i("payment.checking", "Checking…") : i("payment.ive_paid", "I've paid")
|
|
1471
2432
|
}
|
|
1472
2433
|
),
|
|
1473
|
-
l ? /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: "Payment is still being processed. Please try again in a moment." }) : null
|
|
2434
|
+
l ? /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: i("payment.still_processing", "Payment is still being processed. Please try again in a moment.") }) : null
|
|
1474
2435
|
] }),
|
|
1475
2436
|
/* @__PURE__ */ c("div", { class: "rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5", children: [
|
|
1476
|
-
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-600", children: "Checkout window didn't open or got blocked? Click here to open it again." }),
|
|
2437
|
+
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-600", children: i("payment.popup_help_text", "Checkout window didn't open or got blocked? Click here to open it again.") }),
|
|
1477
2438
|
/* @__PURE__ */ o(
|
|
1478
2439
|
"button",
|
|
1479
2440
|
{
|
|
1480
2441
|
type: "button",
|
|
1481
2442
|
onClick: t,
|
|
1482
2443
|
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)]",
|
|
1483
|
-
children: "Open checkout again"
|
|
2444
|
+
children: i("payment.open_checkout_again", "Open checkout again")
|
|
1484
2445
|
}
|
|
1485
2446
|
)
|
|
1486
2447
|
] }),
|
|
@@ -1490,15 +2451,16 @@ function Je({
|
|
|
1490
2451
|
type: "button",
|
|
1491
2452
|
onClick: n,
|
|
1492
2453
|
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)]",
|
|
1493
|
-
children: "Tab closed? Try again"
|
|
2454
|
+
children: i("payment.tab_closed_retry", "Tab closed? Try again")
|
|
1494
2455
|
}
|
|
1495
2456
|
)
|
|
1496
2457
|
] });
|
|
1497
2458
|
}
|
|
1498
|
-
function
|
|
2459
|
+
function ke({
|
|
1499
2460
|
onContinue: r,
|
|
1500
2461
|
restored: e = !1
|
|
1501
2462
|
}) {
|
|
2463
|
+
const { t } = w();
|
|
1502
2464
|
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
1503
2465
|
/* @__PURE__ */ o(
|
|
1504
2466
|
"div",
|
|
@@ -1523,8 +2485,11 @@ function ee({
|
|
|
1523
2485
|
) })
|
|
1524
2486
|
}
|
|
1525
2487
|
),
|
|
1526
|
-
/* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? "Subscription restored" : "Payment received" }),
|
|
1527
|
-
/* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ?
|
|
2488
|
+
/* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? t("modal.purchase_restored_title", "Subscription restored") : t("modal.purchase_success_title", "Payment received") }),
|
|
2489
|
+
/* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ? t(
|
|
2490
|
+
"modal.purchase_restored_subtitle",
|
|
2491
|
+
"Welcome back — your subscription is already active."
|
|
2492
|
+
) : t("modal.purchase_success_subtitle", "Your subscription is now active.") }),
|
|
1528
2493
|
/* @__PURE__ */ o(
|
|
1529
2494
|
"button",
|
|
1530
2495
|
{
|
|
@@ -1535,22 +2500,22 @@ function ee({
|
|
|
1535
2500
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1536
2501
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1537
2502
|
},
|
|
1538
|
-
children: "Continue"
|
|
2503
|
+
children: t("modal.continue", "Continue")
|
|
1539
2504
|
}
|
|
1540
2505
|
)
|
|
1541
2506
|
] });
|
|
1542
2507
|
}
|
|
1543
|
-
const
|
|
1544
|
-
class
|
|
2508
|
+
const or = 10 * 6e4, sr = 5e3, ar = 3e4;
|
|
2509
|
+
class lr {
|
|
1545
2510
|
constructor(e) {
|
|
1546
2511
|
this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
|
|
1547
2512
|
client: e.client,
|
|
1548
2513
|
onActive: e.onActive,
|
|
1549
2514
|
onTimeout: e.onTimeout ?? (() => {
|
|
1550
2515
|
}),
|
|
1551
|
-
timeoutMs: e.timeoutMs ??
|
|
1552
|
-
visibleIntervalMs: e.visibleIntervalMs ??
|
|
1553
|
-
hiddenIntervalMs: e.hiddenIntervalMs ??
|
|
2516
|
+
timeoutMs: e.timeoutMs ?? or,
|
|
2517
|
+
visibleIntervalMs: e.visibleIntervalMs ?? sr,
|
|
2518
|
+
hiddenIntervalMs: e.hiddenIntervalMs ?? ar
|
|
1554
2519
|
};
|
|
1555
2520
|
}
|
|
1556
2521
|
start() {
|
|
@@ -1589,19 +2554,19 @@ class rt {
|
|
|
1589
2554
|
!t || typeof t != "object" || t.type === "paywall_purchase" && this.check();
|
|
1590
2555
|
}
|
|
1591
2556
|
}
|
|
1592
|
-
function
|
|
2557
|
+
function cr() {
|
|
1593
2558
|
return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
|
|
1594
2559
|
}
|
|
1595
|
-
const
|
|
2560
|
+
const ae = { open: !1, view: null, error: null }, F = {
|
|
1596
2561
|
status: "paywall_status",
|
|
1597
2562
|
priceId: "paywall_price_id",
|
|
1598
2563
|
sessionId: "paywall_session_id"
|
|
1599
2564
|
};
|
|
1600
|
-
let
|
|
2565
|
+
let ur = class {
|
|
1601
2566
|
constructor(e) {
|
|
1602
|
-
this.handle = null, this.isOpen = !1, this.listeners = /* @__PURE__ */ 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 =
|
|
1603
|
-
const { auth: t, ownsAuth: n } =
|
|
1604
|
-
this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new
|
|
2567
|
+
this.handle = null, this.isOpen = !1, this.listeners = /* @__PURE__ */ 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 = ae, this.stateListeners = /* @__PURE__ */ new Set();
|
|
2568
|
+
const { auth: t, ownsAuth: n } = dr(e);
|
|
2569
|
+
this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new Re({ ...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((i) => {
|
|
1605
2570
|
this.emit("userChange", i);
|
|
1606
2571
|
}), this.auth && (this.authUnsub = this.auth.onAuthChange((i, s) => {
|
|
1607
2572
|
this.emit("authChange", { event: i, session: s });
|
|
@@ -1612,7 +2577,7 @@ let it = class {
|
|
|
1612
2577
|
const t = typeof e == "object" && e !== null ? e : {};
|
|
1613
2578
|
if (t.enabled === !1) return;
|
|
1614
2579
|
const n = t.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
|
|
1615
|
-
this.tracker = new
|
|
2580
|
+
this.tracker = new ze({
|
|
1616
2581
|
endpoint: n,
|
|
1617
2582
|
paywallId: this.billing.paywallId,
|
|
1618
2583
|
capabilities: this.billing.capabilities,
|
|
@@ -1699,6 +2664,18 @@ let it = class {
|
|
|
1699
2664
|
setBootstrap(e) {
|
|
1700
2665
|
this.billing.setBootstrap(e);
|
|
1701
2666
|
}
|
|
2667
|
+
/**
|
|
2668
|
+
* Сменить force-locale на лету — для live-preview редактора админки, когда
|
|
2669
|
+
* юзер переключает «Preview as user from <country>». Грузит соответствующий
|
|
2670
|
+
* static-чанк и форсит re-render через handle.update. См. PaywallUIOptions.locale.
|
|
2671
|
+
*
|
|
2672
|
+
* Передай `null`/`undefined`, чтобы вернуть автоматическую резолв-логику
|
|
2673
|
+
* (navigator.language → locale_default).
|
|
2674
|
+
*/
|
|
2675
|
+
setLocale(e) {
|
|
2676
|
+
const t = e ?? null;
|
|
2677
|
+
t !== this.forceLocale && (this.forceLocale = t, this.handle && this.handle.update({ locale: t }));
|
|
2678
|
+
}
|
|
1702
2679
|
on(e, t) {
|
|
1703
2680
|
let n = this.listeners.get(e);
|
|
1704
2681
|
return n || (n = /* @__PURE__ */ new Set(), this.listeners.set(e, n)), n.add(t), () => n.delete(t);
|
|
@@ -1713,8 +2690,8 @@ let it = class {
|
|
|
1713
2690
|
for (const s of n)
|
|
1714
2691
|
try {
|
|
1715
2692
|
s(i);
|
|
1716
|
-
} catch (
|
|
1717
|
-
typeof console < "u" && console.error("[paywall] listener error",
|
|
2693
|
+
} catch (a) {
|
|
2694
|
+
typeof console < "u" && console.error("[paywall] listener error", a);
|
|
1718
2695
|
}
|
|
1719
2696
|
}
|
|
1720
2697
|
open(e = {}) {
|
|
@@ -1793,17 +2770,17 @@ let it = class {
|
|
|
1793
2770
|
this.mountAndShow(e, { renew: s });
|
|
1794
2771
|
return;
|
|
1795
2772
|
}
|
|
1796
|
-
const
|
|
1797
|
-
if (
|
|
1798
|
-
this.runOpenGates(e,
|
|
2773
|
+
const a = this.billing.getCachedBootstrap();
|
|
2774
|
+
if (a) {
|
|
2775
|
+
this.runOpenGates(e, a, { skipTrial: n, skipVisibility: i, renew: s });
|
|
1799
2776
|
return;
|
|
1800
2777
|
}
|
|
1801
2778
|
if (this.mountThenLoad) {
|
|
1802
|
-
this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((
|
|
2779
|
+
this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((l) => this.runDelayedGates(l, { skipTrial: n, skipVisibility: i })).catch(() => {
|
|
1803
2780
|
});
|
|
1804
2781
|
return;
|
|
1805
2782
|
}
|
|
1806
|
-
this.billing.bootstrap().then((
|
|
2783
|
+
this.billing.bootstrap().then((l) => this.runOpenGates(e, l, { skipTrial: n, skipVisibility: i, renew: s })).catch(() => {
|
|
1807
2784
|
this.mountAndShow(e, { renew: s });
|
|
1808
2785
|
});
|
|
1809
2786
|
}
|
|
@@ -1826,9 +2803,9 @@ let it = class {
|
|
|
1826
2803
|
i.check().then(async (s) => {
|
|
1827
2804
|
if (this.isOpen && (this.lastTrialStatus = s, s.mode !== "none")) {
|
|
1828
2805
|
if (s.blocked) {
|
|
1829
|
-
const
|
|
1830
|
-
if (this.lastTrialStatus =
|
|
1831
|
-
this.close(), this.emit("trial_blocked",
|
|
2806
|
+
const a = await i.recordBlock();
|
|
2807
|
+
if (this.lastTrialStatus = a, !this.isOpen) return;
|
|
2808
|
+
this.close(), this.emit("trial_blocked", a);
|
|
1832
2809
|
return;
|
|
1833
2810
|
}
|
|
1834
2811
|
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired"));
|
|
@@ -1862,27 +2839,27 @@ let it = class {
|
|
|
1862
2839
|
return;
|
|
1863
2840
|
}
|
|
1864
2841
|
const s = this.ensureTrialStore(i);
|
|
1865
|
-
s.check().then(async (
|
|
1866
|
-
if (this.lastTrialStatus =
|
|
2842
|
+
s.check().then(async (a) => {
|
|
2843
|
+
if (this.lastTrialStatus = a, a.mode === "none") {
|
|
1867
2844
|
this.mountAndShow(e, { renew: n });
|
|
1868
2845
|
return;
|
|
1869
2846
|
}
|
|
1870
|
-
if (
|
|
1871
|
-
const
|
|
1872
|
-
this.lastTrialStatus =
|
|
2847
|
+
if (a.blocked) {
|
|
2848
|
+
const l = await s.recordBlock();
|
|
2849
|
+
this.lastTrialStatus = l, this.emit("trial_blocked", l);
|
|
1873
2850
|
return;
|
|
1874
2851
|
}
|
|
1875
2852
|
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: n });
|
|
1876
|
-
}).catch((
|
|
1877
|
-
typeof console < "u" && console.warn("[paywall] trial check failed",
|
|
2853
|
+
}).catch((a) => {
|
|
2854
|
+
typeof console < "u" && console.warn("[paywall] trial check failed", a), this.mountAndShow(e, { renew: n });
|
|
1878
2855
|
});
|
|
1879
2856
|
}
|
|
1880
2857
|
ensureTrialStore(e) {
|
|
1881
|
-
if (this.trialStore && this.trialStoreConfig &&
|
|
2858
|
+
if (this.trialStore && this.trialStoreConfig && fr(this.trialStoreConfig, e))
|
|
1882
2859
|
return this.trialStore;
|
|
1883
2860
|
this.trialStoreConfig = e;
|
|
1884
2861
|
const t = this.billing.createTrialStore;
|
|
1885
|
-
return this.trialStore = typeof t == "function" ? t.call(this.billing, e) :
|
|
2862
|
+
return this.trialStore = typeof t == "function" ? t.call(this.billing, e) : De(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
|
|
1886
2863
|
}
|
|
1887
2864
|
mountAndShow(e, t = {}) {
|
|
1888
2865
|
const n = t.renew === !0;
|
|
@@ -1890,8 +2867,8 @@ let it = class {
|
|
|
1890
2867
|
this.isOpen = !0, this.handle.update({ open: !0, initialView: e, purchased: !1, renew: n }), this.emit("open");
|
|
1891
2868
|
return;
|
|
1892
2869
|
}
|
|
1893
|
-
this.isOpen = !0, this.handle =
|
|
1894
|
-
|
|
2870
|
+
this.isOpen = !0, this.handle = Ze(
|
|
2871
|
+
er,
|
|
1895
2872
|
{
|
|
1896
2873
|
client: this.billing,
|
|
1897
2874
|
open: !0,
|
|
@@ -1903,13 +2880,14 @@ let it = class {
|
|
|
1903
2880
|
this.emit(i, s), i === "checkout_started" && this.startUserWatcher();
|
|
1904
2881
|
},
|
|
1905
2882
|
onState: (i) => this.applyState(i),
|
|
1906
|
-
inline: this.inline
|
|
2883
|
+
inline: this.inline,
|
|
2884
|
+
locale: this.forceLocale
|
|
1907
2885
|
},
|
|
1908
2886
|
{ host: this.host, shadowMode: this.shadowMode, inline: this.inline }
|
|
1909
2887
|
), this.emit("open");
|
|
1910
2888
|
}
|
|
1911
2889
|
applyState(e) {
|
|
1912
|
-
if (!
|
|
2890
|
+
if (!pr(this.currentState, e)) {
|
|
1913
2891
|
this.currentState = e;
|
|
1914
2892
|
for (const t of this.stateListeners)
|
|
1915
2893
|
try {
|
|
@@ -2020,19 +2998,19 @@ let it = class {
|
|
|
2020
2998
|
try {
|
|
2021
2999
|
t = await this.billing.bootstrap({ signal: e.signal });
|
|
2022
3000
|
} catch {
|
|
2023
|
-
const
|
|
2024
|
-
return
|
|
3001
|
+
const a = this.billing.getCachedUser();
|
|
3002
|
+
return a?.has_active_subscription ? {
|
|
2025
3003
|
access: "granted",
|
|
2026
3004
|
reason: "has_subscription",
|
|
2027
3005
|
visibility: null,
|
|
2028
3006
|
trial: null,
|
|
2029
|
-
user:
|
|
3007
|
+
user: a
|
|
2030
3008
|
} : {
|
|
2031
3009
|
access: "blocked",
|
|
2032
3010
|
reason: "no_subscription",
|
|
2033
3011
|
visibility: null,
|
|
2034
3012
|
trial: null,
|
|
2035
|
-
user:
|
|
3013
|
+
user: a
|
|
2036
3014
|
};
|
|
2037
3015
|
}
|
|
2038
3016
|
const n = t.user ?? null;
|
|
@@ -2046,19 +3024,19 @@ let it = class {
|
|
|
2046
3024
|
};
|
|
2047
3025
|
let i = null;
|
|
2048
3026
|
if (!e.skipVisibility) {
|
|
2049
|
-
const
|
|
2050
|
-
if (
|
|
3027
|
+
const a = t.settings.visibility;
|
|
3028
|
+
if (a && (i = a, this.lastVisibility = a, !a.visible))
|
|
2051
3029
|
return { access: "granted", reason: "visibility_blocked", visibility: i, trial: null, user: n };
|
|
2052
3030
|
}
|
|
2053
3031
|
let s = null;
|
|
2054
3032
|
if (!e.skipTrial) {
|
|
2055
|
-
const
|
|
2056
|
-
if (
|
|
3033
|
+
const a = t.settings.trial;
|
|
3034
|
+
if (a)
|
|
2057
3035
|
try {
|
|
2058
|
-
if (s = await this.ensureTrialStore(
|
|
3036
|
+
if (s = await this.ensureTrialStore(a).check(), this.lastTrialStatus = s, s.blocked)
|
|
2059
3037
|
return { access: "granted", reason: "trial_blocked", visibility: i, trial: s, user: n };
|
|
2060
|
-
} catch (
|
|
2061
|
-
typeof console < "u" && console.warn("[paywall] getAccess: trial check failed",
|
|
3038
|
+
} catch (l) {
|
|
3039
|
+
typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", l);
|
|
2062
3040
|
}
|
|
2063
3041
|
}
|
|
2064
3042
|
return { access: "blocked", reason: "no_subscription", visibility: i, trial: s, user: n };
|
|
@@ -2075,7 +3053,7 @@ let it = class {
|
|
|
2075
3053
|
// В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
|
|
2076
3054
|
// bootstrap при следующем открытии.
|
|
2077
3055
|
startUserWatcher() {
|
|
2078
|
-
this.watcher ||
|
|
3056
|
+
this.watcher || cr() && (this.watcher = new lr({
|
|
2079
3057
|
client: this.billing,
|
|
2080
3058
|
onActive: (e) => {
|
|
2081
3059
|
this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
|
|
@@ -2094,7 +3072,7 @@ let it = class {
|
|
|
2094
3072
|
}), this.watcher.start());
|
|
2095
3073
|
}
|
|
2096
3074
|
close() {
|
|
2097
|
-
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(
|
|
3075
|
+
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(ae), this.emit("close"));
|
|
2098
3076
|
}
|
|
2099
3077
|
/**
|
|
2100
3078
|
* Сканирует текущий URL на маркеры возврата с checkout и эмитит
|
|
@@ -2104,23 +3082,23 @@ let it = class {
|
|
|
2104
3082
|
*/
|
|
2105
3083
|
checkReturn() {
|
|
2106
3084
|
if (typeof window > "u") return;
|
|
2107
|
-
const e = new URL(window.location.href), t =
|
|
3085
|
+
const e = new URL(window.location.href), t = ve(e.hash.replace(/^#/, "")), n = ve(e.search.replace(/^\?/, "")), i = t ?? n;
|
|
2108
3086
|
i && (i.status === "paid" ? (this.emit("purchase_completed", {
|
|
2109
3087
|
priceId: i.priceId,
|
|
2110
3088
|
sessionId: i.sessionId
|
|
2111
|
-
}),
|
|
3089
|
+
}), gr(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), mr(e));
|
|
2112
3090
|
}
|
|
2113
3091
|
destroy() {
|
|
2114
|
-
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 =
|
|
3092
|
+
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 = ae;
|
|
2115
3093
|
}
|
|
2116
3094
|
};
|
|
2117
|
-
function
|
|
3095
|
+
function dr(r) {
|
|
2118
3096
|
if (!r.auth) return { auth: void 0, ownsAuth: !1 };
|
|
2119
|
-
if (r.auth instanceof
|
|
3097
|
+
if (r.auth instanceof ue || hr(r.auth))
|
|
2120
3098
|
return { auth: r.auth, ownsAuth: !1 };
|
|
2121
3099
|
const e = r.auth === !0 ? {} : r.auth;
|
|
2122
3100
|
return {
|
|
2123
|
-
auth: new
|
|
3101
|
+
auth: new ue({
|
|
2124
3102
|
paywallId: r.paywallId,
|
|
2125
3103
|
apiOrigin: e.apiOrigin ?? r.apiOrigin,
|
|
2126
3104
|
storage: e.storage ?? r.storage,
|
|
@@ -2130,27 +3108,27 @@ function ot(r) {
|
|
|
2130
3108
|
ownsAuth: !0
|
|
2131
3109
|
};
|
|
2132
3110
|
}
|
|
2133
|
-
function
|
|
3111
|
+
function hr(r) {
|
|
2134
3112
|
if (typeof r != "object" || r === null) return !1;
|
|
2135
3113
|
const e = r;
|
|
2136
3114
|
return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
|
|
2137
3115
|
}
|
|
2138
|
-
function
|
|
3116
|
+
function pr(r, e) {
|
|
2139
3117
|
return r.open === e.open && r.view === e.view && r.error === e.error;
|
|
2140
3118
|
}
|
|
2141
|
-
function
|
|
3119
|
+
function fr(r, e) {
|
|
2142
3120
|
return r.mode === e.mode && r.payload === e.payload && r.storage === e.storage;
|
|
2143
3121
|
}
|
|
2144
|
-
function
|
|
3122
|
+
function ve(r) {
|
|
2145
3123
|
if (!r) return null;
|
|
2146
|
-
const e = new URLSearchParams(r), t = e.get(
|
|
3124
|
+
const e = new URLSearchParams(r), t = e.get(F.status);
|
|
2147
3125
|
return t ? {
|
|
2148
3126
|
status: t,
|
|
2149
|
-
priceId: e.get(
|
|
2150
|
-
sessionId: e.get(
|
|
3127
|
+
priceId: e.get(F.priceId),
|
|
3128
|
+
sessionId: e.get(F.sessionId)
|
|
2151
3129
|
} : null;
|
|
2152
3130
|
}
|
|
2153
|
-
function
|
|
3131
|
+
function gr(r) {
|
|
2154
3132
|
if (!(typeof window > "u" || !window.opener))
|
|
2155
3133
|
try {
|
|
2156
3134
|
window.opener.postMessage(
|
|
@@ -2165,17 +3143,17 @@ function ct(r) {
|
|
|
2165
3143
|
} catch {
|
|
2166
3144
|
}
|
|
2167
3145
|
}
|
|
2168
|
-
function
|
|
3146
|
+
function mr(r) {
|
|
2169
3147
|
const e = (n, i) => {
|
|
2170
3148
|
if (!n) return "";
|
|
2171
3149
|
const s = new URLSearchParams(n.replace(/^[?#]/, ""));
|
|
2172
|
-
s.delete(
|
|
2173
|
-
const
|
|
2174
|
-
return
|
|
3150
|
+
s.delete(F.status), s.delete(F.priceId), s.delete(F.sessionId);
|
|
3151
|
+
const a = s.toString();
|
|
3152
|
+
return a ? i + a : "";
|
|
2175
3153
|
}, t = r.pathname + e(r.search, "?") + e(r.hash, "#");
|
|
2176
3154
|
window.history.replaceState(null, "", t);
|
|
2177
3155
|
}
|
|
2178
|
-
class
|
|
3156
|
+
class yr {
|
|
2179
3157
|
constructor(e, t, n) {
|
|
2180
3158
|
this.transport = e, this.paywallId = t, this.config = n;
|
|
2181
3159
|
}
|
|
@@ -2198,9 +3176,9 @@ class ht {
|
|
|
2198
3176
|
});
|
|
2199
3177
|
}
|
|
2200
3178
|
}
|
|
2201
|
-
class
|
|
3179
|
+
class xr {
|
|
2202
3180
|
constructor(e, t) {
|
|
2203
|
-
this.transport = e, this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null, this.userListeners = /* @__PURE__ */ new Set(), this.balanceListeners = /* @__PURE__ */ new Set(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.remoteStorageAdapter = {
|
|
3181
|
+
this.transport = e, this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null, this.userListeners = /* @__PURE__ */ new Set(), this.balanceListeners = /* @__PURE__ */ new Set(), this.bootstrapListeners = /* @__PURE__ */ new Set(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.remoteStorageAdapter = {
|
|
2204
3182
|
getItem: (n) => this.transport.request("storage.get", { key: n }),
|
|
2205
3183
|
setItem: async (n, i) => {
|
|
2206
3184
|
await this.transport.request("storage.set", { key: n, value: i });
|
|
@@ -2224,11 +3202,39 @@ class dt {
|
|
|
2224
3202
|
{ force: e.force },
|
|
2225
3203
|
{ signal: e.signal }
|
|
2226
3204
|
);
|
|
2227
|
-
return this.
|
|
3205
|
+
return this.applyBootstrap(t), t.user && this.applyUser(t.user), t;
|
|
2228
3206
|
}
|
|
2229
3207
|
getCachedBootstrap() {
|
|
2230
3208
|
return this.cachedBootstrap;
|
|
2231
3209
|
}
|
|
3210
|
+
/** Подписка на bootstrap-state. Структурно совместима с
|
|
3211
|
+
* `BillingClient.onBootstrapChange` — те же микротаск-семантики для initial
|
|
3212
|
+
* snapshot. В extension-режиме offscreen пока не broadcast'ит bootstrapChange,
|
|
3213
|
+
* поэтому listener срабатывает только на self-инициированные `bootstrap()`
|
|
3214
|
+
* внутри этого RemoteBillingClient'а (popup перезапрашивает bootstrap → mirror
|
|
3215
|
+
* обновляется → listener вызывается). Cross-surface revalidate (другая вкладка
|
|
3216
|
+
* обновила bootstrap) не доезжает до popup'а — для этого нужен отдельный
|
|
3217
|
+
* bootstrapChange-broadcast в protocol.ts/server.ts. */
|
|
3218
|
+
onBootstrapChange(e, t = {}) {
|
|
3219
|
+
this.bootstrapListeners.add(e);
|
|
3220
|
+
const n = t.immediate ?? "microtask";
|
|
3221
|
+
if (this.cachedBootstrap && n !== "none") {
|
|
3222
|
+
const i = this.cachedBootstrap;
|
|
3223
|
+
if (n === "sync")
|
|
3224
|
+
try {
|
|
3225
|
+
e(i);
|
|
3226
|
+
} catch (s) {
|
|
3227
|
+
console.warn("[paywall] onBootstrapChange initial sync threw", s);
|
|
3228
|
+
}
|
|
3229
|
+
else
|
|
3230
|
+
queueMicrotask(() => {
|
|
3231
|
+
this.bootstrapListeners.has(e) && e(i);
|
|
3232
|
+
});
|
|
3233
|
+
}
|
|
3234
|
+
return () => {
|
|
3235
|
+
this.bootstrapListeners.delete(e);
|
|
3236
|
+
};
|
|
3237
|
+
}
|
|
2232
3238
|
/** Шорткат над `bootstrap()` — возвращает цены пейвола (locale-оверрайды
|
|
2233
3239
|
* уже применены в offscreen'е). Те же кэш-семантики, что у `bootstrap()`. */
|
|
2234
3240
|
async getPrices(e = {}) {
|
|
@@ -2324,6 +3330,13 @@ class dt {
|
|
|
2324
3330
|
signal: e.signal
|
|
2325
3331
|
})];
|
|
2326
3332
|
}
|
|
3333
|
+
/** Саппорт-тикет через offscreen'овский BillingClient. File-объекты
|
|
3334
|
+
* переживают chrome.runtime structured-clone (port forward'ит as-is) —
|
|
3335
|
+
* Bearer-токен/email-substitution делает offscreen, как в обычном
|
|
3336
|
+
* BillingClient. */
|
|
3337
|
+
async createSupportTicket(e) {
|
|
3338
|
+
return this.transport.request("billing.createSupportTicket", e);
|
|
3339
|
+
}
|
|
2327
3340
|
/** Отменить подписку через бэк. По умолчанию cancel в конце текущего
|
|
2328
3341
|
* периода (юзер сохраняет access до renewal date'ы). reason обязательна
|
|
2329
3342
|
* (валидируется бэком) — собирается через select причин в host-UI. */
|
|
@@ -2344,7 +3357,7 @@ class dt {
|
|
|
2344
3357
|
* read-modify-write. PaywallUI duck-types этот метод и предпочитает его
|
|
2345
3358
|
* локальной фабрике, если он есть. */
|
|
2346
3359
|
createTrialStore(e) {
|
|
2347
|
-
return new
|
|
3360
|
+
return new yr(this.transport, this.paywallId, e);
|
|
2348
3361
|
}
|
|
2349
3362
|
// === Identity ===
|
|
2350
3363
|
getIdentity() {
|
|
@@ -2361,17 +3374,26 @@ class dt {
|
|
|
2361
3374
|
return this.identity = e, e;
|
|
2362
3375
|
}
|
|
2363
3376
|
destroy() {
|
|
2364
|
-
this.unsubUserBroadcast?.(), this.unsubBalancesBroadcast?.(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.userListeners.clear(), this.balanceListeners.clear(), this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null;
|
|
3377
|
+
this.unsubUserBroadcast?.(), this.unsubBalancesBroadcast?.(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.userListeners.clear(), this.balanceListeners.clear(), this.bootstrapListeners.clear(), this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null;
|
|
3378
|
+
}
|
|
3379
|
+
applyBootstrap(e) {
|
|
3380
|
+
this.cachedBootstrap = e;
|
|
3381
|
+
for (const t of [...this.bootstrapListeners])
|
|
3382
|
+
try {
|
|
3383
|
+
t(e);
|
|
3384
|
+
} catch (n) {
|
|
3385
|
+
console.warn("[paywall] onBootstrapChange listener threw", n);
|
|
3386
|
+
}
|
|
2365
3387
|
}
|
|
2366
3388
|
/** Обновить mirror user'а и эмитнуть listener'ам если он реально изменился.
|
|
2367
3389
|
* Используется и для self-инициированных RPC (bootstrap/getUser), и для
|
|
2368
3390
|
* broadcast'ов от offscreen — чтобы host'овский onUserChange handler
|
|
2369
3391
|
* получил signal независимо от того, кто триггернул обновление. */
|
|
2370
3392
|
applyUser(e) {
|
|
2371
|
-
|
|
3393
|
+
br(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
|
|
2372
3394
|
}
|
|
2373
3395
|
applyBalances(e) {
|
|
2374
|
-
|
|
3396
|
+
wr(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
|
|
2375
3397
|
}
|
|
2376
3398
|
fireUserListeners(e) {
|
|
2377
3399
|
for (const t of [...this.userListeners])
|
|
@@ -2390,17 +3412,17 @@ class dt {
|
|
|
2390
3412
|
}
|
|
2391
3413
|
}
|
|
2392
3414
|
}
|
|
2393
|
-
function
|
|
3415
|
+
function br(r, e) {
|
|
2394
3416
|
return r === e ? !0 : !r || !e ? !1 : r.has_active_subscription === e.has_active_subscription && (r.purchases?.length ?? 0) === (e.purchases?.length ?? 0);
|
|
2395
3417
|
}
|
|
2396
|
-
function
|
|
3418
|
+
function wr(r, e) {
|
|
2397
3419
|
if (r === e) return !0;
|
|
2398
3420
|
if (!r || !e || r.length !== e.length) return !1;
|
|
2399
3421
|
for (let t = 0; t < r.length; t++)
|
|
2400
3422
|
if (r[t].type !== e[t].type || r[t].count !== e[t].count) return !1;
|
|
2401
3423
|
return !0;
|
|
2402
3424
|
}
|
|
2403
|
-
class
|
|
3425
|
+
class kr {
|
|
2404
3426
|
constructor(e, t) {
|
|
2405
3427
|
this.transport = e, this.session = null, this.listeners = /* @__PURE__ */ new Set(), this.unsubBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.unsubBroadcast = this.transport.on("authChange", ({ event: n, session: i }) => {
|
|
2406
3428
|
this.applySession(n, i);
|
|
@@ -2468,6 +3490,12 @@ class gt {
|
|
|
2468
3490
|
async revokeAllSessions() {
|
|
2469
3491
|
await this.transport.request("auth.revokeAllSessions", void 0);
|
|
2470
3492
|
}
|
|
3493
|
+
/** Last-used auth method + email — читается из offscreen-storage. AuthPanel
|
|
3494
|
+
* использует для "Last used"-бейджа и pre-fill'а email. Storage paywall-
|
|
3495
|
+
* scoped, и offscreen — единый источник правды для всех вкладок/popup'ов. */
|
|
3496
|
+
async getLastLogin() {
|
|
3497
|
+
return this.transport.request("auth.getLastLogin", void 0);
|
|
3498
|
+
}
|
|
2471
3499
|
// === Anonymous sign-in ===
|
|
2472
3500
|
/** Анонимный sign-in (Supabase user без email). Логика (idempotent-check +
|
|
2473
3501
|
* resume через сохранённый refresh_token + fresh signin) живёт в
|
|
@@ -2505,14 +3533,14 @@ class gt {
|
|
|
2505
3533
|
*/
|
|
2506
3534
|
async signInWithOAuth(e) {
|
|
2507
3535
|
if (typeof window > "u")
|
|
2508
|
-
throw new
|
|
3536
|
+
throw new j("oauth_unavailable", "window is required for OAuth");
|
|
2509
3537
|
const t = `pw-oauth-pending-${Math.random().toString(36).slice(2, 10)}`, n = window.open("about:blank", t, "width=480,height=640,popup=yes");
|
|
2510
3538
|
if (!n)
|
|
2511
|
-
throw new
|
|
3539
|
+
throw new j(
|
|
2512
3540
|
"popup_blocked",
|
|
2513
3541
|
"browser blocked auth popup — call from a user gesture"
|
|
2514
3542
|
);
|
|
2515
|
-
|
|
3543
|
+
Sr(n, e.provider);
|
|
2516
3544
|
try {
|
|
2517
3545
|
const { authorizeUrl: i, state: s } = await this.transport.request("auth.oauthStart", {
|
|
2518
3546
|
provider: e.provider,
|
|
@@ -2520,8 +3548,8 @@ class gt {
|
|
|
2520
3548
|
userMeta: e.userMeta
|
|
2521
3549
|
});
|
|
2522
3550
|
n.name = `pw-oauth-${s}`, n.location.replace(i), e.onPopupOpened?.();
|
|
2523
|
-
const
|
|
2524
|
-
return this.applySession("SIGNED_IN",
|
|
3551
|
+
const a = await qe(n, s), l = await this.transport.request("auth.oauthExchange", { state: s, code: a });
|
|
3552
|
+
return this.applySession("SIGNED_IN", l), l;
|
|
2525
3553
|
} catch (i) {
|
|
2526
3554
|
try {
|
|
2527
3555
|
n.close();
|
|
@@ -2534,7 +3562,7 @@ class gt {
|
|
|
2534
3562
|
this.unsubBroadcast?.(), this.unsubBroadcast = null, this.listeners.clear(), this.session = null;
|
|
2535
3563
|
}
|
|
2536
3564
|
applySession(e, t) {
|
|
2537
|
-
if (!
|
|
3565
|
+
if (!vr(this.session, t)) {
|
|
2538
3566
|
this.session = t;
|
|
2539
3567
|
for (const n of [...this.listeners])
|
|
2540
3568
|
try {
|
|
@@ -2545,17 +3573,17 @@ class gt {
|
|
|
2545
3573
|
}
|
|
2546
3574
|
}
|
|
2547
3575
|
}
|
|
2548
|
-
function
|
|
3576
|
+
function vr(r, e) {
|
|
2549
3577
|
return r === e ? !0 : !r || !e ? !1 : r.access_token === e.access_token && r.refresh_token === e.refresh_token && r.expires_at === e.expires_at && r.user.id === e.user.id;
|
|
2550
3578
|
}
|
|
2551
|
-
const
|
|
3579
|
+
const _r = {
|
|
2552
3580
|
google: "Google",
|
|
2553
3581
|
apple: "Apple",
|
|
2554
3582
|
github: "GitHub",
|
|
2555
3583
|
facebook: "Facebook"
|
|
2556
3584
|
};
|
|
2557
|
-
function
|
|
2558
|
-
const t =
|
|
3585
|
+
function Sr(r, e) {
|
|
3586
|
+
const t = _r[e] ?? e;
|
|
2559
3587
|
try {
|
|
2560
3588
|
const n = r.document;
|
|
2561
3589
|
n.title = `Sign in with ${t}`;
|
|
@@ -2563,14 +3591,14 @@ function xt(r, e) {
|
|
|
2563
3591
|
i.textContent = "html,body{margin:0;padding:0;height:100%;font-family:-apple-system,system-ui,sans-serif;background:#fafafa;color:#475569}.pw-oauth-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:16px}.pw-oauth-spinner{width:36px;height:36px;border:3px solid #e2e8f0;border-top-color:#7c3aed;border-radius:50%;animation:pw-oauth-spin 800ms linear infinite}.pw-oauth-label{font-size:14px;font-weight:500;letter-spacing:-0.01em}@keyframes pw-oauth-spin{to{transform:rotate(360deg)}}", n.head.appendChild(i);
|
|
2564
3592
|
const s = n.createElement("div");
|
|
2565
3593
|
s.className = "pw-oauth-wrap";
|
|
2566
|
-
const l = n.createElement("div");
|
|
2567
|
-
l.className = "pw-oauth-spinner";
|
|
2568
3594
|
const a = n.createElement("div");
|
|
2569
|
-
a.className = "pw-oauth-
|
|
3595
|
+
a.className = "pw-oauth-spinner";
|
|
3596
|
+
const l = n.createElement("div");
|
|
3597
|
+
l.className = "pw-oauth-label", l.textContent = `Connecting to ${t}…`, s.appendChild(a), s.appendChild(l), n.body.appendChild(s);
|
|
2570
3598
|
} catch {
|
|
2571
3599
|
}
|
|
2572
3600
|
}
|
|
2573
|
-
class
|
|
3601
|
+
class Cr {
|
|
2574
3602
|
constructor(e) {
|
|
2575
3603
|
this.transport = e;
|
|
2576
3604
|
}
|
|
@@ -2582,7 +3610,7 @@ class bt {
|
|
|
2582
3610
|
});
|
|
2583
3611
|
}
|
|
2584
3612
|
}
|
|
2585
|
-
class
|
|
3613
|
+
class Ir {
|
|
2586
3614
|
constructor(e) {
|
|
2587
3615
|
this.factory = e, this.channel = null, this.channelDisposers = [], this.pending = /* @__PURE__ */ new Map(), this.listeners = /* @__PURE__ */ new Map(), this.destroyed = !1, this.nextId = 0, this.clientId = `c-${Math.random().toString(36).slice(2, 10)}`;
|
|
2588
3616
|
}
|
|
@@ -2596,21 +3624,21 @@ class kt {
|
|
|
2596
3624
|
this.channel = e;
|
|
2597
3625
|
const t = e.onMessage((i) => this.handleMessage(i)), n = e.onDisconnect(() => this.handleDisconnect());
|
|
2598
3626
|
return this.channelDisposers = [t, n], this.request("handshake", {
|
|
2599
|
-
protocolVersion:
|
|
3627
|
+
protocolVersion: K,
|
|
2600
3628
|
clientId: this.clientId
|
|
2601
3629
|
}).then((i) => {
|
|
2602
|
-
i.protocolVersion !==
|
|
2603
|
-
`[sdk-extension] protocol version mismatch: client=${
|
|
3630
|
+
i.protocolVersion !== K && console.warn(
|
|
3631
|
+
`[sdk-extension] protocol version mismatch: client=${K}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
|
|
2604
3632
|
);
|
|
2605
3633
|
}).catch(() => {
|
|
2606
3634
|
}), e;
|
|
2607
3635
|
}
|
|
2608
3636
|
handleMessage(e) {
|
|
2609
|
-
if (
|
|
3637
|
+
if (Ar(e)) {
|
|
2610
3638
|
if (e.type === "response") {
|
|
2611
3639
|
const t = this.pending.get(e.id);
|
|
2612
3640
|
if (!t) return;
|
|
2613
|
-
this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(
|
|
3641
|
+
this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(Ne(e.error));
|
|
2614
3642
|
return;
|
|
2615
3643
|
}
|
|
2616
3644
|
if (e.type === "event") {
|
|
@@ -2631,7 +3659,7 @@ class kt {
|
|
|
2631
3659
|
const e = Array.from(this.pending.values());
|
|
2632
3660
|
this.pending.clear();
|
|
2633
3661
|
for (const t of e)
|
|
2634
|
-
t.signal?.removeEventListener("abort", t.abortListener), t.reject(new
|
|
3662
|
+
t.signal?.removeEventListener("abort", t.abortListener), t.reject(new Lr());
|
|
2635
3663
|
}
|
|
2636
3664
|
request(e, t, n = {}) {
|
|
2637
3665
|
if (this.destroyed)
|
|
@@ -2639,31 +3667,31 @@ class kt {
|
|
|
2639
3667
|
if (n.signal?.aborted)
|
|
2640
3668
|
return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
2641
3669
|
const i = this.ensureChannel(), s = `r${++this.nextId}`;
|
|
2642
|
-
return new Promise((
|
|
2643
|
-
const
|
|
2644
|
-
resolve:
|
|
2645
|
-
reject:
|
|
3670
|
+
return new Promise((a, l) => {
|
|
3671
|
+
const d = {
|
|
3672
|
+
resolve: a,
|
|
3673
|
+
reject: l,
|
|
2646
3674
|
signal: n.signal
|
|
2647
3675
|
};
|
|
2648
|
-
n.signal && (
|
|
3676
|
+
n.signal && (d.abortListener = () => {
|
|
2649
3677
|
if (this.pending.delete(s)) {
|
|
2650
|
-
|
|
3678
|
+
l(new DOMException("Aborted", "AbortError"));
|
|
2651
3679
|
try {
|
|
2652
3680
|
i.send({ type: "cancel", id: s });
|
|
2653
3681
|
} catch {
|
|
2654
3682
|
}
|
|
2655
3683
|
}
|
|
2656
|
-
}, n.signal.addEventListener("abort",
|
|
2657
|
-
const
|
|
3684
|
+
}, n.signal.addEventListener("abort", d.abortListener)), this.pending.set(s, d);
|
|
3685
|
+
const p = {
|
|
2658
3686
|
type: "request",
|
|
2659
3687
|
id: s,
|
|
2660
3688
|
kind: e,
|
|
2661
3689
|
params: t
|
|
2662
3690
|
};
|
|
2663
3691
|
try {
|
|
2664
|
-
i.send(
|
|
2665
|
-
} catch (
|
|
2666
|
-
this.pending.delete(s), n.signal?.removeEventListener("abort",
|
|
3692
|
+
i.send(p);
|
|
3693
|
+
} catch (u) {
|
|
3694
|
+
this.pending.delete(s), n.signal?.removeEventListener("abort", d.abortListener), l(u);
|
|
2667
3695
|
}
|
|
2668
3696
|
});
|
|
2669
3697
|
}
|
|
@@ -2687,28 +3715,28 @@ class kt {
|
|
|
2687
3715
|
this.channel?.close(), this.channel = null;
|
|
2688
3716
|
}
|
|
2689
3717
|
}
|
|
2690
|
-
class
|
|
3718
|
+
class Lr extends Error {
|
|
2691
3719
|
constructor() {
|
|
2692
3720
|
super("Transport channel disconnected mid-request"), this.code = "transport_disconnected", this.name = "TransportDisconnectedError";
|
|
2693
3721
|
}
|
|
2694
3722
|
}
|
|
2695
|
-
function
|
|
3723
|
+
function Ar(r) {
|
|
2696
3724
|
if (typeof r != "object" || r === null) return !1;
|
|
2697
3725
|
const e = r.type;
|
|
2698
3726
|
return e === "request" || e === "response" || e === "event";
|
|
2699
3727
|
}
|
|
2700
|
-
let
|
|
2701
|
-
function
|
|
2702
|
-
return
|
|
3728
|
+
let W = null;
|
|
3729
|
+
function Er() {
|
|
3730
|
+
return W || (W = new Ir(() => Fe(Ge)), W);
|
|
2703
3731
|
}
|
|
2704
|
-
class
|
|
3732
|
+
class Rr extends ur {
|
|
2705
3733
|
constructor(e) {
|
|
2706
|
-
const t =
|
|
3734
|
+
const t = Er(), n = new xr(t, {
|
|
2707
3735
|
paywallId: e.paywallId,
|
|
2708
3736
|
apiOrigin: e.apiOrigin
|
|
2709
3737
|
});
|
|
2710
3738
|
let i;
|
|
2711
|
-
e.auth === !0 ? i = new
|
|
3739
|
+
e.auth === !0 ? i = new kr(t, {
|
|
2712
3740
|
paywallId: e.paywallId,
|
|
2713
3741
|
apiOrigin: e.apiOrigin
|
|
2714
3742
|
}) : e.auth && console.warn(
|
|
@@ -2724,7 +3752,7 @@ class Lt extends it {
|
|
|
2724
3752
|
// Внутренний EventTracker отключаем — единственный tracker живёт в
|
|
2725
3753
|
// offscreen'е. Манчиально подписываемся ниже.
|
|
2726
3754
|
analytics: !1
|
|
2727
|
-
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new
|
|
3755
|
+
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new Cr(t), this.bindAnalytics());
|
|
2728
3756
|
}
|
|
2729
3757
|
/** Зеркало sdk/PaywallUI.initTracker'овских биндингов, но с RemoteEventTracker.
|
|
2730
3758
|
* Когда @monetize.software/sdk экспоузнет публичный hook для inject'а tracker'а,
|
|
@@ -2782,11 +3810,11 @@ class Lt extends it {
|
|
|
2782
3810
|
}
|
|
2783
3811
|
}
|
|
2784
3812
|
export {
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
3813
|
+
K as PROTOCOL_VERSION,
|
|
3814
|
+
Rr as PaywallUI,
|
|
3815
|
+
kr as RemoteAuthClient,
|
|
3816
|
+
xr as RemoteBillingClient,
|
|
3817
|
+
Cr as RemoteEventTracker,
|
|
3818
|
+
Er as getContentTransport
|
|
2791
3819
|
};
|
|
2792
3820
|
//# sourceMappingURL=content.js.map
|