@monetize.software/sdk-extension 3.0.0-alpha.23 → 3.0.0-alpha.25

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/content.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./chunks/chrome-port-BEMjZQAH.js"),U=require("preact"),n=require("preact/jsx-runtime"),d=require("preact/hooks"),Be=require("./chunks/port-name-CF4WQQ3-.js");function Oe(r){return`pw-offer-${r}-start`}function D(r,e){if(!r||r.length===0)return null;const t=r.find(i=>i.price_id===e&&(i.discount_percent??0)>0);return t||(r.find(i=>i.price_id==null&&(i.discount_percent??0)>0)??null)}function qe(r,e={}){const t=r.discount_percent??0;if(t<=0)return null;const s=e.now??Date.now(),i=Re(r,e.readStart),o=Ue(r,i),a=i!==null?Math.max(0,i-s):null;return i!==null&&i<=s?null:{offer:r,discountPercent:t,remainingMs:a,totalMs:o,expiresAt:i}}function Re(r,e){if(r.expires_at){const t=Date.parse(r.expires_at);return Number.isFinite(t)?t:null}if(r.duration_minutes&&r.duration_minutes>0&&e){const t=e(r.id);if(!t)return null;const s=Date.parse(t);return Number.isFinite(s)?s+r.duration_minutes*6e4:null}return null}function Ue(r,e){return r.duration_minutes&&r.duration_minutes>0?r.duration_minutes*6e4:e!==null?e-Date.now():null}function De(r){if(typeof window>"u")return null;try{return window.localStorage.getItem(Oe(r))}catch{return null}}const me='@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%}}';let ie=!1;function Ne(){if(ie||(ie=!0,typeof CSS>"u"||typeof CSS.registerProperty!="function"))return;let r;try{const e=new CSSStyleSheet;e.replaceSync(me),r=e.cssRules}catch{return}for(const e of r){if(e.constructor.name!=="CSSPropertyRule")continue;const t=e;try{CSS.registerProperty({name:t.name,syntax:t.syntax,inherits:t.inherits,...t.initialValue!=null?{initialValue:t.initialValue}:{}})}catch{}}}function ze(r,e,t={}){if(typeof document>"u")throw new Error("mountShadow called in non-DOM environment");Ne();const s=t.host??document.createElement("div");s.setAttribute("data-paywall-host",""),s.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;",!s.isConnected&&!t.inline&&document.body.appendChild(s);const i=s.attachShadow({mode:t.shadowMode??"closed"}),o=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./chunks/chrome-port-BEMjZQAH.js"),U=require("preact"),n=require("preact/jsx-runtime"),d=require("preact/hooks"),Re=require("./chunks/port-name-CF4WQQ3-.js");function Ue(r){return`pw-offer-${r}-start`}function ye(r,e){if(!r||r.length===0)return null;const t=r.find(i=>i.price_id===e&&(i.discount_percent??0)>0);return t||(r.find(i=>i.price_id==null&&(i.discount_percent??0)>0)??null)}function F(r,e,t={}){const s=ye(r,e);return s&&be(s,t)?s:null}function be(r,e={}){const t=r.discount_percent??0;if(t<=0)return null;const s=e.now??Date.now(),i=De(r,e.readStart),o=ze(r,i),a=i!==null?Math.max(0,i-s):null;return i!==null&&i<=s?null:{offer:r,discountPercent:t,remainingMs:a,totalMs:o,expiresAt:i}}function De(r,e){if(r.expires_at){const t=Date.parse(r.expires_at);return Number.isFinite(t)?t:null}if(r.duration_minutes&&r.duration_minutes>0&&e){const t=e(r.id);if(!t)return null;const s=Date.parse(t);return Number.isFinite(s)?s+r.duration_minutes*6e4:null}return null}function ze(r,e){return r.duration_minutes&&r.duration_minutes>0?r.duration_minutes*6e4:e!==null?e-Date.now():null}function D(r){if(typeof window>"u")return null;try{return window.localStorage.getItem(Ue(r))}catch{return null}}const we='@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%}}';let oe=!1;function Ne(){if(oe||(oe=!0,typeof CSS>"u"||typeof CSS.registerProperty!="function"))return;let r;try{const e=new CSSStyleSheet;e.replaceSync(we),r=e.cssRules}catch{return}for(const e of r){if(e.constructor.name!=="CSSPropertyRule")continue;const t=e;try{CSS.registerProperty({name:t.name,syntax:t.syntax,inherits:t.inherits,...t.initialValue!=null?{initialValue:t.initialValue}:{}})}catch{}}}function Fe(r,e,t={}){if(typeof document>"u")throw new Error("mountShadow called in non-DOM environment");Ne();const s=t.host??document.createElement("div");s.setAttribute("data-paywall-host",""),s.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;",!s.isConnected&&!t.inline&&document.body.appendChild(s);const i=s.attachShadow({mode:t.shadowMode??"closed"}),o=`
2
2
  :host {
3
3
  all: initial !important;
4
4
  display: block !important;
@@ -16,11 +16,11 @@
16
16
  cursor: auto !important;
17
17
  visibility: visible !important;
18
18
  }
19
- `,a=document.createElement("style");a.textContent=o+me+(t.injectCss??""),i.appendChild(a);const l=document.createElement("div");l.style.pointerEvents="auto",i.appendChild(l);let c=e;return U.render(U.h(r,c),l),{shadowRoot:i,update(h){c={...c,...h},U.render(U.h(r,c),l)},unmount(){U.render(null,l),s.remove()}}}const Fe=(r,e,t)=>{const s=r[e];return s?typeof s=="function"?s():Promise.resolve(s):new Promise((i,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==t?". Note that variables only represent file names one level deep.":""))))})},Ve=["ru","uk","de","es","fr","it","pt","pl","cs","hu","ro","nl","sv","da","no","fi","el","tr","id","ar","ja","ko","zh","hi","th","vi","he"],ye=(r,e,t)=>we(e,t),be=U.createContext({t:ye,locale:"en"});function we(r,e){if(!e)return r;let t=r;for(const[s,i]of Object.entries(e))t=t.split(`{${s}}`).join(String(i));return t}const K=new Map,X=new Map;function ke(r){return Ve.includes(r)}function $e(r){const e=[];if(typeof navigator<"u"&&navigator.language){e.push(navigator.language);const s=navigator.language.split("-")[0];s&&s!==navigator.language&&e.push(s)}const t=r.settings.locale_default;if(t){e.push(t);const s=t.split("-")[0];s&&s!==t&&e.push(s)}for(const s of e)if(ke(s))return s;return null}function He(r,e){return!!r.locales&&r.locales[e]!==void 0}async function Ge(r){const e=K.get(r);if(e)return e;const t=X.get(r);if(t)return t;const s=Fe(Object.assign({"./locales/ar.ts":()=>Promise.resolve().then(()=>require("./chunks/ar-OnxZkqWR.js")),"./locales/cs.ts":()=>Promise.resolve().then(()=>require("./chunks/cs-Cb2KZ70r.js")),"./locales/da.ts":()=>Promise.resolve().then(()=>require("./chunks/da-DyQC12xy.js")),"./locales/de.ts":()=>Promise.resolve().then(()=>require("./chunks/de-CWM13wnK.js")),"./locales/el.ts":()=>Promise.resolve().then(()=>require("./chunks/el-BtKuORsc.js")),"./locales/es.ts":()=>Promise.resolve().then(()=>require("./chunks/es-qLcKnBft.js")),"./locales/fi.ts":()=>Promise.resolve().then(()=>require("./chunks/fi-kGtbK51C.js")),"./locales/fr.ts":()=>Promise.resolve().then(()=>require("./chunks/fr-CScwFVNj.js")),"./locales/he.ts":()=>Promise.resolve().then(()=>require("./chunks/he-ChFVbP_S.js")),"./locales/hi.ts":()=>Promise.resolve().then(()=>require("./chunks/hi-BIswPYL2.js")),"./locales/hu.ts":()=>Promise.resolve().then(()=>require("./chunks/hu-CT_jwL0k.js")),"./locales/id.ts":()=>Promise.resolve().then(()=>require("./chunks/id-2lYf7ogC.js")),"./locales/it.ts":()=>Promise.resolve().then(()=>require("./chunks/it-CEMhCvXU.js")),"./locales/ja.ts":()=>Promise.resolve().then(()=>require("./chunks/ja-CkpO3n78.js")),"./locales/ko.ts":()=>Promise.resolve().then(()=>require("./chunks/ko-BKdzk0jX.js")),"./locales/nl.ts":()=>Promise.resolve().then(()=>require("./chunks/nl-Bek7IiHL.js")),"./locales/no.ts":()=>Promise.resolve().then(()=>require("./chunks/no-BztcQKh8.js")),"./locales/pl.ts":()=>Promise.resolve().then(()=>require("./chunks/pl-CMF2KerQ.js")),"./locales/pt.ts":()=>Promise.resolve().then(()=>require("./chunks/pt-DF9cd_iW.js")),"./locales/ro.ts":()=>Promise.resolve().then(()=>require("./chunks/ro-DpPc1UhJ.js")),"./locales/ru.ts":()=>Promise.resolve().then(()=>require("./chunks/ru-gt3-clOi.js")),"./locales/sv.ts":()=>Promise.resolve().then(()=>require("./chunks/sv-Cg7O9Uh3.js")),"./locales/th.ts":()=>Promise.resolve().then(()=>require("./chunks/th-pvtT9u-U.js")),"./locales/tr.ts":()=>Promise.resolve().then(()=>require("./chunks/tr-gAn3KCul.js")),"./locales/uk.ts":()=>Promise.resolve().then(()=>require("./chunks/uk-HIaOETe4.js")),"./locales/vi.ts":()=>Promise.resolve().then(()=>require("./chunks/vi-B7DVCjxx.js")),"./locales/zh.ts":()=>Promise.resolve().then(()=>require("./chunks/zh-007yK7rl.js"))}),`./locales/${r}.ts`,3).then(i=>{const o=i.default??{};return K.set(r,o),o}).catch(i=>{console.warn(`[paywall] failed to load locale chunk "${r}"`,i);const o={};return K.set(r,o),o}).finally(()=>{X.delete(r)});return X.set(r,s),s}function We({bootstrap:r,forceLocale:e,children:t}){const[s,i]=d.useState("en"),[o,a]=d.useState(null);d.useEffect(()=>{const h=(e&&ke(e)?e:null)??(()=>{if(!r)return null;const g=$e(r);return!g||!He(r,g)?null:g})();if(!h){(o!==null||s!=="en")&&(i("en"),a(null));return}if(h===s&&o)return;let u=!1;return Ge(h).then(g=>{u||(i(h),a(g))}),()=>{u=!0}},[r,e]);const l={locale:s,t:o?(c,h,u)=>we(o[c]??h,u):ye};return n.jsx(be.Provider,{value:l,children:t})}function j(){return d.useContext(be)}const oe='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ze({open:r,onClose:e,labelledBy:t,brandColor:s,topBanner:i,allowClose:o=!0,hideCloseButton:a=!1,inline:l=!1,children:c}){const{t:h}=j(),u=d.useRef(null),g=d.useRef(null);if(d.useEffect(()=>{if(!r)return;g.current=document.activeElement??null;const x=u.current;x&&(x.querySelector(oe)??x).focus({preventScroll:!0});const I=m=>{if(m.key==="Escape"){if(!o)return;m.stopPropagation(),e();return}if(m.key!=="Tab"||!u.current)return;const S=Array.from(u.current.querySelectorAll(oe)).filter(B=>!B.hasAttribute("disabled")&&B.tabIndex!==-1);if(S.length===0){m.preventDefault();return}const C=S[0],T=S[S.length-1],P=document.activeElement;m.shiftKey&&P===C?(m.preventDefault(),T.focus()):!m.shiftKey&&P===T&&(m.preventDefault(),C.focus())};document.addEventListener("keydown",I,!0);const y=document.body.style.overflow;return l||(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",I,!0),l||(document.body.style.overflow=y),g.current?.focus?.({preventScroll:!0})}},[r,e,o,l]),!r)return null;const _=x=>{o&&x.target===x.currentTarget&&e()},p=s??"#3b82f6",k=`${l?"absolute z-[1]":"fixed z-[2147483647]"} inset-0 flex items-center justify-center bg-slate-950/50 p-2 sm:p-4 backdrop-blur-md animate-[pw-fade-in_180ms_ease-out]`;return n.jsxs("div",{class:k,onClick:_,"data-pw-root":!0,children:[n.jsxs("div",{class:"relative flex w-full max-w-[400px] flex-col animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",style:{"--pw-accent":p},children:[i,n.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":t,tabIndex:-1,class:"relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-xl bg-white outline-none",style:{boxShadow:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},children:[c,o&&!a?n.jsx("button",{type:"button",onClick:e,"aria-label":h("modal.close_aria","Close"),class:"absolute right-3 top-3 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-500 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:n.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round"})})}):null]})]}),n.jsx("style",{children:`
19
+ `,a=document.createElement("style");a.textContent=o+we+(t.injectCss??""),i.appendChild(a);const l=document.createElement("div");l.style.pointerEvents="auto",i.appendChild(l);let c=e;return U.render(U.h(r,c),l),{shadowRoot:i,update(h){c={...c,...h},U.render(U.h(r,c),l)},unmount(){U.render(null,l),s.remove()}}}const Ve=(r,e,t)=>{const s=r[e];return s?typeof s=="function"?s():Promise.resolve(s):new Promise((i,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==t?". Note that variables only represent file names one level deep.":""))))})},$e=["ru","uk","de","es","fr","it","pt","pl","cs","hu","ro","nl","sv","da","no","fi","el","tr","id","ar","ja","ko","zh","hi","th","vi","he"],ke=(r,e,t)=>_e(e,t),ve=U.createContext({t:ke,locale:"en"});function _e(r,e){if(!e)return r;let t=r;for(const[s,i]of Object.entries(e))t=t.split(`{${s}}`).join(String(i));return t}const X=new Map,J=new Map;function je(r){return $e.includes(r)}function He(r){const e=[];if(typeof navigator<"u"&&navigator.language){e.push(navigator.language);const s=navigator.language.split("-")[0];s&&s!==navigator.language&&e.push(s)}const t=r.settings.locale_default;if(t){e.push(t);const s=t.split("-")[0];s&&s!==t&&e.push(s)}for(const s of e)if(je(s))return s;return null}function Ge(r,e){return!!r.locales&&r.locales[e]!==void 0}async function We(r){const e=X.get(r);if(e)return e;const t=J.get(r);if(t)return t;const s=Ve(Object.assign({"./locales/ar.ts":()=>Promise.resolve().then(()=>require("./chunks/ar-OnxZkqWR.js")),"./locales/cs.ts":()=>Promise.resolve().then(()=>require("./chunks/cs-Cb2KZ70r.js")),"./locales/da.ts":()=>Promise.resolve().then(()=>require("./chunks/da-DyQC12xy.js")),"./locales/de.ts":()=>Promise.resolve().then(()=>require("./chunks/de-CWM13wnK.js")),"./locales/el.ts":()=>Promise.resolve().then(()=>require("./chunks/el-BtKuORsc.js")),"./locales/es.ts":()=>Promise.resolve().then(()=>require("./chunks/es-qLcKnBft.js")),"./locales/fi.ts":()=>Promise.resolve().then(()=>require("./chunks/fi-kGtbK51C.js")),"./locales/fr.ts":()=>Promise.resolve().then(()=>require("./chunks/fr-CScwFVNj.js")),"./locales/he.ts":()=>Promise.resolve().then(()=>require("./chunks/he-ChFVbP_S.js")),"./locales/hi.ts":()=>Promise.resolve().then(()=>require("./chunks/hi-BIswPYL2.js")),"./locales/hu.ts":()=>Promise.resolve().then(()=>require("./chunks/hu-CT_jwL0k.js")),"./locales/id.ts":()=>Promise.resolve().then(()=>require("./chunks/id-2lYf7ogC.js")),"./locales/it.ts":()=>Promise.resolve().then(()=>require("./chunks/it-CEMhCvXU.js")),"./locales/ja.ts":()=>Promise.resolve().then(()=>require("./chunks/ja-CkpO3n78.js")),"./locales/ko.ts":()=>Promise.resolve().then(()=>require("./chunks/ko-BKdzk0jX.js")),"./locales/nl.ts":()=>Promise.resolve().then(()=>require("./chunks/nl-Bek7IiHL.js")),"./locales/no.ts":()=>Promise.resolve().then(()=>require("./chunks/no-BztcQKh8.js")),"./locales/pl.ts":()=>Promise.resolve().then(()=>require("./chunks/pl-CMF2KerQ.js")),"./locales/pt.ts":()=>Promise.resolve().then(()=>require("./chunks/pt-DF9cd_iW.js")),"./locales/ro.ts":()=>Promise.resolve().then(()=>require("./chunks/ro-DpPc1UhJ.js")),"./locales/ru.ts":()=>Promise.resolve().then(()=>require("./chunks/ru-gt3-clOi.js")),"./locales/sv.ts":()=>Promise.resolve().then(()=>require("./chunks/sv-Cg7O9Uh3.js")),"./locales/th.ts":()=>Promise.resolve().then(()=>require("./chunks/th-pvtT9u-U.js")),"./locales/tr.ts":()=>Promise.resolve().then(()=>require("./chunks/tr-gAn3KCul.js")),"./locales/uk.ts":()=>Promise.resolve().then(()=>require("./chunks/uk-HIaOETe4.js")),"./locales/vi.ts":()=>Promise.resolve().then(()=>require("./chunks/vi-B7DVCjxx.js")),"./locales/zh.ts":()=>Promise.resolve().then(()=>require("./chunks/zh-007yK7rl.js"))}),`./locales/${r}.ts`,3).then(i=>{const o=i.default??{};return X.set(r,o),o}).catch(i=>{console.warn(`[paywall] failed to load locale chunk "${r}"`,i);const o={};return X.set(r,o),o}).finally(()=>{J.delete(r)});return J.set(r,s),s}function Ze({bootstrap:r,forceLocale:e,children:t}){const[s,i]=d.useState("en"),[o,a]=d.useState(null);d.useEffect(()=>{const h=(e&&je(e)?e:null)??(()=>{if(!r)return null;const g=He(r);return!g||!Ge(r,g)?null:g})();if(!h){(o!==null||s!=="en")&&(i("en"),a(null));return}if(h===s&&o)return;let u=!1;return We(h).then(g=>{u||(i(h),a(g))}),()=>{u=!0}},[r,e]);const l={locale:s,t:o?(c,h,u)=>_e(o[c]??h,u):ke};return n.jsx(ve.Provider,{value:l,children:t})}function j(){return d.useContext(ve)}const ae='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ye({open:r,onClose:e,labelledBy:t,brandColor:s,topBanner:i,allowClose:o=!0,hideCloseButton:a=!1,inline:l=!1,children:c}){const{t:h}=j(),u=d.useRef(null),g=d.useRef(null);if(d.useEffect(()=>{if(!r)return;g.current=document.activeElement??null;const x=u.current;x&&(x.querySelector(ae)??x).focus({preventScroll:!0});const I=m=>{if(m.key==="Escape"){if(!o)return;m.stopPropagation(),e();return}if(m.key!=="Tab"||!u.current)return;const S=Array.from(u.current.querySelectorAll(ae)).filter(B=>!B.hasAttribute("disabled")&&B.tabIndex!==-1);if(S.length===0){m.preventDefault();return}const C=S[0],M=S[S.length-1],P=document.activeElement;m.shiftKey&&P===C?(m.preventDefault(),M.focus()):!m.shiftKey&&P===M&&(m.preventDefault(),C.focus())};document.addEventListener("keydown",I,!0);const y=document.body.style.overflow;return l||(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",I,!0),l||(document.body.style.overflow=y),g.current?.focus?.({preventScroll:!0})}},[r,e,o,l]),!r)return null;const _=x=>{o&&x.target===x.currentTarget&&e()},p=s??"#3b82f6",k=`${l?"absolute z-[1]":"fixed z-[2147483647]"} inset-0 flex items-center justify-center bg-slate-950/50 p-2 sm:p-4 backdrop-blur-md animate-[pw-fade-in_180ms_ease-out]`;return n.jsxs("div",{class:k,onClick:_,"data-pw-root":!0,children:[n.jsxs("div",{class:"relative flex w-full max-w-[400px] flex-col animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",style:{"--pw-accent":p},children:[i,n.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":t,tabIndex:-1,class:"relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-xl bg-white outline-none",style:{boxShadow:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},children:[c,o&&!a?n.jsx("button",{type:"button",onClick:e,"aria-label":h("modal.close_aria","Close"),class:"absolute right-3 top-3 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-500 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:n.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round"})})}):null]})]}),n.jsx("style",{children:`
20
20
  @keyframes pw-fade-in { from { opacity: 0 } to { opacity: 1 } }
21
21
  @keyframes pw-scale-in {
22
22
  from { opacity: 0; transform: translateY(12px) scale(0.96) }
23
23
  to { opacity: 1; transform: none }
24
24
  }
25
- `})]})}function Ye(r,e){switch(r){case"google":return e("auth.continue_with_google","Continue with Google");case"apple":return e("auth.continue_with_apple","Continue with Apple");case"github":return e("auth.continue_with_github","Continue with GitHub");case"facebook":return e("auth.continue_with_facebook","Continue with Facebook")}}function ae(r,e,t){const s=e==="signup"?t("auth.signup_failed","Sign-up failed"):t("auth.signin_failed","Sign-in failed");if(!(r instanceof v.PaywallError))return s;switch(r.code){case"invalid_credentials":return t("auth.invalid_credentials","Invalid email or password");case"email_not_confirmed":return t("auth.email_not_confirmed","Please confirm your email before signing in.");case"email_exists":case"user_already_exists":return t("auth.email_exists","An account with this email already exists.");case"weak_password":return t("auth.weak_password","Password is too weak.");case"invalid_otp":case"otp_expired":case"token_expired":return t("auth.invalid_otp","The code is invalid or has expired.");case"over_email_send_rate_limit":case"over_request_rate_limit":case"rate_limited":case"http_429":return t("auth.rate_limited","Too many requests. Please try again later.");case"network_error":return t("auth.network_error","Network error. Please check your connection and try again.");case"upstream":case"upstream_error":case"http_502":case"http_503":case"http_504":return t("auth.service_unavailable","Service is temporarily unavailable. Please try again.");default:return s}}function ve({block:r,ctx:e}){const t=e.auth,s=e.authSession,i=r.allow_signup!==!1,o=r.allow_password_reset!==!1,a=r.hide_when_authenticated!==!1;if(!t)return typeof console<"u"&&console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"),null;const l=s&&!s.user.is_anonymous?s:null;return l&&a?null:l?n.jsx(Ke,{email:l.user.email??"",onSignOut:()=>t.signOut().catch(()=>{})}):n.jsx(Xe,{block:r,allowSignup:i,allowReset:o,ctx:e})}function Ke({email:r,onSignOut:e}){const{t}=j();return n.jsxs("div",{class:"flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3",children:[n.jsxs("div",{class:"flex flex-col",children:[n.jsx("span",{class:"text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:t("auth.signed_in","Signed in")}),n.jsx("span",{class:"text-sm font-medium text-gray-900",children:r})]}),n.jsx("button",{type:"button",onClick:e,class:"rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-600 transition-colors hover:bg-white hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:t("auth.sign_out","Sign out")})]})}function Xe({block:r,allowSignup:e,allowReset:t,ctx:s}){const{t:i}=j(),o=s.auth,a=r.providers??[],l=s.initialAuthMode==="signup"&&e?"signup":"signin",[c,h]=d.useState(l),[u,g]=d.useState(""),[_,p]=d.useState(""),[k,x]=d.useState(""),[I,y]=d.useState(""),[m,S]=d.useState(null),C=d.useRef(!1),[T,P]=d.useState(null),[B,O]=d.useState(null),[q,A]=d.useState(!1),[E,R]=d.useState(null);d.useEffect(()=>{if(typeof o.getLastLogin!="function")return;let f=!1;return o.getLastLogin().then(w=>{f||!w||(R(w),w.email&&g(L=>L===""?w.email:L))},()=>{}),()=>{f=!0}},[o]);const M=f=>{h(f),P(null),O(null),A(!1)},W=async f=>{if(f.preventDefault(),!(C.current||m)){C.current=!0;try{if(P(null),O(null),c==="signup"&&!q){if(!u.trim())return;A(!0);return}if(c==="signup"&&_!==k){P(i("auth.passwords_mismatch","Passwords don't match"));return}S("email");try{c==="signin"?await o.signInWithEmail({email:u,password:_}):c==="signup"?(await o.signUp({email:u,password:_})).kind==="confirmation_required"&&(p(""),h("signup_verify"),O(i("auth.check_email_message","Check your email for a confirmation code."))):c==="forgot"?(await o.requestPasswordReset({email:u}),h("reset_sent")):c==="signup_verify"?await o.verifyOtp({email:u,token:I,type:"email"}):c==="reset_verify"&&(await o.verifyOtp({email:u,token:I,type:_?"recovery":"email"}),_&&await o.updatePassword({password:_}))}catch(w){P(ae(w,c==="signup"?"signup":c==="signup_verify"||c==="reset_verify"?"otp":c==="forgot"?"reset":"signin",i))}finally{S(null)}}finally{C.current=!1}}},F=async f=>{if(!(C.current||m)){C.current=!0,S(f),P(null),O(null);try{await o.signInWithOAuth({provider:f,onPopupOpened:()=>S(null)})}catch(w){if(w instanceof v.PaywallError&&(w.code==="oauth_cancelled"||w.code==="oauth_timeout"))return;P(ae(w,"signin",i))}finally{C.current=!1,S(null)}}},Z=a.length>0&&(c==="signin"||c==="signup"),Y=c==="signin"||c==="signup"||c==="forgot",b=c==="signin"||c==="signup"&&q;return c==="reset_sent"?n.jsx(ct,{email:u,onBack:()=>M("signin"),t:i}):n.jsxs("div",{class:"flex flex-col gap-5",children:[n.jsx(Je,{mode:c,customHeading:r.heading,customSubheading:r.subheading}),Z?n.jsxs("div",{class:"flex flex-col gap-2.5",children:[a.map(f=>n.jsxs("div",{class:"relative",children:[n.jsxs("button",{type:"button",onClick:()=>F(f),disabled:m!==null,class:"flex h-12 w-full items-center justify-center gap-2.5 rounded-full border-1 border-gray-200 bg-white px-5 text-base font-medium text-gray-900 transition-all hover:border-gray-300 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:[m===f?n.jsx("span",{class:"inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700"}):n.jsx(lt,{provider:f}),n.jsx("span",{children:Ye(f,i)})]}),E?.method===f?n.jsx(it,{email:E.email}):null]},f)),n.jsx(at,{})]}):null,n.jsxs("form",{onSubmit:W,class:"flex flex-col gap-3",children:[Y&&n.jsx(le,{type:"email",placeholder:i("auth.email","Email address"),value:u,onInput:g,autocomplete:"email",required:!0}),b&&n.jsx(J,{placeholder:i("auth.password","Password"),value:_,onInput:p,autocomplete:c==="signin"?"current-password":"new-password",required:!0}),c==="signup"&&q&&n.jsx(J,{placeholder:i("auth.repeat_password","Repeat password"),value:k,onInput:x,autocomplete:"new-password",required:!0}),(c==="signup_verify"||c==="reset_verify")&&n.jsx(le,{type:"text",placeholder:i("auth.confirmation_code","Confirmation code"),value:I,onInput:y,autocomplete:"one-time-code",inputMode:"numeric",required:!0}),c==="reset_verify"&&n.jsx(J,{placeholder:i("auth.new_password_optional","New password (optional — only for password reset)"),value:_,onInput:p,autocomplete:"new-password"}),c==="signin"&&t&&n.jsx("div",{class:"flex justify-end text-sm",children:n.jsx(G,{onClick:()=>M("forgot"),children:i("auth.forgot_password","Forgot password?")})}),T&&n.jsx("p",{class:"text-sm text-red-600",children:T}),B&&n.jsx("p",{class:"text-sm text-gray-500",children:B}),n.jsx(rt,{busy:m==="email",label:et(c,q,r.submit_label??r.heading,i)})]}),n.jsx(tt,{mode:c,allowSignup:e,onSwitch:M})]})}function Je({mode:r,customHeading:e,customSubheading:t}){const{t:s}=j(),i=Qe(r,s),o=r==="signin"||r==="signup",a=o&&e?e:i.title,l=o&&t!==void 0?t||null:i.subtitle;return n.jsxs("div",{class:"flex flex-col gap-2",children:[n.jsx("h2",{class:"text-3xl font-bold tracking-tight text-gray-900",children:a}),l?n.jsx("p",{class:"text-base leading-relaxed text-gray-600",children:l}):null]})}function Qe(r,e){switch(r){case"signin":return{title:e("auth.welcome","Welcome back!"),subtitle:e("auth.default_subtitle","Sign in to access all features and sync your data.")};case"signup":return{title:e("auth.welcome_signup","Welcome!"),subtitle:e("auth.default_subtitle","Sign in to access all features and sync your data.")};case"forgot":return{title:e("auth.forgot_password_title","Forgot password?"),subtitle:e("auth.forgot_subtitle","Enter your email and we'll send you a password reset link.")};case"reset_sent":return{title:e("auth.check_email_title","Check your email"),subtitle:null};case"reset_verify":return{title:e("auth.reset_password_title","Reset password"),subtitle:e("auth.reset_password_subtitle","Enter the code from your email and a new password.")};case"signup_verify":return{title:e("auth.confirm_email_title","Confirm your email"),subtitle:e("auth.confirm_email_subtitle","Enter the code we sent to your email to finish creating your account.")}}}function et(r,e,t,s){if(r==="signin"&&t)return t;switch(r){case"signin":return s("auth.log_in","Sign In");case"signup":return e?s("auth.create_account","Create Account"):s("auth.sign_up","Sign Up");case"forgot":return s("auth.send_reset","Send Reset Email");case"signup_verify":case"reset_verify":return s("auth.verify","Verify");default:return s("cta.continue","Continue")}}function tt({mode:r,allowSignup:e,onSwitch:t}){const{t:s}=j();return r==="signin"&&e?n.jsxs("p",{class:"text-center text-sm text-gray-600",children:[s("auth.no_account","Don't have an account?")," ",n.jsx(G,{onClick:()=>t("signup"),children:s("auth.sign_up_link","Sign Up")})]}):r==="signup"||r==="signup_verify"?n.jsxs("p",{class:"text-center text-sm text-gray-600",children:[s("auth.have_account","Already have an account?")," ",n.jsx(G,{onClick:()=>t("signin"),children:s("auth.log_in_link","Log In")})]}):r==="forgot"||r==="reset_sent"||r==="reset_verify"?n.jsxs("p",{class:"text-center text-sm text-gray-600",children:[s("auth.no_account","Don't have an account?")," ",n.jsx(G,{onClick:()=>t("signup"),children:s("auth.sign_up_link","Sign Up")})]}):null}function G({onClick:r,children:e}){return n.jsx("button",{type:"button",onClick:r,class:"font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",style:{color:"var(--pw-accent)"},children:e})}function rt({busy:r,label:e}){return n.jsx("button",{type:"submit",disabled:r,class:"pw-cta-shimmer relative mt-1 flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:r?n.jsx("span",{class:"relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}):n.jsx("span",{class:"relative z-10",children:e})})}function le({type:r,placeholder:e,value:t,onInput:s,autocomplete:i,inputMode:o,required:a}){return n.jsx("input",{type:r,value:t,placeholder:e,onInput:l=>s(l.target.value),autocomplete:i,inputMode:o,required:a,class:"h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"})}function J({placeholder:r,value:e,onInput:t,autocomplete:s,required:i}){const{t:o}=j(),[a,l]=d.useState(!1),c=d.useRef(null);d.useEffect(()=>{const g=c.current;g&&g.value!==e&&(g.value=e)},[a,e]);const h=o("auth.show_password","Show password"),u=o("auth.hide_password","Hide password");return n.jsxs("div",{class:"relative",children:[n.jsx("input",{ref:c,type:a?"text":"password",value:e,placeholder:r,onInput:g=>t(g.target.value),autocomplete:s,required:i,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)]"}),n.jsx("button",{type:"button",onClick:()=>l(g=>!g),"aria-label":a?u:h,tabIndex:-1,class:"absolute right-4 top-1/2 -translate-y-1/2 flex h-6 w-6 items-center justify-center rounded text-gray-500 transition-colors hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:a?n.jsx(st,{}):n.jsx(nt,{})})]})}function nt(){return n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M1.667 10S4.583 4.167 10 4.167 18.333 10 18.333 10 15.417 15.833 10 15.833 1.667 10 1.667 10Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("circle",{cx:"10",cy:"10",r:"2.5",stroke:"currentColor","stroke-width":"1.5"})]})}function st(){return n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M8.236 4.293A6.96 6.96 0 0 1 10 4.167C15.417 4.167 18.333 10 18.333 10a13.5 13.5 0 0 1-1.92 2.755M11.768 11.768A2.5 2.5 0 0 1 8.233 8.233",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M14.953 14.953A8.84 8.84 0 0 1 10 15.833C4.583 15.833 1.667 10 1.667 10a13.5 13.5 0 0 1 3.38-3.953M1.667 1.667l16.666 16.666",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})}function it({email:r}){const{t:e}=j(),t=r?e("auth.last_used","Last · {email}",{email:ot(r)}):e("auth.last_used_no_email","Last");return n.jsx("span",{class:"pointer-events-none absolute -top-2 right-3 max-w-[75%] truncate rounded-full bg-gray-900 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-white shadow-sm",children:t})}function ot(r){const[e,t]=r.split("@");return t?`${e.slice(0,3)}*****@${t}`:r}function at(){const{t:r}=j();return n.jsxs("div",{class:"flex items-center gap-3 py-1 text-sm text-gray-400",children:[n.jsx("div",{class:"h-px flex-1 bg-gray-200"}),n.jsx("span",{children:r("auth.or","or")}),n.jsx("div",{class:"h-px flex-1 bg-gray-200"})]})}function lt({provider:r}){return r==="google"?n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 18 18","aria-hidden":"true",children:[n.jsx("path",{fill:"#4285F4",d:"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.49h4.84a4.14 4.14 0 0 1-1.79 2.71v2.26h2.9c1.7-1.56 2.69-3.87 2.69-6.62Z"}),n.jsx("path",{fill:"#34A853",d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.9-2.26c-.8.54-1.83.86-3.06.86-2.36 0-4.36-1.59-5.07-3.74H.92v2.33A9 9 0 0 0 9 18Z"}),n.jsx("path",{fill:"#FBBC05",d:"M3.93 10.68a5.4 5.4 0 0 1 0-3.36V4.99H.92a9 9 0 0 0 0 8.02l3-2.33Z"}),n.jsx("path",{fill:"#EA4335",d:"M9 3.58c1.32 0 2.5.45 3.44 1.34l2.58-2.58A9 9 0 0 0 .92 4.99l3.01 2.33C4.64 5.17 6.64 3.58 9 3.58Z"})]}):r==="apple"?n.jsx("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}):r==="github"?n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M8 0C3.6 0 0 3.6 0 8a8 8 0 0 0 5.5 7.6c.4.1.5-.2.5-.4v-1.5c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.2 1.9.9 2.4.7 0-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8a7.6 7.6 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.5.8 1.2.8 2.1 0 3.1-1.9 3.7-3.6 3.9.3.3.6.8.6 1.6V15c0 .2.1.5.6.4A8 8 0 0 0 16 8c0-4.4-3.6-8-8-8Z"})}):n.jsx("svg",{width:"18",height:"20",viewBox:"0 0 14 16",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M14 2.7C14 1.2 12.8 0 11.3 0H2.7C1.2 0 0 1.2 0 2.7v10.6C0 14.8 1.2 16 2.7 16h4V9.8H4.7v-2H6.7V6.4c0-2 1.2-3.1 3-3.1.9 0 1.7.1 2 .2V5h-1.4c-.8 0-1 .4-1 1v1.5h2.4l-.3 2H9.3V16h2c1.5 0 2.7-1.2 2.7-2.7V2.7Z"})})}function ct({email:r,onBack:e,t}){return n.jsxs("div",{class:"flex flex-col items-center gap-4 py-2 text-center",children:[n.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full",style:{background:"linear-gradient(135deg, #4ade80, #16a34a)",color:"#fff",boxShadow:"0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"},"aria-hidden":"true",children:n.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",children:n.jsx("path",{d:"M5 13l4 4L19 7",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})})}),n.jsx("h2",{class:"mt-1 text-3xl font-bold tracking-tight text-gray-900",children:t("auth.check_email_title","Check your email")}),n.jsx("p",{class:"text-base leading-relaxed text-gray-600",children:t("auth.reset_sent_subtitle","We sent a password reset link. Follow the instructions in the email to reset your password.")}),r?n.jsx("p",{class:"break-all text-base font-semibold text-gray-900",children:r}):null,n.jsx("p",{class:"text-sm text-gray-500",children:t("auth.reset_link_valid","The link is valid for 1 hour.")}),n.jsx("button",{type:"button",onClick:e,class:"pw-cta-shimmer relative mt-2 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] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:n.jsx("span",{class:"relative z-10",children:t("auth.back_to_login","Back to Login")})})]})}function ut({block:r,bootstrap:e,auth:t,authSession:s,onBack:i,showBack:o=!0,intent:a="preauth",initialMode:l}){const{t:c}=j(),h={bootstrap:e,selectedPriceId:null,setSelectedPriceId:()=>{},onAction:()=>{},auth:t,authSession:s,initialAuthMode:l},u=a==="restore"?{...r,heading:c("auth.restore_purchases_heading","Restore Purchases"),subheading:c("auth.restore_purchases_subheading","Please sign in to restore your purchases.")}:a==="preauth"?{...r,heading:c("auth.login_continue_purchase","Log in to continue your purchase"),subheading:c("auth.link_purchase_subheading","We'll link the purchase to your account to keep access."),submit_label:c("auth.log_in","Sign In")}:r;return n.jsxs("div",{class:"relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8",children:[o?n.jsx(dt,{onClick:i,ariaLabel:c("nav.back_aria","Back")}):null,n.jsx(ve,{block:u,ctx:h})]})}function dt({onClick:r,ariaLabel:e}){return n.jsx("button",{type:"button",onClick:r,"aria-label":e,class:"absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M5 8h8a4 4 0 0 1 0 8H9",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M8 4 4 8l4 4",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"})]})})}const ht=r=>`pw-offer-${r}-start`;function Q(r){const e=r-Date.now();return e<=0?{days:0,hours:0,minutes:0,seconds:0,expired:!0}:{days:Math.floor(e/(1e3*60*60*24)),hours:Math.floor(e%(1e3*60*60*24)/(1e3*60*60)),minutes:Math.floor(e%(1e3*60*60)/(1e3*60)),seconds:Math.floor(e%(1e3*60)/1e3),expired:!1}}function pt(r){if(r.expires_at){const e=Date.parse(r.expires_at);return Number.isFinite(e)?e:null}if(r.duration_minutes&&r.duration_minutes>0){if(typeof window>"u")return null;try{const e=ht(r.id);let t=window.localStorage.getItem(e);return t||(t=new Date().toISOString(),window.localStorage.setItem(e,t)),Date.parse(t)+r.duration_minutes*6e4}catch{return null}}return null}function _e(r,e){if(!r||r.length===0)return null;if(e){const t=r.find(s=>s.id===e);if(t)return t}return r.find(t=>t.expires_at||t.duration_minutes)??null}function je(r){const e=r?pt(r):null,[t,s]=d.useState(()=>e!==null?Q(e):null),i=d.useRef(e);return i.current=e,d.useEffect(()=>{if(e===null){s(null);return}s(Q(e));const o=setInterval(()=>{const a=Q(i.current??0);s(a),a.expired&&clearInterval(o)},1e3);return()=>clearInterval(o)},[e,r?.duration_minutes,r?.id]),t}function ft({block:r,ctx:e}){const{t}=j(),s=_e(e.bootstrap.offers,r.offer_id),i=je(s);if(!s||i===null||i.expired&&!r.force)return null;const o=r.title??s.label??t("offer.limited_time","Limited-time offer"),a=s.discount_percent?`${o} ${s.discount_percent}%`:o;return n.jsxs("div",{class:"flex flex-wrap items-center justify-center gap-2 rounded-2xl px-4 py-3 text-[15px] font-semibold leading-tight text-white",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",textShadow:"0 0 2px rgba(0, 0, 0, 0.25)"},role:"status",children:[n.jsx(Ce,{}),n.jsx("span",{children:a}),n.jsx(Se,{value:i,t})]})}function Se({value:r,t:e}){return n.jsxs("div",{class:"flex items-center gap-1 font-mono text-sm",children:[r.days>0?n.jsxs(n.Fragment,{children:[n.jsx(V,{children:String(r.days)}),n.jsx("span",{class:"text-xs",children:e("countdown.d","d")})]}):null,n.jsx(V,{children:String(r.hours).padStart(2,"0")}),n.jsx("span",{class:"text-xs",children:e("countdown.h","h")}),n.jsx(V,{children:String(r.minutes).padStart(2,"0")}),n.jsx("span",{class:"text-xs",children:e("countdown.m","m")}),n.jsx(V,{children:String(r.seconds).padStart(2,"0")}),n.jsx("span",{class:"text-xs",children:e("countdown.s","s")})]})}function V({children:r}){return n.jsx("span",{class:"rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold",children:r})}function gt({offer:r}){const{t:e}=j(),t=je(r);if(t===null||t.expired)return null;const s=r.label??e("offer.limited_time","Limited-time offer"),i=r.discount_percent?`${s} ${r.discount_percent}%`:s;return n.jsxs("div",{class:"-mb-2 flex flex-wrap items-center justify-center gap-2 rounded-t-xl px-4 pb-5 pt-3 text-[15px] font-semibold leading-tight text-white",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",textShadow:"0 0 2px rgba(0, 0, 0, 0.25)"},role:"status",children:[n.jsx(Ce,{}),n.jsx("span",{children:i}),n.jsx(Se,{value:t,t:e})]})}function Ce(){return n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:n.jsx("path",{fill:"currentColor",d:"m9.44 5.359-2.394-.895.61-3.036c.062-.31-.345-.531-.57-.291L2.434 6.105a.336.336 0 0 0 .126.537l2.395.894-.61 3.037c-.062.31.345.53.57.29l4.653-4.968a.336.336 0 0 0-.126-.536Z"})})}const ce=3,ue=200,de=5e3,ee=5,xt=10*1024*1024,he=["image/jpeg","image/png","image/webp"],mt=/.+@.+\..+/;function yt({client:r,authSession:e,origin:t,onBack:s}){const{t:i}=j(),o=e?.user.email??"",a=o||null,[l,c]=d.useState(o),[h,u]=d.useState(""),[g,_]=d.useState(""),[p,k]=d.useState([]),[x,I]=d.useState(!1),[y,m]=d.useState(null),[S,C]=d.useState({}),T=()=>{const A={},E=(a??l).trim(),R=h.trim(),M=g.trim();return E?mt.test(E.toLowerCase())||(A.email=i("support.invalid_email","Invalid email")):A.email=i("support.required","Required"),(R.length<ce||R.length>ue)&&(A.subject=i("support.subject_length","{min}–{max} characters",{min:ce,max:ue})),(M.length<1||M.length>de)&&(A.message=i("support.message_length","{min}–{max} characters",{min:1,max:de})),C(A),Object.keys(A).length===0},P=async A=>{if(A.preventDefault(),!x&&T()){I(!0),C(E=>({...E,submit:void 0}));try{const E=(a??l).trim();await r.createSupportTicket({subject:h.trim(),content:g.trim(),email:E||void 0,files:p.length>0?p:void 0}),m(E)}catch(E){const R=E instanceof v.PaywallError&&E.message||"Failed to send. Please try again.";C(M=>({...M,submit:R}))}finally{I(!1)}}},B=()=>{u(""),_(""),k([]),C({}),m(null)},O="flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8",q={boxShadow:"0 -4px 12px -4px rgba(15,23,42,0.06)"};return y?n.jsxs("div",{class:"relative flex-1 min-h-0 flex flex-col",children:[n.jsxs("div",{class:"flex-1 min-h-0 overflow-y-auto flex flex-col items-center gap-4 px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8 text-center",children:[n.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 85%, white), var(--pw-accent))",color:"#fff",boxShadow:"0 0 0 8px color-mix(in srgb, var(--pw-accent) 12%, transparent), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 45%, transparent)"},"aria-hidden":"true",children:n.jsx("svg",{viewBox:"0 0 24 24",class:"h-7 w-7",children:n.jsx("path",{fill:"currentColor",d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.93 8.2-6.85 9.29a1.01 1.01 0 0 1-1.43.19L5.76 13.77a1 1 0 1 1 1.25-1.56l4.08 3.26 6.23-8.45a1 1 0 1 1 1.61 1.18Z"})})}),n.jsx("div",{class:"text-lg font-semibold tracking-tight text-gray-900",children:i("support.success_heading","Request submitted")}),n.jsxs("div",{class:"max-w-[320px] text-sm leading-relaxed text-gray-500",children:[i("support.success_message_prefix","We've received your message and will respond to")," ",n.jsx("b",{class:"text-gray-700",children:y}),"."]})]}),n.jsx("div",{class:O,style:q,children:n.jsxs("div",{class:"flex items-center justify-center gap-3",children:[n.jsx("button",{type:"button",onClick:s,class:"rounded-xl px-3 py-2 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:t==="standalone"?i("support.done_button","Done"):i("nav.back_aria","Back")}),n.jsx("button",{type:"button",onClick:B,class:"flex h-10 items-center justify-center rounded-xl px-4 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:i("support.send_another","Send another request")})]})})]}):n.jsxs("form",{onSubmit:P,class:"relative flex-1 min-h-0 flex flex-col",children:[n.jsx(bt,{onClick:s,ariaLabel:i("nav.back_aria","Back")}),n.jsx("div",{class:"flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8",children:n.jsxs("div",{class:"flex flex-col gap-5",children:[n.jsxs("div",{class:"flex flex-col gap-2 pr-10",children:[n.jsx("h2",{class:"text-3xl font-bold tracking-tight text-gray-900",children:i("support.heading","Support")}),n.jsx("p",{class:"text-base leading-relaxed text-gray-600",children:i("support.instruction","Please fill out the form below to submit your support request.")})]}),n.jsxs("div",{class:"flex flex-col gap-3",children:[a?n.jsxs("div",{class:"rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600",children:[i("support.sending_as","Sending as")," ",n.jsx("b",{class:"font-medium text-gray-900",children:a})]}):n.jsx(pe,{type:"email",placeholder:i("support.email_placeholder","Enter your email *"),value:l,onInput:c,error:S.email,autocomplete:"email",required:!0}),n.jsx(pe,{type:"text",placeholder:i("support.subject_placeholder","Enter your subject *"),value:h,onInput:u,error:S.subject,required:!0}),n.jsx(wt,{placeholder:i("support.message_placeholder","Enter your message *"),value:g,onInput:_,error:S.message,required:!0}),n.jsx(kt,{files:p,onChange:k,disabled:x})]})]})}),n.jsxs("div",{class:O,style:q,children:[S.submit&&n.jsx("p",{class:"text-sm text-red-600",children:S.submit}),n.jsxs("div",{class:"flex items-center justify-end gap-3",children:[n.jsx("button",{type:"button",onClick:s,disabled:x,class:"rounded-full px-4 py-2 text-base font-medium text-gray-700 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:t==="standalone"?i("support.close_button","Close"):i("nav.back_aria","Back")}),n.jsx("button",{type:"submit",disabled:x,class:"pw-cta-shimmer relative flex h-12 items-center justify-center overflow-hidden rounded-full px-8 text-base font-semibold text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:x?n.jsx("span",{class:"relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}):n.jsx("span",{class:"relative z-10",children:i("support.send_button","Send")})})]})]})]})}function bt({onClick:r,ariaLabel:e}){return n.jsx("button",{type:"button",onClick:r,"aria-label":e,class:"absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M5 8h8a4 4 0 0 1 0 8H9",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M8 4 4 8l4 4",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"})]})})}function pe({type:r,placeholder:e,value:t,onInput:s,error:i,autocomplete:o,required:a}){return n.jsxs("div",{children:[n.jsx("input",{type:r,value:t,placeholder:e,onInput:l=>s(l.target.value),autocomplete:o,required:a,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)]"}`}),i&&n.jsx("span",{class:"mt-1 ml-2 block text-sm text-red-600",children:i})]})}function wt({placeholder:r,value:e,onInput:t,error:s,required:i}){return n.jsxs("div",{children:[n.jsx("textarea",{value:e,placeholder:r,onInput:o=>t(o.target.value),required:i,rows:5,class:`min-h-[120px] w-full rounded-2xl bg-gray-100 px-5 py-3.5 text-base leading-relaxed text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${s?"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)]"}`}),s&&n.jsx("span",{class:"mt-1 ml-2 block text-sm text-red-600",children:s})]})}function kt({files:r,onChange:e,disabled:t}){const{t:s}=j(),i=d.useRef(null),[o,a]=d.useState(!1),[l,c]=d.useState(null),h=u=>{if(!u||t)return;c(null);const g=Array.from(u);if(r.length+g.length>ee){c(s("support.too_many_files","Up to {max} files",{max:ee}));return}const _=g.filter(p=>he.includes(p.type)&&p.size<=xt);if(_.length!==g.length){c(s("support.invalid_file","Only JPEG/PNG/WebP, ≤ 10MB each"));return}e([...r,..._])};return n.jsxs("div",{children:[n.jsx("span",{class:"text-xs font-medium text-gray-700",children:s("support.attachments_label","Attachments (optional)")}),n.jsxs("div",{role:"button",tabIndex:0,"aria-label":s("support.attachments_aria","Attachments upload"),onClick:()=>!t&&i.current?.click(),onDragOver:u=>{u.preventDefault(),t||a(!0)},onDragLeave:()=>a(!1),onDrop:u=>{u.preventDefault(),a(!1),h(u.dataTransfer?.files??null)},class:`mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${o?"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":""}`,children:[n.jsx("div",{class:"text-xs text-gray-500",children:s("support.dropzone_text","Drop images here or click to select")}),n.jsx("div",{class:"mt-0.5 text-[11px] text-gray-400",children:s("support.file_requirements","JPEG/PNG/WebP, up to {max} files, ≤ 10MB each",{max:ee})})]}),n.jsx("input",{ref:i,type:"file",multiple:!0,accept:he.join(","),class:"hidden",onChange:u=>{h(u.target.files),u.currentTarget.value=""}}),l&&n.jsx("p",{class:"mt-1 text-xs text-red-600",children:l}),r.length>0&&n.jsx("ul",{class:"mt-2 flex flex-col gap-1",children:r.map((u,g)=>n.jsxs("li",{class:"flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",children:[n.jsx("span",{class:"truncate text-gray-700",children:u.name}),n.jsx("button",{type:"button",onClick:()=>{const _=[...r];_.splice(g,1),e(_)},disabled:t,class:"text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60","aria-label":s("support.remove_file_aria","Remove {filename}",{filename:u.name}),children:"✕"})]},`${u.name}-${u.size}-${g}`))})]})}const vt={day:"cta.get_plan_daily",week:"cta.get_plan_weekly",month:"cta.get_plan_monthly",year:"cta.get_plan_yearly"},_t={day:"Get Daily Plan",week:"Get Weekly Plan",month:"Get Monthly Plan",year:"Get Yearly Plan"};function jt(r,e,t,s){if(e==="close")return s("cta.close","Close");if(!r)return s("cta.continue","Continue");if(!t&&r.trial_days&&r.interval&&r.interval!=="lifetime")return s("cta.start_trial","Start {days}-Day Free Trial",{days:r.trial_days});if(!r.interval||r.interval==="lifetime")return s("cta.get_lifetime_access","Get Lifetime Access");const i=vt[r.interval];return i?s(i,_t[r.interval]):s("cta.get_plan_generic","Get {interval} Plan",{interval:St(r.interval)})}function St(r){return r.length?r[0].toUpperCase()+r.slice(1):r}function Ct({block:r,ctx:e}){const{t}=j(),[s,i]=d.useState(!1),o=r.priceId??e.selectedPriceId,a=s||r.action==="checkout"&&!o,l=o?e.bootstrap.prices.find(g=>g.id===o)??null:null,c=e.bootstrap.user?.had_previous_trial??!1,h=r.label??jt(l,r.action,c,t),u=async()=>{if(!a){i(!0);try{await e.onAction(r.action,{priceId:o})}finally{i(!1)}}};return n.jsxs("button",{type:"button",disabled:a,onClick:u,class:"pw-cta-shimmer relative flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:[n.jsx("span",{class:"absolute inset-0 opacity-40",style:{background:"radial-gradient(circle at 50% 0%, color-mix(in srgb, white 40%, transparent) 0%, transparent 70%)"},"aria-hidden":"true"}),s?n.jsx("span",{class:"relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}):n.jsx("span",{class:"relative z-10",children:h})]})}function It({ctx:r}){const{t:e}=j(),t=r.authSession,s=r.auth,[i,o]=d.useState(!1),a=()=>r.onAction("support");if(t&&!t.user.is_anonymous){const l=async()=>{if(!(!s||i)){o(!0);try{await s.signOut()}catch{}finally{o(!1)}}};return n.jsxs("div",{class:"-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500",children:[n.jsxs("span",{children:[e("session.signed_in_as_prefix","Signed in as")," ",n.jsx("b",{class:"font-medium text-gray-700",children:t.user.email})]}),n.jsxs("div",{class:"flex items-center justify-center gap-3",children:[n.jsx($,{onClick:l,disabled:!s||i,children:i?e("session.signing_out","Signing out…"):e("session.sign_out","Sign Out")}),n.jsx(fe,{}),n.jsx($,{onClick:a,children:e("session.contact_support","Contact Support")})]})]})}return n.jsxs("div",{class:"-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]",children:[n.jsx($,{onClick:()=>r.onAction("restore"),children:e("session.restore_purchases","Restore purchases")}),n.jsx(fe,{}),n.jsx($,{onClick:a,children:e("session.contact_support","Contact Support")})]})}function $({onClick:r,disabled:e,children:t}){return n.jsx("button",{type:"button",onClick:r,disabled:e,class:"font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",style:{color:"var(--pw-accent)"},children:t})}function fe(){return n.jsx("span",{class:"h-1 w-1 rounded-full bg-gray-300","aria-hidden":"true"})}function Pt({block:r}){return r.items.length?n.jsx("ul",{class:"flex flex-col gap-2.5",role:"list",children:r.items.map(e=>n.jsxs("li",{class:"flex items-start gap-3 text-sm text-gray-700",children:[n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",class:"mt-0.5 flex-shrink-0 text-emerald-500","aria-hidden":"true",children:n.jsx("path",{d:"M4 10.5l3.5 3.5 8.5-8.5",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})}),n.jsxs("div",{class:"flex flex-col gap-0.5",children:[n.jsx("span",{class:"font-medium leading-snug text-gray-900",children:e.name}),e.desc?n.jsx("span",{class:"text-xs leading-relaxed text-gray-400",children:e.desc}):null]})]},e.id))}):null}function Et({block:r}){const{t:e}=j(),t=r.title??e("pricing.money_back","30-day money-back guarantee"),s=r.subtitle,i=(r.icon??"dollar_shield")!=="none",o=At(t);return n.jsxs("div",{class:"flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100",children:[n.jsxs("div",{class:"inline-flex items-center gap-2 text-[12px] text-gray-700",children:[i?n.jsx(Lt,{}):null,o?n.jsxs("span",{children:[n.jsx("b",{class:"font-bold text-gray-900",children:o.bold})," ",n.jsx("span",{class:"font-medium",children:o.rest})]}):n.jsx("span",{class:"font-medium",children:t})]}),s?n.jsx("span",{class:"text-center text-xs leading-relaxed text-gray-500",children:s}):null]})}function At(r){const e=r.match(/^(\d+[-\s]?days?)\s+(.+)$/i);return e?{bold:e[1],rest:e[2]}:null}function Lt(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"16",height:"16",class:"flex-shrink-0 text-emerald-500","aria-hidden":"true",children:[n.jsx("path",{d:"M12 2 4 5v6c0 5.25 3.5 9.5 8 11 4.5-1.5 8-5.75 8-11V5l-8-3Z",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"}),n.jsx("path",{d:"m9 12 2 2 4-4",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}const Ie=24,Tt=16,Mt=2;function Bt(r,e){const t=e*Mt;let s=Ie;for(r.style.fontSize=`${s}px`;r.scrollHeight>t&&s>Tt;)s-=1,r.style.fontSize=`${s}px`}function Ot({block:r,ctx:e}){const t=r.level??1,s=`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",o=d.useRef(null),a=t===1&&!!e.bootstrap.settings.title_auto_fit;return d.useEffect(()=>{if(!a||!o.current)return;const l=getComputedStyle(o.current),c=parseFloat(l.lineHeight)||Ie*1.5;Bt(o.current,c)},[a,r.text]),n.jsx(s,{ref:o,class:i,children:r.text})}function qt(r){const e=r.local??{currency:r.currency,amount:r.amount};if(r.interval==="year"){const t=(r.interval_count??1)*12;return{amount:e.amount/t,currency:e.currency}}return{amount:e.amount,currency:e.currency}}function te(r,e){const t=r%1!==0?2:0;try{const s=new Intl.NumberFormat(void 0,{style:"currency",currency:e,currencyDisplay:"narrowSymbol",maximumFractionDigits:t,minimumFractionDigits:t}).formatToParts(r);let i="",o="";for(const a of s)a.type==="currency"?i=a.value:a.type!=="literal"&&(o+=a.value);return{currency:i||e,amount:o.trim()}}catch{return{currency:e,amount:String(r)}}}function ne(r,e){const{amount:t,currency:s}=qt(r);if(!e){const{currency:l,amount:c}=te(t,s);return{currency:l,amount:c,originalAmount:null}}const i=t*(1-e/100),o=te(i,s),a=te(t,s);return{currency:o.currency,amount:o.amount,originalAmount:`${a.currency}${a.amount}`}}function Pe(r,e){if(r.label)return r.label.toUpperCase();if(!r.interval||r.interval==="lifetime")return e("pricing.plan_label.lifetime","LIFETIME");const s={day:{key:"pricing.plan_label.daily",fallback:"DAILY PLAN"},week:{key:"pricing.plan_label.weekly",fallback:"WEEKLY PLAN"},month:{key:"pricing.plan_label.monthly",fallback:"MONTHLY PLAN"},year:{key:"pricing.plan_label.yearly",fallback:"YEARLY PLAN"}}[r.interval];return s?e(s.key,s.fallback):`${r.interval.toUpperCase()} PLAN`}function se(r,e){if(!r.interval||r.interval==="lifetime")return e("pricing.interval.lifetime_short","lifetime");if(r.interval==="year")return e("pricing.interval.month","month");const t=r.interval_count??1;return t===1?e(`pricing.interval.${r.interval}`,r.interval):`${t} ${r.interval}s`}function Rt({block:r,ctx:e}){const{t}=j(),s=r.priceIds&&r.priceIds.length>0?new Set(r.priceIds):null,i=e.bootstrap.prices.filter(a=>!s||s.has(a.id));if(i.length===0)return n.jsx("p",{class:"text-sm text-gray-500",children:t("pricing.no_prices","No prices available.")});const o=r.popular_label??t("pricing.most_popular","Most popular");if(r.view==="compact")return n.jsx("div",{class:"flex w-full flex-col rounded-xl border border-gray-200 bg-gray-50",role:"radiogroup","aria-label":t("pricing.plans_aria","Plans"),children:i.map((a,l)=>n.jsx(Dt,{price:a,isLast:l===i.length-1,isPopular:r.popular_price_id===a.id,popularLabel:o,offer:D(e.bootstrap.offers,a.id),selected:e.selectedPriceId===a.id,onSelect:()=>{e.setSelectedPriceId(a.id),e.onAction("price_selected",{priceId:a.id,price:a})},t},a.id))});if(r.view==="horizontal"){const a=Math.min(i.length,3),l=i.some(c=>(D(e.bootstrap.offers,c.id)?.discount_percent??0)>0);return n.jsx("div",{class:"grid items-stretch gap-2",style:{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`},role:"radiogroup","aria-label":t("pricing.plans_aria","Plans"),children:i.map(c=>n.jsx(Nt,{price:c,isPopular:r.popular_price_id===c.id,popularLabel:o,offer:D(e.bootstrap.offers,c.id),reserveStrikeRow:l,selected:e.selectedPriceId===c.id,onSelect:()=>{e.setSelectedPriceId(c.id),e.onAction("price_selected",{priceId:c.id,price:c})},t},c.id))})}return n.jsx("div",{class:"flex flex-col gap-2",role:"radiogroup","aria-label":t("pricing.plans_aria","Plans"),children:i.map(a=>{const l=e.selectedPriceId===a.id,c=r.popular_price_id===a.id,u=D(e.bootstrap.offers,a.id)?.discount_percent??null,{currency:g,amount:_,originalAmount:p}=ne(a,u);return n.jsxs("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>{e.setSelectedPriceId(a.id),e.onAction("price_selected",{priceId:a.id,price:a})},class:["group relative inline-flex w-full mx-auto items-center justify-between flex-row-reverse gap-4 rounded-2xl border-2 px-4 py-3.5 text-left transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",l?"border-[var(--pw-accent)] bg-transparent":"border-gray-200 bg-transparent hover:bg-gray-50"].join(" "),children:[n.jsx("span",{class:["flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",l?"border-[var(--pw-accent)] text-white":"border-gray-300 bg-transparent text-transparent",c?"mt-3":""].join(" "),style:l?{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"}:void 0,"aria-hidden":"true",children:n.jsx("svg",{width:"14",height:"10",viewBox:"0 0 17 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:l?"opacity-100":"opacity-0",children:n.jsx("path",{d:"M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",fill:"currentColor"})})}),n.jsxs("div",{class:"flex flex-1 flex-col gap-0.5",children:[n.jsxs("div",{class:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[n.jsx("span",{class:"text-xs font-normal uppercase tracking-normal text-gray-800/70",children:Pe(a,t)}),p?n.jsx("span",{class:"text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]",children:p}):null,u?n.jsxs("span",{class:"rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700",children:["-",u,"%"]}):null]}),n.jsx("div",{class:"flex items-baseline gap-2 flex-wrap",children:n.jsxs("span",{class:"text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium",children:[n.jsx("span",{class:"opacity-90",children:g}),_,n.jsxs("span",{class:"text-sm font-normal text-gray-500",children:[" ","/ ",se(a,t)]})]})}),a.description?n.jsx("span",{class:"mt-1 text-xs leading-relaxed text-gray-500",children:a.description}):null]}),c?n.jsx("span",{class:"absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",style:{background:"var(--pw-accent)"},children:o}):null]},a.id)})})}function Ut(r,e){return r.label?r.label:!r.interval||r.interval==="lifetime"?e("pricing.interval.lifetime_short","lifetime"):e(`pricing.interval.${r.interval}`,r.interval)}function Dt({price:r,isLast:e,isPopular:t,popularLabel:s,offer:i,selected:o,onSelect:a,t:l}){const c=i?.discount_percent??null,{currency:h,amount:u,originalAmount:g}=ne(r,c);return n.jsxs("button",{type:"button",role:"radio","aria-checked":o,onClick:a,class:"group relative inline-flex w-full max-w-[360px] mx-auto items-center justify-between gap-4 px-4 pt-3.5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--pw-accent)]",children:[n.jsx("span",{class:["flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",o?"border-[var(--pw-accent)] text-white":"border-gray-300 bg-transparent text-transparent"].join(" "),style:o?{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"}:void 0,"aria-hidden":"true",children:n.jsx("svg",{width:"14",height:"10",viewBox:"0 0 17 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:o?"opacity-100":"opacity-0",children:n.jsx("path",{d:"M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",fill:"currentColor"})})}),n.jsxs("div",{class:["flex flex-1 items-center gap-1.5 pb-3.5",e?"":"border-b border-gray-200"].join(" "),children:[n.jsxs("div",{class:"flex flex-wrap items-center gap-1 gap-x-1.5",children:[n.jsx("span",{class:"text-base font-normal capitalize text-gray-800",children:Ut(r,l)}),t?n.jsx("span",{class:"rounded-[9px] px-2 py-1 text-[10px] font-bold",style:{background:"linear-gradient(160deg, color-mix(in srgb, var(--pw-accent) 6%, white) 0%, color-mix(in srgb, var(--pw-accent) 15%, white) 100%)",color:"var(--pw-accent)"},children:s}):null,c?n.jsxs("span",{class:"rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700",children:["-",c,"%"]}):null]}),n.jsx("div",{class:"flex-1"}),n.jsxs("span",{class:"flex items-baseline gap-1.5 text-base font-normal text-gray-600",children:[g?n.jsx("span",{class:"text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]",children:g}):null,n.jsxs("span",{class:"whitespace-nowrap",children:[n.jsx("span",{class:"opacity-90",children:h}),u,n.jsxs("span",{class:"text-xs text-gray-400",children:[" ","/ ",se(r,l)]})]})]})]})]})}function Nt({price:r,isPopular:e,popularLabel:t,offer:s,reserveStrikeRow:i,selected:o,onSelect:a,t:l}){const c=s?.discount_percent??null,{currency:h,amount:u,originalAmount:g}=ne(r,c);return n.jsxs("button",{type:"button",role:"radio","aria-checked":o,onClick:a,class:["group relative flex h-full flex-col items-center justify-start gap-1 rounded-2xl border-2 px-3 pb-4 pt-3.5 text-center transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",o?"border-[var(--pw-accent)]":"border-gray-200 hover:bg-gray-50"].join(" "),style:o?{background:"color-mix(in srgb, var(--pw-accent) 6%, transparent)"}:void 0,children:[n.jsx("span",{class:"flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70",children:Pe(r,l)}),i?n.jsxs("div",{class:"flex h-[22px] items-center justify-center gap-1.5",children:[g?n.jsx("span",{class:"text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]",children:g}):null,c?n.jsxs("span",{class:"rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700",children:["-",c,"%"]}):null]}):null,n.jsxs("span",{class:"text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium",children:[n.jsx("span",{class:"opacity-90",children:h}),u]}),n.jsxs("span",{class:"text-xs font-normal text-gray-500",children:["/ ",se(r,l)]}),e?n.jsx("span",{class:"absolute -top-[10px] left-1/2 -translate-x-1/2 whitespace-nowrap rounded-[11px] border-[3px] border-white px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",style:{background:"var(--pw-accent)"},children:t}):null]})}function zt({block:r}){return n.jsx("p",{class:"text-[0.9375rem] leading-relaxed text-gray-600",children:r.text})}const Ft={week:.25,month:1,year:12};function Vt(r,e){return r?e(`pricing.interval.${r}`,r):e("pricing.interval.period","period")}function $t({block:r,ctx:e}){const{t}=j();if(!r.queries.length)return null;const i=e.bootstrap.prices.find(a=>a.id===e.selectedPriceId)?.interval??null,o=i?Ft[i]:void 0;return n.jsxs("div",{class:"flex flex-col gap-2",children:[n.jsx("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}:",{interval:Vt(i,t)})}),n.jsx("ul",{class:"flex flex-col gap-2",role:"list",children:r.queries.map(a=>{const l=Number.isFinite(a.count)?a.count:0,c=o!==void 0?Math.round(l*o):l;return n.jsxs("li",{class:`flex gap-3 ${a.desc?"items-start":"items-center"}`,children:[n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",class:`flex-shrink-0 text-emerald-500 ${a.desc?"mt-0.5":""}`,"aria-hidden":"true",children:n.jsx("path",{d:"M4 10.5l3.5 3.5 8.5-8.5",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})}),n.jsxs("div",{children:[n.jsx("span",{class:"font-semibold text-gray-900 text-sm",children:c})," ",n.jsx("span",{class:"text-sm text-gray-800",children:a.name}),a.desc?n.jsxs(n.Fragment,{children:[n.jsx("br",{}),n.jsx("span",{class:"text-xs text-gray-400",children:a.desc})]}):null]})]},a.id)})})]})}const Ht={heading:Ot,text:zt,price_grid:Rt,cta_button:Ct,auth_panel:ve,current_session:It,features_list:Pt,tokenization_gate:$t,guarantee_badge:Et,offer_banner:ft};function Gt({layout:r,bootstrap:e,onAction:t,auth:s,authSession:i,hasTopBanner:o}){const a=d.useMemo(()=>{for(const k of r.blocks)if(k.type==="price_grid"&&k.popular_price_id&&e.prices.some(x=>x.id===k.popular_price_id))return k.popular_price_id;return e.prices[0]?.id??null},[r.blocks,e.prices]),[l,c]=d.useState(a),h={bootstrap:e,selectedPriceId:l,setSelectedPriceId:c,onAction:t,auth:s,authSession:i},u=r.blocks.findIndex(k=>k.type==="cta_button"),g=u===-1?r.blocks:r.blocks.slice(0,u),_=u===-1?[]:r.blocks.slice(u),p=(k,x)=>{const I=Ht[k.type];return I?n.jsx(I,{block:k,ctx:h},`${k.type}-${x}`):(typeof console<"u"&&console.warn(`[paywall] unknown block type: ${k.type}`),null)};return n.jsxs(n.Fragment,{children:[n.jsx("div",{class:"flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8",children:n.jsx("div",{class:"flex flex-col gap-6",children:g.map(p)})}),_.length>0?n.jsx("div",{class:"flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",style:{boxShadow:"0 -4px 12px -4px rgba(15,23,42,0.06)"},children:_.map((k,x)=>p(k,g.length+x))}):null]})}function Wt(r,e,t,s){return r?s?{open:!0,view:"purchased",error:null,processing:!1}:e.status==="idle"||e.status==="loading"?{open:!0,view:"loading",error:null,processing:!1}:e.status==="error"?{open:!0,view:"error",error:e.error,processing:!1}:t.kind==="support"?{open:!0,view:"support",error:null,processing:!1}:t.kind==="auth_gate"?{open:!0,view:"auth",error:null,processing:!1}:t.kind==="awaiting_payment"?{open:!0,view:"awaiting_payment",error:null,processing:!1}:t.kind==="popup_blocked"?{open:!0,view:"popup_blocked",error:null,processing:!1}:t.kind==="purchase_success"?{open:!0,view:"purchased",error:null,processing:!1}:t.kind==="verifying"?{open:!0,view:"loading",error:null,processing:!1}:{open:!0,view:"layout",error:null,processing:!1}:{open:!1,view:null,error:null,processing:!1}}function Zt(r,e){return r.open===e.open&&r.view===e.view&&r.error===e.error&&r.processing===e.processing}function Yt({client:r,open:e,onClose:t,onEvent:s,initialView:i,initialAuthMode:o,initialCheckoutPriceId:a,initialCheckoutUrl:l,purchased:c,renew:h,onState:u,inline:g,locale:_}){const[p,k]=d.useState({status:"idle"}),[x,I]=d.useState(()=>r.auth?.getCachedSession()??null),[y,m]=d.useState(()=>i==="support"?{kind:"support",origin:"standalone"}:i==="auth"?a?{kind:"auth_gate",pendingCheckout:{priceId:a,direct:!0},origin:"standalone",intent:"preauth"}:{kind:"auth_gate",origin:"standalone"}:i==="awaiting_payment"&&a&&l?{kind:"awaiting_payment",priceId:a,url:l}:i==="popup_blocked"&&a&&l?{kind:"popup_blocked",priceId:a,url:l}:{kind:"layout"}),S=i==="awaiting_payment"||i==="popup_blocked"||i==="auth"&&!!a,C=d.useRef(!1),T=d.useRef(null);d.useEffect(()=>{if(!u)return;const b=Wt(e,p,y,c),f=T.current;f&&Zt(f,b)||(T.current=b,u(b))},[e,p,y,c,u]),d.useEffect(()=>{if(r.auth)return r.auth.onAuthChange((b,f)=>I(f))},[r.auth]),d.useEffect(()=>{if(typeof r.onBootstrapChange=="function")return r.onBootstrapChange(b=>{k(f=>f.status==="ready"?{status:"ready",data:b}:f)})},[r]),d.useEffect(()=>{if(!e||p.status==="ready"||p.status==="loading")return;let b=!1;return k({status:"loading"}),r.bootstrap().then(f=>{if(b)return;k({status:"ready",data:f}),s("ready",f);const w=i==="support"||i==="auth"||S;f.user?.has_active_subscription&&!h&&!w&&(s("purchase_completed",{priceId:a??null,sessionId:null,restored:!0}),m({kind:"purchase_success",restored:!0}))}).catch(f=>{if(b)return;const w=f instanceof v.PaywallError?f:new v.PaywallError("unknown","Failed to load paywall",{cause:f});k({status:"error",error:w}),s("error",w)}),()=>{b=!0}},[e,r]),d.useLayoutEffect(()=>{if(!e){m({kind:"layout"}),C.current=!1;return}i==="support"?m({kind:"support",origin:"standalone"}):i==="auth"?m(a?{kind:"auth_gate",pendingCheckout:{priceId:a,direct:!0},origin:"standalone",intent:"preauth"}:{kind:"auth_gate",origin:"standalone"}):i==="awaiting_payment"&&a&&l?m({kind:"awaiting_payment",priceId:a,url:l}):i==="popup_blocked"&&a&&l&&m({kind:"popup_blocked",priceId:a,url:l})},[e,i,a,l]);const P=async b=>{try{const f=r.getCachedOffers?.()??null,w=f?D(f,b):null,L=await r.createCheckout({priceId:b,offerId:w?.id,ignoreActivePurchase:h===!0});if(s("checkout_started",{priceId:b,url:L.url,acquiring:L.acquiring}),typeof window>"u"||!L.url)return;const z=window.open(L.url,"_blank");if(z){try{z.opener=null}catch{}m({kind:"awaiting_payment",priceId:b,url:L.url})}else m({kind:"popup_blocked",priceId:b,url:L.url})}catch(f){if(f instanceof v.PaywallError&&f.code==="already_purchased"){try{await r.getUser({force:!0})}catch{}s("purchase_completed",{priceId:b,sessionId:null,restored:!0}),S?t():m({kind:"purchase_success",restored:!0});return}const w=f instanceof v.PaywallError?f:new v.PaywallError("checkout_failed","Checkout failed",{cause:f});s("error",w),S?t():m({kind:"layout"})}},B=(b,f)=>{if(typeof window>"u")return;const w=window.open(f,"_blank");if(w){try{w.opener=null}catch{}m({kind:"awaiting_payment",priceId:b,url:f})}};d.useEffect(()=>{if(y.kind!=="auth_gate"||!x||x.user.is_anonymous||C.current)return;C.current=!0;const b=y.pendingCheckout,f=y.origin;m({kind:"verifying"}),(async()=>{if(!h)try{if((await r.getUser({force:!0})).has_active_subscription){s("purchase_completed",{priceId:b?.priceId??null,sessionId:null,restored:!0}),b?.direct?t():m({kind:"purchase_success",restored:!0});return}}catch{}if(!b){f==="standalone"?t():m({kind:"layout"});return}await P(b.priceId)})().finally(()=>{C.current=!1})},[x,y]);const O=async(b,f)=>{if(b==="close"){t();return}if(b==="price_selected"){s("price_selected",f);return}if(b==="restore"){if(!r.auth)return;const w=r.auth.getCachedSession();if(w&&!w.user.is_anonymous)return;m({kind:"auth_gate",intent:"restore"});return}if(b==="support"){m({kind:"support",origin:"layout"});return}if(b==="checkout"&&p.status==="ready"){const w=f?.priceId;if(!w){s("error",new v.PaywallError("no_price","No price selected"));return}const L=p.data.settings.checkout_mode??"guest",z=r.auth?.getCachedSession()??null,Me=!!z&&!z.user.is_anonymous;if(L==="preauth"&&!!r.auth&&!Me){m({kind:"auth_gate",pendingCheckout:{priceId:w}});return}await P(w)}},q=p.status==="ready"?p.data.settings.brand_color:null,A=p.status==="ready"?p.data.settings.allow_close!==!1:!0,R=y.kind==="layout"&&p.status==="ready"?_e(p.data.offers):null,M=R?n.jsx(gt,{offer:R}):null,W={type:"auth_panel",allow_signup:!0,allow_password_reset:!0,hide_when_authenticated:!1,providers:p.status==="ready"?p.data.settings.auth_providers:void 0},F=y.kind==="support"?n.jsx(yt,{client:r,authSession:x,origin:y.origin,onBack:()=>{y.origin==="standalone"?t():m({kind:"layout"})}}):null,Z=y.kind==="auth_gate"&&y.origin!=="standalone"||y.kind==="support",Y=p.status==="ready"?p.data:null;return n.jsx(We,{bootstrap:Y,forceLocale:_,children:n.jsx(Ze,{open:e,onClose:t,brandColor:q,topBanner:M,allowClose:A,hideCloseButton:Z,inline:g,labelledBy:"pw-title",children:c?n.jsx(ge,{onContinue:t}):y.kind==="purchase_success"?n.jsx(ge,{restored:y.restored,onContinue:t}):F||(p.status==="loading"||p.status==="idle"||y.kind==="verifying"?n.jsx(Kt,{verifying:y.kind==="verifying"}):p.status==="error"?n.jsx(Xt,{message:p.error.message}):y.kind==="auth_gate"&&r.auth?n.jsx(ut,{block:W,bootstrap:p.data,auth:r.auth,authSession:x,showBack:y.origin!=="standalone",intent:y.intent??(y.origin==="standalone"?"standalone":"preauth"),initialMode:y.origin==="standalone"?o:void 0,onBack:()=>{y.origin==="standalone"?t():m({kind:"layout"})}}):y.kind==="awaiting_payment"?n.jsx(Qt,{client:r,onBack:()=>m({kind:"layout"}),onReopen:()=>{if(typeof window>"u")return;const b=window.open(y.url,"_blank");if(b)try{b.opener=null}catch{}},onRetry:()=>P(y.priceId)}):y.kind==="popup_blocked"?n.jsx(Jt,{onReopen:()=>B(y.priceId,y.url)}):n.jsx(Gt,{layout:p.data.layout,bootstrap:p.data,onAction:O,auth:r.auth,authSession:x}))})})}function Kt({verifying:r}){const{t:e}=j();return n.jsxs("div",{class:"flex flex-col items-center justify-center gap-3 py-12",children:[n.jsx("span",{class:"inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]"}),n.jsx("span",{class:"text-xs font-medium tracking-wide text-gray-500",children:r?e("modal.verifying_subscription","Checking your subscription…"):e("modal.loading","Loading…")})]})}function Xt({message:r}){const{t:e}=j();return n.jsxs("div",{class:"flex flex-col items-center gap-2 py-8 text-center",children:[n.jsx("div",{class:"flex h-11 w-11 items-center justify-center rounded-full bg-red-50",children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M10 6v5M10 14h.01",stroke:"#dc2626","stroke-width":"2","stroke-linecap":"round"}),n.jsx("circle",{cx:"10",cy:"10",r:"8",stroke:"#dc2626","stroke-width":"1.75"})]})}),n.jsx("p",{class:"text-sm font-semibold tracking-tight text-gray-900",children:e("modal.error_generic","Something went wrong")}),n.jsx("p",{class:"text-xs leading-relaxed text-gray-500",children:r})]})}function Jt({onReopen:r}){const{t:e}=j();return n.jsxs("div",{class:"flex flex-col items-center gap-3 py-8 text-center",children:[n.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full",style:{background:"color-mix(in srgb, var(--pw-accent) 12%, white)",color:"var(--pw-accent)"},"aria-hidden":"true",children:n.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M14 4h6v6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M20 4l-9 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M19 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}),n.jsx("p",{id:"pw-title",class:"mt-1 text-lg font-semibold tracking-tight text-gray-900",children:e("payment.popup_blocked_title","Allow popups to continue")}),n.jsx("p",{class:"max-w-[20rem] text-sm leading-relaxed text-gray-500",children:e("payment.popup_blocked_message","Your browser blocked the checkout tab. Click below to open it.")}),n.jsx("button",{type:"button",onClick:r,class:"mt-3 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:e("payment.open_checkout_button","Open checkout")})]})}function Qt({client:r,onBack:e,onReopen:t,onRetry:s}){const{t:i}=j(),[o,a]=d.useState(!1),[l,c]=d.useState(!1),h=d.useRef(null);d.useEffect(()=>()=>{h.current!==null&&clearTimeout(h.current)},[]);const u=async()=>{if(!o){a(!0),c(!1);try{if((await r.getUser({force:!0})).has_active_subscription){typeof window<"u"&&window.postMessage({type:"paywall_purchase"},"*");return}c(!0),h.current!==null&&clearTimeout(h.current),h.current=setTimeout(()=>{c(!1),h.current=null},5e3)}catch{c(!0)}finally{a(!1)}}};return n.jsxs("div",{class:"flex flex-col gap-3 px-6 pb-6 pt-4 sm:px-8 sm:pb-8 sm:pt-5",children:[n.jsx("button",{type:"button",onClick:e,class:"-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:i("nav.back","← Back")}),n.jsxs("div",{class:"flex flex-col items-center gap-3 py-6 text-center",children:[n.jsxs("div",{class:"relative flex h-14 w-14 items-center justify-center",children:[n.jsx("span",{class:"absolute inset-0 animate-ping rounded-full opacity-40",style:{background:"color-mix(in srgb, var(--pw-accent) 30%, transparent)"},"aria-hidden":"true"}),n.jsx("span",{class:"relative inline-block h-8 w-8 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]"})]}),n.jsx("p",{id:"pw-title",class:"mt-1 text-lg font-semibold tracking-tight text-gray-900",children:i("payment.awaiting_title","Complete payment in the new tab")}),n.jsx("p",{class:"max-w-[22rem] text-sm leading-relaxed text-gray-500",children:i("payment.awaiting_subtitle","We'll detect your payment automatically — or click below once you're done.")}),n.jsx("button",{type:"button",onClick:u,disabled:o,class:"mt-3 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:brightness-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:o?i("payment.checking","Checking…"):i("payment.ive_paid","I've paid")}),l?n.jsx("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]}),n.jsxs("div",{class:"rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5",children:[n.jsx("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.")}),n.jsx("button",{type:"button",onClick:t,class:"mt-2.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:i("payment.open_checkout_again","Open checkout again")})]}),n.jsx("button",{type:"button",onClick:s,class:"self-center rounded-md px-2 py-1 text-xs text-gray-500 underline-offset-2 hover:text-gray-900 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:i("payment.tab_closed_retry","Tab closed? Try again")})]})}function ge({onContinue:r,restored:e=!1}){const{t}=j();return n.jsxs("div",{class:"flex flex-col items-center gap-3 py-8 text-center",children:[n.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full ring-8",style:{background:"linear-gradient(135deg, #4ade80, #16a34a)",color:"#fff",boxShadow:"0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"},"aria-hidden":"true",children:n.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",children:n.jsx("path",{d:"M5 13l4 4L19 7",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})})}),n.jsx("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")}),n.jsx("p",{class:"text-sm leading-relaxed text-gray-500",children:e?t("modal.purchase_restored_subtitle","Welcome back — your subscription is already active."):t("modal.purchase_success_subtitle","Your subscription is now active.")}),n.jsx("button",{type:"button",onClick:r,class:"mt-3 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:t("modal.continue","Continue")})]})}const er=10*6e4,tr=5e3,rr=3e4;class nr{constructor(e){this.timer=null,this.timeoutTimer=null,this.visibilityHandler=null,this.focusHandler=null,this.messageHandler=null,this.stopped=!1,this.checking=!1,this.opts={client:e.client,onActive:e.onActive,onTimeout:e.onTimeout??(()=>{}),timeoutMs:e.timeoutMs??er,visibleIntervalMs:e.visibleIntervalMs??tr,hiddenIntervalMs:e.hiddenIntervalMs??rr}}start(){this.stopped||typeof document>"u"||typeof window>"u"||(this.check(),this.scheduleNext(),this.visibilityHandler=()=>this.handleVisibilityChange(),document.addEventListener("visibilitychange",this.visibilityHandler),this.focusHandler=()=>void this.check(),window.addEventListener("focus",this.focusHandler),this.messageHandler=e=>this.handleMessage(e),window.addEventListener("message",this.messageHandler),this.timeoutTimer=setTimeout(()=>{this.stopped||(this.stop(),this.opts.onTimeout())},this.opts.timeoutMs))}stop(){this.stopped=!0,this.timer!==null&&clearTimeout(this.timer),this.timer=null,this.timeoutTimer!==null&&clearTimeout(this.timeoutTimer),this.timeoutTimer=null,typeof document<"u"&&this.visibilityHandler&&document.removeEventListener("visibilitychange",this.visibilityHandler),typeof window<"u"&&(this.focusHandler&&window.removeEventListener("focus",this.focusHandler),this.messageHandler&&window.removeEventListener("message",this.messageHandler)),this.visibilityHandler=null,this.focusHandler=null,this.messageHandler=null}async check(){if(!(this.stopped||this.checking)){this.checking=!0;try{const e=await this.opts.client.getUser({force:!0});if(this.stopped)return;e.has_active_subscription&&(this.stop(),this.opts.onActive(e))}catch{}finally{this.checking=!1}}}scheduleNext(){if(this.stopped)return;const t=typeof document<"u"&&document.visibilityState==="visible"?this.opts.visibleIntervalMs:this.opts.hiddenIntervalMs;this.timer=setTimeout(async()=>{await this.check(),this.scheduleNext()},t)}handleVisibilityChange(){typeof document>"u"||(document.visibilityState==="visible"&&this.check(),this.timer!==null&&(clearTimeout(this.timer),this.timer=null),this.scheduleNext())}handleMessage(e){const t=e.data;!t||typeof t!="object"||t.type==="paywall_purchase"&&this.check()}}function sr(){return!(typeof document>"u"||typeof window>"u"||typeof location<"u"&&location.protocol==="chrome-extension:")}const re={open:!1,view:null,error:null,processing:!1},N={status:"paywall_status",priceId:"paywall_price_id",sessionId:"paywall_session_id"};let ir=class{constructor(e){this.handle=null,this.isOpen=!1,this.listeners=new Map,this.userUnsub=null,this.authUnsub=null,this.watcher=null,this.tracker=null,this.purchased=!1,this.trialStore=null,this.trialStoreConfig=null,this.lastTrialStatus=null,this.trialExpiredFired=!1,this.lastVisibility=null,this.currentState=re,this.stateListeners=new Set;const{auth:t,ownsAuth:s}=or(e);this.auth=t,this.ownsAuth=s,this.billing=e.client??new v.BillingClient({...e,auth:this.auth}),this.host=e.host,this.shadowMode=e.shadowMode??"closed",this.mountThenLoad=e.mountThenLoad??!0,this.inline=e.inline===!0,this.forceLocale=e.locale??null,this.userUnsub=this.billing.onUserChange(i=>{this.emit("userChange",i)}),this.auth&&(this.authUnsub=this.auth.onAuthChange((i,o)=>{this.emit("authChange",{event:i,session:o})})),this.initTracker(e.analytics),e.autoDetectReturn!==!1&&typeof window<"u"&&queueMicrotask(()=>this.checkReturn())}initTracker(e){if(e===!1)return;const t=typeof e=="object"&&e!==null?e:{};if(t.enabled===!1)return;const s=t.endpoint??`${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;this.tracker=new v.EventTracker({endpoint:s,paywallId:this.billing.paywallId,capabilities:this.billing.capabilities,getVisitorId:()=>this.billing.getVisitorId(),getCachedVisitorId:()=>this.billing.getCachedVisitorId(),getUserId:()=>this.billing.getIdentity()?.userId??null,flushIntervalMs:t.flushIntervalMs,maxBufferSize:t.maxBufferSize,fetch:t.fetch,sendBeacon:t.sendBeacon}),this.on("open",()=>this.tracker?.track("paywall_opened")),this.on("ready",i=>this.tracker?.track("paywall_viewed",{is_test_mode:i.settings.is_test_mode,prices_count:i.prices.length,offers_count:i.offers.length})),this.on("price_selected",i=>this.tracker?.track("price_selected",{price_id:i.priceId})),this.on("checkout_started",i=>this.tracker?.track("checkout_started",{price_id:i.priceId,acquiring:i.acquiring})),this.on("purchase_completed",i=>this.tracker?.track("purchase_completed",{price_id:i.priceId,session_id:i.sessionId})),this.on("purchase_failed",i=>this.tracker?.track("purchase_failed",{reason:i.reason})),this.on("close",()=>this.tracker?.track("paywall_closed")),this.on("trial_blocked",i=>this.tracker?.track("trial_blocked",{mode:i.mode,...i.mode==="time"?{remaining_ms:i.remainingMs,total_ms:i.totalMs}:i.mode==="opens"?{remaining_actions:i.remainingActions,total_actions:i.totalActions}:{}})),this.on("trial_expired",()=>this.tracker?.track("trial_expired")),this.on("visibility_blocked",i=>this.tracker?.track("visibility_blocked",{reason:i.reason,country:i.country,tier:i.tier})),this.on("error",i=>this.tracker?.track("error",{code:i.code,message:i.message}))}track(e,t){this.tracker?.track(e,t)}onUserChange(e){return this.on("userChange",e)}setBootstrap(e){this.billing.setBootstrap(e)}setLocale(e){const t=e??null;t!==this.forceLocale&&(this.forceLocale=t,this.handle&&this.handle.update({locale:t}))}on(e,t){let s=this.listeners.get(e);return s||(s=new Set,this.listeners.set(e,s)),s.add(t),()=>s.delete(t)}off(e,t){this.listeners.get(e)?.delete(t)}emit(e,...t){const s=this.listeners.get(e);if(!s)return;const i=t[0];for(const o of s)try{o(i)}catch(a){typeof console<"u"&&console.error("[paywall] listener error",a)}}open(e={}){this.openInternal("layout",e)}async preload(e={}){try{await this.billing.bootstrap({signal:e.signal}),this.billing.auth&&await this.billing.getBalances({signal:e.signal})}catch{}}openSupport(e={}){this.openInternal("support",e)}openAuth(e={}){this.auth&&this.openInternal("auth",{...e,skipTrial:!0})}openSignin(e={}){this.auth&&this.openInternal("auth",{...e,skipTrial:!0,authMode:"signin"})}openSignup(e={}){this.auth&&this.openInternal("auth",{...e,skipTrial:!0,authMode:"signup"})}checkout(e,t={}){if(t.identity&&this.billing.setIdentity(t.identity),t.renew!==!0&&this.billing.getCachedUser()?.has_active_subscription){this.emit("purchase_completed",{priceId:e,sessionId:null,restored:!0});return}this.runDirectCheckout(e,t)}async runDirectCheckout(e,t){const s=t.renew===!0,i=t.skipTrial===!0,o=t.skipVisibility===!0;this.applyProcessing(!0);const a=()=>{this.applyProcessing(!1)};let l;try{l=await this.billing.bootstrap()}catch(x){const I=x instanceof v.PaywallError?x:new v.PaywallError("unknown","Failed to load paywall",{cause:x});this.emit("error",I),a();return}if(!o){const x=l.settings.visibility;if(x&&(this.lastVisibility=x,!x.visible)){this.emit("visibility_blocked",x),a();return}}if(!i&&await this.checkTrialBeforeCheckout(l)){a();return}if(!s&&l.user?.has_active_subscription){this.emit("purchase_completed",{priceId:e,sessionId:null,restored:!0}),a();return}const c=l.settings.checkout_mode??"guest",h=this.auth?.getCachedSession()??null,u=!!h&&!h.user.is_anonymous;if(c==="preauth"&&!!this.auth&&!u){this.purchased=!1,this.mountAndShow("auth",{renew:s,authMode:"signin",checkoutPriceId:e});return}const _=this.getOfferForPrice(e);let p;try{p=await this.billing.createCheckout({priceId:e,offerId:_?.offer.id,ignoreActivePurchase:s})}catch(x){if(x instanceof v.PaywallError&&x.code==="already_purchased"){try{await this.billing.getUser({force:!0})}catch{}this.emit("purchase_completed",{priceId:e,sessionId:null,restored:!0}),a();return}const I=x instanceof v.PaywallError?x:new v.PaywallError("checkout_failed","Checkout failed",{cause:x});this.emit("error",I),a();return}if(this.emit("checkout_started",{priceId:e,url:p.url,acquiring:p.acquiring}),this.startUserWatcher(),typeof window>"u"||!p.url){this.mountAndShow("awaiting_payment",{renew:s,checkoutPriceId:e,checkoutUrl:p.url});return}const k=window.open(p.url,"_blank");if(this.purchased=!1,k){try{k.opener=null}catch{}this.mountAndShow("awaiting_payment",{renew:s,checkoutPriceId:e,checkoutUrl:p.url})}else this.mountAndShow("popup_blocked",{renew:s,checkoutPriceId:e,checkoutUrl:p.url})}async checkTrialBeforeCheckout(e){const t=e.settings.trial;if(!t)return!1;const s=this.ensureTrialStore(t);try{const i=await s.check();if(this.lastTrialStatus=i,i.mode==="none")return!1;if(i.blocked){const o=await s.recordBlock();return this.lastTrialStatus=o,this.emit("trial_blocked",o),!0}return this.trialExpiredFired||(this.trialExpiredFired=!0,this.emit("trial_expired")),!1}catch(i){return typeof console<"u"&&console.warn("[paywall] trial check failed",i),!1}}applyProcessing(e){this.currentState.processing!==e&&this.applyState({...this.currentState,processing:e})}signInAnonymously(){return this.auth?this.auth.signInAnonymously():Promise.reject(new v.PaywallError("invalid_config","signInAnonymously requires managed-auth. Pass `auth: true` to PaywallUI."))}openInternal(e,t){t.identity&&this.billing.setIdentity(t.identity),this.purchased=!1;const s=t.skipTrial===!0||e==="support",i=t.skipVisibility===!0||e==="support"||e==="auth",o=t.renew===!0;if(s&&i){this.mountAndShow(e,{renew:o,authMode:t.authMode});return}const a=this.billing.getCachedBootstrap();if(a){this.runOpenGates(e,a,{skipTrial:s,skipVisibility:i,renew:o});return}if(this.mountThenLoad){this.mountAndShow(e,{renew:o}),this.billing.bootstrap().then(l=>this.runDelayedGates(l,{skipTrial:s,skipVisibility:i})).catch(()=>{});return}this.billing.bootstrap().then(l=>this.runOpenGates(e,l,{skipTrial:s,skipVisibility:i,renew:o})).catch(()=>{this.mountAndShow(e,{renew:o})})}runDelayedGates(e,t){if(!this.isOpen)return;if(!t.skipVisibility){const o=e.settings.visibility;if(o&&(this.lastVisibility=o,!o.visible)){this.close(),this.emit("visibility_blocked",o);return}}if(t.skipTrial)return;const s=e.settings.trial;if(!s)return;const i=this.ensureTrialStore(s);i.check().then(async o=>{if(this.isOpen&&(this.lastTrialStatus=o,o.mode!=="none")){if(o.blocked){const a=await i.recordBlock();if(this.lastTrialStatus=a,!this.isOpen)return;this.close(),this.emit("trial_blocked",a);return}this.trialExpiredFired||(this.trialExpiredFired=!0,this.emit("trial_expired"))}}).catch(o=>{typeof console<"u"&&console.warn("[paywall] trial check failed",o)})}runOpenGates(e,t,s){if(!s.skipVisibility){const i=t.settings.visibility;if(i&&(this.lastVisibility=i,!i.visible)){this.emit("visibility_blocked",i);return}}if(s.skipTrial){this.mountAndShow(e,{renew:s.renew});return}this.gateThroughTrial(e,t,s.renew)}gateThroughTrial(e,t,s){const i=t.settings.trial;if(!i){this.mountAndShow(e,{renew:s});return}const o=this.ensureTrialStore(i);o.check().then(async a=>{if(this.lastTrialStatus=a,a.mode==="none"){this.mountAndShow(e,{renew:s});return}if(a.blocked){const l=await o.recordBlock();this.lastTrialStatus=l,this.emit("trial_blocked",l);return}this.trialExpiredFired||(this.trialExpiredFired=!0,this.emit("trial_expired")),this.mountAndShow(e,{renew:s})}).catch(a=>{typeof console<"u"&&console.warn("[paywall] trial check failed",a),this.mountAndShow(e,{renew:s})})}ensureTrialStore(e){if(this.trialStore&&this.trialStoreConfig&&cr(this.trialStoreConfig,e))return this.trialStore;this.trialStoreConfig=e;const t=this.billing.createTrialStore;return this.trialStore=typeof t=="function"?t.call(this.billing,e):v.createTrialStore(this.billing.getStorage(),this.billing.paywallId,e),this.trialStore}mountAndShow(e,t={}){const s=t.renew===!0,i=t.authMode,a=e==="auth"||e==="awaiting_payment"||e==="popup_blocked"?t.checkoutPriceId??null:null,l=e==="awaiting_payment"||e==="popup_blocked"?t.checkoutUrl??null:null;if(this.handle){this.isOpen=!0,this.handle.update({open:!0,initialView:e,initialAuthMode:i,initialCheckoutPriceId:a,initialCheckoutUrl:l,purchased:!1,renew:s}),this.emit("open");return}this.isOpen=!0,this.handle=ze(Yt,{client:this.billing,open:!0,initialView:e,initialAuthMode:i,initialCheckoutPriceId:a,initialCheckoutUrl:l,purchased:!1,renew:s,onClose:()=>this.close(),onEvent:(c,h)=>{this.emit(c,h),c==="checkout_started"&&this.startUserWatcher()},onState:c=>this.applyState(c),inline:this.inline,locale:this.forceLocale},{host:this.host,shadowMode:this.shadowMode,inline:this.inline}),this.emit("open")}applyState(e){if(!lr(this.currentState,e)){this.currentState=e;for(const t of this.stateListeners)try{t(e)}catch(s){console.warn("[paywall] onStateChange listener threw",s)}}}getState(){return this.currentState}onStateChange(e,t={}){this.stateListeners.add(e);const s=t.immediate??"microtask";if(s!=="none"){const i=this.currentState;if(s==="sync")try{e(i)}catch(o){console.warn("[paywall] onStateChange initial sync threw",o)}else queueMicrotask(()=>{this.stateListeners.has(e)&&e(i)})}return()=>{this.stateListeners.delete(e)}}getTrialStatus(){return this.lastTrialStatus}getVisibility(){return this.lastVisibility}getPrices(e={}){return this.billing.getPrices(e)}getCachedPrices(){return this.billing.getCachedPrices()}getCachedOffers(){return this.billing.getCachedOffers()}getOfferForPrice(e){const t=this.billing.getCachedOffers();if(!t)return null;const s=D(t,e);return s?qe(s,{now:Date.now(),readStart:De}):null}getUserLanguage(){return this.billing.getUserLanguage()}async getAccess(e={}){let t=this.billing.getCachedBootstrap();if(!t)try{t=await this.billing.bootstrap({signal:e.signal})}catch{const a=this.billing.getCachedUser();return a?.has_active_subscription?{access:"granted",reason:"has_subscription",visibility:null,trial:null,user:a}:{access:"blocked",reason:"no_subscription",visibility:null,trial:null,user:a}}const s=this.billing.getCachedUser()??t.user??null;if(s?.has_active_subscription)return{access:"granted",reason:"has_subscription",visibility:t.settings.visibility??null,trial:null,user:s};let i=null;if(!e.skipVisibility){const a=t.settings.visibility;if(a&&(i=a,this.lastVisibility=a,!a.visible))return{access:"granted",reason:"visibility_blocked",visibility:i,trial:null,user:s}}let o=null;if(!e.skipTrial){const a=t.settings.trial;if(a)try{if(o=await this.ensureTrialStore(a).check(),this.lastTrialStatus=o,o.blocked)return{access:"granted",reason:"trial_blocked",visibility:i,trial:o,user:s}}catch(l){typeof console<"u"&&console.warn("[paywall] getAccess: trial check failed",l)}}return{access:"blocked",reason:"no_subscription",visibility:i,trial:o,user:s}}async resetTrial(){this.trialStore&&(await this.trialStore.reset(),this.lastTrialStatus=null,this.trialExpiredFired=!1)}startUserWatcher(){this.watcher||sr()&&(this.watcher=new nr({client:this.billing,onActive:e=>{this.watcher=null,this.emit("purchase_completed",{priceId:null,sessionId:null});const t=this.billing.getCachedBootstrap()?.settings.success_redirect_url;if(t&&typeof window<"u")try{window.location.assign(t);return}catch{}this.isOpen&&this.handle&&(this.purchased=!0,this.handle.update({purchased:!0}))},onTimeout:()=>{this.watcher=null}}),this.watcher.start())}close(){!this.isOpen||!this.handle||(this.isOpen=!1,this.purchased=!1,this.handle.update({open:!1,purchased:!1}),this.applyState(re),this.emit("close"))}checkReturn(){if(typeof window>"u")return;const e=new URL(window.location.href),t=xe(e.hash.replace(/^#/,"")),s=xe(e.search.replace(/^\?/,"")),i=t??s;i&&(i.status==="paid"?(this.emit("purchase_completed",{priceId:i.priceId,sessionId:i.sessionId}),ur(i)):(i.status==="failed"||i.status==="cancelled")&&this.emit("purchase_failed",{reason:i.status}),dr(e))}destroy(){this.tracker?.destroy(),this.tracker=null,this.listeners.clear(),this.stateListeners.clear(),this.watcher?.stop(),this.watcher=null,this.userUnsub?.(),this.userUnsub=null,this.authUnsub?.(),this.authUnsub=null,this.ownsAuth&&this.auth&&this.auth.destroy?.(),this.ownsAuth=!1,this.billing.destroy?.(),this.handle?.unmount(),this.handle=null,this.isOpen=!1,this.currentState=re}};function or(r){if(!r.auth)return{auth:void 0,ownsAuth:!1};if(r.auth instanceof v.AuthClient||ar(r.auth))return{auth:r.auth,ownsAuth:!1};const e=r.auth===!0?{}:r.auth;return{auth:new v.AuthClient({paywallId:r.paywallId,apiOrigin:e.apiOrigin??r.apiOrigin,storage:e.storage??r.storage,fetch:e.fetch??r.fetch,openPopup:e.openPopup}),ownsAuth:!0}}function ar(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.onAuthChange=="function"&&typeof e.getCachedSession=="function"&&typeof e.signOut=="function"}function lr(r,e){return r.open===e.open&&r.view===e.view&&r.error===e.error&&r.processing===e.processing}function cr(r,e){return r.mode===e.mode&&r.payload===e.payload&&r.storage===e.storage}function xe(r){if(!r)return null;const e=new URLSearchParams(r),t=e.get(N.status);return t?{status:t,priceId:e.get(N.priceId),sessionId:e.get(N.sessionId)}:null}function ur(r){if(!(typeof window>"u"||!window.opener))try{window.opener.postMessage({type:"paywall_purchase",status:r.status,priceId:r.priceId,sessionId:r.sessionId},"*")}catch{}}function dr(r){const e=(s,i)=>{if(!s)return"";const o=new URLSearchParams(s.replace(/^[?#]/,""));o.delete(N.status),o.delete(N.priceId),o.delete(N.sessionId);const a=o.toString();return a?i+a:""},t=r.pathname+e(r.search,"?")+e(r.hash,"#");window.history.replaceState(null,"",t)}class hr{constructor(e,t,s){this.transport=e,this.paywallId=t,this.config=s}async check(){return this.transport.request("trial.check",{paywallId:this.paywallId,config:this.config})}async recordBlock(){return this.transport.request("trial.recordBlock",{paywallId:this.paywallId,config:this.config})}async reset(){await this.transport.request("trial.reset",{paywallId:this.paywallId,config:this.config})}}class Ee{constructor(e,t){this.transport=e,this.cachedBootstrap=null,this.cachedUser=null,this.cachedBalances=null,this.identity=null,this.userListeners=new Set,this.balanceListeners=new Set,this.bootstrapListeners=new Set,this.unsubUserBroadcast=null,this.unsubBalancesBroadcast=null,this.paywallId=t.paywallId,this.apiOrigin=t.apiOrigin,this.remoteStorageAdapter={getItem:s=>this.transport.request("storage.get",{key:s}),setItem:async(s,i)=>{await this.transport.request("storage.set",{key:s,value:i})},removeItem:async s=>{await this.transport.request("storage.remove",{key:s})}},this.unsubUserBroadcast=this.transport.on("userChange",s=>{this.applyUser(s)}),this.unsubBalancesBroadcast=this.transport.on("balancesChange",s=>{this.applyBalances([...s])})}async bootstrap(e={}){const t=await this.transport.request("billing.bootstrap",{force:e.force},{signal:e.signal});return this.applyBootstrap(t),t.user&&this.applyUser(t.user),t}getCachedBootstrap(){return this.cachedBootstrap}onBootstrapChange(e,t={}){this.bootstrapListeners.add(e);const s=t.immediate??"microtask";if(this.cachedBootstrap&&s!=="none"){const i=this.cachedBootstrap;if(s==="sync")try{e(i)}catch(o){console.warn("[paywall] onBootstrapChange initial sync threw",o)}else queueMicrotask(()=>{this.bootstrapListeners.has(e)&&e(i)})}return()=>{this.bootstrapListeners.delete(e)}}async getPrices(e={}){return(await this.bootstrap(e)).prices}getCachedPrices(){return this.cachedBootstrap?.prices??null}getCachedOffers(){return this.cachedBootstrap?.offers??null}async getVisitorId(){return this.transport.request("billing.getVisitorId",void 0)}async getUser(e={}){const t=await this.transport.request("billing.getUser",{force:e.force},{signal:e.signal});return this.applyUser(t),t}getCachedUser(){return this.cachedUser}onUserChange(e,t={}){this.userListeners.add(e);const s=t.immediate??"microtask";if(this.cachedUser&&s!=="none"){const i=this.cachedUser;if(s==="sync")try{e(i)}catch(o){console.warn("[paywall] onUserChange initial sync threw",o)}else queueMicrotask(()=>{this.userListeners.has(e)&&e(i)})}return()=>{this.userListeners.delete(e)}}async getBalances(e={}){const s=[...await this.transport.request("billing.getBalances",{force:e.force},{signal:e.signal})];return this.applyBalances(s),s}getCachedBalances(){return this.cachedBalances}onBalanceChange(e,t={}){this.balanceListeners.add(e);const s=t.immediate??"microtask";if(this.cachedBalances&&s!=="none"){const i=this.cachedBalances;if(s==="sync")try{e(i)}catch(o){console.warn("[paywall] onBalanceChange initial sync threw",o)}else queueMicrotask(()=>{this.balanceListeners.has(e)&&e(i)})}return()=>{this.balanceListeners.delete(e)}}async createCheckout(e){const{signal:t,...s}=e;return this.transport.request("billing.createCheckout",s,{signal:t})}async listPurchases(e={}){return[...await this.transport.request("billing.listPurchases",void 0,{signal:e.signal})]}async createSupportTicket(e){return this.transport.request("billing.createSupportTicket",e)}async cancelSubscription(e){const{signal:t,...s}=e;return this.transport.request("billing.cancelSubscription",s,{signal:t})}getStorage(){return this.remoteStorageAdapter}createTrialStore(e){return new hr(this.transport,this.paywallId,e)}getIdentity(){return this.identity}async setIdentity(e){this.identity=e,await this.transport.request("billing.setIdentity",{identity:e})}async syncIdentity(){const e=await this.transport.request("billing.getIdentity",void 0);return this.identity=e,e}destroy(){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}applyBootstrap(e){this.cachedBootstrap=e;for(const t of[...this.bootstrapListeners])try{t(e)}catch(s){console.warn("[paywall] onBootstrapChange listener threw",s)}}applyUser(e){pr(this.cachedUser,e)||(this.cachedUser=e,this.fireUserListeners(e))}applyBalances(e){fr(this.cachedBalances,e)||(this.cachedBalances=e,this.fireBalanceListeners(e))}fireUserListeners(e){for(const t of[...this.userListeners])try{t(e)}catch(s){console.warn("[paywall] onUserChange listener threw",s)}}fireBalanceListeners(e){for(const t of[...this.balanceListeners])try{t(e)}catch(s){console.warn("[paywall] onBalanceChange listener threw",s)}}}function pr(r,e){return r===e?!0:!r||!e?!1:r.has_active_subscription===e.has_active_subscription&&(r.purchases?.length??0)===(e.purchases?.length??0)}function fr(r,e){if(r===e)return!0;if(!r||!e||r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t].type!==e[t].type||r[t].count!==e[t].count)return!1;return!0}class Ae{constructor(e,t){this.transport=e,this.session=null,this.listeners=new Set,this.unsubBroadcast=null,this.paywallId=t.paywallId,this.apiOrigin=t.apiOrigin,this.unsubBroadcast=this.transport.on("authChange",({event:s,session:i})=>{this.applySession(s,i)}),this.hydrated=this.transport.request("auth.getCachedSession",void 0).then(s=>{this.session===null&&s!==null&&(this.session=s)}).catch(()=>{})}ready(){return this.hydrated}getCachedSession(){return this.session}getCachedUser(){return this.session?.user??null}onAuthChange(e){return this.listeners.add(e),this.hydrated.then(()=>{if(this.listeners.has(e))try{e("INITIAL_SESSION",this.session)}catch(t){console.warn("[paywall] onAuthChange INITIAL_SESSION threw",t)}}),()=>{this.listeners.delete(e)}}async signInWithEmail(e){const t=await this.transport.request("auth.signInWithEmail",e);return this.applySession("SIGNED_IN",t),t}async signUp(e){const t=await this.transport.request("auth.signUp",e);return t.kind==="signed_in"&&this.applySession("SIGNED_IN",t.session),t}async signOut(){await this.transport.request("auth.signOut",void 0)}async refresh(){const e=await this.transport.request("auth.refresh",void 0);return this.applySession(e?"TOKEN_REFRESHED":"SIGNED_OUT",e),e}async sendOtp(e){await this.transport.request("auth.sendOtp",e)}async verifyOtp(e){const t=await this.transport.request("auth.verifyOtp",e);return this.applySession(e.type==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",t),t}async resendConfirmation(e){await this.transport.request("auth.resendConfirmation",e)}async requestPasswordReset(e){await this.transport.request("auth.requestPasswordReset",e)}async updatePassword(e){await this.transport.request("auth.updatePassword",e)}async revokeAllSessions(){await this.transport.request("auth.revokeAllSessions",void 0)}async getLastLogin(){return this.transport.request("auth.getLastLogin",void 0)}async signInAnonymously(e={}){const t=await this.transport.request("auth.signInAnonymously",{captchaToken:e.captchaToken,userMeta:e.userMeta,forceNewAnon:e.forceNewAnon});return this.applySession("SIGNED_IN",t),t}async getAccessToken(){return this.transport.request("auth.getAccessToken",void 0)}async signInWithOAuth(e){if(typeof window>"u")throw new v.PaywallError("oauth_unavailable","window is required for OAuth");const t=`pw-oauth-pending-${Math.random().toString(36).slice(2,10)}`,s=window.open("about:blank",t,"width=480,height=640,popup=yes");if(!s)throw new v.PaywallError("popup_blocked","browser blocked auth popup — call from a user gesture");mr(s,e.provider);try{const{authorizeUrl:i,state:o}=await this.transport.request("auth.oauthStart",{provider:e.provider,scopes:e.scopes,userMeta:e.userMeta});s.name=`pw-oauth-${o}`,s.location.replace(i),e.onPopupOpened?.();const a=await v.waitForOAuthCode(s,o),l=await this.transport.request("auth.oauthExchange",{state:o,code:a});return this.applySession("SIGNED_IN",l),l}catch(i){try{s.close()}catch{}throw i}}destroy(){this.unsubBroadcast?.(),this.unsubBroadcast=null,this.listeners.clear(),this.session=null}applySession(e,t){if(!gr(this.session,t)){this.session=t;for(const s of[...this.listeners])try{s(e,t)}catch(i){console.warn("[paywall] onAuthChange listener threw",i)}}}}function gr(r,e){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}const xr={google:"Google",apple:"Apple",github:"GitHub",facebook:"Facebook"};function mr(r,e){const t=xr[e]??e;try{const s=r.document;s.title=`Sign in with ${t}`;const i=s.createElement("style");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)}}",s.head.appendChild(i);const o=s.createElement("div");o.className="pw-oauth-wrap";const a=s.createElement("div");a.className="pw-oauth-spinner";const l=s.createElement("div");l.className="pw-oauth-label",l.textContent=`Connecting to ${t}…`,o.appendChild(a),o.appendChild(l),s.body.appendChild(o)}catch{}}class Le{constructor(e){this.transport=e}track(e,t){typeof e!="string"||e.length===0||this.transport.request("tracker.track",{name:e,props:t}).catch(s=>{console.warn("[paywall] track failed",s)})}}class yr{constructor(e){this.factory=e,this.channel=null,this.channelDisposers=[],this.pending=new Map,this.listeners=new Map,this.destroyed=!1,this.nextId=0,this.clientId=`c-${Math.random().toString(36).slice(2,10)}`}ensureChannel(){if(this.destroyed)throw new Error("TransportClient destroyed");if(this.channel)return this.channel;const e=this.factory();this.channel=e;const t=e.onMessage(i=>this.handleMessage(i)),s=e.onDisconnect(()=>this.handleDisconnect());return this.channelDisposers=[t,s],this.request("handshake",{protocolVersion:v.PROTOCOL_VERSION,clientId:this.clientId}).then(i=>{i.protocolVersion!==v.PROTOCOL_VERSION&&console.warn(`[sdk-extension] protocol version mismatch: client=${v.PROTOCOL_VERSION}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`)}).catch(()=>{}),e}handleMessage(e){if(wr(e)){if(e.type==="response"){const t=this.pending.get(e.id);if(!t)return;this.pending.delete(e.id),t.signal?.removeEventListener("abort",t.abortListener),e.ok?t.resolve(e.result):t.reject(v.reconstructError(e.error));return}if(e.type==="event"){const t=this.listeners.get(e.kind);if(!t)return;for(const s of[...t])try{s(e.payload)}catch(i){console.error("[sdk-extension] event handler threw",i)}}}}handleDisconnect(){for(const t of this.channelDisposers)t();this.channelDisposers=[],this.channel=null;const e=Array.from(this.pending.values());this.pending.clear();for(const t of e)t.signal?.removeEventListener("abort",t.abortListener),t.reject(new br)}request(e,t,s={}){if(this.destroyed)return Promise.reject(new Error("TransportClient destroyed"));if(s.signal?.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));const i=this.ensureChannel(),o=`r${++this.nextId}`;return new Promise((a,l)=>{const c={resolve:a,reject:l,signal:s.signal};s.signal&&(c.abortListener=()=>{if(this.pending.delete(o)){l(new DOMException("Aborted","AbortError"));try{i.send({type:"cancel",id:o})}catch{}}},s.signal.addEventListener("abort",c.abortListener)),this.pending.set(o,c);const h={type:"request",id:o,kind:e,params:t};try{i.send(h)}catch(u){this.pending.delete(o),s.signal?.removeEventListener("abort",c.abortListener),l(u)}})}on(e,t){let s=this.listeners.get(e);s||(s=new Set,this.listeners.set(e,s));const i=t;return s.add(i),this.ensureChannel(),()=>{s.delete(i)}}destroy(){if(this.destroyed)return;this.destroyed=!0;for(const t of this.channelDisposers)t();this.channelDisposers=[],this.listeners.clear();const e=Array.from(this.pending.values());this.pending.clear();for(const t of e)t.signal?.removeEventListener("abort",t.abortListener),t.reject(new Error("TransportClient destroyed"));this.channel?.close(),this.channel=null}}class br extends Error{constructor(){super("Transport channel disconnected mid-request"),this.code="transport_disconnected",this.name="TransportDisconnectedError"}}function wr(r){if(typeof r!="object"||r===null)return!1;const e=r.type;return e==="request"||e==="response"||e==="event"}let H=null;function Te(){return H||(H=new yr(()=>v.createRuntimeChannel(Be.PORT_NAME)),H)}class kr extends ir{constructor(e){const t=Te(),s=new Ee(t,{paywallId:e.paywallId,apiOrigin:e.apiOrigin});let i;e.auth===!0?i=new Ae(t,{paywallId:e.paywallId,apiOrigin:e.apiOrigin}):e.auth&&console.warn("[sdk-extension] passing AuthClient instance to PaywallUI.opts.auth is not supported in extension mode — pass `auth: true` to use offscreen-shared auth, or omit for hybrid identity-only mode."),i&&(s.auth=i),super({...e,client:s,auth:i,analytics:!1}),this.remoteTracker=null,this.trackerUnsubs=[],e.analytics!==!1&&(this.remoteTracker=new Le(t),this.bindAnalytics())}bindAnalytics(){const e=this.remoteTracker;e&&this.trackerUnsubs.push(this.on("open",()=>e.track("paywall_opened")),this.on("ready",t=>e.track("paywall_viewed",{is_test_mode:t.settings.is_test_mode,prices_count:t.prices.length,offers_count:t.offers.length})),this.on("price_selected",t=>e.track("price_selected",{price_id:t.priceId})),this.on("checkout_started",t=>e.track("checkout_started",{price_id:t.priceId,acquiring:t.acquiring})),this.on("purchase_completed",t=>e.track("purchase_completed",{price_id:t.priceId,session_id:t.sessionId})),this.on("purchase_failed",t=>e.track("purchase_failed",{reason:t.reason})),this.on("close",()=>e.track("paywall_closed")),this.on("trial_blocked",t=>e.track("trial_blocked",{mode:t.mode,...t.mode==="time"?{remaining_ms:t.remainingMs,total_ms:t.totalMs}:t.mode==="opens"?{remaining_actions:t.remainingActions,total_actions:t.totalActions}:{}})),this.on("trial_expired",()=>e.track("trial_expired")),this.on("visibility_blocked",t=>e.track("visibility_blocked",{reason:t.reason,country:t.country,tier:t.tier})),this.on("error",t=>e.track("error",{code:t.code,message:t.message})))}track(e,t){this.remoteTracker?.track(e,t)}destroy(){for(const e of this.trackerUnsubs)e();this.trackerUnsubs=[],this.remoteTracker=null,super.destroy()}}exports.PROTOCOL_VERSION=v.PROTOCOL_VERSION;exports.PaywallUI=kr;exports.RemoteAuthClient=Ae;exports.RemoteBillingClient=Ee;exports.RemoteEventTracker=Le;exports.getContentTransport=Te;
25
+ `})]})}function Ke(r,e){switch(r){case"google":return e("auth.continue_with_google","Continue with Google");case"apple":return e("auth.continue_with_apple","Continue with Apple");case"github":return e("auth.continue_with_github","Continue with GitHub");case"facebook":return e("auth.continue_with_facebook","Continue with Facebook")}}function le(r,e,t){const s=e==="signup"?t("auth.signup_failed","Sign-up failed"):t("auth.signin_failed","Sign-in failed");if(!(r instanceof v.PaywallError))return s;switch(r.code){case"invalid_credentials":return t("auth.invalid_credentials","Invalid email or password");case"email_not_confirmed":return t("auth.email_not_confirmed","Please confirm your email before signing in.");case"email_exists":case"user_already_exists":return t("auth.email_exists","An account with this email already exists.");case"weak_password":return t("auth.weak_password","Password is too weak.");case"invalid_otp":case"otp_expired":case"token_expired":return t("auth.invalid_otp","The code is invalid or has expired.");case"over_email_send_rate_limit":case"over_request_rate_limit":case"rate_limited":case"http_429":return t("auth.rate_limited","Too many requests. Please try again later.");case"network_error":return t("auth.network_error","Network error. Please check your connection and try again.");case"upstream":case"upstream_error":case"http_502":case"http_503":case"http_504":return t("auth.service_unavailable","Service is temporarily unavailable. Please try again.");default:return s}}function Se({block:r,ctx:e}){const t=e.auth,s=e.authSession,i=r.allow_signup!==!1,o=r.allow_password_reset!==!1,a=r.hide_when_authenticated!==!1;if(!t)return typeof console<"u"&&console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"),null;const l=s&&!s.user.is_anonymous?s:null;return l&&a?null:l?n.jsx(Xe,{email:l.user.email??"",onSignOut:()=>t.signOut().catch(()=>{})}):n.jsx(Je,{block:r,allowSignup:i,allowReset:o,ctx:e})}function Xe({email:r,onSignOut:e}){const{t}=j();return n.jsxs("div",{class:"flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3",children:[n.jsxs("div",{class:"flex flex-col",children:[n.jsx("span",{class:"text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:t("auth.signed_in","Signed in")}),n.jsx("span",{class:"text-sm font-medium text-gray-900",children:r})]}),n.jsx("button",{type:"button",onClick:e,class:"rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-600 transition-colors hover:bg-white hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:t("auth.sign_out","Sign out")})]})}function Je({block:r,allowSignup:e,allowReset:t,ctx:s}){const{t:i}=j(),o=s.auth,a=r.providers??[],l=s.initialAuthMode==="signup"&&e?"signup":"signin",[c,h]=d.useState(l),[u,g]=d.useState(""),[_,p]=d.useState(""),[k,x]=d.useState(""),[I,y]=d.useState(""),[m,S]=d.useState(null),C=d.useRef(!1),[M,P]=d.useState(null),[B,O]=d.useState(null),[q,A]=d.useState(!1),[E,R]=d.useState(null);d.useEffect(()=>{if(typeof o.getLastLogin!="function")return;let f=!1;return o.getLastLogin().then(w=>{f||!w||(R(w),w.email&&g(L=>L===""?w.email:L))},()=>{}),()=>{f=!0}},[o]);const T=f=>{h(f),P(null),O(null),A(!1)},Z=async f=>{if(f.preventDefault(),!(C.current||m)){C.current=!0;try{if(P(null),O(null),c==="signup"&&!q){if(!u.trim())return;A(!0);return}if(c==="signup"&&_!==k){P(i("auth.passwords_mismatch","Passwords don't match"));return}S("email");try{c==="signin"?await o.signInWithEmail({email:u,password:_}):c==="signup"?(await o.signUp({email:u,password:_})).kind==="confirmation_required"&&(p(""),h("signup_verify"),O(i("auth.check_email_message","Check your email for a confirmation code."))):c==="forgot"?(await o.requestPasswordReset({email:u}),h("reset_sent")):c==="signup_verify"?await o.verifyOtp({email:u,token:I,type:"email"}):c==="reset_verify"&&(await o.verifyOtp({email:u,token:I,type:_?"recovery":"email"}),_&&await o.updatePassword({password:_}))}catch(w){P(le(w,c==="signup"?"signup":c==="signup_verify"||c==="reset_verify"?"otp":c==="forgot"?"reset":"signin",i))}finally{S(null)}}finally{C.current=!1}}},V=async f=>{if(!(C.current||m)){C.current=!0,S(f),P(null),O(null);try{await o.signInWithOAuth({provider:f,onPopupOpened:()=>S(null)})}catch(w){if(w instanceof v.PaywallError&&(w.code==="oauth_cancelled"||w.code==="oauth_timeout"))return;P(le(w,"signin",i))}finally{C.current=!1,S(null)}}},Y=a.length>0&&(c==="signin"||c==="signup"),K=c==="signin"||c==="signup"||c==="forgot",b=c==="signin"||c==="signup"&&q;return c==="reset_sent"?n.jsx(ut,{email:u,onBack:()=>T("signin"),t:i}):n.jsxs("div",{class:"flex flex-col gap-5",children:[n.jsx(Qe,{mode:c,customHeading:r.heading,customSubheading:r.subheading}),Y?n.jsxs("div",{class:"flex flex-col gap-2.5",children:[a.map(f=>n.jsxs("div",{class:"relative",children:[n.jsxs("button",{type:"button",onClick:()=>V(f),disabled:m!==null,class:"flex h-12 w-full items-center justify-center gap-2.5 rounded-full border-1 border-gray-200 bg-white px-5 text-base font-medium text-gray-900 transition-all hover:border-gray-300 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:[m===f?n.jsx("span",{class:"inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700"}):n.jsx(ct,{provider:f}),n.jsx("span",{children:Ke(f,i)})]}),E?.method===f?n.jsx(ot,{email:E.email}):null]},f)),n.jsx(lt,{})]}):null,n.jsxs("form",{onSubmit:Z,class:"flex flex-col gap-3",children:[K&&n.jsx(ce,{type:"email",placeholder:i("auth.email","Email address"),value:u,onInput:g,autocomplete:"email",required:!0}),b&&n.jsx(Q,{placeholder:i("auth.password","Password"),value:_,onInput:p,autocomplete:c==="signin"?"current-password":"new-password",required:!0}),c==="signup"&&q&&n.jsx(Q,{placeholder:i("auth.repeat_password","Repeat password"),value:k,onInput:x,autocomplete:"new-password",required:!0}),(c==="signup_verify"||c==="reset_verify")&&n.jsx(ce,{type:"text",placeholder:i("auth.confirmation_code","Confirmation code"),value:I,onInput:y,autocomplete:"one-time-code",inputMode:"numeric",required:!0}),c==="reset_verify"&&n.jsx(Q,{placeholder:i("auth.new_password_optional","New password (optional — only for password reset)"),value:_,onInput:p,autocomplete:"new-password"}),c==="signin"&&t&&n.jsx("div",{class:"flex justify-end text-sm",children:n.jsx(W,{onClick:()=>T("forgot"),children:i("auth.forgot_password","Forgot password?")})}),M&&n.jsx("p",{class:"text-sm text-red-600",children:M}),B&&n.jsx("p",{class:"text-sm text-gray-500",children:B}),n.jsx(nt,{busy:m==="email",label:tt(c,q,r.submit_label??r.heading,i)})]}),n.jsx(rt,{mode:c,allowSignup:e,onSwitch:T})]})}function Qe({mode:r,customHeading:e,customSubheading:t}){const{t:s}=j(),i=et(r,s),o=r==="signin"||r==="signup",a=o&&e?e:i.title,l=o&&t!==void 0?t||null:i.subtitle;return n.jsxs("div",{class:"flex flex-col gap-2",children:[n.jsx("h2",{class:"text-3xl font-bold tracking-tight text-gray-900",children:a}),l?n.jsx("p",{class:"text-base leading-relaxed text-gray-600",children:l}):null]})}function et(r,e){switch(r){case"signin":return{title:e("auth.welcome","Welcome back!"),subtitle:e("auth.default_subtitle","Sign in to access all features and sync your data.")};case"signup":return{title:e("auth.welcome_signup","Welcome!"),subtitle:e("auth.default_subtitle","Sign in to access all features and sync your data.")};case"forgot":return{title:e("auth.forgot_password_title","Forgot password?"),subtitle:e("auth.forgot_subtitle","Enter your email and we'll send you a password reset link.")};case"reset_sent":return{title:e("auth.check_email_title","Check your email"),subtitle:null};case"reset_verify":return{title:e("auth.reset_password_title","Reset password"),subtitle:e("auth.reset_password_subtitle","Enter the code from your email and a new password.")};case"signup_verify":return{title:e("auth.confirm_email_title","Confirm your email"),subtitle:e("auth.confirm_email_subtitle","Enter the code we sent to your email to finish creating your account.")}}}function tt(r,e,t,s){if(r==="signin"&&t)return t;switch(r){case"signin":return s("auth.log_in","Sign In");case"signup":return e?s("auth.create_account","Create Account"):s("auth.sign_up","Sign Up");case"forgot":return s("auth.send_reset","Send Reset Email");case"signup_verify":case"reset_verify":return s("auth.verify","Verify");default:return s("cta.continue","Continue")}}function rt({mode:r,allowSignup:e,onSwitch:t}){const{t:s}=j();return r==="signin"&&e?n.jsxs("p",{class:"text-center text-sm text-gray-600",children:[s("auth.no_account","Don't have an account?")," ",n.jsx(W,{onClick:()=>t("signup"),children:s("auth.sign_up_link","Sign Up")})]}):r==="signup"||r==="signup_verify"?n.jsxs("p",{class:"text-center text-sm text-gray-600",children:[s("auth.have_account","Already have an account?")," ",n.jsx(W,{onClick:()=>t("signin"),children:s("auth.log_in_link","Log In")})]}):r==="forgot"||r==="reset_sent"||r==="reset_verify"?n.jsxs("p",{class:"text-center text-sm text-gray-600",children:[s("auth.no_account","Don't have an account?")," ",n.jsx(W,{onClick:()=>t("signup"),children:s("auth.sign_up_link","Sign Up")})]}):null}function W({onClick:r,children:e}){return n.jsx("button",{type:"button",onClick:r,class:"font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",style:{color:"var(--pw-accent)"},children:e})}function nt({busy:r,label:e}){return n.jsx("button",{type:"submit",disabled:r,class:"pw-cta-shimmer relative mt-1 flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:r?n.jsx("span",{class:"relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}):n.jsx("span",{class:"relative z-10",children:e})})}function ce({type:r,placeholder:e,value:t,onInput:s,autocomplete:i,inputMode:o,required:a}){return n.jsx("input",{type:r,value:t,placeholder:e,onInput:l=>s(l.target.value),autocomplete:i,inputMode:o,required:a,class:"h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"})}function Q({placeholder:r,value:e,onInput:t,autocomplete:s,required:i}){const{t:o}=j(),[a,l]=d.useState(!1),c=d.useRef(null);d.useEffect(()=>{const g=c.current;g&&g.value!==e&&(g.value=e)},[a,e]);const h=o("auth.show_password","Show password"),u=o("auth.hide_password","Hide password");return n.jsxs("div",{class:"relative",children:[n.jsx("input",{ref:c,type:a?"text":"password",value:e,placeholder:r,onInput:g=>t(g.target.value),autocomplete:s,required:i,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)]"}),n.jsx("button",{type:"button",onClick:()=>l(g=>!g),"aria-label":a?u:h,tabIndex:-1,class:"absolute right-4 top-1/2 -translate-y-1/2 flex h-6 w-6 items-center justify-center rounded text-gray-500 transition-colors hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:a?n.jsx(it,{}):n.jsx(st,{})})]})}function st(){return n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M1.667 10S4.583 4.167 10 4.167 18.333 10 18.333 10 15.417 15.833 10 15.833 1.667 10 1.667 10Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("circle",{cx:"10",cy:"10",r:"2.5",stroke:"currentColor","stroke-width":"1.5"})]})}function it(){return n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M8.236 4.293A6.96 6.96 0 0 1 10 4.167C15.417 4.167 18.333 10 18.333 10a13.5 13.5 0 0 1-1.92 2.755M11.768 11.768A2.5 2.5 0 0 1 8.233 8.233",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M14.953 14.953A8.84 8.84 0 0 1 10 15.833C4.583 15.833 1.667 10 1.667 10a13.5 13.5 0 0 1 3.38-3.953M1.667 1.667l16.666 16.666",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})}function ot({email:r}){const{t:e}=j(),t=r?e("auth.last_used","Last · {email}",{email:at(r)}):e("auth.last_used_no_email","Last");return n.jsx("span",{class:"pointer-events-none absolute -top-2 right-3 max-w-[75%] truncate rounded-full bg-gray-900 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-white shadow-sm",children:t})}function at(r){const[e,t]=r.split("@");return t?`${e.slice(0,3)}*****@${t}`:r}function lt(){const{t:r}=j();return n.jsxs("div",{class:"flex items-center gap-3 py-1 text-sm text-gray-400",children:[n.jsx("div",{class:"h-px flex-1 bg-gray-200"}),n.jsx("span",{children:r("auth.or","or")}),n.jsx("div",{class:"h-px flex-1 bg-gray-200"})]})}function ct({provider:r}){return r==="google"?n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 18 18","aria-hidden":"true",children:[n.jsx("path",{fill:"#4285F4",d:"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.49h4.84a4.14 4.14 0 0 1-1.79 2.71v2.26h2.9c1.7-1.56 2.69-3.87 2.69-6.62Z"}),n.jsx("path",{fill:"#34A853",d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.9-2.26c-.8.54-1.83.86-3.06.86-2.36 0-4.36-1.59-5.07-3.74H.92v2.33A9 9 0 0 0 9 18Z"}),n.jsx("path",{fill:"#FBBC05",d:"M3.93 10.68a5.4 5.4 0 0 1 0-3.36V4.99H.92a9 9 0 0 0 0 8.02l3-2.33Z"}),n.jsx("path",{fill:"#EA4335",d:"M9 3.58c1.32 0 2.5.45 3.44 1.34l2.58-2.58A9 9 0 0 0 .92 4.99l3.01 2.33C4.64 5.17 6.64 3.58 9 3.58Z"})]}):r==="apple"?n.jsx("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}):r==="github"?n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M8 0C3.6 0 0 3.6 0 8a8 8 0 0 0 5.5 7.6c.4.1.5-.2.5-.4v-1.5c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.2 1.9.9 2.4.7 0-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8a7.6 7.6 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.5.8 1.2.8 2.1 0 3.1-1.9 3.7-3.6 3.9.3.3.6.8.6 1.6V15c0 .2.1.5.6.4A8 8 0 0 0 16 8c0-4.4-3.6-8-8-8Z"})}):n.jsx("svg",{width:"18",height:"20",viewBox:"0 0 14 16",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M14 2.7C14 1.2 12.8 0 11.3 0H2.7C1.2 0 0 1.2 0 2.7v10.6C0 14.8 1.2 16 2.7 16h4V9.8H4.7v-2H6.7V6.4c0-2 1.2-3.1 3-3.1.9 0 1.7.1 2 .2V5h-1.4c-.8 0-1 .4-1 1v1.5h2.4l-.3 2H9.3V16h2c1.5 0 2.7-1.2 2.7-2.7V2.7Z"})})}function ut({email:r,onBack:e,t}){return n.jsxs("div",{class:"flex flex-col items-center gap-4 py-2 text-center",children:[n.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full",style:{background:"linear-gradient(135deg, #4ade80, #16a34a)",color:"#fff",boxShadow:"0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"},"aria-hidden":"true",children:n.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",children:n.jsx("path",{d:"M5 13l4 4L19 7",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})})}),n.jsx("h2",{class:"mt-1 text-3xl font-bold tracking-tight text-gray-900",children:t("auth.check_email_title","Check your email")}),n.jsx("p",{class:"text-base leading-relaxed text-gray-600",children:t("auth.reset_sent_subtitle","We sent a password reset link. Follow the instructions in the email to reset your password.")}),r?n.jsx("p",{class:"break-all text-base font-semibold text-gray-900",children:r}):null,n.jsx("p",{class:"text-sm text-gray-500",children:t("auth.reset_link_valid","The link is valid for 1 hour.")}),n.jsx("button",{type:"button",onClick:e,class:"pw-cta-shimmer relative mt-2 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] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:n.jsx("span",{class:"relative z-10",children:t("auth.back_to_login","Back to Login")})})]})}function dt({block:r,bootstrap:e,auth:t,authSession:s,onBack:i,showBack:o=!0,intent:a="preauth",initialMode:l}){const{t:c}=j(),h={bootstrap:e,selectedPriceId:null,setSelectedPriceId:()=>{},onAction:()=>{},auth:t,authSession:s,initialAuthMode:l},u=a==="restore"?{...r,heading:c("auth.restore_purchases_heading","Restore Purchases"),subheading:c("auth.restore_purchases_subheading","Please sign in to restore your purchases.")}:a==="preauth"?{...r,heading:c("auth.login_continue_purchase","Log in to continue your purchase"),subheading:c("auth.link_purchase_subheading","We'll link the purchase to your account to keep access."),submit_label:c("auth.log_in","Sign In")}:r;return n.jsxs("div",{class:"relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8",children:[o?n.jsx(ht,{onClick:i,ariaLabel:c("nav.back_aria","Back")}):null,n.jsx(Se,{block:u,ctx:h})]})}function ht({onClick:r,ariaLabel:e}){return n.jsx("button",{type:"button",onClick:r,"aria-label":e,class:"absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M5 8h8a4 4 0 0 1 0 8H9",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M8 4 4 8l4 4",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"})]})})}const pt=r=>`pw-offer-${r}-start`;function ee(r){const e=r-Date.now();return e<=0?{days:0,hours:0,minutes:0,seconds:0,expired:!0}:{days:Math.floor(e/(1e3*60*60*24)),hours:Math.floor(e%(1e3*60*60*24)/(1e3*60*60)),minutes:Math.floor(e%(1e3*60*60)/(1e3*60)),seconds:Math.floor(e%(1e3*60)/1e3),expired:!1}}function ft(r){if(r.expires_at){const e=Date.parse(r.expires_at);return Number.isFinite(e)?e:null}if(r.duration_minutes&&r.duration_minutes>0){if(typeof window>"u")return null;try{const e=pt(r.id);let t=window.localStorage.getItem(e);return t||(t=new Date().toISOString(),window.localStorage.setItem(e,t)),Date.parse(t)+r.duration_minutes*6e4}catch{return null}}return null}function Ce(r,e){if(!r||r.length===0)return null;if(e){const t=r.find(s=>s.id===e);if(t)return t}return r.find(t=>t.expires_at||t.duration_minutes)??null}function Ie(r){const e=r?ft(r):null,[t,s]=d.useState(()=>e!==null?ee(e):null),i=d.useRef(e);return i.current=e,d.useEffect(()=>{if(e===null){s(null);return}s(ee(e));const o=setInterval(()=>{const a=ee(i.current??0);s(a),a.expired&&clearInterval(o)},1e3);return()=>clearInterval(o)},[e,r?.duration_minutes,r?.id]),t}function gt({block:r,ctx:e}){const{t}=j(),s=Ce(e.bootstrap.offers,r.offer_id),i=Ie(s);if(!s||i===null||i.expired&&!r.force)return null;const o=r.title??s.label??t("offer.limited_time","Limited-time offer"),a=s.discount_percent?`${o} ${s.discount_percent}%`:o;return n.jsxs("div",{class:"flex flex-wrap items-center justify-center gap-2 rounded-2xl px-4 py-3 text-[15px] font-semibold leading-tight text-white",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",textShadow:"0 0 2px rgba(0, 0, 0, 0.25)"},role:"status",children:[n.jsx(Ee,{}),n.jsx("span",{children:a}),n.jsx(Pe,{value:i,t})]})}function Pe({value:r,t:e}){return n.jsxs("div",{class:"flex items-center gap-1 font-mono text-sm",children:[r.days>0?n.jsxs(n.Fragment,{children:[n.jsx($,{children:String(r.days)}),n.jsx("span",{class:"text-xs",children:e("countdown.d","d")})]}):null,n.jsx($,{children:String(r.hours).padStart(2,"0")}),n.jsx("span",{class:"text-xs",children:e("countdown.h","h")}),n.jsx($,{children:String(r.minutes).padStart(2,"0")}),n.jsx("span",{class:"text-xs",children:e("countdown.m","m")}),n.jsx($,{children:String(r.seconds).padStart(2,"0")}),n.jsx("span",{class:"text-xs",children:e("countdown.s","s")})]})}function $({children:r}){return n.jsx("span",{class:"rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold",children:r})}function xt({offer:r}){const{t:e}=j(),t=Ie(r);if(t===null||t.expired)return null;const s=r.label??e("offer.limited_time","Limited-time offer"),i=r.discount_percent?`${s} ${r.discount_percent}%`:s;return n.jsxs("div",{class:"-mb-2 flex flex-wrap items-center justify-center gap-2 rounded-t-xl px-4 pb-5 pt-3 text-[15px] font-semibold leading-tight text-white",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",textShadow:"0 0 2px rgba(0, 0, 0, 0.25)"},role:"status",children:[n.jsx(Ee,{}),n.jsx("span",{children:i}),n.jsx(Pe,{value:t,t:e})]})}function Ee(){return n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:n.jsx("path",{fill:"currentColor",d:"m9.44 5.359-2.394-.895.61-3.036c.062-.31-.345-.531-.57-.291L2.434 6.105a.336.336 0 0 0 .126.537l2.395.894-.61 3.037c-.062.31.345.53.57.29l4.653-4.968a.336.336 0 0 0-.126-.536Z"})})}const ue=3,de=200,he=5e3,te=5,mt=10*1024*1024,pe=["image/jpeg","image/png","image/webp"],yt=/.+@.+\..+/;function bt({client:r,authSession:e,origin:t,onBack:s}){const{t:i}=j(),o=e?.user.email??"",a=o||null,[l,c]=d.useState(o),[h,u]=d.useState(""),[g,_]=d.useState(""),[p,k]=d.useState([]),[x,I]=d.useState(!1),[y,m]=d.useState(null),[S,C]=d.useState({}),M=()=>{const A={},E=(a??l).trim(),R=h.trim(),T=g.trim();return E?yt.test(E.toLowerCase())||(A.email=i("support.invalid_email","Invalid email")):A.email=i("support.required","Required"),(R.length<ue||R.length>de)&&(A.subject=i("support.subject_length","{min}–{max} characters",{min:ue,max:de})),(T.length<1||T.length>he)&&(A.message=i("support.message_length","{min}–{max} characters",{min:1,max:he})),C(A),Object.keys(A).length===0},P=async A=>{if(A.preventDefault(),!x&&M()){I(!0),C(E=>({...E,submit:void 0}));try{const E=(a??l).trim();await r.createSupportTicket({subject:h.trim(),content:g.trim(),email:E||void 0,files:p.length>0?p:void 0}),m(E)}catch(E){const R=E instanceof v.PaywallError&&E.message||"Failed to send. Please try again.";C(T=>({...T,submit:R}))}finally{I(!1)}}},B=()=>{u(""),_(""),k([]),C({}),m(null)},O="flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8",q={boxShadow:"0 -4px 12px -4px rgba(15,23,42,0.06)"};return y?n.jsxs("div",{class:"relative flex-1 min-h-0 flex flex-col",children:[n.jsxs("div",{class:"flex-1 min-h-0 overflow-y-auto flex flex-col items-center gap-4 px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8 text-center",children:[n.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 85%, white), var(--pw-accent))",color:"#fff",boxShadow:"0 0 0 8px color-mix(in srgb, var(--pw-accent) 12%, transparent), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 45%, transparent)"},"aria-hidden":"true",children:n.jsx("svg",{viewBox:"0 0 24 24",class:"h-7 w-7",children:n.jsx("path",{fill:"currentColor",d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.93 8.2-6.85 9.29a1.01 1.01 0 0 1-1.43.19L5.76 13.77a1 1 0 1 1 1.25-1.56l4.08 3.26 6.23-8.45a1 1 0 1 1 1.61 1.18Z"})})}),n.jsx("div",{class:"text-lg font-semibold tracking-tight text-gray-900",children:i("support.success_heading","Request submitted")}),n.jsxs("div",{class:"max-w-[320px] text-sm leading-relaxed text-gray-500",children:[i("support.success_message_prefix","We've received your message and will respond to")," ",n.jsx("b",{class:"text-gray-700",children:y}),"."]})]}),n.jsx("div",{class:O,style:q,children:n.jsxs("div",{class:"flex items-center justify-center gap-3",children:[n.jsx("button",{type:"button",onClick:s,class:"rounded-xl px-3 py-2 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:t==="standalone"?i("support.done_button","Done"):i("nav.back_aria","Back")}),n.jsx("button",{type:"button",onClick:B,class:"flex h-10 items-center justify-center rounded-xl px-4 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:i("support.send_another","Send another request")})]})})]}):n.jsxs("form",{onSubmit:P,class:"relative flex-1 min-h-0 flex flex-col",children:[n.jsx(wt,{onClick:s,ariaLabel:i("nav.back_aria","Back")}),n.jsx("div",{class:"flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8",children:n.jsxs("div",{class:"flex flex-col gap-5",children:[n.jsxs("div",{class:"flex flex-col gap-2 pr-10",children:[n.jsx("h2",{class:"text-3xl font-bold tracking-tight text-gray-900",children:i("support.heading","Support")}),n.jsx("p",{class:"text-base leading-relaxed text-gray-600",children:i("support.instruction","Please fill out the form below to submit your support request.")})]}),n.jsxs("div",{class:"flex flex-col gap-3",children:[a?n.jsxs("div",{class:"rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600",children:[i("support.sending_as","Sending as")," ",n.jsx("b",{class:"font-medium text-gray-900",children:a})]}):n.jsx(fe,{type:"email",placeholder:i("support.email_placeholder","Enter your email *"),value:l,onInput:c,error:S.email,autocomplete:"email",required:!0}),n.jsx(fe,{type:"text",placeholder:i("support.subject_placeholder","Enter your subject *"),value:h,onInput:u,error:S.subject,required:!0}),n.jsx(kt,{placeholder:i("support.message_placeholder","Enter your message *"),value:g,onInput:_,error:S.message,required:!0}),n.jsx(vt,{files:p,onChange:k,disabled:x})]})]})}),n.jsxs("div",{class:O,style:q,children:[S.submit&&n.jsx("p",{class:"text-sm text-red-600",children:S.submit}),n.jsxs("div",{class:"flex items-center justify-end gap-3",children:[n.jsx("button",{type:"button",onClick:s,disabled:x,class:"rounded-full px-4 py-2 text-base font-medium text-gray-700 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:t==="standalone"?i("support.close_button","Close"):i("nav.back_aria","Back")}),n.jsx("button",{type:"submit",disabled:x,class:"pw-cta-shimmer relative flex h-12 items-center justify-center overflow-hidden rounded-full px-8 text-base font-semibold text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:x?n.jsx("span",{class:"relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}):n.jsx("span",{class:"relative z-10",children:i("support.send_button","Send")})})]})]})]})}function wt({onClick:r,ariaLabel:e}){return n.jsx("button",{type:"button",onClick:r,"aria-label":e,class:"absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M5 8h8a4 4 0 0 1 0 8H9",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M8 4 4 8l4 4",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"})]})})}function fe({type:r,placeholder:e,value:t,onInput:s,error:i,autocomplete:o,required:a}){return n.jsxs("div",{children:[n.jsx("input",{type:r,value:t,placeholder:e,onInput:l=>s(l.target.value),autocomplete:o,required:a,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)]"}`}),i&&n.jsx("span",{class:"mt-1 ml-2 block text-sm text-red-600",children:i})]})}function kt({placeholder:r,value:e,onInput:t,error:s,required:i}){return n.jsxs("div",{children:[n.jsx("textarea",{value:e,placeholder:r,onInput:o=>t(o.target.value),required:i,rows:5,class:`min-h-[120px] w-full rounded-2xl bg-gray-100 px-5 py-3.5 text-base leading-relaxed text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${s?"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)]"}`}),s&&n.jsx("span",{class:"mt-1 ml-2 block text-sm text-red-600",children:s})]})}function vt({files:r,onChange:e,disabled:t}){const{t:s}=j(),i=d.useRef(null),[o,a]=d.useState(!1),[l,c]=d.useState(null),h=u=>{if(!u||t)return;c(null);const g=Array.from(u);if(r.length+g.length>te){c(s("support.too_many_files","Up to {max} files",{max:te}));return}const _=g.filter(p=>pe.includes(p.type)&&p.size<=mt);if(_.length!==g.length){c(s("support.invalid_file","Only JPEG/PNG/WebP, ≤ 10MB each"));return}e([...r,..._])};return n.jsxs("div",{children:[n.jsx("span",{class:"text-xs font-medium text-gray-700",children:s("support.attachments_label","Attachments (optional)")}),n.jsxs("div",{role:"button",tabIndex:0,"aria-label":s("support.attachments_aria","Attachments upload"),onClick:()=>!t&&i.current?.click(),onDragOver:u=>{u.preventDefault(),t||a(!0)},onDragLeave:()=>a(!1),onDrop:u=>{u.preventDefault(),a(!1),h(u.dataTransfer?.files??null)},class:`mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${o?"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":""}`,children:[n.jsx("div",{class:"text-xs text-gray-500",children:s("support.dropzone_text","Drop images here or click to select")}),n.jsx("div",{class:"mt-0.5 text-[11px] text-gray-400",children:s("support.file_requirements","JPEG/PNG/WebP, up to {max} files, ≤ 10MB each",{max:te})})]}),n.jsx("input",{ref:i,type:"file",multiple:!0,accept:pe.join(","),class:"hidden",onChange:u=>{h(u.target.files),u.currentTarget.value=""}}),l&&n.jsx("p",{class:"mt-1 text-xs text-red-600",children:l}),r.length>0&&n.jsx("ul",{class:"mt-2 flex flex-col gap-1",children:r.map((u,g)=>n.jsxs("li",{class:"flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",children:[n.jsx("span",{class:"truncate text-gray-700",children:u.name}),n.jsx("button",{type:"button",onClick:()=>{const _=[...r];_.splice(g,1),e(_)},disabled:t,class:"text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60","aria-label":s("support.remove_file_aria","Remove {filename}",{filename:u.name}),children:"✕"})]},`${u.name}-${u.size}-${g}`))})]})}const _t={day:"cta.get_plan_daily",week:"cta.get_plan_weekly",month:"cta.get_plan_monthly",year:"cta.get_plan_yearly"},jt={day:"Get Daily Plan",week:"Get Weekly Plan",month:"Get Monthly Plan",year:"Get Yearly Plan"};function St(r,e,t,s){if(e==="close")return s("cta.close","Close");if(!r)return s("cta.continue","Continue");if(!t&&r.trial_days&&r.interval&&r.interval!=="lifetime")return s("cta.start_trial","Start {days}-Day Free Trial",{days:r.trial_days});if(!r.interval||r.interval==="lifetime")return s("cta.get_lifetime_access","Get Lifetime Access");const i=_t[r.interval];return i?s(i,jt[r.interval]):s("cta.get_plan_generic","Get {interval} Plan",{interval:Ct(r.interval)})}function Ct(r){return r.length?r[0].toUpperCase()+r.slice(1):r}function It({block:r,ctx:e}){const{t}=j(),[s,i]=d.useState(!1),o=r.priceId??e.selectedPriceId,a=s||r.action==="checkout"&&!o,l=o?e.bootstrap.prices.find(g=>g.id===o)??null:null,c=e.bootstrap.user?.had_previous_trial??!1,h=r.label??St(l,r.action,c,t),u=async()=>{if(!a){i(!0);try{await e.onAction(r.action,{priceId:o})}finally{i(!1)}}};return n.jsxs("button",{type:"button",disabled:a,onClick:u,class:"pw-cta-shimmer relative flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:[n.jsx("span",{class:"absolute inset-0 opacity-40",style:{background:"radial-gradient(circle at 50% 0%, color-mix(in srgb, white 40%, transparent) 0%, transparent 70%)"},"aria-hidden":"true"}),s?n.jsx("span",{class:"relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}):n.jsx("span",{class:"relative z-10",children:h})]})}function Pt({ctx:r}){const{t:e}=j(),t=r.authSession,s=r.auth,[i,o]=d.useState(!1),a=()=>r.onAction("support");if(t&&!t.user.is_anonymous){const l=async()=>{if(!(!s||i)){o(!0);try{await s.signOut()}catch{}finally{o(!1)}}};return n.jsxs("div",{class:"-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500",children:[n.jsxs("span",{children:[e("session.signed_in_as_prefix","Signed in as")," ",n.jsx("b",{class:"font-medium text-gray-700",children:t.user.email})]}),n.jsxs("div",{class:"flex items-center justify-center gap-3",children:[n.jsx(H,{onClick:l,disabled:!s||i,children:i?e("session.signing_out","Signing out…"):e("session.sign_out","Sign Out")}),n.jsx(ge,{}),n.jsx(H,{onClick:a,children:e("session.contact_support","Contact Support")})]})]})}return n.jsxs("div",{class:"-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]",children:[n.jsx(H,{onClick:()=>r.onAction("restore"),children:e("session.restore_purchases","Restore purchases")}),n.jsx(ge,{}),n.jsx(H,{onClick:a,children:e("session.contact_support","Contact Support")})]})}function H({onClick:r,disabled:e,children:t}){return n.jsx("button",{type:"button",onClick:r,disabled:e,class:"font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",style:{color:"var(--pw-accent)"},children:t})}function ge(){return n.jsx("span",{class:"h-1 w-1 rounded-full bg-gray-300","aria-hidden":"true"})}function Et({block:r}){return r.items.length?n.jsx("ul",{class:"flex flex-col gap-2.5",role:"list",children:r.items.map(e=>n.jsxs("li",{class:"flex items-start gap-3 text-sm text-gray-700",children:[n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",class:"mt-0.5 flex-shrink-0 text-emerald-500","aria-hidden":"true",children:n.jsx("path",{d:"M4 10.5l3.5 3.5 8.5-8.5",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})}),n.jsxs("div",{class:"flex flex-col gap-0.5",children:[n.jsx("span",{class:"font-medium leading-snug text-gray-900",children:e.name}),e.desc?n.jsx("span",{class:"text-xs leading-relaxed text-gray-400",children:e.desc}):null]})]},e.id))}):null}function At({block:r}){const{t:e}=j(),t=r.title??e("pricing.money_back","30-day money-back guarantee"),s=r.subtitle,i=(r.icon??"dollar_shield")!=="none",o=Lt(t);return n.jsxs("div",{class:"flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100",children:[n.jsxs("div",{class:"inline-flex items-center gap-2 text-[12px] text-gray-700",children:[i?n.jsx(Mt,{}):null,o?n.jsxs("span",{children:[n.jsx("b",{class:"font-bold text-gray-900",children:o.bold})," ",n.jsx("span",{class:"font-medium",children:o.rest})]}):n.jsx("span",{class:"font-medium",children:t})]}),s?n.jsx("span",{class:"text-center text-xs leading-relaxed text-gray-500",children:s}):null]})}function Lt(r){const e=r.match(/^(\d+[-\s]?days?)\s+(.+)$/i);return e?{bold:e[1],rest:e[2]}:null}function Mt(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"16",height:"16",class:"flex-shrink-0 text-emerald-500","aria-hidden":"true",children:[n.jsx("path",{d:"M12 2 4 5v6c0 5.25 3.5 9.5 8 11 4.5-1.5 8-5.75 8-11V5l-8-3Z",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"}),n.jsx("path",{d:"m9 12 2 2 4-4",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}const Ae=24,Tt=16,Bt=2;function Ot(r,e){const t=e*Bt;let s=Ae;for(r.style.fontSize=`${s}px`;r.scrollHeight>t&&s>Tt;)s-=1,r.style.fontSize=`${s}px`}function qt({block:r,ctx:e}){const t=r.level??1,s=`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",o=d.useRef(null),a=t===1&&!!e.bootstrap.settings.title_auto_fit;return d.useEffect(()=>{if(!a||!o.current)return;const l=getComputedStyle(o.current),c=parseFloat(l.lineHeight)||Ae*1.5;Ot(o.current,c)},[a,r.text]),n.jsx(s,{ref:o,class:i,children:r.text})}function Rt(r){const e=r.local??{currency:r.currency,amount:r.amount};if(r.interval==="year"){const t=(r.interval_count??1)*12;return{amount:e.amount/t,currency:e.currency}}return{amount:e.amount,currency:e.currency}}function re(r,e){const t=r%1!==0?2:0;try{const s=new Intl.NumberFormat(void 0,{style:"currency",currency:e,currencyDisplay:"narrowSymbol",maximumFractionDigits:t,minimumFractionDigits:t}).formatToParts(r);let i="",o="";for(const a of s)a.type==="currency"?i=a.value:a.type!=="literal"&&(o+=a.value);return{currency:i||e,amount:o.trim()}}catch{return{currency:e,amount:String(r)}}}function se(r,e){const{amount:t,currency:s}=Rt(r);if(!e){const{currency:l,amount:c}=re(t,s);return{currency:l,amount:c,originalAmount:null}}const i=t*(1-e/100),o=re(i,s),a=re(t,s);return{currency:o.currency,amount:o.amount,originalAmount:`${a.currency}${a.amount}`}}function Le(r,e){if(r.label)return r.label.toUpperCase();if(!r.interval||r.interval==="lifetime")return e("pricing.plan_label.lifetime","LIFETIME");const s={day:{key:"pricing.plan_label.daily",fallback:"DAILY PLAN"},week:{key:"pricing.plan_label.weekly",fallback:"WEEKLY PLAN"},month:{key:"pricing.plan_label.monthly",fallback:"MONTHLY PLAN"},year:{key:"pricing.plan_label.yearly",fallback:"YEARLY PLAN"}}[r.interval];return s?e(s.key,s.fallback):`${r.interval.toUpperCase()} PLAN`}function ie(r,e){if(!r.interval||r.interval==="lifetime")return e("pricing.interval.lifetime_short","lifetime");if(r.interval==="year")return e("pricing.interval.month","month");const t=r.interval_count??1;return t===1?e(`pricing.interval.${r.interval}`,r.interval):`${t} ${r.interval}s`}function Ut({block:r,ctx:e}){const{t}=j(),s=r.priceIds&&r.priceIds.length>0?new Set(r.priceIds):null,i=e.bootstrap.prices.filter(a=>!s||s.has(a.id));if(i.length===0)return n.jsx("p",{class:"text-sm text-gray-500",children:t("pricing.no_prices","No prices available.")});const o=r.popular_label??t("pricing.most_popular","Most popular");if(r.view==="compact")return n.jsx("div",{class:"flex w-full flex-col rounded-xl border border-gray-200 bg-gray-50",role:"radiogroup","aria-label":t("pricing.plans_aria","Plans"),children:i.map((a,l)=>n.jsx(zt,{price:a,isLast:l===i.length-1,isPopular:r.popular_price_id===a.id,popularLabel:o,offer:F(e.bootstrap.offers,a.id,{readStart:D}),selected:e.selectedPriceId===a.id,onSelect:()=>{e.setSelectedPriceId(a.id),e.onAction("price_selected",{priceId:a.id,price:a})},t},a.id))});if(r.view==="horizontal"){const a=Math.min(i.length,3),l=i.some(c=>(F(e.bootstrap.offers,c.id,{readStart:D})?.discount_percent??0)>0);return n.jsx("div",{class:"grid items-stretch gap-2",style:{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`},role:"radiogroup","aria-label":t("pricing.plans_aria","Plans"),children:i.map(c=>n.jsx(Nt,{price:c,isPopular:r.popular_price_id===c.id,popularLabel:o,offer:F(e.bootstrap.offers,c.id,{readStart:D}),reserveStrikeRow:l,selected:e.selectedPriceId===c.id,onSelect:()=>{e.setSelectedPriceId(c.id),e.onAction("price_selected",{priceId:c.id,price:c})},t},c.id))})}return n.jsx("div",{class:"flex flex-col gap-2",role:"radiogroup","aria-label":t("pricing.plans_aria","Plans"),children:i.map(a=>{const l=e.selectedPriceId===a.id,c=r.popular_price_id===a.id,u=F(e.bootstrap.offers,a.id,{readStart:D})?.discount_percent??null,{currency:g,amount:_,originalAmount:p}=se(a,u);return n.jsxs("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>{e.setSelectedPriceId(a.id),e.onAction("price_selected",{priceId:a.id,price:a})},class:["group relative inline-flex w-full mx-auto items-center justify-between flex-row-reverse gap-4 rounded-2xl border-2 px-4 py-3.5 text-left transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",l?"border-[var(--pw-accent)] bg-transparent":"border-gray-200 bg-transparent hover:bg-gray-50"].join(" "),children:[n.jsx("span",{class:["flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",l?"border-[var(--pw-accent)] text-white":"border-gray-300 bg-transparent text-transparent",c?"mt-3":""].join(" "),style:l?{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"}:void 0,"aria-hidden":"true",children:n.jsx("svg",{width:"14",height:"10",viewBox:"0 0 17 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:l?"opacity-100":"opacity-0",children:n.jsx("path",{d:"M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",fill:"currentColor"})})}),n.jsxs("div",{class:"flex flex-1 flex-col gap-0.5",children:[n.jsxs("div",{class:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[n.jsx("span",{class:"text-xs font-normal uppercase tracking-normal text-gray-800/70",children:Le(a,t)}),p?n.jsx("span",{class:"text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]",children:p}):null,u?n.jsxs("span",{class:"rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700",children:["-",u,"%"]}):null]}),n.jsx("div",{class:"flex items-baseline gap-2 flex-wrap",children:n.jsxs("span",{class:"text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium",children:[n.jsx("span",{class:"opacity-90",children:g}),_,n.jsxs("span",{class:"text-sm font-normal text-gray-500",children:[" ","/ ",ie(a,t)]})]})}),a.description?n.jsx("span",{class:"mt-1 text-xs leading-relaxed text-gray-500",children:a.description}):null]}),c?n.jsx("span",{class:"absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",style:{background:"var(--pw-accent)"},children:o}):null]},a.id)})})}function Dt(r,e){return r.label?r.label:!r.interval||r.interval==="lifetime"?e("pricing.interval.lifetime_short","lifetime"):e(`pricing.interval.${r.interval}`,r.interval)}function zt({price:r,isLast:e,isPopular:t,popularLabel:s,offer:i,selected:o,onSelect:a,t:l}){const c=i?.discount_percent??null,{currency:h,amount:u,originalAmount:g}=se(r,c);return n.jsxs("button",{type:"button",role:"radio","aria-checked":o,onClick:a,class:"group relative inline-flex w-full max-w-[360px] mx-auto items-center justify-between gap-4 px-4 pt-3.5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--pw-accent)]",children:[n.jsx("span",{class:["flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",o?"border-[var(--pw-accent)] text-white":"border-gray-300 bg-transparent text-transparent"].join(" "),style:o?{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"}:void 0,"aria-hidden":"true",children:n.jsx("svg",{width:"14",height:"10",viewBox:"0 0 17 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:o?"opacity-100":"opacity-0",children:n.jsx("path",{d:"M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",fill:"currentColor"})})}),n.jsxs("div",{class:["flex flex-1 items-center gap-1.5 pb-3.5",e?"":"border-b border-gray-200"].join(" "),children:[n.jsxs("div",{class:"flex flex-wrap items-center gap-1 gap-x-1.5",children:[n.jsx("span",{class:"text-base font-normal capitalize text-gray-800",children:Dt(r,l)}),t?n.jsx("span",{class:"rounded-[9px] px-2 py-1 text-[10px] font-bold",style:{background:"linear-gradient(160deg, color-mix(in srgb, var(--pw-accent) 6%, white) 0%, color-mix(in srgb, var(--pw-accent) 15%, white) 100%)",color:"var(--pw-accent)"},children:s}):null,c?n.jsxs("span",{class:"rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700",children:["-",c,"%"]}):null]}),n.jsx("div",{class:"flex-1"}),n.jsxs("span",{class:"flex items-baseline gap-1.5 text-base font-normal text-gray-600",children:[g?n.jsx("span",{class:"text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]",children:g}):null,n.jsxs("span",{class:"whitespace-nowrap",children:[n.jsx("span",{class:"opacity-90",children:h}),u,n.jsxs("span",{class:"text-xs text-gray-400",children:[" ","/ ",ie(r,l)]})]})]})]})]})}function Nt({price:r,isPopular:e,popularLabel:t,offer:s,reserveStrikeRow:i,selected:o,onSelect:a,t:l}){const c=s?.discount_percent??null,{currency:h,amount:u,originalAmount:g}=se(r,c);return n.jsxs("button",{type:"button",role:"radio","aria-checked":o,onClick:a,class:["group relative flex h-full flex-col items-center justify-start gap-1 rounded-2xl border-2 px-3 pb-4 pt-3.5 text-center transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",o?"border-[var(--pw-accent)]":"border-gray-200 hover:bg-gray-50"].join(" "),style:o?{background:"color-mix(in srgb, var(--pw-accent) 6%, transparent)"}:void 0,children:[n.jsx("span",{class:"flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70",children:Le(r,l)}),i?n.jsxs("div",{class:"flex h-[22px] items-center justify-center gap-1.5",children:[g?n.jsx("span",{class:"text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]",children:g}):null,c?n.jsxs("span",{class:"rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700",children:["-",c,"%"]}):null]}):null,n.jsxs("span",{class:"text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium",children:[n.jsx("span",{class:"opacity-90",children:h}),u]}),n.jsxs("span",{class:"text-xs font-normal text-gray-500",children:["/ ",ie(r,l)]}),e?n.jsx("span",{class:"absolute -top-[10px] left-1/2 -translate-x-1/2 whitespace-nowrap rounded-[11px] border-[3px] border-white px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",style:{background:"var(--pw-accent)"},children:t}):null]})}function Ft({block:r}){return n.jsx("p",{class:"text-[0.9375rem] leading-relaxed text-gray-600",children:r.text})}const Vt={week:.25,month:1,year:12};function $t(r,e){return r?e(`pricing.interval.${r}`,r):e("pricing.interval.period","period")}function Ht({block:r,ctx:e}){const{t}=j();if(!r.queries.length)return null;const i=e.bootstrap.prices.find(a=>a.id===e.selectedPriceId)?.interval??null,o=i?Vt[i]:void 0;return n.jsxs("div",{class:"flex flex-col gap-2",children:[n.jsx("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}:",{interval:$t(i,t)})}),n.jsx("ul",{class:"flex flex-col gap-2",role:"list",children:r.queries.map(a=>{const l=Number.isFinite(a.count)?a.count:0,c=o!==void 0?Math.round(l*o):l;return n.jsxs("li",{class:`flex gap-3 ${a.desc?"items-start":"items-center"}`,children:[n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",class:`flex-shrink-0 text-emerald-500 ${a.desc?"mt-0.5":""}`,"aria-hidden":"true",children:n.jsx("path",{d:"M4 10.5l3.5 3.5 8.5-8.5",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})}),n.jsxs("div",{children:[n.jsx("span",{class:"font-semibold text-gray-900 text-sm",children:c})," ",n.jsx("span",{class:"text-sm text-gray-800",children:a.name}),a.desc?n.jsxs(n.Fragment,{children:[n.jsx("br",{}),n.jsx("span",{class:"text-xs text-gray-400",children:a.desc})]}):null]})]},a.id)})})]})}const Gt={heading:qt,text:Ft,price_grid:Ut,cta_button:It,auth_panel:Se,current_session:Pt,features_list:Et,tokenization_gate:Ht,guarantee_badge:At,offer_banner:gt};function Wt({layout:r,bootstrap:e,onAction:t,auth:s,authSession:i,hasTopBanner:o}){const a=d.useMemo(()=>{for(const k of r.blocks)if(k.type==="price_grid"&&k.popular_price_id&&e.prices.some(x=>x.id===k.popular_price_id))return k.popular_price_id;return e.prices[0]?.id??null},[r.blocks,e.prices]),[l,c]=d.useState(a),h={bootstrap:e,selectedPriceId:l,setSelectedPriceId:c,onAction:t,auth:s,authSession:i},u=r.blocks.findIndex(k=>k.type==="cta_button"),g=u===-1?r.blocks:r.blocks.slice(0,u),_=u===-1?[]:r.blocks.slice(u),p=(k,x)=>{const I=Gt[k.type];return I?n.jsx(I,{block:k,ctx:h},`${k.type}-${x}`):(typeof console<"u"&&console.warn(`[paywall] unknown block type: ${k.type}`),null)};return n.jsxs(n.Fragment,{children:[n.jsx("div",{class:"flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8",children:n.jsx("div",{class:"flex flex-col gap-6",children:g.map(p)})}),_.length>0?n.jsx("div",{class:"flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",style:{boxShadow:"0 -4px 12px -4px rgba(15,23,42,0.06)"},children:_.map((k,x)=>p(k,g.length+x))}):null]})}function Zt(r,e,t,s){return r?s?{open:!0,view:"purchased",error:null,processing:!1}:e.status==="idle"||e.status==="loading"?{open:!0,view:"loading",error:null,processing:!1}:e.status==="error"?{open:!0,view:"error",error:e.error,processing:!1}:t.kind==="support"?{open:!0,view:"support",error:null,processing:!1}:t.kind==="auth_gate"?{open:!0,view:"auth",error:null,processing:!1}:t.kind==="awaiting_payment"?{open:!0,view:"awaiting_payment",error:null,processing:!1}:t.kind==="popup_blocked"?{open:!0,view:"popup_blocked",error:null,processing:!1}:t.kind==="purchase_success"?{open:!0,view:"purchased",error:null,processing:!1}:t.kind==="verifying"?{open:!0,view:"loading",error:null,processing:!1}:{open:!0,view:"layout",error:null,processing:!1}:{open:!1,view:null,error:null,processing:!1}}function Yt(r,e){return r.open===e.open&&r.view===e.view&&r.error===e.error&&r.processing===e.processing}function Kt({client:r,open:e,onClose:t,onEvent:s,initialView:i,initialAuthMode:o,initialCheckoutPriceId:a,initialCheckoutUrl:l,purchased:c,renew:h,onState:u,inline:g,locale:_}){const[p,k]=d.useState({status:"idle"}),[x,I]=d.useState(()=>r.auth?.getCachedSession()??null),[y,m]=d.useState(()=>i==="support"?{kind:"support",origin:"standalone"}:i==="auth"?a?{kind:"auth_gate",pendingCheckout:{priceId:a,direct:!0},origin:"standalone",intent:"preauth"}:{kind:"auth_gate",origin:"standalone"}:i==="awaiting_payment"&&a&&l?{kind:"awaiting_payment",priceId:a,url:l}:i==="popup_blocked"&&a&&l?{kind:"popup_blocked",priceId:a,url:l}:{kind:"layout"}),S=i==="awaiting_payment"||i==="popup_blocked"||i==="auth"&&!!a,C=d.useRef(!1),M=d.useRef(null);d.useEffect(()=>{if(!u)return;const b=Zt(e,p,y,c),f=M.current;f&&Yt(f,b)||(M.current=b,u(b))},[e,p,y,c,u]),d.useEffect(()=>{if(r.auth)return r.auth.onAuthChange((b,f)=>I(f))},[r.auth]),d.useEffect(()=>{if(typeof r.onBootstrapChange=="function")return r.onBootstrapChange(b=>{k(f=>f.status==="ready"?{status:"ready",data:b}:f)})},[r]),d.useEffect(()=>{if(!e||p.status==="ready"||p.status==="loading")return;let b=!1;return k({status:"loading"}),r.bootstrap().then(f=>{if(b)return;k({status:"ready",data:f}),s("ready",f);const w=i==="support"||i==="auth"||S;f.user?.has_active_subscription&&!h&&!w&&(s("purchase_completed",{priceId:a??null,sessionId:null,restored:!0}),m({kind:"purchase_success",restored:!0}))}).catch(f=>{if(b)return;const w=f instanceof v.PaywallError?f:new v.PaywallError("unknown","Failed to load paywall",{cause:f});k({status:"error",error:w}),s("error",w)}),()=>{b=!0}},[e,r]),d.useLayoutEffect(()=>{if(!e){m({kind:"layout"}),C.current=!1;return}i==="support"?m({kind:"support",origin:"standalone"}):i==="auth"?m(a?{kind:"auth_gate",pendingCheckout:{priceId:a,direct:!0},origin:"standalone",intent:"preauth"}:{kind:"auth_gate",origin:"standalone"}):i==="awaiting_payment"&&a&&l?m({kind:"awaiting_payment",priceId:a,url:l}):i==="popup_blocked"&&a&&l&&m({kind:"popup_blocked",priceId:a,url:l})},[e,i,a,l]);const P=async b=>{try{const f=r.getCachedOffers?.()??null,w=f?F(f,b,{readStart:D}):null,L=await r.createCheckout({priceId:b,offerId:w?.id,ignoreActivePurchase:h===!0});if(s("checkout_started",{priceId:b,url:L.url,acquiring:L.acquiring}),typeof window>"u"||!L.url)return;const N=window.open(L.url,"_blank");if(N){try{N.opener=null}catch{}m({kind:"awaiting_payment",priceId:b,url:L.url})}else m({kind:"popup_blocked",priceId:b,url:L.url})}catch(f){if(f instanceof v.PaywallError&&f.code==="already_purchased"){try{await r.getUser({force:!0})}catch{}s("purchase_completed",{priceId:b,sessionId:null,restored:!0}),S?t():m({kind:"purchase_success",restored:!0});return}const w=f instanceof v.PaywallError?f:new v.PaywallError("checkout_failed","Checkout failed",{cause:f});s("error",w),S?t():m({kind:"layout"})}},B=(b,f)=>{if(typeof window>"u")return;const w=window.open(f,"_blank");if(w){try{w.opener=null}catch{}m({kind:"awaiting_payment",priceId:b,url:f})}};d.useEffect(()=>{if(y.kind!=="auth_gate"||!x||x.user.is_anonymous||C.current)return;C.current=!0;const b=y.pendingCheckout,f=y.origin;m({kind:"verifying"}),(async()=>{if(!h)try{if((await r.getUser({force:!0})).has_active_subscription){s("purchase_completed",{priceId:b?.priceId??null,sessionId:null,restored:!0}),b?.direct?t():m({kind:"purchase_success",restored:!0});return}}catch{}if(!b){f==="standalone"?t():m({kind:"layout"});return}await P(b.priceId)})().finally(()=>{C.current=!1})},[x,y]);const O=async(b,f)=>{if(b==="close"){t();return}if(b==="price_selected"){s("price_selected",f);return}if(b==="restore"){if(!r.auth)return;const w=r.auth.getCachedSession();if(w&&!w.user.is_anonymous)return;m({kind:"auth_gate",intent:"restore"});return}if(b==="support"){m({kind:"support",origin:"layout"});return}if(b==="checkout"&&p.status==="ready"){const w=f?.priceId;if(!w){s("error",new v.PaywallError("no_price","No price selected"));return}const L=p.data.settings.checkout_mode??"guest",N=r.auth?.getCachedSession()??null,qe=!!N&&!N.user.is_anonymous;if(L==="preauth"&&!!r.auth&&!qe){m({kind:"auth_gate",pendingCheckout:{priceId:w}});return}await P(w)}},q=p.status==="ready"?p.data.settings.brand_color:null,A=p.status==="ready"?p.data.settings.allow_close!==!1:!0,R=y.kind==="layout"&&p.status==="ready"?Ce(p.data.offers):null,T=R?n.jsx(xt,{offer:R}):null,Z={type:"auth_panel",allow_signup:!0,allow_password_reset:!0,hide_when_authenticated:!1,providers:p.status==="ready"?p.data.settings.auth_providers:void 0},V=y.kind==="support"?n.jsx(bt,{client:r,authSession:x,origin:y.origin,onBack:()=>{y.origin==="standalone"?t():m({kind:"layout"})}}):null,Y=y.kind==="auth_gate"&&y.origin!=="standalone"||y.kind==="support",K=p.status==="ready"?p.data:null;return n.jsx(Ze,{bootstrap:K,forceLocale:_,children:n.jsx(Ye,{open:e,onClose:t,brandColor:q,topBanner:T,allowClose:A,hideCloseButton:Y,inline:g,labelledBy:"pw-title",children:c?n.jsx(xe,{onContinue:t}):y.kind==="purchase_success"?n.jsx(xe,{restored:y.restored,onContinue:t}):V||(p.status==="loading"||p.status==="idle"||y.kind==="verifying"?n.jsx(Xt,{verifying:y.kind==="verifying"}):p.status==="error"?n.jsx(Jt,{message:p.error.message}):y.kind==="auth_gate"&&r.auth?n.jsx(dt,{block:Z,bootstrap:p.data,auth:r.auth,authSession:x,showBack:y.origin!=="standalone",intent:y.intent??(y.origin==="standalone"?"standalone":"preauth"),initialMode:y.origin==="standalone"?o:void 0,onBack:()=>{y.origin==="standalone"?t():m({kind:"layout"})}}):y.kind==="awaiting_payment"?n.jsx(er,{client:r,onBack:()=>m({kind:"layout"}),onReopen:()=>{if(typeof window>"u")return;const b=window.open(y.url,"_blank");if(b)try{b.opener=null}catch{}},onRetry:()=>P(y.priceId)}):y.kind==="popup_blocked"?n.jsx(Qt,{onReopen:()=>B(y.priceId,y.url)}):n.jsx(Wt,{layout:p.data.layout,bootstrap:p.data,onAction:O,auth:r.auth,authSession:x}))})})}function Xt({verifying:r}){const{t:e}=j();return n.jsxs("div",{class:"flex flex-col items-center justify-center gap-3 py-12",children:[n.jsx("span",{class:"inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]"}),n.jsx("span",{class:"text-xs font-medium tracking-wide text-gray-500",children:r?e("modal.verifying_subscription","Checking your subscription…"):e("modal.loading","Loading…")})]})}function Jt({message:r}){const{t:e}=j();return n.jsxs("div",{class:"flex flex-col items-center gap-2 py-8 text-center",children:[n.jsx("div",{class:"flex h-11 w-11 items-center justify-center rounded-full bg-red-50",children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M10 6v5M10 14h.01",stroke:"#dc2626","stroke-width":"2","stroke-linecap":"round"}),n.jsx("circle",{cx:"10",cy:"10",r:"8",stroke:"#dc2626","stroke-width":"1.75"})]})}),n.jsx("p",{class:"text-sm font-semibold tracking-tight text-gray-900",children:e("modal.error_generic","Something went wrong")}),n.jsx("p",{class:"text-xs leading-relaxed text-gray-500",children:r})]})}function Qt({onReopen:r}){const{t:e}=j();return n.jsxs("div",{class:"flex flex-col items-center gap-3 py-8 text-center",children:[n.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full",style:{background:"color-mix(in srgb, var(--pw-accent) 12%, white)",color:"var(--pw-accent)"},"aria-hidden":"true",children:n.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M14 4h6v6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M20 4l-9 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),n.jsx("path",{d:"M19 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}),n.jsx("p",{id:"pw-title",class:"mt-1 text-lg font-semibold tracking-tight text-gray-900",children:e("payment.popup_blocked_title","Allow popups to continue")}),n.jsx("p",{class:"max-w-[20rem] text-sm leading-relaxed text-gray-500",children:e("payment.popup_blocked_message","Your browser blocked the checkout tab. Click below to open it.")}),n.jsx("button",{type:"button",onClick:r,class:"mt-3 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:e("payment.open_checkout_button","Open checkout")})]})}function er({client:r,onBack:e,onReopen:t,onRetry:s}){const{t:i}=j(),[o,a]=d.useState(!1),[l,c]=d.useState(!1),h=d.useRef(null);d.useEffect(()=>()=>{h.current!==null&&clearTimeout(h.current)},[]);const u=async()=>{if(!o){a(!0),c(!1);try{if((await r.getUser({force:!0})).has_active_subscription){typeof window<"u"&&window.postMessage({type:"paywall_purchase"},"*");return}c(!0),h.current!==null&&clearTimeout(h.current),h.current=setTimeout(()=>{c(!1),h.current=null},5e3)}catch{c(!0)}finally{a(!1)}}};return n.jsxs("div",{class:"flex flex-col gap-3 px-6 pb-6 pt-4 sm:px-8 sm:pb-8 sm:pt-5",children:[n.jsx("button",{type:"button",onClick:e,class:"-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:i("nav.back","← Back")}),n.jsxs("div",{class:"flex flex-col items-center gap-3 py-6 text-center",children:[n.jsxs("div",{class:"relative flex h-14 w-14 items-center justify-center",children:[n.jsx("span",{class:"absolute inset-0 animate-ping rounded-full opacity-40",style:{background:"color-mix(in srgb, var(--pw-accent) 30%, transparent)"},"aria-hidden":"true"}),n.jsx("span",{class:"relative inline-block h-8 w-8 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]"})]}),n.jsx("p",{id:"pw-title",class:"mt-1 text-lg font-semibold tracking-tight text-gray-900",children:i("payment.awaiting_title","Complete payment in the new tab")}),n.jsx("p",{class:"max-w-[22rem] text-sm leading-relaxed text-gray-500",children:i("payment.awaiting_subtitle","We'll detect your payment automatically — or click below once you're done.")}),n.jsx("button",{type:"button",onClick:u,disabled:o,class:"mt-3 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:brightness-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",boxShadow:"0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"},children:o?i("payment.checking","Checking…"):i("payment.ive_paid","I've paid")}),l?n.jsx("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]}),n.jsxs("div",{class:"rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5",children:[n.jsx("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.")}),n.jsx("button",{type:"button",onClick:t,class:"mt-2.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:i("payment.open_checkout_again","Open checkout again")})]}),n.jsx("button",{type:"button",onClick:s,class:"self-center rounded-md px-2 py-1 text-xs text-gray-500 underline-offset-2 hover:text-gray-900 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",children:i("payment.tab_closed_retry","Tab closed? Try again")})]})}function xe({onContinue:r,restored:e=!1}){const{t}=j();return n.jsxs("div",{class:"flex flex-col items-center gap-4 py-6 text-center",children:[n.jsx("div",{class:"flex h-14 w-14 items-center justify-center rounded-full",style:{background:"linear-gradient(135deg, #4ade80, #16a34a)",color:"#fff",boxShadow:"0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"},"aria-hidden":"true",children:n.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",children:n.jsx("path",{d:"M5 13l4 4L19 7",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})})}),n.jsx("p",{id:"pw-title",class:"mt-1 text-3xl font-bold tracking-tight text-gray-900",children:e?t("modal.purchase_restored_title","Subscription restored"):t("modal.purchase_success_title","Payment received")}),n.jsx("p",{class:"text-base leading-relaxed text-gray-600",children:e?t("modal.purchase_restored_subtitle","Welcome back — your subscription is already active."):t("modal.purchase_success_subtitle","Your subscription is now active.")}),n.jsx("button",{type:"button",onClick:r,class:"pw-cta-shimmer relative mt-2 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] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",boxShadow:"0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"},children:n.jsx("span",{class:"relative z-10",children:t("modal.continue","Continue")})})]})}const tr=10*6e4,rr=5e3,nr=3e4;class sr{constructor(e){this.timer=null,this.timeoutTimer=null,this.visibilityHandler=null,this.focusHandler=null,this.messageHandler=null,this.stopped=!1,this.checking=!1,this.opts={client:e.client,onActive:e.onActive,onTimeout:e.onTimeout??(()=>{}),timeoutMs:e.timeoutMs??tr,visibleIntervalMs:e.visibleIntervalMs??rr,hiddenIntervalMs:e.hiddenIntervalMs??nr}}start(){this.stopped||typeof document>"u"||typeof window>"u"||(this.check(),this.scheduleNext(),this.visibilityHandler=()=>this.handleVisibilityChange(),document.addEventListener("visibilitychange",this.visibilityHandler),this.focusHandler=()=>void this.check(),window.addEventListener("focus",this.focusHandler),this.messageHandler=e=>this.handleMessage(e),window.addEventListener("message",this.messageHandler),this.timeoutTimer=setTimeout(()=>{this.stopped||(this.stop(),this.opts.onTimeout())},this.opts.timeoutMs))}stop(){this.stopped=!0,this.timer!==null&&clearTimeout(this.timer),this.timer=null,this.timeoutTimer!==null&&clearTimeout(this.timeoutTimer),this.timeoutTimer=null,typeof document<"u"&&this.visibilityHandler&&document.removeEventListener("visibilitychange",this.visibilityHandler),typeof window<"u"&&(this.focusHandler&&window.removeEventListener("focus",this.focusHandler),this.messageHandler&&window.removeEventListener("message",this.messageHandler)),this.visibilityHandler=null,this.focusHandler=null,this.messageHandler=null}async check(){if(!(this.stopped||this.checking)){this.checking=!0;try{const e=await this.opts.client.getUser({force:!0});if(this.stopped)return;e.has_active_subscription&&(this.stop(),this.opts.onActive(e))}catch{}finally{this.checking=!1}}}scheduleNext(){if(this.stopped)return;const t=typeof document<"u"&&document.visibilityState==="visible"?this.opts.visibleIntervalMs:this.opts.hiddenIntervalMs;this.timer=setTimeout(async()=>{await this.check(),this.scheduleNext()},t)}handleVisibilityChange(){typeof document>"u"||(document.visibilityState==="visible"&&this.check(),this.timer!==null&&(clearTimeout(this.timer),this.timer=null),this.scheduleNext())}handleMessage(e){const t=e.data;!t||typeof t!="object"||t.type==="paywall_purchase"&&this.check()}}function ir(){return!(typeof document>"u"||typeof window>"u"||typeof location<"u"&&location.protocol==="chrome-extension:")}const ne={open:!1,view:null,error:null,processing:!1},z={status:"paywall_status",priceId:"paywall_price_id",sessionId:"paywall_session_id"};let or=class{constructor(e){this.handle=null,this.isOpen=!1,this.listeners=new Map,this.userUnsub=null,this.authUnsub=null,this.watcher=null,this.tracker=null,this.purchased=!1,this.lastMountedView=null,this.trialStore=null,this.trialStoreConfig=null,this.lastTrialStatus=null,this.trialExpiredFired=!1,this.lastVisibility=null,this.currentState=ne,this.stateListeners=new Set;const{auth:t,ownsAuth:s}=ar(e);this.auth=t,this.ownsAuth=s,this.billing=e.client??new v.BillingClient({...e,auth:this.auth}),this.host=e.host,this.shadowMode=e.shadowMode??"closed",this.mountThenLoad=e.mountThenLoad??!0,this.inline=e.inline===!0,this.forceLocale=e.locale??null,this.userUnsub=this.billing.onUserChange(i=>{this.emit("userChange",i)}),this.auth&&(this.authUnsub=this.auth.onAuthChange((i,o)=>{this.emit("authChange",{event:i,session:o})})),this.initTracker(e.analytics),e.autoDetectReturn!==!1&&typeof window<"u"&&queueMicrotask(()=>this.checkReturn())}initTracker(e){if(e===!1)return;const t=typeof e=="object"&&e!==null?e:{};if(t.enabled===!1)return;const s=t.endpoint??`${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;this.tracker=new v.EventTracker({endpoint:s,paywallId:this.billing.paywallId,capabilities:this.billing.capabilities,getVisitorId:()=>this.billing.getVisitorId(),getCachedVisitorId:()=>this.billing.getCachedVisitorId(),getUserId:()=>this.billing.getIdentity()?.userId??null,flushIntervalMs:t.flushIntervalMs,maxBufferSize:t.maxBufferSize,fetch:t.fetch,sendBeacon:t.sendBeacon}),this.on("open",()=>{this.lastMountedView==="layout"&&this.tracker?.track("paywall_opened")}),this.on("ready",i=>{this.lastMountedView==="layout"&&this.tracker?.track("paywall_viewed",{is_test_mode:i.settings.is_test_mode,prices_count:i.prices.length,offers_count:i.offers.length})}),this.on("price_selected",i=>this.tracker?.track("price_selected",{price_id:i.priceId})),this.on("checkout_started",i=>this.tracker?.track("checkout_started",{price_id:i.priceId,acquiring:i.acquiring})),this.on("purchase_completed",i=>this.tracker?.track("purchase_completed",{price_id:i.priceId,session_id:i.sessionId})),this.on("purchase_failed",i=>this.tracker?.track("purchase_failed",{reason:i.reason})),this.on("close",()=>{this.lastMountedView==="layout"&&this.tracker?.track("paywall_closed")}),this.on("trial_blocked",i=>this.tracker?.track("trial_blocked",{mode:i.mode,...i.mode==="time"?{remaining_ms:i.remainingMs,total_ms:i.totalMs}:i.mode==="opens"?{remaining_actions:i.remainingActions,total_actions:i.totalActions}:{}})),this.on("trial_expired",()=>this.tracker?.track("trial_expired")),this.on("visibility_blocked",i=>this.tracker?.track("visibility_blocked",{reason:i.reason,country:i.country,tier:i.tier})),this.on("error",i=>this.tracker?.track("error",{code:i.code,message:i.message}))}track(e,t){this.tracker?.track(e,t)}onUserChange(e){return this.on("userChange",e)}setBootstrap(e){this.billing.setBootstrap(e)}setLocale(e){const t=e??null;t!==this.forceLocale&&(this.forceLocale=t,this.handle&&this.handle.update({locale:t}))}on(e,t){let s=this.listeners.get(e);return s||(s=new Set,this.listeners.set(e,s)),s.add(t),()=>s.delete(t)}off(e,t){this.listeners.get(e)?.delete(t)}emit(e,...t){const s=this.listeners.get(e);if(!s)return;const i=t[0];for(const o of s)try{o(i)}catch(a){typeof console<"u"&&console.error("[paywall] listener error",a)}}open(e={}){this.openInternal("layout",e)}async preload(e={}){try{await this.billing.bootstrap({signal:e.signal}),this.billing.auth&&await this.billing.getBalances({signal:e.signal})}catch{}}openSupport(e={}){this.openInternal("support",e)}openAuth(e={}){this.auth&&this.openInternal("auth",{...e,skipTrial:!0})}openSignin(e={}){this.auth&&this.openInternal("auth",{...e,skipTrial:!0,authMode:"signin"})}openSignup(e={}){this.auth&&this.openInternal("auth",{...e,skipTrial:!0,authMode:"signup"})}checkout(e,t={}){if(t.identity&&this.billing.setIdentity(t.identity),t.renew!==!0&&this.billing.getCachedUser()?.has_active_subscription){this.emit("purchase_completed",{priceId:e,sessionId:null,restored:!0});return}this.runDirectCheckout(e,t)}async runDirectCheckout(e,t){const s=t.renew===!0,i=t.skipTrial===!0,o=t.skipVisibility===!0;this.applyProcessing(!0);const a=()=>{this.applyProcessing(!1)};let l;try{l=await this.billing.bootstrap()}catch(x){const I=x instanceof v.PaywallError?x:new v.PaywallError("unknown","Failed to load paywall",{cause:x});this.emit("error",I),a();return}if(!o){const x=l.settings.visibility;if(x&&(this.lastVisibility=x,!x.visible)){this.emit("visibility_blocked",x),a();return}}if(!i&&await this.checkTrialBeforeCheckout(l)){a();return}if(!s&&l.user?.has_active_subscription){this.emit("purchase_completed",{priceId:e,sessionId:null,restored:!0}),a();return}const c=l.settings.checkout_mode??"guest",h=this.auth?.getCachedSession()??null,u=!!h&&!h.user.is_anonymous;if(c==="preauth"&&!!this.auth&&!u){this.purchased=!1,this.mountAndShow("auth",{renew:s,authMode:"signin",checkoutPriceId:e});return}const _=this.getOfferForPrice(e);let p;try{p=await this.billing.createCheckout({priceId:e,offerId:_?.offer.id,ignoreActivePurchase:s})}catch(x){if(x instanceof v.PaywallError&&x.code==="already_purchased"){try{await this.billing.getUser({force:!0})}catch{}this.emit("purchase_completed",{priceId:e,sessionId:null,restored:!0}),a();return}const I=x instanceof v.PaywallError?x:new v.PaywallError("checkout_failed","Checkout failed",{cause:x});this.emit("error",I),a();return}if(this.emit("checkout_started",{priceId:e,url:p.url,acquiring:p.acquiring}),this.startUserWatcher(),typeof window>"u"||!p.url){this.mountAndShow("awaiting_payment",{renew:s,checkoutPriceId:e,checkoutUrl:p.url});return}const k=window.open(p.url,"_blank");if(this.purchased=!1,k){try{k.opener=null}catch{}this.mountAndShow("awaiting_payment",{renew:s,checkoutPriceId:e,checkoutUrl:p.url})}else this.mountAndShow("popup_blocked",{renew:s,checkoutPriceId:e,checkoutUrl:p.url})}async checkTrialBeforeCheckout(e){const t=e.settings.trial;if(!t)return!1;const s=this.ensureTrialStore(t);try{const i=await s.check();if(this.lastTrialStatus=i,i.mode==="none")return!1;if(i.blocked){const o=await s.recordBlock();return this.lastTrialStatus=o,this.emit("trial_blocked",o),!0}return this.trialExpiredFired||(this.trialExpiredFired=!0,this.emit("trial_expired")),!1}catch(i){return typeof console<"u"&&console.warn("[paywall] trial check failed",i),!1}}applyProcessing(e){this.currentState.processing!==e&&this.applyState({...this.currentState,processing:e})}signInAnonymously(){return this.auth?this.auth.signInAnonymously():Promise.reject(new v.PaywallError("invalid_config","signInAnonymously requires managed-auth. Pass `auth: true` to PaywallUI."))}openInternal(e,t){t.identity&&this.billing.setIdentity(t.identity),this.purchased=!1;const s=t.skipTrial===!0||e==="support",i=t.skipVisibility===!0||e==="support"||e==="auth",o=t.renew===!0;if(s&&i){this.mountAndShow(e,{renew:o,authMode:t.authMode});return}const a=this.billing.getCachedBootstrap();if(a){this.runOpenGates(e,a,{skipTrial:s,skipVisibility:i,renew:o});return}if(this.mountThenLoad){this.mountAndShow(e,{renew:o}),this.billing.bootstrap().then(l=>this.runDelayedGates(l,{skipTrial:s,skipVisibility:i})).catch(()=>{});return}this.billing.bootstrap().then(l=>this.runOpenGates(e,l,{skipTrial:s,skipVisibility:i,renew:o})).catch(()=>{this.mountAndShow(e,{renew:o})})}runDelayedGates(e,t){if(!this.isOpen)return;if(!t.skipVisibility){const o=e.settings.visibility;if(o&&(this.lastVisibility=o,!o.visible)){this.close(),this.emit("visibility_blocked",o);return}}if(t.skipTrial)return;const s=e.settings.trial;if(!s)return;const i=this.ensureTrialStore(s);i.check().then(async o=>{if(this.isOpen&&(this.lastTrialStatus=o,o.mode!=="none")){if(o.blocked){const a=await i.recordBlock();if(this.lastTrialStatus=a,!this.isOpen)return;this.close(),this.emit("trial_blocked",a);return}this.trialExpiredFired||(this.trialExpiredFired=!0,this.emit("trial_expired"))}}).catch(o=>{typeof console<"u"&&console.warn("[paywall] trial check failed",o)})}runOpenGates(e,t,s){if(!s.skipVisibility){const i=t.settings.visibility;if(i&&(this.lastVisibility=i,!i.visible)){this.emit("visibility_blocked",i);return}}if(s.skipTrial){this.mountAndShow(e,{renew:s.renew});return}this.gateThroughTrial(e,t,s.renew)}gateThroughTrial(e,t,s){const i=t.settings.trial;if(!i){this.mountAndShow(e,{renew:s});return}const o=this.ensureTrialStore(i);o.check().then(async a=>{if(this.lastTrialStatus=a,a.mode==="none"){this.mountAndShow(e,{renew:s});return}if(a.blocked){const l=await o.recordBlock();this.lastTrialStatus=l,this.emit("trial_blocked",l);return}this.trialExpiredFired||(this.trialExpiredFired=!0,this.emit("trial_expired")),this.mountAndShow(e,{renew:s})}).catch(a=>{typeof console<"u"&&console.warn("[paywall] trial check failed",a),this.mountAndShow(e,{renew:s})})}ensureTrialStore(e){if(this.trialStore&&this.trialStoreConfig&&ur(this.trialStoreConfig,e))return this.trialStore;this.trialStoreConfig=e;const t=this.billing.createTrialStore;return this.trialStore=typeof t=="function"?t.call(this.billing,e):v.createTrialStore(this.billing.getStorage(),this.billing.paywallId,e),this.trialStore}mountAndShow(e,t={}){this.lastMountedView=e;const s=t.renew===!0,i=t.authMode,a=e==="auth"||e==="awaiting_payment"||e==="popup_blocked"?t.checkoutPriceId??null:null,l=e==="awaiting_payment"||e==="popup_blocked"?t.checkoutUrl??null:null;if(this.handle){this.isOpen=!0,this.handle.update({open:!0,initialView:e,initialAuthMode:i,initialCheckoutPriceId:a,initialCheckoutUrl:l,purchased:!1,renew:s}),this.emit("open");return}this.isOpen=!0,this.handle=Fe(Kt,{client:this.billing,open:!0,initialView:e,initialAuthMode:i,initialCheckoutPriceId:a,initialCheckoutUrl:l,purchased:!1,renew:s,onClose:()=>this.close(),onEvent:(c,h)=>{this.emit(c,h),c==="checkout_started"&&this.startUserWatcher()},onState:c=>this.applyState(c),inline:this.inline,locale:this.forceLocale},{host:this.host,shadowMode:this.shadowMode,inline:this.inline}),this.emit("open")}applyState(e){if(!cr(this.currentState,e)){this.currentState=e;for(const t of this.stateListeners)try{t(e)}catch(s){console.warn("[paywall] onStateChange listener threw",s)}}}getState(){return this.currentState}onStateChange(e,t={}){this.stateListeners.add(e);const s=t.immediate??"microtask";if(s!=="none"){const i=this.currentState;if(s==="sync")try{e(i)}catch(o){console.warn("[paywall] onStateChange initial sync threw",o)}else queueMicrotask(()=>{this.stateListeners.has(e)&&e(i)})}return()=>{this.stateListeners.delete(e)}}getTrialStatus(){return this.lastTrialStatus}getVisibility(){return this.lastVisibility}getPrices(e={}){return this.billing.getPrices(e)}getCachedPrices(){return this.billing.getCachedPrices()}getCachedOffers(){return this.billing.getCachedOffers()}getOfferForPrice(e){const t=this.billing.getCachedOffers();if(!t)return null;const s=ye(t,e);return s?be(s,{now:Date.now(),readStart:D}):null}getUserLanguage(){return this.billing.getUserLanguage()}async getAccess(e={}){let t=this.billing.getCachedBootstrap();if(!t)try{t=await this.billing.bootstrap({signal:e.signal})}catch{const a=this.billing.getCachedUser();return a?.has_active_subscription?{access:"granted",reason:"has_subscription",visibility:null,trial:null,user:a}:{access:"blocked",reason:"no_subscription",visibility:null,trial:null,user:a}}const s=this.billing.getCachedUser()??t.user??null;if(s?.has_active_subscription)return{access:"granted",reason:"has_subscription",visibility:t.settings.visibility??null,trial:null,user:s};let i=null;if(!e.skipVisibility){const a=t.settings.visibility;if(a&&(i=a,this.lastVisibility=a,!a.visible))return{access:"granted",reason:"visibility_blocked",visibility:i,trial:null,user:s}}let o=null;if(!e.skipTrial){const a=t.settings.trial;if(a)try{if(o=await this.ensureTrialStore(a).check(),this.lastTrialStatus=o,o.blocked)return{access:"granted",reason:"trial_blocked",visibility:i,trial:o,user:s}}catch(l){typeof console<"u"&&console.warn("[paywall] getAccess: trial check failed",l)}}return{access:"blocked",reason:"no_subscription",visibility:i,trial:o,user:s}}async resetTrial(){this.trialStore&&(await this.trialStore.reset(),this.lastTrialStatus=null,this.trialExpiredFired=!1)}startUserWatcher(){this.watcher||ir()&&(this.watcher=new sr({client:this.billing,onActive:e=>{this.watcher=null,this.emit("purchase_completed",{priceId:null,sessionId:null});const t=this.billing.getCachedBootstrap()?.settings.success_redirect_url;if(t&&typeof window<"u")try{window.location.assign(t);return}catch{}this.isOpen&&this.handle&&(this.purchased=!0,this.handle.update({purchased:!0}))},onTimeout:()=>{this.watcher=null}}),this.watcher.start())}close(){!this.isOpen||!this.handle||(this.isOpen=!1,this.purchased=!1,this.handle.update({open:!1,purchased:!1}),this.applyState(ne),this.emit("close"))}checkReturn(){if(typeof window>"u")return;const e=new URL(window.location.href),t=me(e.hash.replace(/^#/,"")),s=me(e.search.replace(/^\?/,"")),i=t??s;i&&(i.status==="paid"?(this.emit("purchase_completed",{priceId:i.priceId,sessionId:i.sessionId}),dr(i)):(i.status==="failed"||i.status==="cancelled")&&this.emit("purchase_failed",{reason:i.status}),hr(e))}destroy(){this.tracker?.destroy(),this.tracker=null,this.listeners.clear(),this.stateListeners.clear(),this.watcher?.stop(),this.watcher=null,this.userUnsub?.(),this.userUnsub=null,this.authUnsub?.(),this.authUnsub=null,this.ownsAuth&&this.auth&&this.auth.destroy?.(),this.ownsAuth=!1,this.billing.destroy?.(),this.handle?.unmount(),this.handle=null,this.isOpen=!1,this.currentState=ne}};function ar(r){if(!r.auth)return{auth:void 0,ownsAuth:!1};if(r.auth instanceof v.AuthClient||lr(r.auth))return{auth:r.auth,ownsAuth:!1};const e=r.auth===!0?{}:r.auth;return{auth:new v.AuthClient({paywallId:r.paywallId,apiOrigin:e.apiOrigin??r.apiOrigin,storage:e.storage??r.storage,fetch:e.fetch??r.fetch,openPopup:e.openPopup}),ownsAuth:!0}}function lr(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.onAuthChange=="function"&&typeof e.getCachedSession=="function"&&typeof e.signOut=="function"}function cr(r,e){return r.open===e.open&&r.view===e.view&&r.error===e.error&&r.processing===e.processing}function ur(r,e){return r.mode===e.mode&&r.payload===e.payload&&r.storage===e.storage}function me(r){if(!r)return null;const e=new URLSearchParams(r),t=e.get(z.status);return t?{status:t,priceId:e.get(z.priceId),sessionId:e.get(z.sessionId)}:null}function dr(r){if(!(typeof window>"u"||!window.opener))try{window.opener.postMessage({type:"paywall_purchase",status:r.status,priceId:r.priceId,sessionId:r.sessionId},"*")}catch{}}function hr(r){const e=(s,i)=>{if(!s)return"";const o=new URLSearchParams(s.replace(/^[?#]/,""));o.delete(z.status),o.delete(z.priceId),o.delete(z.sessionId);const a=o.toString();return a?i+a:""},t=r.pathname+e(r.search,"?")+e(r.hash,"#");window.history.replaceState(null,"",t)}class pr{constructor(e,t,s){this.transport=e,this.paywallId=t,this.config=s}async check(){return this.transport.request("trial.check",{paywallId:this.paywallId,config:this.config})}async recordBlock(){return this.transport.request("trial.recordBlock",{paywallId:this.paywallId,config:this.config})}async reset(){await this.transport.request("trial.reset",{paywallId:this.paywallId,config:this.config})}}class Me{constructor(e,t){this.transport=e,this.cachedBootstrap=null,this.cachedUser=null,this.cachedBalances=null,this.identity=null,this.userListeners=new Set,this.balanceListeners=new Set,this.bootstrapListeners=new Set,this.unsubUserBroadcast=null,this.unsubBalancesBroadcast=null,this.paywallId=t.paywallId,this.apiOrigin=t.apiOrigin,this.remoteStorageAdapter={getItem:s=>this.transport.request("storage.get",{key:s}),setItem:async(s,i)=>{await this.transport.request("storage.set",{key:s,value:i})},removeItem:async s=>{await this.transport.request("storage.remove",{key:s})}},this.unsubUserBroadcast=this.transport.on("userChange",s=>{this.applyUser(s)}),this.unsubBalancesBroadcast=this.transport.on("balancesChange",s=>{this.applyBalances([...s])})}async bootstrap(e={}){const t=await this.transport.request("billing.bootstrap",{force:e.force},{signal:e.signal});return this.applyBootstrap(t),t.user&&this.applyUser(t.user),t}getCachedBootstrap(){return this.cachedBootstrap}onBootstrapChange(e,t={}){this.bootstrapListeners.add(e);const s=t.immediate??"microtask";if(this.cachedBootstrap&&s!=="none"){const i=this.cachedBootstrap;if(s==="sync")try{e(i)}catch(o){console.warn("[paywall] onBootstrapChange initial sync threw",o)}else queueMicrotask(()=>{this.bootstrapListeners.has(e)&&e(i)})}return()=>{this.bootstrapListeners.delete(e)}}async getPrices(e={}){return(await this.bootstrap(e)).prices}getCachedPrices(){return this.cachedBootstrap?.prices??null}getCachedOffers(){return this.cachedBootstrap?.offers??null}async getVisitorId(){return this.transport.request("billing.getVisitorId",void 0)}async getUser(e={}){const t=await this.transport.request("billing.getUser",{force:e.force},{signal:e.signal});return this.applyUser(t),t}getCachedUser(){return this.cachedUser}onUserChange(e,t={}){this.userListeners.add(e);const s=t.immediate??"microtask";if(this.cachedUser&&s!=="none"){const i=this.cachedUser;if(s==="sync")try{e(i)}catch(o){console.warn("[paywall] onUserChange initial sync threw",o)}else queueMicrotask(()=>{this.userListeners.has(e)&&e(i)})}return()=>{this.userListeners.delete(e)}}async getBalances(e={}){const s=[...await this.transport.request("billing.getBalances",{force:e.force},{signal:e.signal})];return this.applyBalances(s),s}getCachedBalances(){return this.cachedBalances}onBalanceChange(e,t={}){this.balanceListeners.add(e);const s=t.immediate??"microtask";if(this.cachedBalances&&s!=="none"){const i=this.cachedBalances;if(s==="sync")try{e(i)}catch(o){console.warn("[paywall] onBalanceChange initial sync threw",o)}else queueMicrotask(()=>{this.balanceListeners.has(e)&&e(i)})}return()=>{this.balanceListeners.delete(e)}}async createCheckout(e){const{signal:t,...s}=e;return this.transport.request("billing.createCheckout",s,{signal:t})}async listPurchases(e={}){return[...await this.transport.request("billing.listPurchases",void 0,{signal:e.signal})]}async createSupportTicket(e){return this.transport.request("billing.createSupportTicket",e)}async cancelSubscription(e){const{signal:t,...s}=e;return this.transport.request("billing.cancelSubscription",s,{signal:t})}getStorage(){return this.remoteStorageAdapter}createTrialStore(e){return new pr(this.transport,this.paywallId,e)}getIdentity(){return this.identity}async setIdentity(e){this.identity=e,await this.transport.request("billing.setIdentity",{identity:e})}async syncIdentity(){const e=await this.transport.request("billing.getIdentity",void 0);return this.identity=e,e}destroy(){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}applyBootstrap(e){this.cachedBootstrap=e;for(const t of[...this.bootstrapListeners])try{t(e)}catch(s){console.warn("[paywall] onBootstrapChange listener threw",s)}}applyUser(e){fr(this.cachedUser,e)||(this.cachedUser=e,this.fireUserListeners(e))}applyBalances(e){gr(this.cachedBalances,e)||(this.cachedBalances=e,this.fireBalanceListeners(e))}fireUserListeners(e){for(const t of[...this.userListeners])try{t(e)}catch(s){console.warn("[paywall] onUserChange listener threw",s)}}fireBalanceListeners(e){for(const t of[...this.balanceListeners])try{t(e)}catch(s){console.warn("[paywall] onBalanceChange listener threw",s)}}}function fr(r,e){return r===e?!0:!r||!e?!1:r.has_active_subscription===e.has_active_subscription&&(r.purchases?.length??0)===(e.purchases?.length??0)}function gr(r,e){if(r===e)return!0;if(!r||!e||r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t].type!==e[t].type||r[t].count!==e[t].count)return!1;return!0}class Te{constructor(e,t){this.transport=e,this.session=null,this.listeners=new Set,this.unsubBroadcast=null,this.paywallId=t.paywallId,this.apiOrigin=t.apiOrigin,this.unsubBroadcast=this.transport.on("authChange",({event:s,session:i})=>{this.applySession(s,i)}),this.hydrated=this.transport.request("auth.getCachedSession",void 0).then(s=>{this.session===null&&s!==null&&(this.session=s)}).catch(()=>{})}ready(){return this.hydrated}getCachedSession(){return this.session}getCachedUser(){return this.session?.user??null}onAuthChange(e){return this.listeners.add(e),this.hydrated.then(()=>{if(this.listeners.has(e))try{e("INITIAL_SESSION",this.session)}catch(t){console.warn("[paywall] onAuthChange INITIAL_SESSION threw",t)}}),()=>{this.listeners.delete(e)}}async signInWithEmail(e){const t=await this.transport.request("auth.signInWithEmail",e);return this.applySession("SIGNED_IN",t),t}async signUp(e){const t=await this.transport.request("auth.signUp",e);return t.kind==="signed_in"&&this.applySession("SIGNED_IN",t.session),t}async signOut(){await this.transport.request("auth.signOut",void 0)}async refresh(){const e=await this.transport.request("auth.refresh",void 0);return this.applySession(e?"TOKEN_REFRESHED":"SIGNED_OUT",e),e}async sendOtp(e){await this.transport.request("auth.sendOtp",e)}async verifyOtp(e){const t=await this.transport.request("auth.verifyOtp",e);return this.applySession(e.type==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",t),t}async resendConfirmation(e){await this.transport.request("auth.resendConfirmation",e)}async requestPasswordReset(e){await this.transport.request("auth.requestPasswordReset",e)}async updatePassword(e){await this.transport.request("auth.updatePassword",e)}async revokeAllSessions(){await this.transport.request("auth.revokeAllSessions",void 0)}async getLastLogin(){return this.transport.request("auth.getLastLogin",void 0)}async signInAnonymously(e={}){const t=await this.transport.request("auth.signInAnonymously",{captchaToken:e.captchaToken,userMeta:e.userMeta,forceNewAnon:e.forceNewAnon});return this.applySession("SIGNED_IN",t),t}async getAccessToken(){return this.transport.request("auth.getAccessToken",void 0)}async signInWithOAuth(e){if(typeof window>"u")throw new v.PaywallError("oauth_unavailable","window is required for OAuth");const t=`pw-oauth-pending-${Math.random().toString(36).slice(2,10)}`,s=window.open("about:blank",t,"width=480,height=640,popup=yes");if(!s)throw new v.PaywallError("popup_blocked","browser blocked auth popup — call from a user gesture");yr(s,e.provider);try{const{authorizeUrl:i,state:o}=await this.transport.request("auth.oauthStart",{provider:e.provider,scopes:e.scopes,userMeta:e.userMeta});s.name=`pw-oauth-${o}`,s.location.replace(i),e.onPopupOpened?.();const a=await v.waitForOAuthCode(s,o),l=await this.transport.request("auth.oauthExchange",{state:o,code:a});return this.applySession("SIGNED_IN",l),l}catch(i){try{s.close()}catch{}throw i}}destroy(){this.unsubBroadcast?.(),this.unsubBroadcast=null,this.listeners.clear(),this.session=null}applySession(e,t){if(!xr(this.session,t)){this.session=t;for(const s of[...this.listeners])try{s(e,t)}catch(i){console.warn("[paywall] onAuthChange listener threw",i)}}}}function xr(r,e){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}const mr={google:"Google",apple:"Apple",github:"GitHub",facebook:"Facebook"};function yr(r,e){const t=mr[e]??e;try{const s=r.document;s.title=`Sign in with ${t}`;const i=s.createElement("style");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)}}",s.head.appendChild(i);const o=s.createElement("div");o.className="pw-oauth-wrap";const a=s.createElement("div");a.className="pw-oauth-spinner";const l=s.createElement("div");l.className="pw-oauth-label",l.textContent=`Connecting to ${t}…`,o.appendChild(a),o.appendChild(l),s.body.appendChild(o)}catch{}}class Be{constructor(e){this.transport=e}track(e,t){typeof e!="string"||e.length===0||this.transport.request("tracker.track",{name:e,props:t}).catch(s=>{console.warn("[paywall] track failed",s)})}}class br{constructor(e){this.factory=e,this.channel=null,this.channelDisposers=[],this.pending=new Map,this.listeners=new Map,this.destroyed=!1,this.nextId=0,this.clientId=`c-${Math.random().toString(36).slice(2,10)}`}ensureChannel(){if(this.destroyed)throw new Error("TransportClient destroyed");if(this.channel)return this.channel;const e=this.factory();this.channel=e;const t=e.onMessage(i=>this.handleMessage(i)),s=e.onDisconnect(()=>this.handleDisconnect());return this.channelDisposers=[t,s],this.request("handshake",{protocolVersion:v.PROTOCOL_VERSION,clientId:this.clientId}).then(i=>{i.protocolVersion!==v.PROTOCOL_VERSION&&console.warn(`[sdk-extension] protocol version mismatch: client=${v.PROTOCOL_VERSION}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`)}).catch(()=>{}),e}handleMessage(e){if(kr(e)){if(e.type==="response"){const t=this.pending.get(e.id);if(!t)return;this.pending.delete(e.id),t.signal?.removeEventListener("abort",t.abortListener),e.ok?t.resolve(e.result):t.reject(v.reconstructError(e.error));return}if(e.type==="event"){const t=this.listeners.get(e.kind);if(!t)return;for(const s of[...t])try{s(e.payload)}catch(i){console.error("[sdk-extension] event handler threw",i)}}}}handleDisconnect(){for(const t of this.channelDisposers)t();this.channelDisposers=[],this.channel=null;const e=Array.from(this.pending.values());this.pending.clear();for(const t of e)t.signal?.removeEventListener("abort",t.abortListener),t.reject(new wr)}request(e,t,s={}){if(this.destroyed)return Promise.reject(new Error("TransportClient destroyed"));if(s.signal?.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));const i=this.ensureChannel(),o=`r${++this.nextId}`;return new Promise((a,l)=>{const c={resolve:a,reject:l,signal:s.signal};s.signal&&(c.abortListener=()=>{if(this.pending.delete(o)){l(new DOMException("Aborted","AbortError"));try{i.send({type:"cancel",id:o})}catch{}}},s.signal.addEventListener("abort",c.abortListener)),this.pending.set(o,c);const h={type:"request",id:o,kind:e,params:t};try{i.send(h)}catch(u){this.pending.delete(o),s.signal?.removeEventListener("abort",c.abortListener),l(u)}})}on(e,t){let s=this.listeners.get(e);s||(s=new Set,this.listeners.set(e,s));const i=t;return s.add(i),this.ensureChannel(),()=>{s.delete(i)}}destroy(){if(this.destroyed)return;this.destroyed=!0;for(const t of this.channelDisposers)t();this.channelDisposers=[],this.listeners.clear();const e=Array.from(this.pending.values());this.pending.clear();for(const t of e)t.signal?.removeEventListener("abort",t.abortListener),t.reject(new Error("TransportClient destroyed"));this.channel?.close(),this.channel=null}}class wr extends Error{constructor(){super("Transport channel disconnected mid-request"),this.code="transport_disconnected",this.name="TransportDisconnectedError"}}function kr(r){if(typeof r!="object"||r===null)return!1;const e=r.type;return e==="request"||e==="response"||e==="event"}let G=null;function Oe(){return G||(G=new br(()=>v.createRuntimeChannel(Re.PORT_NAME)),G)}class vr extends or{constructor(e){const t=Oe(),s=new Me(t,{paywallId:e.paywallId,apiOrigin:e.apiOrigin});let i;e.auth===!0?i=new Te(t,{paywallId:e.paywallId,apiOrigin:e.apiOrigin}):e.auth&&console.warn("[sdk-extension] passing AuthClient instance to PaywallUI.opts.auth is not supported in extension mode — pass `auth: true` to use offscreen-shared auth, or omit for hybrid identity-only mode."),i&&(s.auth=i),super({...e,client:s,auth:i,analytics:!1}),this.remoteTracker=null,this.trackerUnsubs=[],e.analytics!==!1&&(this.remoteTracker=new Be(t),this.bindAnalytics())}bindAnalytics(){const e=this.remoteTracker;e&&this.trackerUnsubs.push(this.on("open",()=>e.track("paywall_opened")),this.on("ready",t=>e.track("paywall_viewed",{is_test_mode:t.settings.is_test_mode,prices_count:t.prices.length,offers_count:t.offers.length})),this.on("price_selected",t=>e.track("price_selected",{price_id:t.priceId})),this.on("checkout_started",t=>e.track("checkout_started",{price_id:t.priceId,acquiring:t.acquiring})),this.on("purchase_completed",t=>e.track("purchase_completed",{price_id:t.priceId,session_id:t.sessionId})),this.on("purchase_failed",t=>e.track("purchase_failed",{reason:t.reason})),this.on("close",()=>e.track("paywall_closed")),this.on("trial_blocked",t=>e.track("trial_blocked",{mode:t.mode,...t.mode==="time"?{remaining_ms:t.remainingMs,total_ms:t.totalMs}:t.mode==="opens"?{remaining_actions:t.remainingActions,total_actions:t.totalActions}:{}})),this.on("trial_expired",()=>e.track("trial_expired")),this.on("visibility_blocked",t=>e.track("visibility_blocked",{reason:t.reason,country:t.country,tier:t.tier})),this.on("error",t=>e.track("error",{code:t.code,message:t.message})))}track(e,t){this.remoteTracker?.track(e,t)}destroy(){for(const e of this.trackerUnsubs)e();this.trackerUnsubs=[],this.remoteTracker=null,super.destroy()}}exports.PROTOCOL_VERSION=v.PROTOCOL_VERSION;exports.PaywallUI=vr;exports.RemoteAuthClient=Te;exports.RemoteBillingClient=Me;exports.RemoteEventTracker=Be;exports.getContentTransport=Oe;
26
26
  //# sourceMappingURL=content.cjs.map