@monetize.software/sdk 3.0.0-alpha.12 → 3.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/PaywallUI-DA8Kj9fJ.js +26 -0
- package/dist/chunks/PaywallUI-DA8Kj9fJ.js.map +1 -0
- package/dist/chunks/{PaywallUI-pb7JpLr6.js → PaywallUI-vv6Hw8su.js} +1255 -1091
- package/dist/chunks/PaywallUI-vv6Hw8su.js.map +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +11 -0
- package/dist/core.js +76 -72
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +73 -25
- package/dist/index.js +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +73 -25
- package/dist/ui.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/PaywallUI-CSgfmhHq.js +0 -26
- package/dist/chunks/PaywallUI-CSgfmhHq.js.map +0 -1
- package/dist/chunks/PaywallUI-pb7JpLr6.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PaywallError as
|
|
2
|
-
import { render as
|
|
3
|
-
import { jsx as a, jsxs as d, Fragment as
|
|
4
|
-
import { useContext as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
return `paywall-${
|
|
1
|
+
import { PaywallError as L, findApplicableOffer as N, BillingClient as Ne, EventTracker as He, resolveOffer as $e, readBrowserOfferStart as Ve, AuthClient as de } from "../core.js";
|
|
2
|
+
import { render as X, h as ue, createContext as qe } from "preact";
|
|
3
|
+
import { jsx as a, jsxs as d, Fragment as se } from "preact/jsx-runtime";
|
|
4
|
+
import { useContext as Ge, useState as v, useEffect as j, useRef as F, useMemo as We, useLayoutEffect as Ze } from "preact/hooks";
|
|
5
|
+
const pe = 3600 * 1e3;
|
|
6
|
+
function J(t) {
|
|
7
|
+
return `paywall-${t}-trial-time-first-open`;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return `paywall-${
|
|
9
|
+
function Q(t) {
|
|
10
|
+
return `paywall-${t}-skip-times`;
|
|
11
11
|
}
|
|
12
|
-
class
|
|
13
|
-
constructor(
|
|
14
|
-
this.storage =
|
|
12
|
+
class Ie {
|
|
13
|
+
constructor(e, r, i) {
|
|
14
|
+
this.storage = e, this.paywallId = r, this.config = i;
|
|
15
15
|
}
|
|
16
16
|
async check() {
|
|
17
17
|
return this.config.mode === "time" ? this.checkTime() : this.checkOpens();
|
|
@@ -20,70 +20,70 @@ class Ct {
|
|
|
20
20
|
return this.config.mode === "time" ? this.recordTime() : this.recordOpens();
|
|
21
21
|
}
|
|
22
22
|
async reset() {
|
|
23
|
-
await this.storage.removeItem(this.config.mode === "time" ?
|
|
23
|
+
await this.storage.removeItem(this.config.mode === "time" ? J(this.paywallId) : Q(this.paywallId));
|
|
24
24
|
}
|
|
25
25
|
async checkTime() {
|
|
26
|
-
const
|
|
26
|
+
const e = this.config.payload * pe, r = await this.storage.getItem(J(this.paywallId)), i = r ? Number(r) : null;
|
|
27
27
|
if (!i || !Number.isFinite(i))
|
|
28
28
|
return {
|
|
29
29
|
mode: "time",
|
|
30
30
|
blocked: !0,
|
|
31
31
|
startedAt: null,
|
|
32
32
|
expiresAt: null,
|
|
33
|
-
remainingMs:
|
|
34
|
-
totalMs:
|
|
33
|
+
remainingMs: e,
|
|
34
|
+
totalMs: e
|
|
35
35
|
};
|
|
36
|
-
const n = i +
|
|
36
|
+
const n = i + e, s = Math.max(0, n - Date.now());
|
|
37
37
|
return {
|
|
38
38
|
mode: "time",
|
|
39
|
-
blocked:
|
|
39
|
+
blocked: s > 0,
|
|
40
40
|
startedAt: i,
|
|
41
41
|
expiresAt: n,
|
|
42
|
-
remainingMs:
|
|
43
|
-
totalMs:
|
|
42
|
+
remainingMs: s,
|
|
43
|
+
totalMs: e
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
async checkOpens() {
|
|
47
|
-
const
|
|
47
|
+
const e = this.config.payload, r = await this.storage.getItem(Q(this.paywallId)), i = r ? Number(r) : 0, n = Number.isFinite(i) ? i : 0, s = n < e, o = Math.max(0, e - n);
|
|
48
48
|
return {
|
|
49
49
|
mode: "opens",
|
|
50
|
-
blocked:
|
|
51
|
-
remainingActions:
|
|
52
|
-
totalActions:
|
|
50
|
+
blocked: s,
|
|
51
|
+
remainingActions: o,
|
|
52
|
+
totalActions: e
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
async recordTime() {
|
|
56
|
-
const
|
|
56
|
+
const e = this.config.payload * pe, r = J(this.paywallId), i = await this.storage.getItem(r);
|
|
57
57
|
let n = i ? Number(i) : null;
|
|
58
58
|
(!n || !Number.isFinite(n)) && (n = Date.now(), await this.storage.setItem(r, String(n)));
|
|
59
|
-
const
|
|
59
|
+
const s = n + e, o = Math.max(0, s - Date.now());
|
|
60
60
|
return {
|
|
61
61
|
mode: "time",
|
|
62
|
-
blocked:
|
|
62
|
+
blocked: o > 0,
|
|
63
63
|
startedAt: n,
|
|
64
|
-
expiresAt:
|
|
65
|
-
remainingMs:
|
|
66
|
-
totalMs:
|
|
64
|
+
expiresAt: s,
|
|
65
|
+
remainingMs: o,
|
|
66
|
+
totalMs: e
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
async recordOpens() {
|
|
70
|
-
const
|
|
71
|
-
await this.storage.setItem(r, String(
|
|
72
|
-
const c = Math.max(0,
|
|
70
|
+
const e = this.config.payload, r = Q(this.paywallId), i = await this.storage.getItem(r), n = i ? Number(i) : 0, s = Number.isFinite(n) ? n : 0, o = Math.min(e, s + 1);
|
|
71
|
+
await this.storage.setItem(r, String(o));
|
|
72
|
+
const c = Math.max(0, e - o);
|
|
73
73
|
return {
|
|
74
74
|
mode: "opens",
|
|
75
|
-
blocked:
|
|
75
|
+
blocked: o < e,
|
|
76
76
|
remainingActions: c,
|
|
77
|
-
totalActions:
|
|
77
|
+
totalActions: e
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
let
|
|
82
|
-
class
|
|
83
|
-
constructor(
|
|
84
|
-
|
|
81
|
+
let he = !1;
|
|
82
|
+
class Ke {
|
|
83
|
+
constructor(e, r, i) {
|
|
84
|
+
he || (he = !0, console.warn(
|
|
85
85
|
'[paywall] trial.storage="server" is not implemented yet — falling back to client storage. State lives in localStorage; users can reset trial by clearing site data.'
|
|
86
|
-
)), this.fallback = new
|
|
86
|
+
)), this.fallback = new Ie(e, r, i);
|
|
87
87
|
}
|
|
88
88
|
check() {
|
|
89
89
|
return this.fallback.check();
|
|
@@ -95,23 +95,23 @@ class Zt {
|
|
|
95
95
|
return this.fallback.reset();
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
return r.storage === "server" ? new
|
|
98
|
+
function Ye(t, e, r) {
|
|
99
|
+
return r.storage === "server" ? new Ke(t, e, r) : new Ie(t, e, r);
|
|
100
100
|
}
|
|
101
|
-
const It = '/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-600:oklch(57.7% .245 27.325);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{all:initial;color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*,:before,:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}button{cursor:pointer;font-family:inherit}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.-top-2{top:calc(var(--spacing) * -2)}.-top-\\[9px\\]{top:-9px}.-top-\\[10px\\]{top:-10px}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.-right-\\[6px\\]{right:-6px}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.left-1\\/2{left:50%}.z-10{z-index:10}.z-\\[1\\]{z-index:1}.z-\\[2147483647\\]{z-index:2147483647}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-mt-3{margin-top:calc(var(--spacing) * -3)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.-mb-2{margin-bottom:calc(var(--spacing) * -2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-1{height:calc(var(--spacing) * 1)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-6\\.5{height:calc(var(--spacing) * 6.5)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-\\[22px\\]{height:22px}.h-full{height:100%}.h-px{height:1px}.max-h-\\[calc\\(100dvh-1rem\\)\\]{max-height:calc(100dvh - 1rem)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-\\[2\\.4em\\]{min-height:2.4em}.min-h-\\[120px\\]{min-height:120px}.w-1{width:calc(var(--spacing) * 1)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-6\\.5{width:calc(var(--spacing) * 6.5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-full{width:100%}.max-w-\\[18rem\\]{max-width:18rem}.max-w-\\[20rem\\]{max-width:20rem}.max-w-\\[75\\%\\]{max-width:75%}.max-w-\\[320px\\]{max-width:320px}.max-w-\\[360px\\]{max-width:360px}.max-w-\\[400px\\]{max-width:400px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[pw-fade-in_180ms_ease-out\\]{animation:.18s ease-out pw-fade-in}.animate-\\[pw-scale-in_220ms_cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{animation:.22s cubic-bezier(.16,1,.3,1) pw-scale-in}.animate-ping{animation:var(--animate-ping)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-1\\.5{column-gap:calc(var(--spacing) * 1.5)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.self-center{align-self:center}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[9px\\]{border-radius:9px}.rounded-\\[11px\\]{border-radius:11px}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.rounded-tl-xl{border-top-left-radius:var(--radius-xl)}.rounded-tr-xl{border-top-right-radius:var(--radius-xl)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[2\\.5px\\]{border-style:var(--tw-border-style);border-width:2.5px}.border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.border-\\[5px\\]{border-style:var(--tw-border-style);border-width:5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b,.border-b-1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\[var\\(--pw-accent\\)\\]{border-color:var(--pw-accent)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-white{border-color:var(--color-white)}.border-white\\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\\/40{border-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.border-t-\\[var\\(--pw-accent\\)\\]{border-top-color:var(--pw-accent)}.border-t-gray-700{border-top-color:var(--color-gray-700)}.border-t-white{border-top-color:var(--color-white)}.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:var(--pw-accent)}@supports (color:color-mix(in lab,red,red)){.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:color-mix(in srgb,var(--pw-accent) 6%,white)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/60{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/60{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-red-50{background-color:var(--color-red-50)}.bg-slate-950\\/50{background-color:#02061880}@supports (color:color-mix(in lab,red,red)){.bg-slate-950\\/50{background-color:color-mix(in oklab,var(--color-slate-950) 50%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.p-2{padding:calc(var(--spacing) * 2)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-3\\.5{padding-bottom:calc(var(--spacing) * 3.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.9375rem\\]{font-size:.9375rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[26px\\]{font-size:26px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-700{color:var(--color-emerald-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-800\\/70{color:#1e2939b3}@supports (color:color-mix(in lab,red,red)){.text-gray-800\\/70{color:color-mix(in oklab,var(--color-gray-800) 70%,transparent)}}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-transparent{color:#0000}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.decoration-gray-400{-webkit-text-decoration-color:var(--color-gray-400);text-decoration-color:var(--color-gray-400)}.decoration-\\[1\\.5px\\]{text-decoration-thickness:1.5px}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_2px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#ef444480);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-8{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.\\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.placeholder\\:text-gray-500::placeholder{color:var(--color-gray-500)}@media(hover:hover){.hover\\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-50\\/60:hover{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-50\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-gray-200\\/60:hover{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-200\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}.hover\\:text-gray-900:hover{color:var(--color-gray-900)}.hover\\:text-red-600:hover{color:var(--color-red-600)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:brightness-105:hover{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\\:bg-gray-200\\/60:focus{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.focus\\:bg-gray-200\\/60:focus{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,var(--pw-accent))}@supports (color:color-mix(in lab,red,red)){.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,color-mix(in srgb,var(--pw-accent) 30%,transparent))}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:opacity-80:focus-visible{opacity:.8}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-\\[var\\(--pw-accent\\)\\]:focus-visible{--tw-ring-color:var(--pw-accent)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:scale-\\[0\\.98\\]:active{scale:.98}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-60:disabled{opacity:.6}@media(hover:hover){.disabled\\:hover\\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\\:hover\\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(min-width:40rem){.sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.sm\\:p-4{padding:calc(var(--spacing) * 4)}.sm\\:p-8{padding:calc(var(--spacing) * 8)}.sm\\:px-8{padding-inline:calc(var(--spacing) * 8)}.sm\\:pt-5{padding-top:calc(var(--spacing) * 5)}.sm\\:pt-8{padding-top:calc(var(--spacing) * 8)}.sm\\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\\:pb-8{padding-bottom:calc(var(--spacing) * 8)}.sm\\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}}.pw-cta-shimmer:before{content:"";z-index:1;background:linear-gradient(90deg,#0000,#ffffff59 50%,#0000);width:100%;height:100%;animation:3s infinite pw-cta-shimmer;position:absolute;top:0;left:-100%}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}';
|
|
102
|
-
let
|
|
103
|
-
function
|
|
104
|
-
if (
|
|
105
|
-
let
|
|
101
|
+
const Ae = '/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-600:oklch(57.7% .245 27.325);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{all:initial;color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*,:before,:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}button{cursor:pointer;font-family:inherit}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.-top-2{top:calc(var(--spacing) * -2)}.-top-\\[9px\\]{top:-9px}.-top-\\[10px\\]{top:-10px}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.-right-\\[6px\\]{right:-6px}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.left-1\\/2{left:50%}.z-10{z-index:10}.z-\\[1\\]{z-index:1}.z-\\[2147483647\\]{z-index:2147483647}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-mt-3{margin-top:calc(var(--spacing) * -3)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.-mb-2{margin-bottom:calc(var(--spacing) * -2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-1{height:calc(var(--spacing) * 1)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-6\\.5{height:calc(var(--spacing) * 6.5)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-\\[22px\\]{height:22px}.h-full{height:100%}.h-px{height:1px}.max-h-\\[calc\\(100dvh-1rem\\)\\]{max-height:calc(100dvh - 1rem)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-\\[2\\.4em\\]{min-height:2.4em}.min-h-\\[120px\\]{min-height:120px}.w-1{width:calc(var(--spacing) * 1)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-6\\.5{width:calc(var(--spacing) * 6.5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-full{width:100%}.max-w-\\[18rem\\]{max-width:18rem}.max-w-\\[20rem\\]{max-width:20rem}.max-w-\\[75\\%\\]{max-width:75%}.max-w-\\[320px\\]{max-width:320px}.max-w-\\[360px\\]{max-width:360px}.max-w-\\[400px\\]{max-width:400px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[pw-fade-in_180ms_ease-out\\]{animation:.18s ease-out pw-fade-in}.animate-\\[pw-scale-in_220ms_cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{animation:.22s cubic-bezier(.16,1,.3,1) pw-scale-in}.animate-ping{animation:var(--animate-ping)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-1\\.5{column-gap:calc(var(--spacing) * 1.5)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.self-center{align-self:center}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[9px\\]{border-radius:9px}.rounded-\\[11px\\]{border-radius:11px}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.rounded-tl-xl{border-top-left-radius:var(--radius-xl)}.rounded-tr-xl{border-top-right-radius:var(--radius-xl)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[2\\.5px\\]{border-style:var(--tw-border-style);border-width:2.5px}.border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.border-\\[5px\\]{border-style:var(--tw-border-style);border-width:5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b,.border-b-1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\[var\\(--pw-accent\\)\\]{border-color:var(--pw-accent)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-white{border-color:var(--color-white)}.border-white\\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\\/40{border-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.border-t-\\[var\\(--pw-accent\\)\\]{border-top-color:var(--pw-accent)}.border-t-gray-700{border-top-color:var(--color-gray-700)}.border-t-white{border-top-color:var(--color-white)}.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:var(--pw-accent)}@supports (color:color-mix(in lab,red,red)){.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:color-mix(in srgb,var(--pw-accent) 6%,white)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/60{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/60{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-red-50{background-color:var(--color-red-50)}.bg-slate-950\\/50{background-color:#02061880}@supports (color:color-mix(in lab,red,red)){.bg-slate-950\\/50{background-color:color-mix(in oklab,var(--color-slate-950) 50%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.p-2{padding:calc(var(--spacing) * 2)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-3\\.5{padding-bottom:calc(var(--spacing) * 3.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.9375rem\\]{font-size:.9375rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[26px\\]{font-size:26px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-700{color:var(--color-emerald-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-800\\/70{color:#1e2939b3}@supports (color:color-mix(in lab,red,red)){.text-gray-800\\/70{color:color-mix(in oklab,var(--color-gray-800) 70%,transparent)}}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-transparent{color:#0000}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.decoration-gray-400{-webkit-text-decoration-color:var(--color-gray-400);text-decoration-color:var(--color-gray-400)}.decoration-\\[1\\.5px\\]{text-decoration-thickness:1.5px}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_2px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#ef444480);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-8{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.\\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.placeholder\\:text-gray-500::placeholder{color:var(--color-gray-500)}@media(hover:hover){.hover\\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-50\\/60:hover{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-50\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-gray-200\\/60:hover{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-200\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}.hover\\:text-gray-900:hover{color:var(--color-gray-900)}.hover\\:text-red-600:hover{color:var(--color-red-600)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:brightness-105:hover{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\\:bg-gray-200\\/60:focus{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.focus\\:bg-gray-200\\/60:focus{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,var(--pw-accent))}@supports (color:color-mix(in lab,red,red)){.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,color-mix(in srgb,var(--pw-accent) 30%,transparent))}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:opacity-80:focus-visible{opacity:.8}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-\\[var\\(--pw-accent\\)\\]:focus-visible{--tw-ring-color:var(--pw-accent)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:scale-\\[0\\.98\\]:active{scale:.98}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-60:disabled{opacity:.6}@media(hover:hover){.disabled\\:hover\\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\\:hover\\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(min-width:40rem){.sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.sm\\:p-4{padding:calc(var(--spacing) * 4)}.sm\\:p-8{padding:calc(var(--spacing) * 8)}.sm\\:px-8{padding-inline:calc(var(--spacing) * 8)}.sm\\:pt-5{padding-top:calc(var(--spacing) * 5)}.sm\\:pt-8{padding-top:calc(var(--spacing) * 8)}.sm\\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\\:pb-8{padding-bottom:calc(var(--spacing) * 8)}.sm\\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}}.pw-cta-shimmer:before{content:"";z-index:1;background:linear-gradient(90deg,#0000,#ffffff59 50%,#0000);width:100%;height:100%;animation:3s infinite pw-cta-shimmer;position:absolute;top:0;left:-100%}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}';
|
|
102
|
+
let ge = !1;
|
|
103
|
+
function Xe() {
|
|
104
|
+
if (ge || (ge = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
|
|
105
|
+
let t;
|
|
106
106
|
try {
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const e = new CSSStyleSheet();
|
|
108
|
+
e.replaceSync(Ae), t = e.cssRules;
|
|
109
109
|
} catch {
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
for (const
|
|
113
|
-
if (
|
|
114
|
-
const r =
|
|
112
|
+
for (const e of t) {
|
|
113
|
+
if (e.constructor.name !== "CSSPropertyRule") continue;
|
|
114
|
+
const r = e;
|
|
115
115
|
try {
|
|
116
116
|
CSS.registerProperty({
|
|
117
117
|
name: r.name,
|
|
@@ -123,13 +123,13 @@ function Yt() {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Je(t, e, r = {}) {
|
|
127
127
|
if (typeof document > "u")
|
|
128
128
|
throw new Error("mountShadow called in non-DOM environment");
|
|
129
|
-
|
|
129
|
+
Xe();
|
|
130
130
|
const i = r.host ?? document.createElement("div");
|
|
131
131
|
i.setAttribute("data-paywall-host", ""), i.style.cssText = r.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;", !i.isConnected && !r.inline && document.body.appendChild(i);
|
|
132
|
-
const n = i.attachShadow({ mode: r.shadowMode ?? "closed" }),
|
|
132
|
+
const n = i.attachShadow({ mode: r.shadowMode ?? "closed" }), s = `
|
|
133
133
|
:host {
|
|
134
134
|
all: initial !important;
|
|
135
135
|
display: block !important;
|
|
@@ -147,34 +147,34 @@ function Xt(e, t, r = {}) {
|
|
|
147
147
|
cursor: auto !important;
|
|
148
148
|
visibility: visible !important;
|
|
149
149
|
}
|
|
150
|
-
`,
|
|
151
|
-
|
|
150
|
+
`, o = document.createElement("style");
|
|
151
|
+
o.textContent = s + Ae + (r.injectCss ?? ""), n.appendChild(o);
|
|
152
152
|
const c = document.createElement("div");
|
|
153
153
|
c.style.pointerEvents = "auto", n.appendChild(c);
|
|
154
|
-
let l =
|
|
155
|
-
return
|
|
154
|
+
let l = e;
|
|
155
|
+
return X(ue(t, l), c), {
|
|
156
156
|
shadowRoot: n,
|
|
157
|
-
update(
|
|
158
|
-
l = { ...l, ...
|
|
157
|
+
update(p) {
|
|
158
|
+
l = { ...l, ...p }, X(ue(t, l), c);
|
|
159
159
|
},
|
|
160
160
|
unmount() {
|
|
161
|
-
|
|
161
|
+
X(null, c), i.remove();
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
const
|
|
166
|
-
const i = e
|
|
167
|
-
return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((n,
|
|
165
|
+
const Qe = (t, e, r) => {
|
|
166
|
+
const i = t[e];
|
|
167
|
+
return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((n, s) => {
|
|
168
168
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
169
|
-
|
|
169
|
+
s.bind(
|
|
170
170
|
null,
|
|
171
171
|
new Error(
|
|
172
|
-
"Unknown variable dynamic import: " +
|
|
172
|
+
"Unknown variable dynamic import: " + e + (e.split("/").length !== r ? ". Note that variables only represent file names one level deep." : "")
|
|
173
173
|
)
|
|
174
174
|
)
|
|
175
175
|
);
|
|
176
176
|
});
|
|
177
|
-
},
|
|
177
|
+
}, et = [
|
|
178
178
|
"ru",
|
|
179
179
|
"uk",
|
|
180
180
|
"de",
|
|
@@ -202,130 +202,130 @@ const Jt = (e, t, r) => {
|
|
|
202
202
|
"th",
|
|
203
203
|
"vi",
|
|
204
204
|
"he"
|
|
205
|
-
],
|
|
206
|
-
function
|
|
207
|
-
if (!
|
|
208
|
-
let r =
|
|
209
|
-
for (const [i, n] of Object.entries(
|
|
205
|
+
], Me = (t, e, r) => Te(e, r), Le = qe({ t: Me, locale: "en" });
|
|
206
|
+
function Te(t, e) {
|
|
207
|
+
if (!e) return t;
|
|
208
|
+
let r = t;
|
|
209
|
+
for (const [i, n] of Object.entries(e))
|
|
210
210
|
r = r.split(`{${i}}`).join(String(n));
|
|
211
211
|
return r;
|
|
212
212
|
}
|
|
213
|
-
const
|
|
214
|
-
function
|
|
215
|
-
return
|
|
213
|
+
const ee = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Map();
|
|
214
|
+
function Pe(t) {
|
|
215
|
+
return et.includes(t);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
const
|
|
217
|
+
function tt(t) {
|
|
218
|
+
const e = [];
|
|
219
219
|
if (typeof navigator < "u" && navigator.language) {
|
|
220
|
-
|
|
220
|
+
e.push(navigator.language);
|
|
221
221
|
const i = navigator.language.split("-")[0];
|
|
222
|
-
i && i !== navigator.language &&
|
|
222
|
+
i && i !== navigator.language && e.push(i);
|
|
223
223
|
}
|
|
224
|
-
const r =
|
|
224
|
+
const r = t.settings.locale_default;
|
|
225
225
|
if (r) {
|
|
226
|
-
|
|
226
|
+
e.push(r);
|
|
227
227
|
const i = r.split("-")[0];
|
|
228
|
-
i && i !== r &&
|
|
228
|
+
i && i !== r && e.push(i);
|
|
229
229
|
}
|
|
230
|
-
for (const i of
|
|
231
|
-
if (
|
|
230
|
+
for (const i of e)
|
|
231
|
+
if (Pe(i)) return i;
|
|
232
232
|
return null;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
return !!
|
|
234
|
+
function rt(t, e) {
|
|
235
|
+
return !!t.locales && t.locales[e] !== void 0;
|
|
236
236
|
}
|
|
237
|
-
async function
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
240
|
-
const r =
|
|
237
|
+
async function it(t) {
|
|
238
|
+
const e = ee.get(t);
|
|
239
|
+
if (e) return e;
|
|
240
|
+
const r = te.get(t);
|
|
241
241
|
if (r) return r;
|
|
242
|
-
const i =
|
|
243
|
-
const
|
|
244
|
-
return
|
|
242
|
+
const i = Qe(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./ar-B2Wg_IrC.js"), "./locales/cs.ts": () => import("./cs-BNo9Dx0Q.js"), "./locales/da.ts": () => import("./da-Do9Lq6En.js"), "./locales/de.ts": () => import("./de-C8pDZNvx.js"), "./locales/el.ts": () => import("./el-DzMNX-_P.js"), "./locales/es.ts": () => import("./es-YrKt-q4w.js"), "./locales/fi.ts": () => import("./fi-Bh44pwZ4.js"), "./locales/fr.ts": () => import("./fr-Bc0pw4ws.js"), "./locales/he.ts": () => import("./he-Bfm-bhe3.js"), "./locales/hi.ts": () => import("./hi-D-O-B9Dn.js"), "./locales/hu.ts": () => import("./hu-CmIuAbLL.js"), "./locales/id.ts": () => import("./id-DN7IES-A.js"), "./locales/it.ts": () => import("./it-Cz5Nmqx5.js"), "./locales/ja.ts": () => import("./ja-BH9BlBh2.js"), "./locales/ko.ts": () => import("./ko-CYV9QuYs.js"), "./locales/nl.ts": () => import("./nl-BvkB900D.js"), "./locales/no.ts": () => import("./no-3s9_ormb.js"), "./locales/pl.ts": () => import("./pl-C9WTGQtb.js"), "./locales/pt.ts": () => import("./pt-uFVUv_Op.js"), "./locales/ro.ts": () => import("./ro-BrqQ8Au-.js"), "./locales/ru.ts": () => import("./ru-DK594dA8.js"), "./locales/sv.ts": () => import("./sv-CHNH8-mq.js"), "./locales/th.ts": () => import("./th-l24Pm5q-.js"), "./locales/tr.ts": () => import("./tr-ADpigSY5.js"), "./locales/uk.ts": () => import("./uk-CGqo4jek.js"), "./locales/vi.ts": () => import("./vi-Dk9bTu6f.js"), "./locales/zh.ts": () => import("./zh-LDkEV2D9.js") }), `./locales/${t}.ts`, 3).then((n) => {
|
|
243
|
+
const s = n.default ?? {};
|
|
244
|
+
return ee.set(t, s), s;
|
|
245
245
|
}).catch((n) => {
|
|
246
|
-
console.warn(`[paywall] failed to load locale chunk "${
|
|
247
|
-
const
|
|
248
|
-
return
|
|
246
|
+
console.warn(`[paywall] failed to load locale chunk "${t}"`, n);
|
|
247
|
+
const s = {};
|
|
248
|
+
return ee.set(t, s), s;
|
|
249
249
|
}).finally(() => {
|
|
250
|
-
|
|
250
|
+
te.delete(t);
|
|
251
251
|
});
|
|
252
|
-
return
|
|
253
|
-
}
|
|
254
|
-
function
|
|
255
|
-
const [i, n] =
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
if (!
|
|
259
|
-
const
|
|
260
|
-
return !
|
|
252
|
+
return te.set(t, i), i;
|
|
253
|
+
}
|
|
254
|
+
function nt({ bootstrap: t, forceLocale: e, children: r }) {
|
|
255
|
+
const [i, n] = v("en"), [s, o] = v(null);
|
|
256
|
+
j(() => {
|
|
257
|
+
const p = (e && Pe(e) ? e : null) ?? (() => {
|
|
258
|
+
if (!t) return null;
|
|
259
|
+
const f = tt(t);
|
|
260
|
+
return !f || !rt(t, f) ? null : f;
|
|
261
261
|
})();
|
|
262
|
-
if (!
|
|
263
|
-
(
|
|
262
|
+
if (!p) {
|
|
263
|
+
(s !== null || i !== "en") && (n("en"), o(null));
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
266
|
-
if (
|
|
266
|
+
if (p === i && s) return;
|
|
267
267
|
let u = !1;
|
|
268
|
-
return
|
|
269
|
-
u || (n(
|
|
268
|
+
return it(p).then((f) => {
|
|
269
|
+
u || (n(p), o(f));
|
|
270
270
|
}), () => {
|
|
271
271
|
u = !0;
|
|
272
272
|
};
|
|
273
|
-
}, [
|
|
273
|
+
}, [t, e]);
|
|
274
274
|
const c = {
|
|
275
275
|
locale: i,
|
|
276
|
-
t:
|
|
276
|
+
t: s ? (l, p, u) => Te(s[l] ?? p, u) : Me
|
|
277
277
|
};
|
|
278
|
-
return /* @__PURE__ */ a(
|
|
278
|
+
return /* @__PURE__ */ a(Le.Provider, { value: c, children: r });
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function S() {
|
|
281
|
+
return Ge(Le);
|
|
282
282
|
}
|
|
283
|
-
const
|
|
284
|
-
function
|
|
285
|
-
open:
|
|
286
|
-
onClose:
|
|
283
|
+
const fe = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
284
|
+
function at({
|
|
285
|
+
open: t,
|
|
286
|
+
onClose: e,
|
|
287
287
|
labelledBy: r,
|
|
288
288
|
brandColor: i,
|
|
289
289
|
topBanner: n,
|
|
290
|
-
allowClose:
|
|
291
|
-
hideCloseButton:
|
|
290
|
+
allowClose: s = !0,
|
|
291
|
+
hideCloseButton: o = !1,
|
|
292
292
|
inline: c = !1,
|
|
293
293
|
children: l
|
|
294
294
|
}) {
|
|
295
|
-
const { t:
|
|
296
|
-
return
|
|
297
|
-
if (!
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
if (!
|
|
304
|
-
|
|
295
|
+
const { t: p } = S(), u = F(null), f = F(null);
|
|
296
|
+
return j(() => {
|
|
297
|
+
if (!t) return;
|
|
298
|
+
f.current = document.activeElement ?? null;
|
|
299
|
+
const w = u.current;
|
|
300
|
+
w && (w.querySelector(fe) ?? w).focus({ preventScroll: !0 });
|
|
301
|
+
const A = (m) => {
|
|
302
|
+
if (m.key === "Escape") {
|
|
303
|
+
if (!s) return;
|
|
304
|
+
m.stopPropagation(), e();
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
u.current.querySelectorAll(
|
|
307
|
+
if (m.key !== "Tab" || !u.current) return;
|
|
308
|
+
const C = Array.from(
|
|
309
|
+
u.current.querySelectorAll(fe)
|
|
310
310
|
).filter((z) => !z.hasAttribute("disabled") && z.tabIndex !== -1);
|
|
311
|
-
if (
|
|
312
|
-
|
|
311
|
+
if (C.length === 0) {
|
|
312
|
+
m.preventDefault();
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
|
|
315
|
+
const I = C[0], B = C[C.length - 1], M = document.activeElement;
|
|
316
|
+
m.shiftKey && M === I ? (m.preventDefault(), B.focus()) : !m.shiftKey && M === B && (m.preventDefault(), I.focus());
|
|
317
317
|
};
|
|
318
|
-
document.addEventListener("keydown",
|
|
319
|
-
const
|
|
318
|
+
document.addEventListener("keydown", A, !0);
|
|
319
|
+
const b = document.body.style.overflow;
|
|
320
320
|
return c || (document.body.style.overflow = "hidden"), () => {
|
|
321
|
-
document.removeEventListener("keydown",
|
|
321
|
+
document.removeEventListener("keydown", A, !0), c || (document.body.style.overflow = b), f.current?.focus?.({ preventScroll: !0 });
|
|
322
322
|
};
|
|
323
|
-
}, [
|
|
323
|
+
}, [t, e, s, c]), t ? /* @__PURE__ */ d(
|
|
324
324
|
"div",
|
|
325
325
|
{
|
|
326
326
|
class: `${c ? "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]`,
|
|
327
|
-
onClick: (
|
|
328
|
-
|
|
327
|
+
onClick: (w) => {
|
|
328
|
+
s && w.target === w.currentTarget && e();
|
|
329
329
|
},
|
|
330
330
|
"data-pw-root": !0,
|
|
331
331
|
children: [
|
|
@@ -350,12 +350,12 @@ function ne({
|
|
|
350
350
|
},
|
|
351
351
|
children: [
|
|
352
352
|
l,
|
|
353
|
-
|
|
353
|
+
s && !o ? /* @__PURE__ */ a(
|
|
354
354
|
"button",
|
|
355
355
|
{
|
|
356
356
|
type: "button",
|
|
357
|
-
onClick:
|
|
358
|
-
"aria-label":
|
|
357
|
+
onClick: e,
|
|
358
|
+
"aria-label": p("modal.close_aria", "Close"),
|
|
359
359
|
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)]",
|
|
360
360
|
children: /* @__PURE__ */ a("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ a(
|
|
361
361
|
"path",
|
|
@@ -385,22 +385,22 @@ function ne({
|
|
|
385
385
|
}
|
|
386
386
|
) : null;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
switch (
|
|
388
|
+
function ot(t, e) {
|
|
389
|
+
switch (t) {
|
|
390
390
|
case "google":
|
|
391
|
-
return
|
|
391
|
+
return e("auth.continue_with_google", "Continue with Google");
|
|
392
392
|
case "apple":
|
|
393
|
-
return
|
|
393
|
+
return e("auth.continue_with_apple", "Continue with Apple");
|
|
394
394
|
case "github":
|
|
395
|
-
return
|
|
395
|
+
return e("auth.continue_with_github", "Continue with GitHub");
|
|
396
396
|
case "facebook":
|
|
397
|
-
return
|
|
397
|
+
return e("auth.continue_with_facebook", "Continue with Facebook");
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
const i =
|
|
402
|
-
if (!(
|
|
403
|
-
switch (
|
|
400
|
+
function we(t, e, r) {
|
|
401
|
+
const i = e === "signup" ? r("auth.signup_failed", "Sign-up failed") : r("auth.signin_failed", "Sign-in failed");
|
|
402
|
+
if (!(t instanceof L)) return i;
|
|
403
|
+
switch (t.code) {
|
|
404
404
|
case "invalid_credentials":
|
|
405
405
|
return r("auth.invalid_credentials", "Invalid email or password");
|
|
406
406
|
case "email_not_confirmed":
|
|
@@ -431,265 +431,265 @@ function ft(e, t, r) {
|
|
|
431
431
|
return i;
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
const r =
|
|
434
|
+
function Ee({ block: t, ctx: e }) {
|
|
435
|
+
const r = e.auth, i = e.authSession, n = t.allow_signup !== !1, s = t.allow_password_reset !== !1, o = t.hide_when_authenticated !== !1;
|
|
436
436
|
if (!r)
|
|
437
437
|
return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
|
|
438
438
|
const c = i && !i.user.is_anonymous ? i : null;
|
|
439
|
-
return c &&
|
|
439
|
+
return c && o ? null : c ? /* @__PURE__ */ a(st, { email: c.user.email ?? "", onSignOut: () => r.signOut().catch(() => {
|
|
440
440
|
}) }) : /* @__PURE__ */ a(
|
|
441
|
-
|
|
441
|
+
lt,
|
|
442
442
|
{
|
|
443
|
-
block:
|
|
443
|
+
block: t,
|
|
444
444
|
allowSignup: n,
|
|
445
|
-
allowReset:
|
|
446
|
-
ctx:
|
|
445
|
+
allowReset: s,
|
|
446
|
+
ctx: e
|
|
447
447
|
}
|
|
448
448
|
);
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
const { t: r } =
|
|
450
|
+
function st({ email: t, onSignOut: e }) {
|
|
451
|
+
const { t: r } = S();
|
|
452
452
|
return /* @__PURE__ */ d("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
|
|
453
453
|
/* @__PURE__ */ d("div", { class: "flex flex-col", children: [
|
|
454
454
|
/* @__PURE__ */ a("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: r("auth.signed_in", "Signed in") }),
|
|
455
|
-
/* @__PURE__ */ a("span", { class: "text-sm font-medium text-gray-900", children:
|
|
455
|
+
/* @__PURE__ */ a("span", { class: "text-sm font-medium text-gray-900", children: t })
|
|
456
456
|
] }),
|
|
457
457
|
/* @__PURE__ */ a(
|
|
458
458
|
"button",
|
|
459
459
|
{
|
|
460
460
|
type: "button",
|
|
461
|
-
onClick:
|
|
461
|
+
onClick: e,
|
|
462
462
|
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)]",
|
|
463
463
|
children: r("auth.sign_out", "Sign out")
|
|
464
464
|
}
|
|
465
465
|
)
|
|
466
466
|
] });
|
|
467
467
|
}
|
|
468
|
-
function
|
|
469
|
-
const { t: n } =
|
|
470
|
-
|
|
471
|
-
if (typeof
|
|
472
|
-
let
|
|
473
|
-
return
|
|
474
|
-
(
|
|
475
|
-
|
|
468
|
+
function lt({ block: t, allowSignup: e, allowReset: r, ctx: i }) {
|
|
469
|
+
const { t: n } = S(), s = i.auth, o = t.providers ?? [], c = i.initialAuthMode === "signup" && e ? "signup" : "signin", [l, p] = v(c), [u, f] = v(""), [_, h] = v(""), [k, w] = v(""), [A, b] = v(""), [m, C] = v(null), I = F(!1), [B, M] = v(null), [z, O] = v(null), [R, P] = v(!1), [T, U] = v(null);
|
|
470
|
+
j(() => {
|
|
471
|
+
if (typeof s.getLastLogin != "function") return;
|
|
472
|
+
let g = !1;
|
|
473
|
+
return s.getLastLogin().then(
|
|
474
|
+
(x) => {
|
|
475
|
+
g || !x || (U(x), x.email && f((E) => E === "" ? x.email : E));
|
|
476
476
|
},
|
|
477
477
|
() => {
|
|
478
478
|
}
|
|
479
479
|
), () => {
|
|
480
|
-
|
|
480
|
+
g = !0;
|
|
481
481
|
};
|
|
482
|
-
}, [
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
},
|
|
486
|
-
if (
|
|
487
|
-
|
|
482
|
+
}, [s]);
|
|
483
|
+
const D = (g) => {
|
|
484
|
+
p(g), M(null), O(null), P(!1);
|
|
485
|
+
}, Z = async (g) => {
|
|
486
|
+
if (g.preventDefault(), !(I.current || m)) {
|
|
487
|
+
I.current = !0;
|
|
488
488
|
try {
|
|
489
|
-
if (
|
|
489
|
+
if (M(null), O(null), l === "signup" && !R) {
|
|
490
490
|
if (!u.trim()) return;
|
|
491
|
-
|
|
491
|
+
P(!0);
|
|
492
492
|
return;
|
|
493
493
|
}
|
|
494
|
-
if (l === "signup" &&
|
|
495
|
-
|
|
494
|
+
if (l === "signup" && _ !== k) {
|
|
495
|
+
M(n("auth.passwords_mismatch", "Passwords don't match"));
|
|
496
496
|
return;
|
|
497
497
|
}
|
|
498
|
-
|
|
498
|
+
C("email");
|
|
499
499
|
try {
|
|
500
|
-
l === "signin" ? await
|
|
500
|
+
l === "signin" ? await s.signInWithEmail({ email: u, password: _ }) : l === "signup" ? (await s.signUp({ email: u, password: _ })).kind === "confirmation_required" && (h(""), p("signup_verify"), O(n("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await s.requestPasswordReset({ email: u }), p("reset_sent"), O(
|
|
501
501
|
n("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
|
|
502
|
-
)) : l === "signup_verify" ? await
|
|
502
|
+
)) : l === "signup_verify" ? await s.verifyOtp({ email: u, token: A, type: "email" }) : l === "reset_verify" && (await s.verifyOtp({
|
|
503
503
|
email: u,
|
|
504
|
-
token:
|
|
505
|
-
type:
|
|
506
|
-
}),
|
|
507
|
-
} catch (
|
|
508
|
-
|
|
504
|
+
token: A,
|
|
505
|
+
type: _ ? "recovery" : "email"
|
|
506
|
+
}), _ && await s.updatePassword({ password: _ }));
|
|
507
|
+
} catch (x) {
|
|
508
|
+
M(we(x, l === "signup" ? "signup" : l === "signup_verify" || l === "reset_verify" ? "otp" : l === "forgot" ? "reset" : "signin", n));
|
|
509
509
|
} finally {
|
|
510
|
-
|
|
510
|
+
C(null);
|
|
511
511
|
}
|
|
512
512
|
} finally {
|
|
513
|
-
|
|
513
|
+
I.current = !1;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
},
|
|
517
|
-
if (!(
|
|
518
|
-
|
|
516
|
+
}, V = async (g) => {
|
|
517
|
+
if (!(I.current || m)) {
|
|
518
|
+
I.current = !0, C(g), M(null), O(null);
|
|
519
519
|
try {
|
|
520
|
-
await
|
|
521
|
-
provider:
|
|
522
|
-
onPopupOpened: () =>
|
|
520
|
+
await s.signInWithOAuth({
|
|
521
|
+
provider: g,
|
|
522
|
+
onPopupOpened: () => C(null)
|
|
523
523
|
});
|
|
524
|
-
} catch (
|
|
525
|
-
if (
|
|
524
|
+
} catch (x) {
|
|
525
|
+
if (x instanceof L && (x.code === "oauth_cancelled" || x.code === "oauth_timeout"))
|
|
526
526
|
return;
|
|
527
|
-
|
|
527
|
+
M(we(x, "signin", n));
|
|
528
528
|
} finally {
|
|
529
|
-
|
|
529
|
+
I.current = !1, C(null);
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
}, K =
|
|
532
|
+
}, K = o.length > 0 && (l === "signin" || l === "signup"), Y = l === "signin" || l === "signup" || l === "forgot", y = l === "signin" || l === "signup" && R;
|
|
533
533
|
return /* @__PURE__ */ d("div", { class: "flex flex-col gap-5", children: [
|
|
534
|
-
/* @__PURE__ */ a(
|
|
534
|
+
/* @__PURE__ */ a(ct, { mode: l, customHeading: t.heading, customSubheading: t.subheading }),
|
|
535
535
|
K ? /* @__PURE__ */ d("div", { class: "flex flex-col gap-2.5", children: [
|
|
536
|
-
|
|
536
|
+
o.map((g) => /* @__PURE__ */ d("div", { class: "relative", children: [
|
|
537
537
|
/* @__PURE__ */ d(
|
|
538
538
|
"button",
|
|
539
539
|
{
|
|
540
540
|
type: "button",
|
|
541
|
-
onClick: () =>
|
|
542
|
-
disabled:
|
|
541
|
+
onClick: () => V(g),
|
|
542
|
+
disabled: m !== null,
|
|
543
543
|
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)]",
|
|
544
544
|
children: [
|
|
545
|
-
|
|
546
|
-
/* @__PURE__ */ a("span", { children:
|
|
545
|
+
m === g ? /* @__PURE__ */ a("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ a(yt, { provider: g }),
|
|
546
|
+
/* @__PURE__ */ a("span", { children: ot(g, n) })
|
|
547
547
|
]
|
|
548
548
|
}
|
|
549
549
|
),
|
|
550
|
-
|
|
551
|
-
] },
|
|
552
|
-
/* @__PURE__ */ a(
|
|
550
|
+
T?.method === g ? /* @__PURE__ */ a(wt, { email: T.email }) : null
|
|
551
|
+
] }, g)),
|
|
552
|
+
/* @__PURE__ */ a(bt, {})
|
|
553
553
|
] }) : null,
|
|
554
|
-
/* @__PURE__ */ d("form", { onSubmit:
|
|
555
|
-
|
|
556
|
-
|
|
554
|
+
/* @__PURE__ */ d("form", { onSubmit: Z, class: "flex flex-col gap-3", children: [
|
|
555
|
+
Y && /* @__PURE__ */ a(
|
|
556
|
+
me,
|
|
557
557
|
{
|
|
558
558
|
type: "email",
|
|
559
559
|
placeholder: n("auth.email", "Email address"),
|
|
560
560
|
value: u,
|
|
561
|
-
onInput:
|
|
561
|
+
onInput: f,
|
|
562
562
|
autocomplete: "email",
|
|
563
563
|
required: !0
|
|
564
564
|
}
|
|
565
565
|
),
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
y && /* @__PURE__ */ a(
|
|
567
|
+
re,
|
|
568
568
|
{
|
|
569
569
|
placeholder: n("auth.password", "Password"),
|
|
570
|
-
value:
|
|
571
|
-
onInput:
|
|
570
|
+
value: _,
|
|
571
|
+
onInput: h,
|
|
572
572
|
autocomplete: l === "signin" ? "current-password" : "new-password",
|
|
573
573
|
required: !0
|
|
574
574
|
}
|
|
575
575
|
),
|
|
576
576
|
l === "signup" && R && /* @__PURE__ */ a(
|
|
577
|
-
|
|
577
|
+
re,
|
|
578
578
|
{
|
|
579
579
|
placeholder: n("auth.repeat_password", "Repeat password"),
|
|
580
|
-
value:
|
|
581
|
-
onInput:
|
|
580
|
+
value: k,
|
|
581
|
+
onInput: w,
|
|
582
582
|
autocomplete: "new-password",
|
|
583
583
|
required: !0
|
|
584
584
|
}
|
|
585
585
|
),
|
|
586
586
|
(l === "signup_verify" || l === "reset_verify") && /* @__PURE__ */ a(
|
|
587
|
-
|
|
587
|
+
me,
|
|
588
588
|
{
|
|
589
589
|
type: "text",
|
|
590
590
|
placeholder: n("auth.confirmation_code", "Confirmation code"),
|
|
591
|
-
value:
|
|
592
|
-
onInput:
|
|
591
|
+
value: A,
|
|
592
|
+
onInput: b,
|
|
593
593
|
autocomplete: "one-time-code",
|
|
594
594
|
inputMode: "numeric",
|
|
595
595
|
required: !0
|
|
596
596
|
}
|
|
597
597
|
),
|
|
598
598
|
l === "reset_verify" && /* @__PURE__ */ a(
|
|
599
|
-
|
|
599
|
+
re,
|
|
600
600
|
{
|
|
601
601
|
placeholder: n(
|
|
602
602
|
"auth.new_password_optional",
|
|
603
603
|
"New password (optional — only for password reset)"
|
|
604
604
|
),
|
|
605
|
-
value:
|
|
606
|
-
onInput:
|
|
605
|
+
value: _,
|
|
606
|
+
onInput: h,
|
|
607
607
|
autocomplete: "new-password"
|
|
608
608
|
}
|
|
609
609
|
),
|
|
610
610
|
l === "reset_sent" && z && /* @__PURE__ */ a("p", { class: "rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600", children: z }),
|
|
611
|
-
l === "signin" && r && /* @__PURE__ */ a("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ a(W, { onClick: () =>
|
|
612
|
-
|
|
611
|
+
l === "signin" && r && /* @__PURE__ */ a("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ a(W, { onClick: () => D("forgot"), children: n("auth.forgot_password", "Forgot password?") }) }),
|
|
612
|
+
B && /* @__PURE__ */ a("p", { class: "text-sm text-red-600", children: B }),
|
|
613
613
|
z && l !== "reset_sent" && /* @__PURE__ */ a("p", { class: "text-sm text-gray-500", children: z }),
|
|
614
614
|
l !== "reset_sent" && /* @__PURE__ */ a(
|
|
615
|
-
|
|
615
|
+
ht,
|
|
616
616
|
{
|
|
617
|
-
busy:
|
|
618
|
-
label:
|
|
617
|
+
busy: m === "email",
|
|
618
|
+
label: ut(l, R, t.submit_label ?? t.heading, n)
|
|
619
619
|
}
|
|
620
620
|
)
|
|
621
621
|
] }),
|
|
622
622
|
/* @__PURE__ */ a(
|
|
623
|
-
|
|
623
|
+
pt,
|
|
624
624
|
{
|
|
625
625
|
mode: l,
|
|
626
|
-
allowSignup:
|
|
627
|
-
onSwitch:
|
|
626
|
+
allowSignup: e,
|
|
627
|
+
onSwitch: D
|
|
628
628
|
}
|
|
629
629
|
)
|
|
630
630
|
] });
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
mode:
|
|
634
|
-
customHeading:
|
|
632
|
+
function ct({
|
|
633
|
+
mode: t,
|
|
634
|
+
customHeading: e,
|
|
635
635
|
customSubheading: r
|
|
636
636
|
}) {
|
|
637
|
-
const { t: i } =
|
|
637
|
+
const { t: i } = S(), n = dt(t, i), s = t === "signin" || t === "signup", o = s && e ? e : n.title, c = s && r !== void 0 ? r || null : n.subtitle;
|
|
638
638
|
return /* @__PURE__ */ d("div", { class: "flex flex-col gap-2", children: [
|
|
639
|
-
/* @__PURE__ */ a("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children:
|
|
639
|
+
/* @__PURE__ */ a("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: o }),
|
|
640
640
|
c ? /* @__PURE__ */ a("p", { class: "text-base leading-relaxed text-gray-600", children: c }) : null
|
|
641
641
|
] });
|
|
642
642
|
}
|
|
643
|
-
function
|
|
644
|
-
switch (
|
|
643
|
+
function dt(t, e) {
|
|
644
|
+
switch (t) {
|
|
645
645
|
case "signin":
|
|
646
646
|
return {
|
|
647
|
-
title:
|
|
648
|
-
subtitle:
|
|
647
|
+
title: e("auth.welcome", "Welcome back!"),
|
|
648
|
+
subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
|
|
649
649
|
};
|
|
650
650
|
case "signup":
|
|
651
651
|
return {
|
|
652
|
-
title:
|
|
653
|
-
subtitle:
|
|
652
|
+
title: e("auth.welcome_signup", "Welcome!"),
|
|
653
|
+
subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
|
|
654
654
|
};
|
|
655
655
|
case "forgot":
|
|
656
656
|
return {
|
|
657
|
-
title:
|
|
658
|
-
subtitle:
|
|
657
|
+
title: e("auth.forgot_password_title", "Forgot password?"),
|
|
658
|
+
subtitle: e(
|
|
659
659
|
"auth.forgot_subtitle",
|
|
660
660
|
"Enter your email and we'll send you a password reset link."
|
|
661
661
|
)
|
|
662
662
|
};
|
|
663
663
|
case "reset_sent":
|
|
664
664
|
return {
|
|
665
|
-
title:
|
|
665
|
+
title: e("auth.check_email_title", "Check your email"),
|
|
666
666
|
subtitle: null
|
|
667
667
|
};
|
|
668
668
|
case "reset_verify":
|
|
669
669
|
return {
|
|
670
|
-
title:
|
|
671
|
-
subtitle:
|
|
670
|
+
title: e("auth.reset_password_title", "Reset password"),
|
|
671
|
+
subtitle: e(
|
|
672
672
|
"auth.reset_password_subtitle",
|
|
673
673
|
"Enter the code from your email and a new password."
|
|
674
674
|
)
|
|
675
675
|
};
|
|
676
676
|
case "signup_verify":
|
|
677
677
|
return {
|
|
678
|
-
title:
|
|
679
|
-
subtitle:
|
|
678
|
+
title: e("auth.confirm_email_title", "Confirm your email"),
|
|
679
|
+
subtitle: e(
|
|
680
680
|
"auth.confirm_email_subtitle",
|
|
681
681
|
"Enter the code we sent to your email to finish creating your account."
|
|
682
682
|
)
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
|
-
function
|
|
687
|
-
if (
|
|
688
|
-
switch (
|
|
686
|
+
function ut(t, e, r, i) {
|
|
687
|
+
if (t === "signin" && r) return r;
|
|
688
|
+
switch (t) {
|
|
689
689
|
case "signin":
|
|
690
690
|
return i("auth.log_in", "Sign In");
|
|
691
691
|
case "signup":
|
|
692
|
-
return
|
|
692
|
+
return e ? i("auth.create_account", "Create Account") : i("auth.sign_up", "Sign Up");
|
|
693
693
|
case "forgot":
|
|
694
694
|
return i("auth.send_reset", "Send Reset Email");
|
|
695
695
|
case "signup_verify":
|
|
@@ -699,87 +699,87 @@ function de(e, t, r, i) {
|
|
|
699
699
|
return i("cta.continue", "Continue");
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
function
|
|
703
|
-
mode:
|
|
704
|
-
allowSignup:
|
|
702
|
+
function pt({
|
|
703
|
+
mode: t,
|
|
704
|
+
allowSignup: e,
|
|
705
705
|
onSwitch: r
|
|
706
706
|
}) {
|
|
707
|
-
const { t: i } =
|
|
708
|
-
return
|
|
707
|
+
const { t: i } = S();
|
|
708
|
+
return t === "signin" && e ? /* @__PURE__ */ d("p", { class: "text-center text-sm text-gray-600", children: [
|
|
709
709
|
i("auth.no_account", "Don't have an account?"),
|
|
710
710
|
" ",
|
|
711
711
|
/* @__PURE__ */ a(W, { onClick: () => r("signup"), children: i("auth.sign_up_link", "Sign Up") })
|
|
712
|
-
] }) :
|
|
712
|
+
] }) : t === "signup" || t === "signup_verify" ? /* @__PURE__ */ d("p", { class: "text-center text-sm text-gray-600", children: [
|
|
713
713
|
i("auth.have_account", "Already have an account?"),
|
|
714
714
|
" ",
|
|
715
715
|
/* @__PURE__ */ a(W, { onClick: () => r("signin"), children: i("auth.log_in_link", "Log In") })
|
|
716
|
-
] }) :
|
|
716
|
+
] }) : t === "forgot" || t === "reset_sent" || t === "reset_verify" ? /* @__PURE__ */ d("p", { class: "text-center text-sm text-gray-600", children: [
|
|
717
717
|
i("auth.no_account", "Don't have an account?"),
|
|
718
718
|
" ",
|
|
719
719
|
/* @__PURE__ */ a(W, { onClick: () => r("signup"), children: i("auth.sign_up_link", "Sign Up") })
|
|
720
720
|
] }) : null;
|
|
721
721
|
}
|
|
722
722
|
function W({
|
|
723
|
-
onClick:
|
|
724
|
-
children:
|
|
723
|
+
onClick: t,
|
|
724
|
+
children: e
|
|
725
725
|
}) {
|
|
726
726
|
return /* @__PURE__ */ a(
|
|
727
727
|
"button",
|
|
728
728
|
{
|
|
729
729
|
type: "button",
|
|
730
|
-
onClick:
|
|
730
|
+
onClick: t,
|
|
731
731
|
class: "font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",
|
|
732
732
|
style: { color: "var(--pw-accent)" },
|
|
733
|
-
children:
|
|
733
|
+
children: e
|
|
734
734
|
}
|
|
735
735
|
);
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function ht({ busy: t, label: e }) {
|
|
738
738
|
return /* @__PURE__ */ a(
|
|
739
739
|
"button",
|
|
740
740
|
{
|
|
741
741
|
type: "submit",
|
|
742
|
-
disabled:
|
|
742
|
+
disabled: t,
|
|
743
743
|
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)]",
|
|
744
744
|
style: {
|
|
745
745
|
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%)",
|
|
746
746
|
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)"
|
|
747
747
|
},
|
|
748
|
-
children:
|
|
748
|
+
children: t ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children: e })
|
|
749
749
|
}
|
|
750
750
|
);
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function me({ type: t, placeholder: e, value: r, onInput: i, autocomplete: n, inputMode: s, required: o }) {
|
|
753
753
|
return /* @__PURE__ */ a(
|
|
754
754
|
"input",
|
|
755
755
|
{
|
|
756
|
-
type:
|
|
756
|
+
type: t,
|
|
757
757
|
value: r,
|
|
758
|
-
placeholder:
|
|
758
|
+
placeholder: e,
|
|
759
759
|
onInput: (c) => i(c.target.value),
|
|
760
760
|
autocomplete: n,
|
|
761
|
-
inputMode:
|
|
762
|
-
required:
|
|
761
|
+
inputMode: s,
|
|
762
|
+
required: o,
|
|
763
763
|
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)]"
|
|
764
764
|
}
|
|
765
765
|
);
|
|
766
766
|
}
|
|
767
|
-
function
|
|
768
|
-
const { t:
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
|
|
772
|
-
}, [
|
|
773
|
-
const
|
|
767
|
+
function re({ placeholder: t, value: e, onInput: r, autocomplete: i, required: n }) {
|
|
768
|
+
const { t: s } = S(), [o, c] = v(!1), l = F(null);
|
|
769
|
+
j(() => {
|
|
770
|
+
const f = l.current;
|
|
771
|
+
f && f.value !== e && (f.value = e);
|
|
772
|
+
}, [o, e]);
|
|
773
|
+
const p = s("auth.show_password", "Show password"), u = s("auth.hide_password", "Hide password");
|
|
774
774
|
return /* @__PURE__ */ d("div", { class: "relative", children: [
|
|
775
775
|
/* @__PURE__ */ a(
|
|
776
776
|
"input",
|
|
777
777
|
{
|
|
778
778
|
ref: l,
|
|
779
|
-
type:
|
|
780
|
-
value:
|
|
781
|
-
placeholder:
|
|
782
|
-
onInput: (
|
|
779
|
+
type: o ? "text" : "password",
|
|
780
|
+
value: e,
|
|
781
|
+
placeholder: t,
|
|
782
|
+
onInput: (f) => r(f.target.value),
|
|
783
783
|
autocomplete: i,
|
|
784
784
|
required: n,
|
|
785
785
|
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)]"
|
|
@@ -789,16 +789,16 @@ function et({ placeholder: e, value: t, onInput: r, autocomplete: i, required: n
|
|
|
789
789
|
"button",
|
|
790
790
|
{
|
|
791
791
|
type: "button",
|
|
792
|
-
onClick: () => c((
|
|
793
|
-
"aria-label":
|
|
792
|
+
onClick: () => c((f) => !f),
|
|
793
|
+
"aria-label": o ? u : p,
|
|
794
794
|
tabIndex: -1,
|
|
795
795
|
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)]",
|
|
796
|
-
children:
|
|
796
|
+
children: o ? /* @__PURE__ */ a(ft, {}) : /* @__PURE__ */ a(gt, {})
|
|
797
797
|
}
|
|
798
798
|
)
|
|
799
799
|
] });
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function gt() {
|
|
802
802
|
return /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
803
803
|
/* @__PURE__ */ a(
|
|
804
804
|
"path",
|
|
@@ -813,7 +813,7 @@ function he() {
|
|
|
813
813
|
/* @__PURE__ */ a("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
|
|
814
814
|
] });
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function ft() {
|
|
817
817
|
return /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
818
818
|
/* @__PURE__ */ a(
|
|
819
819
|
"path",
|
|
@@ -837,47 +837,47 @@ function ge() {
|
|
|
837
837
|
)
|
|
838
838
|
] });
|
|
839
839
|
}
|
|
840
|
-
function
|
|
841
|
-
const { t } =
|
|
840
|
+
function wt({ email: t }) {
|
|
841
|
+
const { t: e } = S(), r = t ? e("auth.last_used", "Last · {email}", { email: mt(t) }) : e("auth.last_used_no_email", "Last");
|
|
842
842
|
return /* @__PURE__ */ a("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: r });
|
|
843
843
|
}
|
|
844
|
-
function
|
|
845
|
-
const [
|
|
846
|
-
return r ? `${
|
|
844
|
+
function mt(t) {
|
|
845
|
+
const [e, r] = t.split("@");
|
|
846
|
+
return r ? `${e.slice(0, 3)}*****@${r}` : t;
|
|
847
847
|
}
|
|
848
|
-
function
|
|
849
|
-
const { t
|
|
848
|
+
function bt() {
|
|
849
|
+
const { t } = S();
|
|
850
850
|
return /* @__PURE__ */ d("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
|
|
851
851
|
/* @__PURE__ */ a("div", { class: "h-px flex-1 bg-gray-200" }),
|
|
852
|
-
/* @__PURE__ */ a("span", { children:
|
|
852
|
+
/* @__PURE__ */ a("span", { children: t("auth.or", "or") }),
|
|
853
853
|
/* @__PURE__ */ a("div", { class: "h-px flex-1 bg-gray-200" })
|
|
854
854
|
] });
|
|
855
855
|
}
|
|
856
|
-
function
|
|
857
|
-
return
|
|
856
|
+
function yt({ provider: t }) {
|
|
857
|
+
return t === "google" ? /* @__PURE__ */ d("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
|
|
858
858
|
/* @__PURE__ */ a("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" }),
|
|
859
859
|
/* @__PURE__ */ a("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" }),
|
|
860
860
|
/* @__PURE__ */ a("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" }),
|
|
861
861
|
/* @__PURE__ */ a("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" })
|
|
862
|
-
] }) :
|
|
862
|
+
] }) : t === "apple" ? (
|
|
863
863
|
// viewBox 0 0 24 24 даёт воздух сверху/снизу пути, поэтому визуально
|
|
864
864
|
// Apple-яблоко выглядит меньше Google. Компенсируем увеличенным
|
|
865
865
|
// width/height — 26×26 даёт примерно equal optical size с Google 20×20.
|
|
866
866
|
/* @__PURE__ */ a("svg", { width: "26", height: "26", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("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" }) })
|
|
867
|
-
) :
|
|
867
|
+
) : t === "github" ? /* @__PURE__ */ a("svg", { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M8 0C3.6 0 0 3.6 0 8a8 8 0 0 0 5.5 7.6c.4.1.5-.2.5-.4v-1.5c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.2 1.9.9 2.4.7 0-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8a7.6 7.6 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.5.8 1.2.8 2.1 0 3.1-1.9 3.7-3.6 3.9.3.3.6.8.6 1.6V15c0 .2.1.5.6.4A8 8 0 0 0 16 8c0-4.4-3.6-8-8-8Z" }) }) : /* @__PURE__ */ a("svg", { width: "18", height: "20", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ a("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" }) });
|
|
868
868
|
}
|
|
869
|
-
function
|
|
870
|
-
block:
|
|
871
|
-
bootstrap:
|
|
869
|
+
function xt({
|
|
870
|
+
block: t,
|
|
871
|
+
bootstrap: e,
|
|
872
872
|
auth: r,
|
|
873
873
|
authSession: i,
|
|
874
874
|
onBack: n,
|
|
875
|
-
showBack:
|
|
876
|
-
intent:
|
|
875
|
+
showBack: s = !0,
|
|
876
|
+
intent: o = "preauth",
|
|
877
877
|
initialMode: c
|
|
878
878
|
}) {
|
|
879
|
-
const { t: l } =
|
|
880
|
-
bootstrap:
|
|
879
|
+
const { t: l } = S(), p = {
|
|
880
|
+
bootstrap: e,
|
|
881
881
|
selectedPriceId: null,
|
|
882
882
|
setSelectedPriceId: () => {
|
|
883
883
|
},
|
|
@@ -886,15 +886,15 @@ function xe({
|
|
|
886
886
|
auth: r,
|
|
887
887
|
authSession: i,
|
|
888
888
|
initialAuthMode: c
|
|
889
|
-
}, u =
|
|
890
|
-
...
|
|
889
|
+
}, u = o === "restore" ? {
|
|
890
|
+
...t,
|
|
891
891
|
heading: l("auth.restore_purchases_heading", "Restore Purchases"),
|
|
892
892
|
subheading: l(
|
|
893
893
|
"auth.restore_purchases_subheading",
|
|
894
894
|
"Please sign in to restore your purchases."
|
|
895
895
|
)
|
|
896
|
-
} :
|
|
897
|
-
...
|
|
896
|
+
} : o === "preauth" ? {
|
|
897
|
+
...t,
|
|
898
898
|
heading: l("auth.login_continue_purchase", "Log in to continue your purchase"),
|
|
899
899
|
subheading: l(
|
|
900
900
|
"auth.link_purchase_subheading",
|
|
@@ -905,19 +905,19 @@ function xe({
|
|
|
905
905
|
// чтобы продолжить покупку") в pill-кнопку h-12 не помещаются и
|
|
906
906
|
// переносятся на 2 строки. Явный короткий submit_label решает.
|
|
907
907
|
submit_label: l("auth.log_in", "Sign In")
|
|
908
|
-
} :
|
|
908
|
+
} : t;
|
|
909
909
|
return /* @__PURE__ */ d("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
|
|
910
|
-
|
|
911
|
-
/* @__PURE__ */ a(
|
|
910
|
+
s ? /* @__PURE__ */ a(vt, { onClick: n, ariaLabel: l("nav.back_aria", "Back") }) : null,
|
|
911
|
+
/* @__PURE__ */ a(Ee, { block: u, ctx: p })
|
|
912
912
|
] });
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function vt({ onClick: t, ariaLabel: e }) {
|
|
915
915
|
return /* @__PURE__ */ a(
|
|
916
916
|
"button",
|
|
917
917
|
{
|
|
918
918
|
type: "button",
|
|
919
|
-
onClick:
|
|
920
|
-
"aria-label":
|
|
919
|
+
onClick: t,
|
|
920
|
+
"aria-label": e,
|
|
921
921
|
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)]",
|
|
922
922
|
children: /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
923
923
|
/* @__PURE__ */ a(
|
|
@@ -944,67 +944,67 @@ function ye({ onClick: e, ariaLabel: t }) {
|
|
|
944
944
|
}
|
|
945
945
|
);
|
|
946
946
|
}
|
|
947
|
-
const
|
|
948
|
-
function
|
|
949
|
-
const
|
|
950
|
-
return
|
|
951
|
-
days: Math.floor(
|
|
952
|
-
hours: Math.floor(
|
|
953
|
-
minutes: Math.floor(
|
|
954
|
-
seconds: Math.floor(
|
|
947
|
+
const je = (t) => `pw-offer-${t}-start`;
|
|
948
|
+
function ie(t) {
|
|
949
|
+
const e = t - Date.now();
|
|
950
|
+
return e <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
|
|
951
|
+
days: Math.floor(e / (1e3 * 60 * 60 * 24)),
|
|
952
|
+
hours: Math.floor(e % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
|
|
953
|
+
minutes: Math.floor(e % (1e3 * 60 * 60) / (1e3 * 60)),
|
|
954
|
+
seconds: Math.floor(e % (1e3 * 60) / 1e3),
|
|
955
955
|
expired: !1
|
|
956
956
|
};
|
|
957
957
|
}
|
|
958
|
-
function
|
|
959
|
-
if (
|
|
960
|
-
const
|
|
961
|
-
return Number.isFinite(
|
|
958
|
+
function kt(t) {
|
|
959
|
+
if (t.expires_at) {
|
|
960
|
+
const e = Date.parse(t.expires_at);
|
|
961
|
+
return Number.isFinite(e) ? e : null;
|
|
962
962
|
}
|
|
963
|
-
if (
|
|
963
|
+
if (t.duration_minutes && t.duration_minutes > 0) {
|
|
964
964
|
if (typeof window > "u") return null;
|
|
965
965
|
try {
|
|
966
|
-
const
|
|
967
|
-
let r = window.localStorage.getItem(
|
|
968
|
-
return r || (r = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(
|
|
966
|
+
const e = je(t.id);
|
|
967
|
+
let r = window.localStorage.getItem(e);
|
|
968
|
+
return r || (r = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(e, r)), Date.parse(r) + t.duration_minutes * 6e4;
|
|
969
969
|
} catch {
|
|
970
970
|
return null;
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
973
|
return null;
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
if (!
|
|
977
|
-
if (
|
|
978
|
-
const r =
|
|
975
|
+
function ze(t, e) {
|
|
976
|
+
if (!t || t.length === 0) return null;
|
|
977
|
+
if (e) {
|
|
978
|
+
const r = t.find((i) => i.id === e);
|
|
979
979
|
if (r) return r;
|
|
980
980
|
}
|
|
981
|
-
return
|
|
981
|
+
return t.find((r) => r.expires_at || r.duration_minutes) ?? null;
|
|
982
982
|
}
|
|
983
|
-
function
|
|
984
|
-
const
|
|
985
|
-
() =>
|
|
986
|
-
), n = F(
|
|
987
|
-
return n.current =
|
|
988
|
-
if (
|
|
983
|
+
function Be(t) {
|
|
984
|
+
const e = t ? kt(t) : null, [r, i] = v(
|
|
985
|
+
() => e !== null ? ie(e) : null
|
|
986
|
+
), n = F(e);
|
|
987
|
+
return n.current = e, j(() => {
|
|
988
|
+
if (e === null) {
|
|
989
989
|
i(null);
|
|
990
990
|
return;
|
|
991
991
|
}
|
|
992
|
-
i(
|
|
993
|
-
const
|
|
994
|
-
const
|
|
995
|
-
if (i(
|
|
992
|
+
i(ie(e));
|
|
993
|
+
const s = setInterval(() => {
|
|
994
|
+
const o = ie(n.current ?? 0);
|
|
995
|
+
if (i(o), o.expired && (clearInterval(s), t?.duration_minutes && typeof window < "u"))
|
|
996
996
|
try {
|
|
997
|
-
window.localStorage.removeItem(
|
|
997
|
+
window.localStorage.removeItem(je(t.id));
|
|
998
998
|
} catch {
|
|
999
999
|
}
|
|
1000
1000
|
}, 1e3);
|
|
1001
|
-
return () => clearInterval(
|
|
1002
|
-
}, [
|
|
1001
|
+
return () => clearInterval(s);
|
|
1002
|
+
}, [e, t?.duration_minutes, t?.id]), r;
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1005
|
-
const { t: r } =
|
|
1006
|
-
if (!i || n === null || n.expired && !
|
|
1007
|
-
const
|
|
1004
|
+
function _t({ block: t, ctx: e }) {
|
|
1005
|
+
const { t: r } = S(), i = ze(e.bootstrap.offers, t.offer_id), n = Be(i);
|
|
1006
|
+
if (!i || n === null || n.expired && !t.force) return null;
|
|
1007
|
+
const s = t.title ?? i.label ?? r("offer.limited_time", "Limited-time offer"), o = i.discount_percent ? `${s} ${i.discount_percent}%` : s;
|
|
1008
1008
|
return /* @__PURE__ */ d(
|
|
1009
1009
|
"div",
|
|
1010
1010
|
{
|
|
@@ -1015,34 +1015,34 @@ function ke({ block: e, ctx: t }) {
|
|
|
1015
1015
|
},
|
|
1016
1016
|
role: "status",
|
|
1017
1017
|
children: [
|
|
1018
|
-
/* @__PURE__ */ a(
|
|
1019
|
-
/* @__PURE__ */ a("span", { children:
|
|
1020
|
-
/* @__PURE__ */ a(
|
|
1018
|
+
/* @__PURE__ */ a(Fe, {}),
|
|
1019
|
+
/* @__PURE__ */ a("span", { children: o }),
|
|
1020
|
+
/* @__PURE__ */ a(Oe, { value: n, t: r })
|
|
1021
1021
|
]
|
|
1022
1022
|
}
|
|
1023
1023
|
);
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function Oe({ value: t, t: e }) {
|
|
1026
1026
|
return /* @__PURE__ */ d("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
|
|
1027
|
-
|
|
1028
|
-
/* @__PURE__ */ a(
|
|
1029
|
-
/* @__PURE__ */ a("span", { class: "text-xs", children:
|
|
1027
|
+
t.days > 0 ? /* @__PURE__ */ d(se, { children: [
|
|
1028
|
+
/* @__PURE__ */ a(q, { children: String(t.days) }),
|
|
1029
|
+
/* @__PURE__ */ a("span", { class: "text-xs", children: e("countdown.d", "d") })
|
|
1030
1030
|
] }) : null,
|
|
1031
|
-
/* @__PURE__ */ a(
|
|
1032
|
-
/* @__PURE__ */ a("span", { class: "text-xs", children:
|
|
1033
|
-
/* @__PURE__ */ a(
|
|
1034
|
-
/* @__PURE__ */ a("span", { class: "text-xs", children:
|
|
1035
|
-
/* @__PURE__ */ a(
|
|
1036
|
-
/* @__PURE__ */ a("span", { class: "text-xs", children:
|
|
1031
|
+
/* @__PURE__ */ a(q, { children: String(t.hours).padStart(2, "0") }),
|
|
1032
|
+
/* @__PURE__ */ a("span", { class: "text-xs", children: e("countdown.h", "h") }),
|
|
1033
|
+
/* @__PURE__ */ a(q, { children: String(t.minutes).padStart(2, "0") }),
|
|
1034
|
+
/* @__PURE__ */ a("span", { class: "text-xs", children: e("countdown.m", "m") }),
|
|
1035
|
+
/* @__PURE__ */ a(q, { children: String(t.seconds).padStart(2, "0") }),
|
|
1036
|
+
/* @__PURE__ */ a("span", { class: "text-xs", children: e("countdown.s", "s") })
|
|
1037
1037
|
] });
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return /* @__PURE__ */ a("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children:
|
|
1039
|
+
function q({ children: t }) {
|
|
1040
|
+
return /* @__PURE__ */ a("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: t });
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1043
|
-
const { t } =
|
|
1042
|
+
function St({ offer: t }) {
|
|
1043
|
+
const { t: e } = S(), r = Be(t);
|
|
1044
1044
|
if (r === null || r.expired) return null;
|
|
1045
|
-
const i =
|
|
1045
|
+
const i = t.label ?? e("offer.limited_time", "Limited-time offer"), n = t.discount_percent ? `${i} ${t.discount_percent}%` : i;
|
|
1046
1046
|
return /* @__PURE__ */ d(
|
|
1047
1047
|
"div",
|
|
1048
1048
|
{
|
|
@@ -1053,14 +1053,14 @@ function _e({ offer: e }) {
|
|
|
1053
1053
|
},
|
|
1054
1054
|
role: "status",
|
|
1055
1055
|
children: [
|
|
1056
|
-
/* @__PURE__ */ a(
|
|
1056
|
+
/* @__PURE__ */ a(Fe, {}),
|
|
1057
1057
|
/* @__PURE__ */ a("span", { children: n }),
|
|
1058
|
-
/* @__PURE__ */ a(
|
|
1058
|
+
/* @__PURE__ */ a(Oe, { value: r, t: e })
|
|
1059
1059
|
]
|
|
1060
1060
|
}
|
|
1061
1061
|
);
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function Fe() {
|
|
1064
1064
|
return /* @__PURE__ */ a(
|
|
1065
1065
|
"svg",
|
|
1066
1066
|
{
|
|
@@ -1079,39 +1079,39 @@ function Ot() {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
);
|
|
1081
1081
|
}
|
|
1082
|
-
const
|
|
1083
|
-
function
|
|
1084
|
-
const { t: n } =
|
|
1085
|
-
const
|
|
1086
|
-
return
|
|
1087
|
-
min:
|
|
1088
|
-
max:
|
|
1089
|
-
})), (
|
|
1082
|
+
const be = 3, ye = 200, xe = 5e3, ne = 5, Ct = 10 * 1024 * 1024, ve = ["image/jpeg", "image/png", "image/webp"], It = /.+@.+\..+/;
|
|
1083
|
+
function At({ client: t, authSession: e, origin: r, onBack: i }) {
|
|
1084
|
+
const { t: n } = S(), s = e?.user.email ?? "", o = s || null, [c, l] = v(s), [p, u] = v(""), [f, _] = v(""), [h, k] = v([]), [w, A] = v(!1), [b, m] = v(null), [C, I] = v({}), B = () => {
|
|
1085
|
+
const P = {}, T = (o ?? c).trim(), U = p.trim(), D = f.trim();
|
|
1086
|
+
return T ? It.test(T.toLowerCase()) || (P.email = n("support.invalid_email", "Invalid email")) : P.email = n("support.required", "Required"), (U.length < be || U.length > ye) && (P.subject = n("support.subject_length", "{min}–{max} characters", {
|
|
1087
|
+
min: be,
|
|
1088
|
+
max: ye
|
|
1089
|
+
})), (D.length < 1 || D.length > xe) && (P.message = n("support.message_length", "{min}–{max} characters", {
|
|
1090
1090
|
min: 1,
|
|
1091
|
-
max:
|
|
1092
|
-
})),
|
|
1093
|
-
},
|
|
1094
|
-
if (
|
|
1095
|
-
|
|
1091
|
+
max: xe
|
|
1092
|
+
})), I(P), Object.keys(P).length === 0;
|
|
1093
|
+
}, M = async (P) => {
|
|
1094
|
+
if (P.preventDefault(), !w && B()) {
|
|
1095
|
+
A(!0), I((T) => ({ ...T, submit: void 0 }));
|
|
1096
1096
|
try {
|
|
1097
|
-
const
|
|
1098
|
-
await
|
|
1099
|
-
subject:
|
|
1100
|
-
content:
|
|
1101
|
-
email:
|
|
1102
|
-
files:
|
|
1103
|
-
}),
|
|
1104
|
-
} catch (
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1097
|
+
const T = (o ?? c).trim();
|
|
1098
|
+
await t.createSupportTicket({
|
|
1099
|
+
subject: p.trim(),
|
|
1100
|
+
content: f.trim(),
|
|
1101
|
+
email: T || void 0,
|
|
1102
|
+
files: h.length > 0 ? h : void 0
|
|
1103
|
+
}), m(T);
|
|
1104
|
+
} catch (T) {
|
|
1105
|
+
const U = T instanceof L && T.message || "Failed to send. Please try again.";
|
|
1106
|
+
I((D) => ({ ...D, submit: U }));
|
|
1107
1107
|
} finally {
|
|
1108
|
-
|
|
1108
|
+
A(!1);
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
}, z = () => {
|
|
1112
|
-
u(""),
|
|
1113
|
-
},
|
|
1114
|
-
return
|
|
1112
|
+
u(""), _(""), k([]), I({}), m(null);
|
|
1113
|
+
}, O = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", R = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
|
|
1114
|
+
return b ? /* @__PURE__ */ d("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1115
1115
|
/* @__PURE__ */ d("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: [
|
|
1116
1116
|
/* @__PURE__ */ a(
|
|
1117
1117
|
"div",
|
|
@@ -1139,11 +1139,11 @@ function Ie({ client: e, authSession: t, origin: r, onBack: i }) {
|
|
|
1139
1139
|
"We've received your message and will respond to"
|
|
1140
1140
|
),
|
|
1141
1141
|
" ",
|
|
1142
|
-
/* @__PURE__ */ a("b", { class: "text-gray-700", children:
|
|
1142
|
+
/* @__PURE__ */ a("b", { class: "text-gray-700", children: b }),
|
|
1143
1143
|
"."
|
|
1144
1144
|
] })
|
|
1145
1145
|
] }),
|
|
1146
|
-
/* @__PURE__ */ a("div", { class:
|
|
1146
|
+
/* @__PURE__ */ a("div", { class: O, style: R, children: /* @__PURE__ */ d("div", { class: "flex items-center justify-center gap-3", children: [
|
|
1147
1147
|
/* @__PURE__ */ a(
|
|
1148
1148
|
"button",
|
|
1149
1149
|
{
|
|
@@ -1167,63 +1167,63 @@ function Ie({ client: e, authSession: t, origin: r, onBack: i }) {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
)
|
|
1169
1169
|
] }) })
|
|
1170
|
-
] }) : /* @__PURE__ */ d("form", { onSubmit:
|
|
1171
|
-
/* @__PURE__ */ a(
|
|
1170
|
+
] }) : /* @__PURE__ */ d("form", { onSubmit: M, class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1171
|
+
/* @__PURE__ */ a(Mt, { onClick: i, ariaLabel: n("nav.back_aria", "Back") }),
|
|
1172
1172
|
/* @__PURE__ */ a("div", { class: "flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8", children: /* @__PURE__ */ d("div", { class: "flex flex-col gap-5", children: [
|
|
1173
1173
|
/* @__PURE__ */ d("div", { class: "flex flex-col gap-2 pr-10", children: [
|
|
1174
1174
|
/* @__PURE__ */ a("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: n("support.heading", "Support") }),
|
|
1175
1175
|
/* @__PURE__ */ a("p", { class: "text-base leading-relaxed text-gray-600", children: n("support.instruction", "Please fill out the form below to submit your support request.") })
|
|
1176
1176
|
] }),
|
|
1177
1177
|
/* @__PURE__ */ d("div", { class: "flex flex-col gap-3", children: [
|
|
1178
|
-
|
|
1178
|
+
o ? /* @__PURE__ */ d("div", { class: "rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600", children: [
|
|
1179
1179
|
n("support.sending_as", "Sending as"),
|
|
1180
1180
|
" ",
|
|
1181
|
-
/* @__PURE__ */ a("b", { class: "font-medium text-gray-900", children:
|
|
1181
|
+
/* @__PURE__ */ a("b", { class: "font-medium text-gray-900", children: o })
|
|
1182
1182
|
] }) : /* @__PURE__ */ a(
|
|
1183
|
-
|
|
1183
|
+
ke,
|
|
1184
1184
|
{
|
|
1185
1185
|
type: "email",
|
|
1186
1186
|
placeholder: n("support.email_placeholder", "Enter your email *"),
|
|
1187
1187
|
value: c,
|
|
1188
1188
|
onInput: l,
|
|
1189
|
-
error:
|
|
1189
|
+
error: C.email,
|
|
1190
1190
|
autocomplete: "email",
|
|
1191
1191
|
required: !0
|
|
1192
1192
|
}
|
|
1193
1193
|
),
|
|
1194
1194
|
/* @__PURE__ */ a(
|
|
1195
|
-
|
|
1195
|
+
ke,
|
|
1196
1196
|
{
|
|
1197
1197
|
type: "text",
|
|
1198
1198
|
placeholder: n("support.subject_placeholder", "Enter your subject *"),
|
|
1199
|
-
value:
|
|
1199
|
+
value: p,
|
|
1200
1200
|
onInput: u,
|
|
1201
|
-
error:
|
|
1201
|
+
error: C.subject,
|
|
1202
1202
|
required: !0
|
|
1203
1203
|
}
|
|
1204
1204
|
),
|
|
1205
1205
|
/* @__PURE__ */ a(
|
|
1206
|
-
|
|
1206
|
+
Lt,
|
|
1207
1207
|
{
|
|
1208
1208
|
placeholder: n("support.message_placeholder", "Enter your message *"),
|
|
1209
|
-
value:
|
|
1210
|
-
onInput:
|
|
1211
|
-
error:
|
|
1209
|
+
value: f,
|
|
1210
|
+
onInput: _,
|
|
1211
|
+
error: C.message,
|
|
1212
1212
|
required: !0
|
|
1213
1213
|
}
|
|
1214
1214
|
),
|
|
1215
|
-
/* @__PURE__ */ a(
|
|
1215
|
+
/* @__PURE__ */ a(Tt, { files: h, onChange: k, disabled: w })
|
|
1216
1216
|
] })
|
|
1217
1217
|
] }) }),
|
|
1218
|
-
/* @__PURE__ */ d("div", { class:
|
|
1219
|
-
|
|
1218
|
+
/* @__PURE__ */ d("div", { class: O, style: R, children: [
|
|
1219
|
+
C.submit && /* @__PURE__ */ a("p", { class: "text-sm text-red-600", children: C.submit }),
|
|
1220
1220
|
/* @__PURE__ */ d("div", { class: "flex items-center justify-end gap-3", children: [
|
|
1221
1221
|
/* @__PURE__ */ a(
|
|
1222
1222
|
"button",
|
|
1223
1223
|
{
|
|
1224
1224
|
type: "button",
|
|
1225
1225
|
onClick: i,
|
|
1226
|
-
disabled:
|
|
1226
|
+
disabled: w,
|
|
1227
1227
|
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)]",
|
|
1228
1228
|
children: r === "standalone" ? n("support.close_button", "Close") : n("nav.back_aria", "Back")
|
|
1229
1229
|
}
|
|
@@ -1232,26 +1232,26 @@ function Ie({ client: e, authSession: t, origin: r, onBack: i }) {
|
|
|
1232
1232
|
"button",
|
|
1233
1233
|
{
|
|
1234
1234
|
type: "submit",
|
|
1235
|
-
disabled:
|
|
1235
|
+
disabled: w,
|
|
1236
1236
|
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)]",
|
|
1237
1237
|
style: {
|
|
1238
1238
|
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%)",
|
|
1239
1239
|
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)"
|
|
1240
1240
|
},
|
|
1241
|
-
children:
|
|
1241
|
+
children: w ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children: n("support.send_button", "Send") })
|
|
1242
1242
|
}
|
|
1243
1243
|
)
|
|
1244
1244
|
] })
|
|
1245
1245
|
] })
|
|
1246
1246
|
] });
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function Mt({ onClick: t, ariaLabel: e }) {
|
|
1249
1249
|
return /* @__PURE__ */ a(
|
|
1250
1250
|
"button",
|
|
1251
1251
|
{
|
|
1252
1252
|
type: "button",
|
|
1253
|
-
onClick:
|
|
1254
|
-
"aria-label":
|
|
1253
|
+
onClick: t,
|
|
1254
|
+
"aria-label": e,
|
|
1255
1255
|
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)]",
|
|
1256
1256
|
children: /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1257
1257
|
/* @__PURE__ */ a(
|
|
@@ -1278,34 +1278,34 @@ function Ae({ onClick: e, ariaLabel: t }) {
|
|
|
1278
1278
|
}
|
|
1279
1279
|
);
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1282
|
-
type:
|
|
1283
|
-
placeholder:
|
|
1281
|
+
function ke({
|
|
1282
|
+
type: t,
|
|
1283
|
+
placeholder: e,
|
|
1284
1284
|
value: r,
|
|
1285
1285
|
onInput: i,
|
|
1286
1286
|
error: n,
|
|
1287
|
-
autocomplete:
|
|
1288
|
-
required:
|
|
1287
|
+
autocomplete: s,
|
|
1288
|
+
required: o
|
|
1289
1289
|
}) {
|
|
1290
1290
|
return /* @__PURE__ */ d("div", { children: [
|
|
1291
1291
|
/* @__PURE__ */ a(
|
|
1292
1292
|
"input",
|
|
1293
1293
|
{
|
|
1294
|
-
type:
|
|
1294
|
+
type: t,
|
|
1295
1295
|
value: r,
|
|
1296
|
-
placeholder:
|
|
1296
|
+
placeholder: e,
|
|
1297
1297
|
onInput: (c) => i(c.target.value),
|
|
1298
|
-
autocomplete:
|
|
1299
|
-
required:
|
|
1298
|
+
autocomplete: s,
|
|
1299
|
+
required: o,
|
|
1300
1300
|
class: `h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${n ? "shadow-[0_0_0_2px_rgba(239,68,68,0.5)]" : "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`
|
|
1301
1301
|
}
|
|
1302
1302
|
),
|
|
1303
1303
|
n && /* @__PURE__ */ a("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: n })
|
|
1304
1304
|
] });
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1307
|
-
placeholder:
|
|
1308
|
-
value:
|
|
1306
|
+
function Lt({
|
|
1307
|
+
placeholder: t,
|
|
1308
|
+
value: e,
|
|
1309
1309
|
onInput: r,
|
|
1310
1310
|
error: i,
|
|
1311
1311
|
required: n
|
|
@@ -1314,9 +1314,9 @@ function Me({
|
|
|
1314
1314
|
/* @__PURE__ */ a(
|
|
1315
1315
|
"textarea",
|
|
1316
1316
|
{
|
|
1317
|
-
value:
|
|
1318
|
-
placeholder:
|
|
1319
|
-
onInput: (
|
|
1317
|
+
value: e,
|
|
1318
|
+
placeholder: t,
|
|
1319
|
+
onInput: (s) => r(s.target.value),
|
|
1320
1320
|
required: n,
|
|
1321
1321
|
rows: 5,
|
|
1322
1322
|
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 ${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)]"}`
|
|
@@ -1325,23 +1325,23 @@ function Me({
|
|
|
1325
1325
|
i && /* @__PURE__ */ a("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: i })
|
|
1326
1326
|
] });
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1329
|
-
const { t: i } =
|
|
1328
|
+
function Tt({ files: t, onChange: e, disabled: r }) {
|
|
1329
|
+
const { t: i } = S(), n = F(null), [s, o] = v(!1), [c, l] = v(null), p = (u) => {
|
|
1330
1330
|
if (!u || r) return;
|
|
1331
1331
|
l(null);
|
|
1332
|
-
const
|
|
1333
|
-
if (
|
|
1334
|
-
l(i("support.too_many_files", "Up to {max} files", { max:
|
|
1332
|
+
const f = Array.from(u);
|
|
1333
|
+
if (t.length + f.length > ne) {
|
|
1334
|
+
l(i("support.too_many_files", "Up to {max} files", { max: ne }));
|
|
1335
1335
|
return;
|
|
1336
1336
|
}
|
|
1337
|
-
const
|
|
1338
|
-
(
|
|
1337
|
+
const _ = f.filter(
|
|
1338
|
+
(h) => ve.includes(h.type) && h.size <= Ct
|
|
1339
1339
|
);
|
|
1340
|
-
if (
|
|
1340
|
+
if (_.length !== f.length) {
|
|
1341
1341
|
l(i("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
|
|
1342
1342
|
return;
|
|
1343
1343
|
}
|
|
1344
|
-
|
|
1344
|
+
e([...t, ..._]);
|
|
1345
1345
|
};
|
|
1346
1346
|
return /* @__PURE__ */ d("div", { children: [
|
|
1347
1347
|
/* @__PURE__ */ a("span", { class: "text-xs font-medium text-gray-700", children: i("support.attachments_label", "Attachments (optional)") }),
|
|
@@ -1353,17 +1353,17 @@ function Le({ files: e, onChange: t, disabled: r }) {
|
|
|
1353
1353
|
"aria-label": i("support.attachments_aria", "Attachments upload"),
|
|
1354
1354
|
onClick: () => !r && n.current?.click(),
|
|
1355
1355
|
onDragOver: (u) => {
|
|
1356
|
-
u.preventDefault(), r ||
|
|
1356
|
+
u.preventDefault(), r || o(!0);
|
|
1357
1357
|
},
|
|
1358
|
-
onDragLeave: () =>
|
|
1358
|
+
onDragLeave: () => o(!1),
|
|
1359
1359
|
onDrop: (u) => {
|
|
1360
|
-
u.preventDefault(),
|
|
1360
|
+
u.preventDefault(), o(!1), p(u.dataTransfer?.files ?? null);
|
|
1361
1361
|
},
|
|
1362
|
-
class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${
|
|
1362
|
+
class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${s ? "border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]" : "border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${r ? "cursor-not-allowed opacity-60" : ""}`,
|
|
1363
1363
|
children: [
|
|
1364
1364
|
/* @__PURE__ */ a("div", { class: "text-xs text-gray-500", children: i("support.dropzone_text", "Drop images here or click to select") }),
|
|
1365
1365
|
/* @__PURE__ */ a("div", { class: "mt-0.5 text-[11px] text-gray-400", children: i("support.file_requirements", "JPEG/PNG/WebP, up to {max} files, ≤ 10MB each", {
|
|
1366
|
-
max:
|
|
1366
|
+
max: ne
|
|
1367
1367
|
}) })
|
|
1368
1368
|
]
|
|
1369
1369
|
}
|
|
@@ -1374,15 +1374,15 @@ function Le({ files: e, onChange: t, disabled: r }) {
|
|
|
1374
1374
|
ref: n,
|
|
1375
1375
|
type: "file",
|
|
1376
1376
|
multiple: !0,
|
|
1377
|
-
accept:
|
|
1377
|
+
accept: ve.join(","),
|
|
1378
1378
|
class: "hidden",
|
|
1379
1379
|
onChange: (u) => {
|
|
1380
|
-
|
|
1380
|
+
p(u.target.files), u.currentTarget.value = "";
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
1383
|
),
|
|
1384
1384
|
c && /* @__PURE__ */ a("p", { class: "mt-1 text-xs text-red-600", children: c }),
|
|
1385
|
-
|
|
1385
|
+
t.length > 0 && /* @__PURE__ */ a("ul", { class: "mt-2 flex flex-col gap-1", children: t.map((u, f) => /* @__PURE__ */ d(
|
|
1386
1386
|
"li",
|
|
1387
1387
|
{
|
|
1388
1388
|
class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
|
|
@@ -1393,8 +1393,8 @@ function Le({ files: e, onChange: t, disabled: r }) {
|
|
|
1393
1393
|
{
|
|
1394
1394
|
type: "button",
|
|
1395
1395
|
onClick: () => {
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1396
|
+
const _ = [...t];
|
|
1397
|
+
_.splice(f, 1), e(_);
|
|
1398
1398
|
},
|
|
1399
1399
|
disabled: r,
|
|
1400
1400
|
class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
|
|
@@ -1404,48 +1404,48 @@ function Le({ files: e, onChange: t, disabled: r }) {
|
|
|
1404
1404
|
)
|
|
1405
1405
|
]
|
|
1406
1406
|
},
|
|
1407
|
-
`${u.name}-${u.size}-${
|
|
1407
|
+
`${u.name}-${u.size}-${f}`
|
|
1408
1408
|
)) })
|
|
1409
1409
|
] });
|
|
1410
1410
|
}
|
|
1411
|
-
const
|
|
1411
|
+
const Pt = {
|
|
1412
1412
|
day: "cta.get_plan_daily",
|
|
1413
1413
|
week: "cta.get_plan_weekly",
|
|
1414
1414
|
month: "cta.get_plan_monthly",
|
|
1415
1415
|
year: "cta.get_plan_yearly"
|
|
1416
|
-
},
|
|
1416
|
+
}, Et = {
|
|
1417
1417
|
day: "Get Daily Plan",
|
|
1418
1418
|
week: "Get Weekly Plan",
|
|
1419
1419
|
month: "Get Monthly Plan",
|
|
1420
1420
|
year: "Get Yearly Plan"
|
|
1421
1421
|
};
|
|
1422
|
-
function
|
|
1423
|
-
if (
|
|
1424
|
-
if (!
|
|
1425
|
-
if (!r &&
|
|
1426
|
-
return i("cta.start_trial", "Start {days}-Day Free Trial", { days:
|
|
1427
|
-
if (!
|
|
1422
|
+
function jt(t, e, r, i) {
|
|
1423
|
+
if (e === "close") return i("cta.close", "Close");
|
|
1424
|
+
if (!t) return i("cta.continue", "Continue");
|
|
1425
|
+
if (!r && t.trial_days && t.interval && t.interval !== "lifetime")
|
|
1426
|
+
return i("cta.start_trial", "Start {days}-Day Free Trial", { days: t.trial_days });
|
|
1427
|
+
if (!t.interval || t.interval === "lifetime")
|
|
1428
1428
|
return i("cta.get_lifetime_access", "Get Lifetime Access");
|
|
1429
|
-
const n =
|
|
1430
|
-
return n ? i(n,
|
|
1431
|
-
interval:
|
|
1429
|
+
const n = Pt[t.interval];
|
|
1430
|
+
return n ? i(n, Et[t.interval]) : i("cta.get_plan_generic", "Get {interval} Plan", {
|
|
1431
|
+
interval: zt(t.interval)
|
|
1432
1432
|
});
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1435
|
-
return
|
|
1434
|
+
function zt(t) {
|
|
1435
|
+
return t.length ? t[0].toUpperCase() + t.slice(1) : t;
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1438
|
-
const { t: r } =
|
|
1437
|
+
function Bt({ block: t, ctx: e }) {
|
|
1438
|
+
const { t: r } = S(), [i, n] = v(!1), s = t.priceId ?? e.selectedPriceId, o = i || t.action === "checkout" && !s, c = s ? e.bootstrap.prices.find((f) => f.id === s) ?? null : null, l = e.bootstrap.user?.had_previous_trial ?? !1, p = t.label ?? jt(c, t.action, l, r);
|
|
1439
1439
|
return /* @__PURE__ */ d(
|
|
1440
1440
|
"button",
|
|
1441
1441
|
{
|
|
1442
1442
|
type: "button",
|
|
1443
|
-
disabled:
|
|
1443
|
+
disabled: o,
|
|
1444
1444
|
onClick: async () => {
|
|
1445
|
-
if (!
|
|
1445
|
+
if (!o) {
|
|
1446
1446
|
n(!0);
|
|
1447
1447
|
try {
|
|
1448
|
-
await
|
|
1448
|
+
await e.onAction(t.action, { priceId: s });
|
|
1449
1449
|
} finally {
|
|
1450
1450
|
n(!1);
|
|
1451
1451
|
}
|
|
@@ -1467,66 +1467,66 @@ function ze({ block: e, ctx: t }) {
|
|
|
1467
1467
|
"aria-hidden": "true"
|
|
1468
1468
|
}
|
|
1469
1469
|
),
|
|
1470
|
-
i ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children:
|
|
1470
|
+
i ? /* @__PURE__ */ a("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ a("span", { class: "relative z-10", children: p })
|
|
1471
1471
|
]
|
|
1472
1472
|
}
|
|
1473
1473
|
);
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const { t } =
|
|
1475
|
+
function Ot({ ctx: t }) {
|
|
1476
|
+
const { t: e } = S(), r = t.authSession, i = t.auth, [n, s] = v(!1), o = () => t.onAction("support");
|
|
1477
1477
|
if (r && !r.user.is_anonymous) {
|
|
1478
1478
|
const c = async () => {
|
|
1479
1479
|
if (!(!i || n)) {
|
|
1480
|
-
|
|
1480
|
+
s(!0);
|
|
1481
1481
|
try {
|
|
1482
1482
|
await i.signOut();
|
|
1483
1483
|
} catch {
|
|
1484
1484
|
} finally {
|
|
1485
|
-
|
|
1485
|
+
s(!1);
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
1488
|
};
|
|
1489
1489
|
return /* @__PURE__ */ d("div", { class: "-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500", children: [
|
|
1490
1490
|
/* @__PURE__ */ d("span", { children: [
|
|
1491
|
-
|
|
1491
|
+
e("session.signed_in_as_prefix", "Signed in as"),
|
|
1492
1492
|
" ",
|
|
1493
1493
|
/* @__PURE__ */ a("b", { class: "font-medium text-gray-700", children: r.user.email })
|
|
1494
1494
|
] }),
|
|
1495
1495
|
/* @__PURE__ */ d("div", { class: "flex items-center justify-center gap-3", children: [
|
|
1496
|
-
/* @__PURE__ */ a(
|
|
1497
|
-
/* @__PURE__ */ a(
|
|
1498
|
-
/* @__PURE__ */ a(
|
|
1496
|
+
/* @__PURE__ */ a(G, { onClick: c, disabled: !i || n, children: n ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
|
|
1497
|
+
/* @__PURE__ */ a(_e, {}),
|
|
1498
|
+
/* @__PURE__ */ a(G, { onClick: o, children: e("session.contact_support", "Contact Support") })
|
|
1499
1499
|
] })
|
|
1500
1500
|
] });
|
|
1501
1501
|
}
|
|
1502
1502
|
return /* @__PURE__ */ d("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
|
|
1503
|
-
/* @__PURE__ */ a(
|
|
1504
|
-
/* @__PURE__ */ a(
|
|
1505
|
-
/* @__PURE__ */ a(
|
|
1503
|
+
/* @__PURE__ */ a(G, { onClick: () => t.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
|
|
1504
|
+
/* @__PURE__ */ a(_e, {}),
|
|
1505
|
+
/* @__PURE__ */ a(G, { onClick: o, children: e("session.contact_support", "Contact Support") })
|
|
1506
1506
|
] });
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1509
|
-
onClick:
|
|
1510
|
-
disabled:
|
|
1508
|
+
function G({
|
|
1509
|
+
onClick: t,
|
|
1510
|
+
disabled: e,
|
|
1511
1511
|
children: r
|
|
1512
1512
|
}) {
|
|
1513
1513
|
return /* @__PURE__ */ a(
|
|
1514
1514
|
"button",
|
|
1515
1515
|
{
|
|
1516
1516
|
type: "button",
|
|
1517
|
-
onClick:
|
|
1518
|
-
disabled:
|
|
1517
|
+
onClick: t,
|
|
1518
|
+
disabled: e,
|
|
1519
1519
|
class: "font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
|
|
1520
1520
|
style: { color: "var(--pw-accent)" },
|
|
1521
1521
|
children: r
|
|
1522
1522
|
}
|
|
1523
1523
|
);
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1525
|
+
function _e() {
|
|
1526
1526
|
return /* @__PURE__ */ a("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1529
|
-
return
|
|
1528
|
+
function Ft({ block: t }) {
|
|
1529
|
+
return t.items.length ? /* @__PURE__ */ a("ul", { class: "flex flex-col gap-2.5", role: "list", children: t.items.map((e) => /* @__PURE__ */ d("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
|
|
1530
1530
|
/* @__PURE__ */ a(
|
|
1531
1531
|
"svg",
|
|
1532
1532
|
{
|
|
@@ -1549,30 +1549,30 @@ function Oe({ block: e }) {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
),
|
|
1551
1551
|
/* @__PURE__ */ d("div", { class: "flex flex-col gap-0.5", children: [
|
|
1552
|
-
/* @__PURE__ */ a("span", { class: "font-medium leading-snug text-gray-900", children:
|
|
1553
|
-
|
|
1552
|
+
/* @__PURE__ */ a("span", { class: "font-medium leading-snug text-gray-900", children: e.name }),
|
|
1553
|
+
e.desc ? /* @__PURE__ */ a("span", { class: "text-xs leading-relaxed text-gray-400", children: e.desc }) : null
|
|
1554
1554
|
] })
|
|
1555
|
-
] },
|
|
1555
|
+
] }, e.id)) }) : null;
|
|
1556
1556
|
}
|
|
1557
|
-
function
|
|
1558
|
-
const { t } =
|
|
1557
|
+
function Rt({ block: t }) {
|
|
1558
|
+
const { t: e } = S(), r = t.title ?? e("pricing.money_back", "30-day money-back guarantee"), i = t.subtitle, n = (t.icon ?? "dollar_shield") !== "none", s = Ut(r);
|
|
1559
1559
|
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100", children: [
|
|
1560
1560
|
/* @__PURE__ */ d("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
|
|
1561
|
-
n ? /* @__PURE__ */ a(
|
|
1562
|
-
|
|
1563
|
-
/* @__PURE__ */ a("b", { class: "font-bold text-gray-900", children:
|
|
1561
|
+
n ? /* @__PURE__ */ a(Dt, {}) : null,
|
|
1562
|
+
s ? /* @__PURE__ */ d("span", { children: [
|
|
1563
|
+
/* @__PURE__ */ a("b", { class: "font-bold text-gray-900", children: s.bold }),
|
|
1564
1564
|
" ",
|
|
1565
|
-
/* @__PURE__ */ a("span", { class: "font-medium", children:
|
|
1565
|
+
/* @__PURE__ */ a("span", { class: "font-medium", children: s.rest })
|
|
1566
1566
|
] }) : /* @__PURE__ */ a("span", { class: "font-medium", children: r })
|
|
1567
1567
|
] }),
|
|
1568
1568
|
i ? /* @__PURE__ */ a("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: i }) : null
|
|
1569
1569
|
] });
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1572
|
-
const
|
|
1573
|
-
return
|
|
1571
|
+
function Ut(t) {
|
|
1572
|
+
const e = t.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
|
|
1573
|
+
return e ? { bold: e[1], rest: e[2] } : null;
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function Dt() {
|
|
1576
1576
|
return /* @__PURE__ */ d(
|
|
1577
1577
|
"svg",
|
|
1578
1578
|
{
|
|
@@ -1607,131 +1607,131 @@ function Ue() {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
);
|
|
1609
1609
|
}
|
|
1610
|
-
const
|
|
1611
|
-
function $
|
|
1612
|
-
const r =
|
|
1613
|
-
let i =
|
|
1614
|
-
for (
|
|
1615
|
-
i -= 1,
|
|
1616
|
-
}
|
|
1617
|
-
function
|
|
1618
|
-
const r =
|
|
1619
|
-
return
|
|
1620
|
-
if (!
|
|
1621
|
-
const c = getComputedStyle(
|
|
1622
|
-
$
|
|
1623
|
-
}, [
|
|
1624
|
-
}
|
|
1625
|
-
function
|
|
1626
|
-
const
|
|
1627
|
-
if (
|
|
1628
|
-
const r = (
|
|
1629
|
-
return { amount:
|
|
1630
|
-
}
|
|
1631
|
-
return { amount:
|
|
1632
|
-
}
|
|
1633
|
-
function
|
|
1634
|
-
const r =
|
|
1610
|
+
const Re = 24, Nt = 16, Ht = 2;
|
|
1611
|
+
function $t(t, e) {
|
|
1612
|
+
const r = e * Ht;
|
|
1613
|
+
let i = Re;
|
|
1614
|
+
for (t.style.fontSize = `${i}px`; t.scrollHeight > r && i > Nt; )
|
|
1615
|
+
i -= 1, t.style.fontSize = `${i}px`;
|
|
1616
|
+
}
|
|
1617
|
+
function Vt({ block: t, ctx: e }) {
|
|
1618
|
+
const r = t.level ?? 1, i = `h${r}`, n = r === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : r === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = F(null), o = r === 1 && !!e.bootstrap.settings.title_auto_fit;
|
|
1619
|
+
return j(() => {
|
|
1620
|
+
if (!o || !s.current) return;
|
|
1621
|
+
const c = getComputedStyle(s.current), l = parseFloat(c.lineHeight) || Re * 1.5;
|
|
1622
|
+
$t(s.current, l);
|
|
1623
|
+
}, [o, t.text]), /* @__PURE__ */ a(i, { ref: s, class: n, children: t.text });
|
|
1624
|
+
}
|
|
1625
|
+
function qt(t) {
|
|
1626
|
+
const e = t.local ?? { currency: t.currency, amount: t.amount };
|
|
1627
|
+
if (t.interval === "year") {
|
|
1628
|
+
const r = (t.interval_count ?? 1) * 12;
|
|
1629
|
+
return { amount: e.amount / r, currency: e.currency };
|
|
1630
|
+
}
|
|
1631
|
+
return { amount: e.amount, currency: e.currency };
|
|
1632
|
+
}
|
|
1633
|
+
function ae(t, e) {
|
|
1634
|
+
const r = t % 1 !== 0 ? 2 : 0;
|
|
1635
1635
|
try {
|
|
1636
1636
|
const i = new Intl.NumberFormat(void 0, {
|
|
1637
1637
|
style: "currency",
|
|
1638
|
-
currency:
|
|
1638
|
+
currency: e,
|
|
1639
1639
|
currencyDisplay: "narrowSymbol",
|
|
1640
1640
|
maximumFractionDigits: r,
|
|
1641
1641
|
minimumFractionDigits: r
|
|
1642
|
-
}).formatToParts(
|
|
1643
|
-
let n = "",
|
|
1644
|
-
for (const
|
|
1645
|
-
|
|
1646
|
-
return { currency: n ||
|
|
1642
|
+
}).formatToParts(t);
|
|
1643
|
+
let n = "", s = "";
|
|
1644
|
+
for (const o of i)
|
|
1645
|
+
o.type === "currency" ? n = o.value : o.type !== "literal" && (s += o.value);
|
|
1646
|
+
return { currency: n || e, amount: s.trim() };
|
|
1647
1647
|
} catch {
|
|
1648
|
-
return { currency:
|
|
1648
|
+
return { currency: e, amount: String(t) };
|
|
1649
1649
|
}
|
|
1650
1650
|
}
|
|
1651
|
-
function
|
|
1652
|
-
const { amount: r, currency: i } =
|
|
1653
|
-
if (!
|
|
1654
|
-
const { currency: c, amount: l } =
|
|
1651
|
+
function le(t, e) {
|
|
1652
|
+
const { amount: r, currency: i } = qt(t);
|
|
1653
|
+
if (!e) {
|
|
1654
|
+
const { currency: c, amount: l } = ae(r, i);
|
|
1655
1655
|
return { currency: c, amount: l, originalAmount: null };
|
|
1656
1656
|
}
|
|
1657
|
-
const n = r * (1 -
|
|
1657
|
+
const n = r * (1 - e / 100), s = ae(n, i), o = ae(r, i);
|
|
1658
1658
|
return {
|
|
1659
|
-
currency:
|
|
1660
|
-
amount:
|
|
1661
|
-
originalAmount: `${
|
|
1659
|
+
currency: s.currency,
|
|
1660
|
+
amount: s.amount,
|
|
1661
|
+
originalAmount: `${o.currency}${o.amount}`
|
|
1662
1662
|
};
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1665
|
-
if (
|
|
1666
|
-
if (!
|
|
1667
|
-
return
|
|
1664
|
+
function Ue(t, e) {
|
|
1665
|
+
if (t.label) return t.label.toUpperCase();
|
|
1666
|
+
if (!t.interval || t.interval === "lifetime")
|
|
1667
|
+
return e("pricing.plan_label.lifetime", "LIFETIME");
|
|
1668
1668
|
const i = {
|
|
1669
1669
|
day: { key: "pricing.plan_label.daily", fallback: "DAILY PLAN" },
|
|
1670
1670
|
week: { key: "pricing.plan_label.weekly", fallback: "WEEKLY PLAN" },
|
|
1671
1671
|
month: { key: "pricing.plan_label.monthly", fallback: "MONTHLY PLAN" },
|
|
1672
1672
|
year: { key: "pricing.plan_label.yearly", fallback: "YEARLY PLAN" }
|
|
1673
|
-
}[
|
|
1674
|
-
return i ?
|
|
1675
|
-
}
|
|
1676
|
-
function
|
|
1677
|
-
if (!
|
|
1678
|
-
return
|
|
1679
|
-
if (
|
|
1680
|
-
const r =
|
|
1681
|
-
return r === 1 ?
|
|
1682
|
-
}
|
|
1683
|
-
function
|
|
1684
|
-
const { t: r } =
|
|
1673
|
+
}[t.interval];
|
|
1674
|
+
return i ? e(i.key, i.fallback) : `${t.interval.toUpperCase()} PLAN`;
|
|
1675
|
+
}
|
|
1676
|
+
function ce(t, e) {
|
|
1677
|
+
if (!t.interval || t.interval === "lifetime")
|
|
1678
|
+
return e("pricing.interval.lifetime_short", "lifetime");
|
|
1679
|
+
if (t.interval === "year") return e("pricing.interval.month", "month");
|
|
1680
|
+
const r = t.interval_count ?? 1;
|
|
1681
|
+
return r === 1 ? e(`pricing.interval.${t.interval}`, t.interval) : `${r} ${t.interval}s`;
|
|
1682
|
+
}
|
|
1683
|
+
function Gt({ block: t, ctx: e }) {
|
|
1684
|
+
const { t: r } = S(), i = t.priceIds && t.priceIds.length > 0 ? new Set(t.priceIds) : null, n = e.bootstrap.prices.filter((o) => !i || i.has(o.id));
|
|
1685
1685
|
if (n.length === 0)
|
|
1686
1686
|
return /* @__PURE__ */ a("p", { class: "text-sm text-gray-500", children: r("pricing.no_prices", "No prices available.") });
|
|
1687
|
-
const
|
|
1688
|
-
if (
|
|
1687
|
+
const s = t.popular_label ?? r("pricing.most_popular", "Most popular");
|
|
1688
|
+
if (t.view === "compact")
|
|
1689
1689
|
return /* @__PURE__ */ a(
|
|
1690
1690
|
"div",
|
|
1691
1691
|
{
|
|
1692
1692
|
class: "flex w-full flex-col rounded-xl border border-gray-200 bg-gray-50",
|
|
1693
1693
|
role: "radiogroup",
|
|
1694
1694
|
"aria-label": r("pricing.plans_aria", "Plans"),
|
|
1695
|
-
children: n.map((
|
|
1696
|
-
|
|
1695
|
+
children: n.map((o, c) => /* @__PURE__ */ a(
|
|
1696
|
+
Zt,
|
|
1697
1697
|
{
|
|
1698
|
-
price:
|
|
1698
|
+
price: o,
|
|
1699
1699
|
isLast: c === n.length - 1,
|
|
1700
|
-
isPopular:
|
|
1701
|
-
popularLabel:
|
|
1702
|
-
offer:
|
|
1703
|
-
selected:
|
|
1700
|
+
isPopular: t.popular_price_id === o.id,
|
|
1701
|
+
popularLabel: s,
|
|
1702
|
+
offer: N(e.bootstrap.offers, o.id),
|
|
1703
|
+
selected: e.selectedPriceId === o.id,
|
|
1704
1704
|
onSelect: () => {
|
|
1705
|
-
|
|
1705
|
+
e.setSelectedPriceId(o.id), e.onAction("price_selected", { priceId: o.id, price: o });
|
|
1706
1706
|
},
|
|
1707
1707
|
t: r
|
|
1708
1708
|
},
|
|
1709
|
-
|
|
1709
|
+
o.id
|
|
1710
1710
|
))
|
|
1711
1711
|
}
|
|
1712
1712
|
);
|
|
1713
|
-
if (
|
|
1714
|
-
const
|
|
1715
|
-
(l) => (
|
|
1713
|
+
if (t.view === "horizontal") {
|
|
1714
|
+
const o = Math.min(n.length, 3), c = n.some(
|
|
1715
|
+
(l) => (N(e.bootstrap.offers, l.id)?.discount_percent ?? 0) > 0
|
|
1716
1716
|
);
|
|
1717
1717
|
return /* @__PURE__ */ a(
|
|
1718
1718
|
"div",
|
|
1719
1719
|
{
|
|
1720
1720
|
class: "grid items-stretch gap-2",
|
|
1721
|
-
style: { gridTemplateColumns: `repeat(${
|
|
1721
|
+
style: { gridTemplateColumns: `repeat(${o}, minmax(0, 1fr))` },
|
|
1722
1722
|
role: "radiogroup",
|
|
1723
1723
|
"aria-label": r("pricing.plans_aria", "Plans"),
|
|
1724
1724
|
children: n.map((l) => /* @__PURE__ */ a(
|
|
1725
|
-
|
|
1725
|
+
Kt,
|
|
1726
1726
|
{
|
|
1727
1727
|
price: l,
|
|
1728
|
-
isPopular:
|
|
1729
|
-
popularLabel:
|
|
1730
|
-
offer:
|
|
1728
|
+
isPopular: t.popular_price_id === l.id,
|
|
1729
|
+
popularLabel: s,
|
|
1730
|
+
offer: N(e.bootstrap.offers, l.id),
|
|
1731
1731
|
reserveStrikeRow: c,
|
|
1732
|
-
selected:
|
|
1732
|
+
selected: e.selectedPriceId === l.id,
|
|
1733
1733
|
onSelect: () => {
|
|
1734
|
-
|
|
1734
|
+
e.setSelectedPriceId(l.id), e.onAction("price_selected", { priceId: l.id, price: l });
|
|
1735
1735
|
},
|
|
1736
1736
|
t: r
|
|
1737
1737
|
},
|
|
@@ -1746,8 +1746,8 @@ function Ge({ block: e, ctx: t }) {
|
|
|
1746
1746
|
class: "flex flex-col gap-2",
|
|
1747
1747
|
role: "radiogroup",
|
|
1748
1748
|
"aria-label": r("pricing.plans_aria", "Plans"),
|
|
1749
|
-
children: n.map((
|
|
1750
|
-
const c =
|
|
1749
|
+
children: n.map((o) => {
|
|
1750
|
+
const c = e.selectedPriceId === o.id, l = t.popular_price_id === o.id, u = N(e.bootstrap.offers, o.id)?.discount_percent ?? null, { currency: f, amount: _, originalAmount: h } = le(o, u);
|
|
1751
1751
|
return /* @__PURE__ */ d(
|
|
1752
1752
|
"button",
|
|
1753
1753
|
{
|
|
@@ -1755,7 +1755,7 @@ function Ge({ block: e, ctx: t }) {
|
|
|
1755
1755
|
role: "radio",
|
|
1756
1756
|
"aria-checked": c,
|
|
1757
1757
|
onClick: () => {
|
|
1758
|
-
|
|
1758
|
+
e.setSelectedPriceId(o.id), e.onAction("price_selected", { priceId: o.id, price: o });
|
|
1759
1759
|
},
|
|
1760
1760
|
class: [
|
|
1761
1761
|
"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)]",
|
|
@@ -1803,12 +1803,12 @@ function Ge({ block: e, ctx: t }) {
|
|
|
1803
1803
|
),
|
|
1804
1804
|
/* @__PURE__ */ d("div", { class: "flex flex-1 flex-col gap-0.5", children: [
|
|
1805
1805
|
/* @__PURE__ */ d("div", { class: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
1806
|
-
/* @__PURE__ */ a("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children:
|
|
1807
|
-
|
|
1806
|
+
/* @__PURE__ */ a("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: Ue(o, r) }),
|
|
1807
|
+
h ? (
|
|
1808
1808
|
// opacity-60 приглушает strike: глаз сначала ловит label
|
|
1809
1809
|
// и discount-badge, потом main price; original «бывшая цена»
|
|
1810
1810
|
// — третичная информация, не должна конкурировать с label.
|
|
1811
|
-
/* @__PURE__ */ a("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children:
|
|
1811
|
+
/* @__PURE__ */ a("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: h })
|
|
1812
1812
|
) : null,
|
|
1813
1813
|
u ? (
|
|
1814
1814
|
// Emerald pill — фиксированный «успех/выгода», не зависит от
|
|
@@ -1821,53 +1821,53 @@ function Ge({ block: e, ctx: t }) {
|
|
|
1821
1821
|
) : null
|
|
1822
1822
|
] }),
|
|
1823
1823
|
/* @__PURE__ */ a("div", { class: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ d("span", { class: "text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium", children: [
|
|
1824
|
-
/* @__PURE__ */ a("span", { class: "opacity-90", children:
|
|
1825
|
-
|
|
1824
|
+
/* @__PURE__ */ a("span", { class: "opacity-90", children: f }),
|
|
1825
|
+
_,
|
|
1826
1826
|
/* @__PURE__ */ d("span", { class: "text-sm font-normal text-gray-500", children: [
|
|
1827
1827
|
" ",
|
|
1828
1828
|
"/ ",
|
|
1829
|
-
|
|
1829
|
+
ce(o, r)
|
|
1830
1830
|
] })
|
|
1831
1831
|
] }) }),
|
|
1832
|
-
|
|
1832
|
+
o.description ? /* @__PURE__ */ a("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: o.description }) : null
|
|
1833
1833
|
] }),
|
|
1834
1834
|
l ? /* @__PURE__ */ a(
|
|
1835
1835
|
"span",
|
|
1836
1836
|
{
|
|
1837
1837
|
class: "absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",
|
|
1838
1838
|
style: { background: "var(--pw-accent)" },
|
|
1839
|
-
children:
|
|
1839
|
+
children: s
|
|
1840
1840
|
}
|
|
1841
1841
|
) : null
|
|
1842
1842
|
]
|
|
1843
1843
|
},
|
|
1844
|
-
|
|
1844
|
+
o.id
|
|
1845
1845
|
);
|
|
1846
1846
|
})
|
|
1847
1847
|
}
|
|
1848
1848
|
);
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1851
|
-
return
|
|
1850
|
+
function Wt(t, e) {
|
|
1851
|
+
return t.label ? t.label : !t.interval || t.interval === "lifetime" ? e("pricing.interval.lifetime_short", "lifetime") : e(`pricing.interval.${t.interval}`, t.interval);
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1854
|
-
price:
|
|
1855
|
-
isLast:
|
|
1853
|
+
function Zt({
|
|
1854
|
+
price: t,
|
|
1855
|
+
isLast: e,
|
|
1856
1856
|
isPopular: r,
|
|
1857
1857
|
popularLabel: i,
|
|
1858
1858
|
offer: n,
|
|
1859
|
-
selected:
|
|
1860
|
-
onSelect:
|
|
1859
|
+
selected: s,
|
|
1860
|
+
onSelect: o,
|
|
1861
1861
|
t: c
|
|
1862
1862
|
}) {
|
|
1863
|
-
const l = n?.discount_percent ?? null, { currency:
|
|
1863
|
+
const l = n?.discount_percent ?? null, { currency: p, amount: u, originalAmount: f } = le(t, l);
|
|
1864
1864
|
return /* @__PURE__ */ d(
|
|
1865
1865
|
"button",
|
|
1866
1866
|
{
|
|
1867
1867
|
type: "button",
|
|
1868
1868
|
role: "radio",
|
|
1869
|
-
"aria-checked":
|
|
1870
|
-
onClick:
|
|
1869
|
+
"aria-checked": s,
|
|
1870
|
+
onClick: o,
|
|
1871
1871
|
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)]",
|
|
1872
1872
|
children: [
|
|
1873
1873
|
/* @__PURE__ */ a(
|
|
@@ -1875,9 +1875,9 @@ function We({
|
|
|
1875
1875
|
{
|
|
1876
1876
|
class: [
|
|
1877
1877
|
"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",
|
|
1878
|
-
|
|
1878
|
+
s ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent"
|
|
1879
1879
|
].join(" "),
|
|
1880
|
-
style:
|
|
1880
|
+
style: s ? {
|
|
1881
1881
|
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%)"
|
|
1882
1882
|
} : void 0,
|
|
1883
1883
|
"aria-hidden": "true",
|
|
@@ -1889,7 +1889,7 @@ function We({
|
|
|
1889
1889
|
viewBox: "0 0 17 12",
|
|
1890
1890
|
fill: "none",
|
|
1891
1891
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1892
|
-
class:
|
|
1892
|
+
class: s ? "opacity-100" : "opacity-0",
|
|
1893
1893
|
children: /* @__PURE__ */ a(
|
|
1894
1894
|
"path",
|
|
1895
1895
|
{
|
|
@@ -1906,11 +1906,11 @@ function We({
|
|
|
1906
1906
|
{
|
|
1907
1907
|
class: [
|
|
1908
1908
|
"flex flex-1 items-center gap-1.5 pb-3.5",
|
|
1909
|
-
|
|
1909
|
+
e ? "" : "border-b border-gray-200"
|
|
1910
1910
|
].join(" "),
|
|
1911
1911
|
children: [
|
|
1912
1912
|
/* @__PURE__ */ d("div", { class: "flex flex-wrap items-center gap-1 gap-x-1.5", children: [
|
|
1913
|
-
/* @__PURE__ */ a("span", { class: "text-base font-normal capitalize text-gray-800", children:
|
|
1913
|
+
/* @__PURE__ */ a("span", { class: "text-base font-normal capitalize text-gray-800", children: Wt(t, c) }),
|
|
1914
1914
|
r ? (
|
|
1915
1915
|
// Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
|
|
1916
1916
|
// Низкий visual weight: pill про "имя плана" (most popular), а не
|
|
@@ -1935,14 +1935,14 @@ function We({
|
|
|
1935
1935
|
] }),
|
|
1936
1936
|
/* @__PURE__ */ a("div", { class: "flex-1" }),
|
|
1937
1937
|
/* @__PURE__ */ d("span", { class: "flex items-baseline gap-1.5 text-base font-normal text-gray-600", children: [
|
|
1938
|
-
|
|
1938
|
+
f ? /* @__PURE__ */ a("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: f }) : null,
|
|
1939
1939
|
/* @__PURE__ */ d("span", { class: "whitespace-nowrap", children: [
|
|
1940
|
-
/* @__PURE__ */ a("span", { class: "opacity-90", children:
|
|
1940
|
+
/* @__PURE__ */ a("span", { class: "opacity-90", children: p }),
|
|
1941
1941
|
u,
|
|
1942
1942
|
/* @__PURE__ */ d("span", { class: "text-xs text-gray-400", children: [
|
|
1943
1943
|
" ",
|
|
1944
1944
|
"/ ",
|
|
1945
|
-
|
|
1945
|
+
ce(t, c)
|
|
1946
1946
|
] })
|
|
1947
1947
|
] })
|
|
1948
1948
|
] })
|
|
@@ -1953,33 +1953,33 @@ function We({
|
|
|
1953
1953
|
}
|
|
1954
1954
|
);
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1957
|
-
price:
|
|
1958
|
-
isPopular:
|
|
1956
|
+
function Kt({
|
|
1957
|
+
price: t,
|
|
1958
|
+
isPopular: e,
|
|
1959
1959
|
popularLabel: r,
|
|
1960
1960
|
offer: i,
|
|
1961
1961
|
reserveStrikeRow: n,
|
|
1962
|
-
selected:
|
|
1963
|
-
onSelect:
|
|
1962
|
+
selected: s,
|
|
1963
|
+
onSelect: o,
|
|
1964
1964
|
t: c
|
|
1965
1965
|
}) {
|
|
1966
|
-
const l = i?.discount_percent ?? null, { currency:
|
|
1966
|
+
const l = i?.discount_percent ?? null, { currency: p, amount: u, originalAmount: f } = le(t, l);
|
|
1967
1967
|
return /* @__PURE__ */ d(
|
|
1968
1968
|
"button",
|
|
1969
1969
|
{
|
|
1970
1970
|
type: "button",
|
|
1971
1971
|
role: "radio",
|
|
1972
|
-
"aria-checked":
|
|
1973
|
-
onClick:
|
|
1972
|
+
"aria-checked": s,
|
|
1973
|
+
onClick: o,
|
|
1974
1974
|
class: [
|
|
1975
1975
|
"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)]",
|
|
1976
|
-
|
|
1976
|
+
s ? "border-[var(--pw-accent)]" : "border-gray-200 hover:bg-gray-50"
|
|
1977
1977
|
].join(" "),
|
|
1978
|
-
style:
|
|
1978
|
+
style: s ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
|
|
1979
1979
|
children: [
|
|
1980
|
-
/* @__PURE__ */ a("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children:
|
|
1980
|
+
/* @__PURE__ */ a("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: Ue(t, c) }),
|
|
1981
1981
|
n ? /* @__PURE__ */ d("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
|
|
1982
|
-
|
|
1982
|
+
f ? /* @__PURE__ */ a("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: f }) : null,
|
|
1983
1983
|
l ? /* @__PURE__ */ d("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
|
|
1984
1984
|
"-",
|
|
1985
1985
|
l,
|
|
@@ -1987,14 +1987,14 @@ function Ze({
|
|
|
1987
1987
|
] }) : null
|
|
1988
1988
|
] }) : null,
|
|
1989
1989
|
/* @__PURE__ */ d("span", { class: "text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium", children: [
|
|
1990
|
-
/* @__PURE__ */ a("span", { class: "opacity-90", children:
|
|
1990
|
+
/* @__PURE__ */ a("span", { class: "opacity-90", children: p }),
|
|
1991
1991
|
u
|
|
1992
1992
|
] }),
|
|
1993
1993
|
/* @__PURE__ */ d("span", { class: "text-xs font-normal text-gray-500", children: [
|
|
1994
1994
|
"/ ",
|
|
1995
|
-
|
|
1995
|
+
ce(t, c)
|
|
1996
1996
|
] }),
|
|
1997
|
-
|
|
1997
|
+
e ? /* @__PURE__ */ a(
|
|
1998
1998
|
"span",
|
|
1999
1999
|
{
|
|
2000
2000
|
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",
|
|
@@ -2006,28 +2006,28 @@ function Ze({
|
|
|
2006
2006
|
}
|
|
2007
2007
|
);
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2010
|
-
return /* @__PURE__ */ a("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children:
|
|
2009
|
+
function Yt({ block: t }) {
|
|
2010
|
+
return /* @__PURE__ */ a("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: t.text });
|
|
2011
2011
|
}
|
|
2012
|
-
const
|
|
2012
|
+
const Xt = {
|
|
2013
2013
|
week: 0.25,
|
|
2014
2014
|
month: 1,
|
|
2015
2015
|
year: 12
|
|
2016
2016
|
};
|
|
2017
|
-
function
|
|
2018
|
-
return
|
|
2017
|
+
function Jt(t, e) {
|
|
2018
|
+
return t ? e(`pricing.interval.${t}`, t) : e("pricing.interval.period", "period");
|
|
2019
2019
|
}
|
|
2020
|
-
function
|
|
2021
|
-
const { t: r } =
|
|
2022
|
-
if (!
|
|
2023
|
-
const n =
|
|
2020
|
+
function Qt({ block: t, ctx: e }) {
|
|
2021
|
+
const { t: r } = S();
|
|
2022
|
+
if (!t.queries.length) return null;
|
|
2023
|
+
const n = e.bootstrap.prices.find((o) => o.id === e.selectedPriceId)?.interval ?? null, s = n ? Xt[n] : void 0;
|
|
2024
2024
|
return /* @__PURE__ */ d("div", { class: "flex flex-col gap-2", children: [
|
|
2025
2025
|
/* @__PURE__ */ a("div", { class: "text-sm font-semibold text-gray-800", children: !n || n === "lifetime" ? r("pricing.included_total", "Included for lifetime:") : r("pricing.included_per", "Included per {interval}:", {
|
|
2026
|
-
interval:
|
|
2026
|
+
interval: Jt(n, r)
|
|
2027
2027
|
}) }),
|
|
2028
|
-
/* @__PURE__ */ a("ul", { class: "flex flex-col gap-2", role: "list", children:
|
|
2029
|
-
const c = Number.isFinite(
|
|
2030
|
-
return /* @__PURE__ */ d("li", { class: `flex gap-3 ${
|
|
2028
|
+
/* @__PURE__ */ a("ul", { class: "flex flex-col gap-2", role: "list", children: t.queries.map((o) => {
|
|
2029
|
+
const c = Number.isFinite(o.count) ? o.count : 0, l = s !== void 0 ? Math.round(c * s) : c;
|
|
2030
|
+
return /* @__PURE__ */ d("li", { class: `flex gap-3 ${o.desc ? "items-start" : "items-center"}`, children: [
|
|
2031
2031
|
/* @__PURE__ */ a(
|
|
2032
2032
|
"svg",
|
|
2033
2033
|
{
|
|
@@ -2035,7 +2035,7 @@ function Je({ block: e, ctx: t }) {
|
|
|
2035
2035
|
height: "18",
|
|
2036
2036
|
viewBox: "0 0 20 20",
|
|
2037
2037
|
fill: "none",
|
|
2038
|
-
class: `flex-shrink-0 text-emerald-500 ${
|
|
2038
|
+
class: `flex-shrink-0 text-emerald-500 ${o.desc ? "mt-0.5" : ""}`,
|
|
2039
2039
|
"aria-hidden": "true",
|
|
2040
2040
|
children: /* @__PURE__ */ a(
|
|
2041
2041
|
"path",
|
|
@@ -2052,48 +2052,48 @@ function Je({ block: e, ctx: t }) {
|
|
|
2052
2052
|
/* @__PURE__ */ d("div", { children: [
|
|
2053
2053
|
/* @__PURE__ */ a("span", { class: "font-semibold text-gray-900 text-sm", children: l }),
|
|
2054
2054
|
" ",
|
|
2055
|
-
/* @__PURE__ */ a("span", { class: "text-sm text-gray-800", children:
|
|
2056
|
-
|
|
2055
|
+
/* @__PURE__ */ a("span", { class: "text-sm text-gray-800", children: o.name }),
|
|
2056
|
+
o.desc ? /* @__PURE__ */ d(se, { children: [
|
|
2057
2057
|
/* @__PURE__ */ a("br", {}),
|
|
2058
|
-
/* @__PURE__ */ a("span", { class: "text-xs text-gray-400", children:
|
|
2058
|
+
/* @__PURE__ */ a("span", { class: "text-xs text-gray-400", children: o.desc })
|
|
2059
2059
|
] }) : null
|
|
2060
2060
|
] })
|
|
2061
|
-
] },
|
|
2061
|
+
] }, o.id);
|
|
2062
2062
|
}) })
|
|
2063
2063
|
] });
|
|
2064
2064
|
}
|
|
2065
|
-
const
|
|
2066
|
-
heading:
|
|
2067
|
-
text:
|
|
2068
|
-
price_grid:
|
|
2069
|
-
cta_button:
|
|
2070
|
-
auth_panel:
|
|
2071
|
-
current_session:
|
|
2072
|
-
features_list:
|
|
2073
|
-
tokenization_gate:
|
|
2074
|
-
guarantee_badge:
|
|
2075
|
-
offer_banner:
|
|
2065
|
+
const er = {
|
|
2066
|
+
heading: Vt,
|
|
2067
|
+
text: Yt,
|
|
2068
|
+
price_grid: Gt,
|
|
2069
|
+
cta_button: Bt,
|
|
2070
|
+
auth_panel: Ee,
|
|
2071
|
+
current_session: Ot,
|
|
2072
|
+
features_list: Ft,
|
|
2073
|
+
tokenization_gate: Qt,
|
|
2074
|
+
guarantee_badge: Rt,
|
|
2075
|
+
offer_banner: _t
|
|
2076
2076
|
};
|
|
2077
|
-
function tr({ layout:
|
|
2078
|
-
const
|
|
2079
|
-
for (const
|
|
2080
|
-
if (
|
|
2081
|
-
return
|
|
2082
|
-
return
|
|
2083
|
-
}, [
|
|
2084
|
-
bootstrap:
|
|
2077
|
+
function tr({ layout: t, bootstrap: e, onAction: r, auth: i, authSession: n, hasTopBanner: s }) {
|
|
2078
|
+
const o = We(() => {
|
|
2079
|
+
for (const k of t.blocks)
|
|
2080
|
+
if (k.type === "price_grid" && k.popular_price_id && e.prices.some((w) => w.id === k.popular_price_id))
|
|
2081
|
+
return k.popular_price_id;
|
|
2082
|
+
return e.prices[0]?.id ?? null;
|
|
2083
|
+
}, [t.blocks, e.prices]), [c, l] = v(o), p = {
|
|
2084
|
+
bootstrap: e,
|
|
2085
2085
|
selectedPriceId: c,
|
|
2086
2086
|
setSelectedPriceId: l,
|
|
2087
2087
|
onAction: r,
|
|
2088
2088
|
auth: i,
|
|
2089
2089
|
authSession: n
|
|
2090
|
-
}, u =
|
|
2091
|
-
const
|
|
2092
|
-
return
|
|
2090
|
+
}, u = t.blocks.findIndex((k) => k.type === "cta_button"), f = u === -1 ? t.blocks : t.blocks.slice(0, u), _ = u === -1 ? [] : t.blocks.slice(u), h = (k, w) => {
|
|
2091
|
+
const A = er[k.type];
|
|
2092
|
+
return A ? /* @__PURE__ */ a(A, { block: k, ctx: p }, `${k.type}-${w}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${k.type}`), null);
|
|
2093
2093
|
};
|
|
2094
|
-
return /* @__PURE__ */ d(
|
|
2095
|
-
/* @__PURE__ */ a("div", { class: "flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8", children: /* @__PURE__ */ a("div", { class: "flex flex-col gap-6", children:
|
|
2096
|
-
|
|
2094
|
+
return /* @__PURE__ */ d(se, { children: [
|
|
2095
|
+
/* @__PURE__ */ a("div", { class: "flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8", children: /* @__PURE__ */ a("div", { class: "flex flex-col gap-6", children: f.map(h) }) }),
|
|
2096
|
+
_.length > 0 ? (
|
|
2097
2097
|
// Тонкий shadow-top вместо border-t — создаёт depth, читается как
|
|
2098
2098
|
// «footer закреплён к низу dialog'а». Линия выглядела как divider
|
|
2099
2099
|
// в обычном flow, не передавала sticky-character.
|
|
@@ -2102,182 +2102,202 @@ function tr({ layout: e, bootstrap: t, onAction: r, auth: i, authSession: n, has
|
|
|
2102
2102
|
{
|
|
2103
2103
|
class: "flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",
|
|
2104
2104
|
style: { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" },
|
|
2105
|
-
children:
|
|
2105
|
+
children: _.map((k, w) => h(k, f.length + w))
|
|
2106
2106
|
}
|
|
2107
2107
|
)
|
|
2108
2108
|
) : null
|
|
2109
2109
|
] });
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2112
|
-
return
|
|
2111
|
+
function rr(t, e, r, i) {
|
|
2112
|
+
return t ? i ? { 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 } : r.kind === "support" ? { open: !0, view: "support", error: null, processing: !1 } : r.kind === "auth_gate" ? { open: !0, view: "auth", error: null, processing: !1 } : r.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null, processing: !1 } : r.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null, processing: !1 } : r.kind === "purchase_success" ? { open: !0, view: "purchased", error: null, processing: !1 } : r.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 };
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2115
|
-
return
|
|
2114
|
+
function ir(t, e) {
|
|
2115
|
+
return t.open === e.open && t.view === e.view && t.error === e.error && t.processing === e.processing;
|
|
2116
2116
|
}
|
|
2117
|
-
function
|
|
2118
|
-
client:
|
|
2119
|
-
open:
|
|
2117
|
+
function nr({
|
|
2118
|
+
client: t,
|
|
2119
|
+
open: e,
|
|
2120
2120
|
onClose: r,
|
|
2121
2121
|
onEvent: i,
|
|
2122
2122
|
initialView: n,
|
|
2123
|
-
initialAuthMode:
|
|
2124
|
-
initialCheckoutPriceId:
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2123
|
+
initialAuthMode: s,
|
|
2124
|
+
initialCheckoutPriceId: o,
|
|
2125
|
+
initialCheckoutUrl: c,
|
|
2126
|
+
purchased: l,
|
|
2127
|
+
renew: p,
|
|
2128
|
+
onState: u,
|
|
2129
|
+
inline: f,
|
|
2130
|
+
locale: _
|
|
2130
2131
|
}) {
|
|
2131
|
-
const [
|
|
2132
|
-
() =>
|
|
2133
|
-
), [
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
}
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2132
|
+
const [h, k] = v({ status: "idle" }), [w, A] = v(
|
|
2133
|
+
() => t.auth?.getCachedSession() ?? null
|
|
2134
|
+
), [b, m] = v(() => n === "support" ? { kind: "support", origin: "standalone" } : n === "auth" ? o ? {
|
|
2135
|
+
kind: "auth_gate",
|
|
2136
|
+
pendingCheckout: { priceId: o, direct: !0 },
|
|
2137
|
+
origin: "standalone",
|
|
2138
|
+
intent: "preauth"
|
|
2139
|
+
} : { kind: "auth_gate", origin: "standalone" } : n === "awaiting_payment" && o && c ? {
|
|
2140
|
+
kind: "awaiting_payment",
|
|
2141
|
+
priceId: o,
|
|
2142
|
+
url: c
|
|
2143
|
+
} : n === "popup_blocked" && o && c ? {
|
|
2144
|
+
kind: "popup_blocked",
|
|
2145
|
+
priceId: o,
|
|
2146
|
+
url: c
|
|
2147
|
+
} : { kind: "layout" }), C = n === "awaiting_payment" || n === "popup_blocked" || n === "auth" && !!o, I = F(!1), B = F(null);
|
|
2148
|
+
j(() => {
|
|
2149
|
+
if (!u) return;
|
|
2150
|
+
const y = rr(e, h, b, l), g = B.current;
|
|
2151
|
+
g && ir(g, y) || (B.current = y, u(y));
|
|
2152
|
+
}, [e, h, b, l, u]), j(() => {
|
|
2153
|
+
if (t.auth)
|
|
2154
|
+
return t.auth.onAuthChange((y, g) => A(g));
|
|
2155
|
+
}, [t.auth]), j(() => {
|
|
2156
|
+
if (typeof t.onBootstrapChange == "function")
|
|
2157
|
+
return t.onBootstrapChange((y) => {
|
|
2158
|
+
k(
|
|
2159
|
+
(g) => g.status === "ready" ? { status: "ready", data: y } : g
|
|
2146
2160
|
);
|
|
2147
2161
|
});
|
|
2148
|
-
}, [
|
|
2149
|
-
if (!
|
|
2150
|
-
let
|
|
2151
|
-
return
|
|
2152
|
-
if (
|
|
2153
|
-
|
|
2154
|
-
const
|
|
2155
|
-
|
|
2156
|
-
priceId:
|
|
2162
|
+
}, [t]), j(() => {
|
|
2163
|
+
if (!e || h.status === "ready" || h.status === "loading") return;
|
|
2164
|
+
let y = !1;
|
|
2165
|
+
return k({ status: "loading" }), t.bootstrap().then((g) => {
|
|
2166
|
+
if (y) return;
|
|
2167
|
+
k({ status: "ready", data: g }), i("ready", g);
|
|
2168
|
+
const x = n === "support" || n === "auth" || C;
|
|
2169
|
+
g.user?.has_active_subscription && !p && !x && (i("purchase_completed", {
|
|
2170
|
+
priceId: o ?? null,
|
|
2157
2171
|
sessionId: null,
|
|
2158
2172
|
restored: !0
|
|
2159
|
-
}),
|
|
2160
|
-
}).catch((
|
|
2161
|
-
if (
|
|
2162
|
-
const
|
|
2163
|
-
|
|
2173
|
+
}), m({ kind: "purchase_success", restored: !0 }));
|
|
2174
|
+
}).catch((g) => {
|
|
2175
|
+
if (y) return;
|
|
2176
|
+
const x = g instanceof L ? g : new L("unknown", "Failed to load paywall", { cause: g });
|
|
2177
|
+
k({ status: "error", error: x }), i("error", x);
|
|
2164
2178
|
}), () => {
|
|
2165
|
-
|
|
2179
|
+
y = !0;
|
|
2166
2180
|
};
|
|
2167
|
-
}, [
|
|
2168
|
-
if (!
|
|
2169
|
-
|
|
2181
|
+
}, [e, t]), Ze(() => {
|
|
2182
|
+
if (!e) {
|
|
2183
|
+
m({ kind: "layout" }), I.current = !1;
|
|
2170
2184
|
return;
|
|
2171
2185
|
}
|
|
2172
|
-
n === "support" ?
|
|
2173
|
-
|
|
2174
|
-
|
|
2186
|
+
n === "support" ? m({ kind: "support", origin: "standalone" }) : n === "auth" ? m(o ? {
|
|
2187
|
+
kind: "auth_gate",
|
|
2188
|
+
pendingCheckout: { priceId: o, direct: !0 },
|
|
2189
|
+
origin: "standalone",
|
|
2190
|
+
intent: "preauth"
|
|
2191
|
+
} : { kind: "auth_gate", origin: "standalone" }) : n === "awaiting_payment" && o && c ? m({
|
|
2192
|
+
kind: "awaiting_payment",
|
|
2193
|
+
priceId: o,
|
|
2194
|
+
url: c
|
|
2195
|
+
}) : n === "popup_blocked" && o && c && m({
|
|
2196
|
+
kind: "popup_blocked",
|
|
2197
|
+
priceId: o,
|
|
2198
|
+
url: c
|
|
2199
|
+
});
|
|
2200
|
+
}, [e, n, o, c]);
|
|
2201
|
+
const M = async (y) => {
|
|
2175
2202
|
try {
|
|
2176
|
-
const
|
|
2177
|
-
priceId:
|
|
2178
|
-
|
|
2203
|
+
const g = t.getCachedOffers?.() ?? null, x = g ? N(g, y) : null, E = await t.createCheckout({
|
|
2204
|
+
priceId: y,
|
|
2205
|
+
offerId: x?.id,
|
|
2206
|
+
ignoreActivePurchase: p === !0
|
|
2179
2207
|
});
|
|
2180
|
-
if (i("checkout_started", { priceId:
|
|
2181
|
-
const
|
|
2182
|
-
if (
|
|
2208
|
+
if (i("checkout_started", { priceId: y, url: E.url, acquiring: E.acquiring }), typeof window > "u" || !E.url) return;
|
|
2209
|
+
const $ = window.open(E.url, "_blank");
|
|
2210
|
+
if ($) {
|
|
2183
2211
|
try {
|
|
2184
|
-
|
|
2212
|
+
$.opener = null;
|
|
2185
2213
|
} catch {
|
|
2186
2214
|
}
|
|
2187
|
-
|
|
2215
|
+
m({ kind: "awaiting_payment", priceId: y, url: E.url });
|
|
2188
2216
|
} else
|
|
2189
|
-
|
|
2190
|
-
} catch (
|
|
2191
|
-
if (
|
|
2217
|
+
m({ kind: "popup_blocked", priceId: y, url: E.url });
|
|
2218
|
+
} catch (g) {
|
|
2219
|
+
if (g instanceof L && g.code === "already_purchased") {
|
|
2192
2220
|
try {
|
|
2193
|
-
await
|
|
2221
|
+
await t.getUser({ force: !0 });
|
|
2194
2222
|
} catch {
|
|
2195
2223
|
}
|
|
2196
|
-
i("purchase_completed", { priceId:
|
|
2224
|
+
i("purchase_completed", { priceId: y, sessionId: null, restored: !0 }), C ? r() : m({ kind: "purchase_success", restored: !0 });
|
|
2197
2225
|
return;
|
|
2198
2226
|
}
|
|
2199
|
-
const
|
|
2200
|
-
i("error",
|
|
2227
|
+
const x = g instanceof L ? g : new L("checkout_failed", "Checkout failed", { cause: g });
|
|
2228
|
+
i("error", x), C ? r() : m({ kind: "layout" });
|
|
2201
2229
|
}
|
|
2202
|
-
},
|
|
2230
|
+
}, z = (y, g) => {
|
|
2203
2231
|
if (typeof window > "u") return;
|
|
2204
|
-
const
|
|
2205
|
-
if (
|
|
2232
|
+
const x = window.open(g, "_blank");
|
|
2233
|
+
if (x) {
|
|
2206
2234
|
try {
|
|
2207
|
-
|
|
2235
|
+
x.opener = null;
|
|
2208
2236
|
} catch {
|
|
2209
2237
|
}
|
|
2210
|
-
|
|
2238
|
+
m({ kind: "awaiting_payment", priceId: y, url: g });
|
|
2211
2239
|
}
|
|
2212
2240
|
};
|
|
2213
|
-
|
|
2214
|
-
if (
|
|
2241
|
+
j(() => {
|
|
2242
|
+
if (b.kind !== "auth_gate" || !w || w.user.is_anonymous || I.current) return;
|
|
2215
2243
|
I.current = !0;
|
|
2216
|
-
const
|
|
2217
|
-
|
|
2218
|
-
if (!
|
|
2244
|
+
const y = b.pendingCheckout, g = b.origin;
|
|
2245
|
+
m({ kind: "verifying" }), (async () => {
|
|
2246
|
+
if (!p)
|
|
2219
2247
|
try {
|
|
2220
|
-
if ((await
|
|
2248
|
+
if ((await t.getUser({ force: !0 })).has_active_subscription) {
|
|
2221
2249
|
i("purchase_completed", {
|
|
2222
|
-
priceId:
|
|
2250
|
+
priceId: y?.priceId ?? null,
|
|
2223
2251
|
sessionId: null,
|
|
2224
2252
|
restored: !0
|
|
2225
|
-
}),
|
|
2253
|
+
}), y?.direct ? r() : m({ kind: "purchase_success", restored: !0 });
|
|
2226
2254
|
return;
|
|
2227
2255
|
}
|
|
2228
2256
|
} catch {
|
|
2229
2257
|
}
|
|
2230
|
-
if (!
|
|
2231
|
-
|
|
2258
|
+
if (!y) {
|
|
2259
|
+
g === "standalone" ? r() : m({ kind: "layout" });
|
|
2232
2260
|
return;
|
|
2233
2261
|
}
|
|
2234
|
-
await
|
|
2262
|
+
await M(y.priceId);
|
|
2235
2263
|
})().finally(() => {
|
|
2236
2264
|
I.current = !1;
|
|
2237
2265
|
});
|
|
2238
|
-
}, [
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
if (w === "preauth" && !!e.auth && !L) {
|
|
2242
|
-
v({ kind: "auth_gate", pendingCheckout: { priceId: b, direct: !0 } });
|
|
2243
|
-
return;
|
|
2244
|
-
}
|
|
2245
|
-
E(b);
|
|
2246
|
-
}, [p, g]);
|
|
2247
|
-
const z = async (b, w) => {
|
|
2248
|
-
if (b === "close") {
|
|
2266
|
+
}, [w, b]);
|
|
2267
|
+
const O = async (y, g) => {
|
|
2268
|
+
if (y === "close") {
|
|
2249
2269
|
r();
|
|
2250
2270
|
return;
|
|
2251
2271
|
}
|
|
2252
|
-
if (
|
|
2253
|
-
i("price_selected",
|
|
2272
|
+
if (y === "price_selected") {
|
|
2273
|
+
i("price_selected", g);
|
|
2254
2274
|
return;
|
|
2255
2275
|
}
|
|
2256
|
-
if (
|
|
2257
|
-
if (!
|
|
2258
|
-
const
|
|
2259
|
-
if (
|
|
2260
|
-
|
|
2276
|
+
if (y === "restore") {
|
|
2277
|
+
if (!t.auth) return;
|
|
2278
|
+
const x = t.auth.getCachedSession();
|
|
2279
|
+
if (x && !x.user.is_anonymous) return;
|
|
2280
|
+
m({ kind: "auth_gate", intent: "restore" });
|
|
2261
2281
|
return;
|
|
2262
2282
|
}
|
|
2263
|
-
if (
|
|
2264
|
-
|
|
2283
|
+
if (y === "support") {
|
|
2284
|
+
m({ kind: "support", origin: "layout" });
|
|
2265
2285
|
return;
|
|
2266
2286
|
}
|
|
2267
|
-
if (
|
|
2268
|
-
const
|
|
2269
|
-
if (!
|
|
2270
|
-
i("error", new
|
|
2287
|
+
if (y === "checkout" && h.status === "ready") {
|
|
2288
|
+
const x = g?.priceId;
|
|
2289
|
+
if (!x) {
|
|
2290
|
+
i("error", new L("no_price", "No price selected"));
|
|
2271
2291
|
return;
|
|
2272
2292
|
}
|
|
2273
|
-
const
|
|
2274
|
-
if (
|
|
2275
|
-
|
|
2293
|
+
const E = h.data.settings.checkout_mode ?? "guest", $ = t.auth?.getCachedSession() ?? null, De = !!$ && !$.user.is_anonymous;
|
|
2294
|
+
if (E === "preauth" && !!t.auth && !De) {
|
|
2295
|
+
m({ kind: "auth_gate", pendingCheckout: { priceId: x } });
|
|
2276
2296
|
return;
|
|
2277
2297
|
}
|
|
2278
|
-
await
|
|
2298
|
+
await M(x);
|
|
2279
2299
|
}
|
|
2280
|
-
},
|
|
2300
|
+
}, R = h.status === "ready" ? h.data.settings.brand_color : null, P = h.status === "ready" ? h.data.settings.allow_close !== !1 : !0, U = b.kind === "layout" && h.status === "ready" ? ze(h.data.offers) : null, D = U ? /* @__PURE__ */ a(St, { offer: U }) : null, Z = {
|
|
2281
2301
|
type: "auth_panel",
|
|
2282
2302
|
// Заголовок не задаём — AuthGate сам решит по intent'у (restore →
|
|
2283
2303
|
// "Restore Purchases", остальные → дефолтный "Welcome back!").
|
|
@@ -2286,92 +2306,92 @@ function ir({
|
|
|
2286
2306
|
// Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
|
|
2287
2307
|
// чем хотим показывать "Signed in as ..." промежуточным экраном.
|
|
2288
2308
|
hide_when_authenticated: !1,
|
|
2289
|
-
providers:
|
|
2290
|
-
}, V =
|
|
2291
|
-
|
|
2309
|
+
providers: h.status === "ready" ? h.data.settings.auth_providers : void 0
|
|
2310
|
+
}, V = b.kind === "support" ? /* @__PURE__ */ a(
|
|
2311
|
+
At,
|
|
2292
2312
|
{
|
|
2293
|
-
client:
|
|
2294
|
-
authSession:
|
|
2295
|
-
origin:
|
|
2313
|
+
client: t,
|
|
2314
|
+
authSession: w,
|
|
2315
|
+
origin: b.origin,
|
|
2296
2316
|
onBack: () => {
|
|
2297
|
-
|
|
2317
|
+
b.origin === "standalone" ? r() : m({ kind: "layout" });
|
|
2298
2318
|
}
|
|
2299
2319
|
}
|
|
2300
|
-
) : null,
|
|
2301
|
-
return /* @__PURE__ */ a(
|
|
2302
|
-
|
|
2320
|
+
) : null, K = b.kind === "auth_gate" && b.origin !== "standalone" || b.kind === "support", Y = h.status === "ready" ? h.data : null;
|
|
2321
|
+
return /* @__PURE__ */ a(nt, { bootstrap: Y, forceLocale: _, children: /* @__PURE__ */ a(
|
|
2322
|
+
at,
|
|
2303
2323
|
{
|
|
2304
|
-
open:
|
|
2324
|
+
open: e,
|
|
2305
2325
|
onClose: r,
|
|
2306
|
-
brandColor:
|
|
2326
|
+
brandColor: R,
|
|
2307
2327
|
topBanner: D,
|
|
2308
|
-
allowClose:
|
|
2309
|
-
hideCloseButton:
|
|
2310
|
-
inline:
|
|
2328
|
+
allowClose: P,
|
|
2329
|
+
hideCloseButton: K,
|
|
2330
|
+
inline: f,
|
|
2311
2331
|
labelledBy: "pw-title",
|
|
2312
|
-
children:
|
|
2313
|
-
|
|
2332
|
+
children: l ? /* @__PURE__ */ a(Se, { onContinue: r }) : b.kind === "purchase_success" ? /* @__PURE__ */ a(Se, { restored: b.restored, onContinue: r }) : V || (h.status === "loading" || h.status === "idle" || b.kind === "verifying" ? /* @__PURE__ */ a(ar, { verifying: b.kind === "verifying" }) : h.status === "error" ? /* @__PURE__ */ a(or, { message: h.error.message }) : b.kind === "auth_gate" && t.auth ? /* @__PURE__ */ a(
|
|
2333
|
+
xt,
|
|
2314
2334
|
{
|
|
2315
|
-
block:
|
|
2316
|
-
bootstrap:
|
|
2317
|
-
auth:
|
|
2318
|
-
authSession:
|
|
2319
|
-
showBack:
|
|
2320
|
-
intent:
|
|
2321
|
-
initialMode:
|
|
2335
|
+
block: Z,
|
|
2336
|
+
bootstrap: h.data,
|
|
2337
|
+
auth: t.auth,
|
|
2338
|
+
authSession: w,
|
|
2339
|
+
showBack: b.origin !== "standalone",
|
|
2340
|
+
intent: b.intent ?? (b.origin === "standalone" ? "standalone" : "preauth"),
|
|
2341
|
+
initialMode: b.origin === "standalone" ? s : void 0,
|
|
2322
2342
|
onBack: () => {
|
|
2323
|
-
|
|
2343
|
+
b.origin === "standalone" ? r() : m({ kind: "layout" });
|
|
2324
2344
|
}
|
|
2325
2345
|
}
|
|
2326
|
-
) :
|
|
2327
|
-
|
|
2346
|
+
) : b.kind === "awaiting_payment" ? /* @__PURE__ */ a(
|
|
2347
|
+
lr,
|
|
2328
2348
|
{
|
|
2329
|
-
client:
|
|
2330
|
-
onBack: () =>
|
|
2349
|
+
client: t,
|
|
2350
|
+
onBack: () => m({ kind: "layout" }),
|
|
2331
2351
|
onReopen: () => {
|
|
2332
2352
|
if (typeof window > "u") return;
|
|
2333
|
-
const
|
|
2334
|
-
if (
|
|
2353
|
+
const y = window.open(b.url, "_blank");
|
|
2354
|
+
if (y)
|
|
2335
2355
|
try {
|
|
2336
|
-
|
|
2356
|
+
y.opener = null;
|
|
2337
2357
|
} catch {
|
|
2338
2358
|
}
|
|
2339
2359
|
},
|
|
2340
|
-
onRetry: () =>
|
|
2360
|
+
onRetry: () => M(b.priceId)
|
|
2341
2361
|
}
|
|
2342
|
-
) :
|
|
2362
|
+
) : b.kind === "popup_blocked" ? /* @__PURE__ */ a(sr, { onReopen: () => z(b.priceId, b.url) }) : /* @__PURE__ */ a(
|
|
2343
2363
|
tr,
|
|
2344
2364
|
{
|
|
2345
|
-
layout:
|
|
2346
|
-
bootstrap:
|
|
2347
|
-
onAction:
|
|
2348
|
-
auth:
|
|
2349
|
-
authSession:
|
|
2365
|
+
layout: h.data.layout,
|
|
2366
|
+
bootstrap: h.data,
|
|
2367
|
+
onAction: O,
|
|
2368
|
+
auth: t.auth,
|
|
2369
|
+
authSession: w
|
|
2350
2370
|
}
|
|
2351
2371
|
))
|
|
2352
2372
|
}
|
|
2353
2373
|
) });
|
|
2354
2374
|
}
|
|
2355
|
-
function
|
|
2356
|
-
const { t } =
|
|
2375
|
+
function ar({ verifying: t }) {
|
|
2376
|
+
const { t: e } = S();
|
|
2357
2377
|
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
|
|
2358
2378
|
/* @__PURE__ */ a("span", { class: "inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" }),
|
|
2359
|
-
/* @__PURE__ */ a("span", { class: "text-xs font-medium tracking-wide text-gray-500", children:
|
|
2379
|
+
/* @__PURE__ */ a("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: t ? e("modal.verifying_subscription", "Checking your subscription…") : e("modal.loading", "Loading…") })
|
|
2360
2380
|
] });
|
|
2361
2381
|
}
|
|
2362
|
-
function
|
|
2363
|
-
const { t } =
|
|
2382
|
+
function or({ message: t }) {
|
|
2383
|
+
const { t: e } = S();
|
|
2364
2384
|
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
2365
2385
|
/* @__PURE__ */ a("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ d("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2366
2386
|
/* @__PURE__ */ a("path", { d: "M10 6v5M10 14h.01", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round" }),
|
|
2367
2387
|
/* @__PURE__ */ a("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
|
|
2368
2388
|
] }) }),
|
|
2369
|
-
/* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children:
|
|
2370
|
-
/* @__PURE__ */ a("p", { class: "text-xs leading-relaxed text-gray-500", children:
|
|
2389
|
+
/* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("modal.error_generic", "Something went wrong") }),
|
|
2390
|
+
/* @__PURE__ */ a("p", { class: "text-xs leading-relaxed text-gray-500", children: t })
|
|
2371
2391
|
] });
|
|
2372
2392
|
}
|
|
2373
|
-
function
|
|
2374
|
-
const { t } =
|
|
2393
|
+
function sr({ onReopen: t }) {
|
|
2394
|
+
const { t: e } = S();
|
|
2375
2395
|
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
2376
2396
|
/* @__PURE__ */ a(
|
|
2377
2397
|
"div",
|
|
@@ -2385,48 +2405,48 @@ function or({ onReopen: e }) {
|
|
|
2385
2405
|
] })
|
|
2386
2406
|
}
|
|
2387
2407
|
),
|
|
2388
|
-
/* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children:
|
|
2389
|
-
/* @__PURE__ */ a("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children:
|
|
2408
|
+
/* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("payment.popup_blocked_title", "Allow popups to continue") }),
|
|
2409
|
+
/* @__PURE__ */ a("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: e("payment.popup_blocked_message", "Your browser blocked the checkout tab. Click below to open it.") }),
|
|
2390
2410
|
/* @__PURE__ */ a(
|
|
2391
2411
|
"button",
|
|
2392
2412
|
{
|
|
2393
2413
|
type: "button",
|
|
2394
|
-
onClick:
|
|
2414
|
+
onClick: t,
|
|
2395
2415
|
class: "mt-1 rounded-xl px-4 py-2 text-xs font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
2396
2416
|
style: {
|
|
2397
2417
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
2398
2418
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
2399
2419
|
},
|
|
2400
|
-
children:
|
|
2420
|
+
children: e("payment.open_checkout_button", "Open checkout")
|
|
2401
2421
|
}
|
|
2402
2422
|
)
|
|
2403
2423
|
] });
|
|
2404
2424
|
}
|
|
2405
|
-
function
|
|
2406
|
-
client:
|
|
2407
|
-
onBack:
|
|
2425
|
+
function lr({
|
|
2426
|
+
client: t,
|
|
2427
|
+
onBack: e,
|
|
2408
2428
|
onReopen: r,
|
|
2409
2429
|
onRetry: i
|
|
2410
2430
|
}) {
|
|
2411
|
-
const { t: n } =
|
|
2412
|
-
|
|
2413
|
-
|
|
2431
|
+
const { t: n } = S(), [s, o] = v(!1), [c, l] = v(!1), p = F(null);
|
|
2432
|
+
j(() => () => {
|
|
2433
|
+
p.current !== null && clearTimeout(p.current);
|
|
2414
2434
|
}, []);
|
|
2415
2435
|
const u = async () => {
|
|
2416
|
-
if (!
|
|
2417
|
-
|
|
2436
|
+
if (!s) {
|
|
2437
|
+
o(!0), l(!1);
|
|
2418
2438
|
try {
|
|
2419
|
-
if ((await
|
|
2439
|
+
if ((await t.getUser({ force: !0 })).has_active_subscription) {
|
|
2420
2440
|
typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
|
|
2421
2441
|
return;
|
|
2422
2442
|
}
|
|
2423
|
-
l(!0),
|
|
2424
|
-
l(!1),
|
|
2443
|
+
l(!0), p.current !== null && clearTimeout(p.current), p.current = setTimeout(() => {
|
|
2444
|
+
l(!1), p.current = null;
|
|
2425
2445
|
}, 5e3);
|
|
2426
2446
|
} catch {
|
|
2427
2447
|
l(!0);
|
|
2428
2448
|
} finally {
|
|
2429
|
-
|
|
2449
|
+
o(!1);
|
|
2430
2450
|
}
|
|
2431
2451
|
}
|
|
2432
2452
|
};
|
|
@@ -2435,7 +2455,7 @@ function sr({
|
|
|
2435
2455
|
"button",
|
|
2436
2456
|
{
|
|
2437
2457
|
type: "button",
|
|
2438
|
-
onClick:
|
|
2458
|
+
onClick: e,
|
|
2439
2459
|
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)]",
|
|
2440
2460
|
children: n("nav.back", "← Back")
|
|
2441
2461
|
}
|
|
@@ -2462,13 +2482,13 @@ function sr({
|
|
|
2462
2482
|
{
|
|
2463
2483
|
type: "button",
|
|
2464
2484
|
onClick: u,
|
|
2465
|
-
disabled:
|
|
2485
|
+
disabled: s,
|
|
2466
2486
|
class: "mt-1 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:brightness-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
2467
2487
|
style: {
|
|
2468
2488
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
2469
2489
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
2470
2490
|
},
|
|
2471
|
-
children:
|
|
2491
|
+
children: s ? n("payment.checking", "Checking…") : n("payment.ive_paid", "I've paid")
|
|
2472
2492
|
}
|
|
2473
2493
|
),
|
|
2474
2494
|
c ? /* @__PURE__ */ a("p", { class: "text-xs leading-relaxed text-gray-500", children: n("payment.still_processing", "Payment is still being processed. Please try again in a moment.") }) : null
|
|
@@ -2496,11 +2516,11 @@ function sr({
|
|
|
2496
2516
|
)
|
|
2497
2517
|
] });
|
|
2498
2518
|
}
|
|
2499
|
-
function
|
|
2500
|
-
onContinue:
|
|
2501
|
-
restored:
|
|
2519
|
+
function Se({
|
|
2520
|
+
onContinue: t,
|
|
2521
|
+
restored: e = !1
|
|
2502
2522
|
}) {
|
|
2503
|
-
const { t: r } =
|
|
2523
|
+
const { t: r } = S();
|
|
2504
2524
|
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
2505
2525
|
/* @__PURE__ */ a(
|
|
2506
2526
|
"div",
|
|
@@ -2525,8 +2545,8 @@ function _t({
|
|
|
2525
2545
|
) })
|
|
2526
2546
|
}
|
|
2527
2547
|
),
|
|
2528
|
-
/* @__PURE__ */ a("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children:
|
|
2529
|
-
/* @__PURE__ */ a("p", { class: "text-sm leading-relaxed text-gray-500", children:
|
|
2548
|
+
/* @__PURE__ */ a("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? r("modal.purchase_restored_title", "Subscription restored") : r("modal.purchase_success_title", "Payment received") }),
|
|
2549
|
+
/* @__PURE__ */ a("p", { class: "text-sm leading-relaxed text-gray-500", children: e ? r(
|
|
2530
2550
|
"modal.purchase_restored_subtitle",
|
|
2531
2551
|
"Welcome back — your subscription is already active."
|
|
2532
2552
|
) : r("modal.purchase_success_subtitle", "Your subscription is now active.") }),
|
|
@@ -2534,7 +2554,7 @@ function _t({
|
|
|
2534
2554
|
"button",
|
|
2535
2555
|
{
|
|
2536
2556
|
type: "button",
|
|
2537
|
-
onClick:
|
|
2557
|
+
onClick: t,
|
|
2538
2558
|
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)]",
|
|
2539
2559
|
style: {
|
|
2540
2560
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
@@ -2545,21 +2565,21 @@ function _t({
|
|
|
2545
2565
|
)
|
|
2546
2566
|
] });
|
|
2547
2567
|
}
|
|
2548
|
-
const
|
|
2549
|
-
class
|
|
2550
|
-
constructor(
|
|
2568
|
+
const cr = 10 * 6e4, dr = 5e3, ur = 3e4;
|
|
2569
|
+
class pr {
|
|
2570
|
+
constructor(e) {
|
|
2551
2571
|
this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
|
|
2552
|
-
client:
|
|
2553
|
-
onActive:
|
|
2554
|
-
onTimeout:
|
|
2572
|
+
client: e.client,
|
|
2573
|
+
onActive: e.onActive,
|
|
2574
|
+
onTimeout: e.onTimeout ?? (() => {
|
|
2555
2575
|
}),
|
|
2556
|
-
timeoutMs:
|
|
2557
|
-
visibleIntervalMs:
|
|
2558
|
-
hiddenIntervalMs:
|
|
2576
|
+
timeoutMs: e.timeoutMs ?? cr,
|
|
2577
|
+
visibleIntervalMs: e.visibleIntervalMs ?? dr,
|
|
2578
|
+
hiddenIntervalMs: e.hiddenIntervalMs ?? ur
|
|
2559
2579
|
};
|
|
2560
2580
|
}
|
|
2561
2581
|
start() {
|
|
2562
|
-
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 = (
|
|
2582
|
+
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(() => {
|
|
2563
2583
|
this.stopped || (this.stop(), this.opts.onTimeout());
|
|
2564
2584
|
}, this.opts.timeoutMs));
|
|
2565
2585
|
}
|
|
@@ -2570,9 +2590,9 @@ class ur {
|
|
|
2570
2590
|
if (!(this.stopped || this.checking)) {
|
|
2571
2591
|
this.checking = !0;
|
|
2572
2592
|
try {
|
|
2573
|
-
const
|
|
2593
|
+
const e = await this.opts.client.getUser({ force: !0 });
|
|
2574
2594
|
if (this.stopped) return;
|
|
2575
|
-
|
|
2595
|
+
e.has_active_subscription && (this.stop(), this.opts.onActive(e));
|
|
2576
2596
|
} catch {
|
|
2577
2597
|
} finally {
|
|
2578
2598
|
this.checking = !1;
|
|
@@ -2589,35 +2609,40 @@ class ur {
|
|
|
2589
2609
|
handleVisibilityChange() {
|
|
2590
2610
|
typeof document > "u" || (document.visibilityState === "visible" && this.check(), this.timer !== null && (clearTimeout(this.timer), this.timer = null), this.scheduleNext());
|
|
2591
2611
|
}
|
|
2592
|
-
handleMessage(
|
|
2593
|
-
const r =
|
|
2612
|
+
handleMessage(e) {
|
|
2613
|
+
const r = e.data;
|
|
2594
2614
|
!r || typeof r != "object" || r.type === "paywall_purchase" && this.check();
|
|
2595
2615
|
}
|
|
2596
2616
|
}
|
|
2597
|
-
function
|
|
2617
|
+
function hr() {
|
|
2598
2618
|
return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
|
|
2599
2619
|
}
|
|
2600
|
-
const
|
|
2620
|
+
const oe = {
|
|
2621
|
+
open: !1,
|
|
2622
|
+
view: null,
|
|
2623
|
+
error: null,
|
|
2624
|
+
processing: !1
|
|
2625
|
+
}, H = {
|
|
2601
2626
|
status: "paywall_status",
|
|
2602
2627
|
priceId: "paywall_price_id",
|
|
2603
2628
|
sessionId: "paywall_session_id"
|
|
2604
2629
|
};
|
|
2605
|
-
class
|
|
2606
|
-
constructor(
|
|
2607
|
-
this.handle = null, this.isOpen = !1, this.listeners = /* @__PURE__ */ new Map(), this.userUnsub = null, this.authUnsub = null, this.watcher = null, this.tracker = null, this.purchased = !1, this.trialStore = null, this.trialStoreConfig = null, this.lastTrialStatus = null, this.trialExpiredFired = !1, this.lastVisibility = null, this.currentState =
|
|
2608
|
-
const { auth: r, ownsAuth: i } =
|
|
2609
|
-
this.auth = r, this.ownsAuth = i, this.billing =
|
|
2630
|
+
class Cr {
|
|
2631
|
+
constructor(e) {
|
|
2632
|
+
this.handle = null, this.isOpen = !1, this.listeners = /* @__PURE__ */ new Map(), this.userUnsub = null, this.authUnsub = null, this.watcher = null, this.tracker = null, this.purchased = !1, this.trialStore = null, this.trialStoreConfig = null, this.lastTrialStatus = null, this.trialExpiredFired = !1, this.lastVisibility = null, this.currentState = oe, this.stateListeners = /* @__PURE__ */ new Set();
|
|
2633
|
+
const { auth: r, ownsAuth: i } = gr(e);
|
|
2634
|
+
this.auth = r, this.ownsAuth = i, this.billing = e.client ?? new Ne({ ...e, auth: this.auth }), this.host = e.host, this.shadowMode = e.shadowMode ?? "closed", this.mountThenLoad = e.mountThenLoad ?? !0, this.inline = e.inline === !0, this.forceLocale = e.locale ?? null, this.userUnsub = this.billing.onUserChange((n) => {
|
|
2610
2635
|
this.emit("userChange", n);
|
|
2611
|
-
}), this.auth && (this.authUnsub = this.auth.onAuthChange((n,
|
|
2612
|
-
this.emit("authChange", { event: n, session:
|
|
2613
|
-
})), this.initTracker(
|
|
2636
|
+
}), this.auth && (this.authUnsub = this.auth.onAuthChange((n, s) => {
|
|
2637
|
+
this.emit("authChange", { event: n, session: s });
|
|
2638
|
+
})), this.initTracker(e.analytics), e.autoDetectReturn !== !1 && typeof window < "u" && queueMicrotask(() => this.checkReturn());
|
|
2614
2639
|
}
|
|
2615
|
-
initTracker(
|
|
2616
|
-
if (
|
|
2617
|
-
const r = typeof
|
|
2640
|
+
initTracker(e) {
|
|
2641
|
+
if (e === !1) return;
|
|
2642
|
+
const r = typeof e == "object" && e !== null ? e : {};
|
|
2618
2643
|
if (r.enabled === !1) return;
|
|
2619
2644
|
const i = r.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
|
|
2620
|
-
this.tracker = new
|
|
2645
|
+
this.tracker = new He({
|
|
2621
2646
|
endpoint: i,
|
|
2622
2647
|
paywallId: this.billing.paywallId,
|
|
2623
2648
|
capabilities: this.billing.capabilities,
|
|
@@ -2680,16 +2705,16 @@ class Sr {
|
|
|
2680
2705
|
* Самый частый кейс — `track('app_opened')` от хоста сразу после загрузки
|
|
2681
2706
|
* приложения, чтобы зафиксировать воронку до открытия пейвола.
|
|
2682
2707
|
*/
|
|
2683
|
-
track(
|
|
2684
|
-
this.tracker?.track(
|
|
2708
|
+
track(e, r) {
|
|
2709
|
+
this.tracker?.track(e, r);
|
|
2685
2710
|
}
|
|
2686
2711
|
/**
|
|
2687
2712
|
* Удобный шорткат вместо `paywall.on('userChange', cb)` — самый частый
|
|
2688
2713
|
* паттерн в host-коде, поэтому отдельный named метод. Колбек получает
|
|
2689
2714
|
* last-known user из кеша синхронно через microtask, если он есть.
|
|
2690
2715
|
*/
|
|
2691
|
-
onUserChange(
|
|
2692
|
-
return this.on("userChange",
|
|
2716
|
+
onUserChange(e) {
|
|
2717
|
+
return this.on("userChange", e);
|
|
2693
2718
|
}
|
|
2694
2719
|
/**
|
|
2695
2720
|
* Заменить cachedBootstrap живыми данными — для preview-режима в редакторе
|
|
@@ -2701,8 +2726,8 @@ class Sr {
|
|
|
2701
2726
|
* работает и в production-режиме, но конкуренция с revalidate'ом из сети
|
|
2702
2727
|
* почти всегда нежелательна.
|
|
2703
2728
|
*/
|
|
2704
|
-
setBootstrap(
|
|
2705
|
-
this.billing.setBootstrap(
|
|
2729
|
+
setBootstrap(e) {
|
|
2730
|
+
this.billing.setBootstrap(e);
|
|
2706
2731
|
}
|
|
2707
2732
|
/**
|
|
2708
2733
|
* Сменить force-locale на лету — для live-preview редактора админки, когда
|
|
@@ -2712,30 +2737,30 @@ class Sr {
|
|
|
2712
2737
|
* Передай `null`/`undefined`, чтобы вернуть автоматическую резолв-логику
|
|
2713
2738
|
* (navigator.language → locale_default).
|
|
2714
2739
|
*/
|
|
2715
|
-
setLocale(
|
|
2716
|
-
const r =
|
|
2740
|
+
setLocale(e) {
|
|
2741
|
+
const r = e ?? null;
|
|
2717
2742
|
r !== this.forceLocale && (this.forceLocale = r, this.handle && this.handle.update({ locale: r }));
|
|
2718
2743
|
}
|
|
2719
|
-
on(
|
|
2720
|
-
let i = this.listeners.get(
|
|
2721
|
-
return i || (i = /* @__PURE__ */ new Set(), this.listeners.set(
|
|
2744
|
+
on(e, r) {
|
|
2745
|
+
let i = this.listeners.get(e);
|
|
2746
|
+
return i || (i = /* @__PURE__ */ new Set(), this.listeners.set(e, i)), i.add(r), () => i.delete(r);
|
|
2722
2747
|
}
|
|
2723
|
-
off(
|
|
2724
|
-
this.listeners.get(
|
|
2748
|
+
off(e, r) {
|
|
2749
|
+
this.listeners.get(e)?.delete(r);
|
|
2725
2750
|
}
|
|
2726
|
-
emit(
|
|
2727
|
-
const i = this.listeners.get(
|
|
2751
|
+
emit(e, ...r) {
|
|
2752
|
+
const i = this.listeners.get(e);
|
|
2728
2753
|
if (!i) return;
|
|
2729
2754
|
const n = r[0];
|
|
2730
|
-
for (const
|
|
2755
|
+
for (const s of i)
|
|
2731
2756
|
try {
|
|
2732
|
-
|
|
2733
|
-
} catch (
|
|
2734
|
-
typeof console < "u" && console.error("[paywall] listener error",
|
|
2757
|
+
s(n);
|
|
2758
|
+
} catch (o) {
|
|
2759
|
+
typeof console < "u" && console.error("[paywall] listener error", o);
|
|
2735
2760
|
}
|
|
2736
2761
|
}
|
|
2737
|
-
open(
|
|
2738
|
-
this.openInternal("layout",
|
|
2762
|
+
open(e = {}) {
|
|
2763
|
+
this.openInternal("layout", e);
|
|
2739
2764
|
}
|
|
2740
2765
|
/**
|
|
2741
2766
|
* Прогревает bootstrap-кеш и balance-кеш заранее, без открытия модалки.
|
|
@@ -2749,9 +2774,9 @@ class Sr {
|
|
|
2749
2774
|
* Вызывать можно сколько угодно раз — последующие вызовы возвращают cached
|
|
2750
2775
|
* Promise (BillingClient уже дедуплицирует).
|
|
2751
2776
|
*/
|
|
2752
|
-
async preload(
|
|
2777
|
+
async preload(e = {}) {
|
|
2753
2778
|
try {
|
|
2754
|
-
await this.billing.bootstrap({ signal:
|
|
2779
|
+
await this.billing.bootstrap({ signal: e.signal }), this.billing.auth && await this.billing.getBalances({ signal: e.signal });
|
|
2755
2780
|
} catch {
|
|
2756
2781
|
}
|
|
2757
2782
|
}
|
|
@@ -2765,8 +2790,8 @@ class Sr {
|
|
|
2765
2790
|
* Contact Support-ссылку в `current_session`-блоке (там Back возвращает
|
|
2766
2791
|
* к layout).
|
|
2767
2792
|
*/
|
|
2768
|
-
openSupport(
|
|
2769
|
-
this.openInternal("support",
|
|
2793
|
+
openSupport(e = {}) {
|
|
2794
|
+
this.openInternal("support", e);
|
|
2770
2795
|
}
|
|
2771
2796
|
/**
|
|
2772
2797
|
* Открывает модалку сразу с auth-gate (логин/регистрация), без layout с
|
|
@@ -2780,8 +2805,8 @@ class Sr {
|
|
|
2780
2805
|
*
|
|
2781
2806
|
* Триал не блокирует этот флоу — auth не connect'ится с trial-механикой.
|
|
2782
2807
|
*/
|
|
2783
|
-
openAuth(
|
|
2784
|
-
this.auth && this.openInternal("auth", { ...
|
|
2808
|
+
openAuth(e = {}) {
|
|
2809
|
+
this.auth && this.openInternal("auth", { ...e, skipTrial: !0 });
|
|
2785
2810
|
}
|
|
2786
2811
|
/**
|
|
2787
2812
|
* Шорткат над `openAuth()` — открывает модалку сразу на signin-форме.
|
|
@@ -2791,8 +2816,8 @@ class Sr {
|
|
|
2791
2816
|
* - `paywall.openSignup()` — «новая регистрация»
|
|
2792
2817
|
* Без managed-auth — no-op.
|
|
2793
2818
|
*/
|
|
2794
|
-
openSignin(
|
|
2795
|
-
this.auth && this.openInternal("auth", { ...
|
|
2819
|
+
openSignin(e = {}) {
|
|
2820
|
+
this.auth && this.openInternal("auth", { ...e, skipTrial: !0, authMode: "signin" });
|
|
2796
2821
|
}
|
|
2797
2822
|
/**
|
|
2798
2823
|
* Открывает модалку с auth-gate сразу в режиме регистрации (signup-mode
|
|
@@ -2801,30 +2826,43 @@ class Sr {
|
|
|
2801
2826
|
* соблюдается admin-конфиг.
|
|
2802
2827
|
* Без managed-auth — no-op.
|
|
2803
2828
|
*/
|
|
2804
|
-
openSignup(
|
|
2805
|
-
this.auth && this.openInternal("auth", { ...
|
|
2829
|
+
openSignup(e = {}) {
|
|
2830
|
+
this.auth && this.openInternal("auth", { ...e, skipTrial: !0, authMode: "signup" });
|
|
2806
2831
|
}
|
|
2807
2832
|
/**
|
|
2808
|
-
* Direct-checkout:
|
|
2809
|
-
*
|
|
2810
|
-
* рендерит pricing-карточки/таблицу собственным UI и
|
|
2811
|
-
* «Buy / Get this plan» вёл прямо в
|
|
2812
|
-
* выбора плана в модалке SDK.
|
|
2833
|
+
* Direct-checkout: создать checkout-URL по конкретной цене и сразу открыть
|
|
2834
|
+
* платёжного провайдера, минуя layout с тарифами. Полезно когда
|
|
2835
|
+
* host-приложение рендерит pricing-карточки/таблицу собственным UI и
|
|
2836
|
+
* хочет, чтобы клик по «Buy / Get this plan» вёл прямо в Stripe/Paddle.
|
|
2813
2837
|
*
|
|
2814
|
-
*
|
|
2815
|
-
*
|
|
2816
|
-
*
|
|
2817
|
-
*
|
|
2818
|
-
*
|
|
2819
|
-
*
|
|
2838
|
+
* **Late-mount UX.** В отличие от `open()`, модалка не появляется во время
|
|
2839
|
+
* фоновой работы (bootstrap + visibility/trial gates + createCheckout).
|
|
2840
|
+
* Хост на этой фазе показывает busy-state прямо на своей кнопке (через
|
|
2841
|
+
* `state.processing === true` из `paywall.getState()` — или автоматически
|
|
2842
|
+
* через `<PaywallButton priceId>` в sdk-react). Модалка монтируется
|
|
2843
|
+
* ТОЛЬКО когда реально нужна UI:
|
|
2844
|
+
* - `checkout_mode='preauth'` + managed-auth + не залогинен → auth-gate
|
|
2845
|
+
* (форма signin'а); после успеха auto-resume в createCheckout.
|
|
2846
|
+
* - popup провайдера заблокирован браузером → popup_blocked view с
|
|
2847
|
+
* retry-кнопкой под fresh user gesture.
|
|
2848
|
+
* - popup открылся успешно → awaiting_payment view (индикатор «оплати
|
|
2849
|
+
* в новой вкладке» + I've paid).
|
|
2820
2850
|
*
|
|
2821
|
-
* Что
|
|
2822
|
-
* -
|
|
2823
|
-
*
|
|
2824
|
-
*
|
|
2825
|
-
*
|
|
2826
|
-
*
|
|
2827
|
-
*
|
|
2851
|
+
* Что эмитится без модалки:
|
|
2852
|
+
* - `purchase_completed{restored:true, priceId}` когда юзер уже подписан
|
|
2853
|
+
* (cached user, fresh bootstrap, или 409 hasActivePurchase от бэка) —
|
|
2854
|
+
* headless reject;
|
|
2855
|
+
* - `error` когда createCheckout упал или identity.email отсутствует;
|
|
2856
|
+
* - `visibility_blocked` / `trial_blocked` — стандартные gate-эвенты.
|
|
2857
|
+
*
|
|
2858
|
+
* Что эмитится одновременно с модалкой:
|
|
2859
|
+
* - `checkout_started{priceId, url, acquiring}` ровно когда headless URL
|
|
2860
|
+
* получен, ДО mount'а awaiting_payment/popup_blocked.
|
|
2861
|
+
*
|
|
2862
|
+
* Offer (countdown-скидка) автоматически резолвится из cached offers'ов
|
|
2863
|
+
* через `getOfferForPrice(priceId)` и передаётся в createCheckout как
|
|
2864
|
+
* `offerId` — чтобы duration_minutes-офферы тоже применились на бэке
|
|
2865
|
+
* (для них нет server-side таймера, без явного offer-id скидка теряется).
|
|
2828
2866
|
*
|
|
2829
2867
|
* Требования:
|
|
2830
2868
|
* - `identity.email` должен быть выставлен (через `opts.identity`, либо
|
|
@@ -2833,21 +2871,145 @@ class Sr {
|
|
|
2833
2871
|
* - В `checkout_mode='preauth'` без managed-auth — backend требует
|
|
2834
2872
|
* email-юзера; убедись что `identity.email` явно задан.
|
|
2835
2873
|
*
|
|
2836
|
-
* Без
|
|
2837
|
-
*
|
|
2838
|
-
*
|
|
2839
|
-
*
|
|
2874
|
+
* Без модалки совсем (когда host рендерит свой awaiting-payment экран) —
|
|
2875
|
+
* используй `paywall.billing.createCheckout({priceId, offerId})` напрямую,
|
|
2876
|
+
* но тогда auth-gate / popup_blocked / awaiting_payment придётся рисовать
|
|
2877
|
+
* самостоятельно.
|
|
2840
2878
|
*/
|
|
2841
|
-
checkout(
|
|
2842
|
-
if (r.renew !== !0 && this.billing.getCachedUser()?.has_active_subscription) {
|
|
2879
|
+
checkout(e, r = {}) {
|
|
2880
|
+
if (r.identity && this.billing.setIdentity(r.identity), r.renew !== !0 && this.billing.getCachedUser()?.has_active_subscription) {
|
|
2843
2881
|
this.emit("purchase_completed", {
|
|
2844
|
-
priceId:
|
|
2882
|
+
priceId: e,
|
|
2845
2883
|
sessionId: null,
|
|
2846
2884
|
restored: !0
|
|
2847
2885
|
});
|
|
2848
2886
|
return;
|
|
2849
2887
|
}
|
|
2850
|
-
this.
|
|
2888
|
+
this.runDirectCheckout(e, r);
|
|
2889
|
+
}
|
|
2890
|
+
/** Headless prep-work для `checkout(priceId, opts)`: bootstrap → gates →
|
|
2891
|
+
* preauth check → createCheckout → mount модалки с финальным view.
|
|
2892
|
+
* Вынесено отдельным методом ради чистого async/await flow вместо вложенных
|
|
2893
|
+
* then-chain'ов (5+ ветвей). Любая ошибка не пробрасывается наружу: эмитим
|
|
2894
|
+
* через `paywall.emit('error')` и выходим — host подписан на `error`-event. */
|
|
2895
|
+
async runDirectCheckout(e, r) {
|
|
2896
|
+
const i = r.renew === !0, n = r.skipTrial === !0, s = r.skipVisibility === !0;
|
|
2897
|
+
this.applyProcessing(!0);
|
|
2898
|
+
const o = () => {
|
|
2899
|
+
this.applyProcessing(!1);
|
|
2900
|
+
};
|
|
2901
|
+
let c;
|
|
2902
|
+
try {
|
|
2903
|
+
c = await this.billing.bootstrap();
|
|
2904
|
+
} catch (w) {
|
|
2905
|
+
const A = w instanceof L ? w : new L("unknown", "Failed to load paywall", { cause: w });
|
|
2906
|
+
this.emit("error", A), o();
|
|
2907
|
+
return;
|
|
2908
|
+
}
|
|
2909
|
+
if (!s) {
|
|
2910
|
+
const w = c.settings.visibility;
|
|
2911
|
+
if (w && (this.lastVisibility = w, !w.visible)) {
|
|
2912
|
+
this.emit("visibility_blocked", w), o();
|
|
2913
|
+
return;
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
if (!n && await this.checkTrialBeforeCheckout(c)) {
|
|
2917
|
+
o();
|
|
2918
|
+
return;
|
|
2919
|
+
}
|
|
2920
|
+
if (!i && c.user?.has_active_subscription) {
|
|
2921
|
+
this.emit("purchase_completed", {
|
|
2922
|
+
priceId: e,
|
|
2923
|
+
sessionId: null,
|
|
2924
|
+
restored: !0
|
|
2925
|
+
}), o();
|
|
2926
|
+
return;
|
|
2927
|
+
}
|
|
2928
|
+
const l = c.settings.checkout_mode ?? "guest", p = this.auth?.getCachedSession() ?? null, u = !!p && !p.user.is_anonymous;
|
|
2929
|
+
if (l === "preauth" && !!this.auth && !u) {
|
|
2930
|
+
this.purchased = !1, this.mountAndShow("auth", {
|
|
2931
|
+
renew: i,
|
|
2932
|
+
authMode: "signin",
|
|
2933
|
+
checkoutPriceId: e
|
|
2934
|
+
});
|
|
2935
|
+
return;
|
|
2936
|
+
}
|
|
2937
|
+
const _ = this.getOfferForPrice(e);
|
|
2938
|
+
let h;
|
|
2939
|
+
try {
|
|
2940
|
+
h = await this.billing.createCheckout({
|
|
2941
|
+
priceId: e,
|
|
2942
|
+
offerId: _?.offer.id,
|
|
2943
|
+
ignoreActivePurchase: i
|
|
2944
|
+
});
|
|
2945
|
+
} catch (w) {
|
|
2946
|
+
if (w instanceof L && w.code === "already_purchased") {
|
|
2947
|
+
try {
|
|
2948
|
+
await this.billing.getUser({ force: !0 });
|
|
2949
|
+
} catch {
|
|
2950
|
+
}
|
|
2951
|
+
this.emit("purchase_completed", {
|
|
2952
|
+
priceId: e,
|
|
2953
|
+
sessionId: null,
|
|
2954
|
+
restored: !0
|
|
2955
|
+
}), o();
|
|
2956
|
+
return;
|
|
2957
|
+
}
|
|
2958
|
+
const A = w instanceof L ? w : new L("checkout_failed", "Checkout failed", { cause: w });
|
|
2959
|
+
this.emit("error", A), o();
|
|
2960
|
+
return;
|
|
2961
|
+
}
|
|
2962
|
+
if (this.emit("checkout_started", {
|
|
2963
|
+
priceId: e,
|
|
2964
|
+
url: h.url,
|
|
2965
|
+
acquiring: h.acquiring
|
|
2966
|
+
}), this.startUserWatcher(), typeof window > "u" || !h.url) {
|
|
2967
|
+
this.mountAndShow("awaiting_payment", {
|
|
2968
|
+
renew: i,
|
|
2969
|
+
checkoutPriceId: e,
|
|
2970
|
+
checkoutUrl: h.url
|
|
2971
|
+
});
|
|
2972
|
+
return;
|
|
2973
|
+
}
|
|
2974
|
+
const k = window.open(h.url, "_blank");
|
|
2975
|
+
if (this.purchased = !1, k) {
|
|
2976
|
+
try {
|
|
2977
|
+
k.opener = null;
|
|
2978
|
+
} catch {
|
|
2979
|
+
}
|
|
2980
|
+
this.mountAndShow("awaiting_payment", {
|
|
2981
|
+
renew: i,
|
|
2982
|
+
checkoutPriceId: e,
|
|
2983
|
+
checkoutUrl: h.url
|
|
2984
|
+
});
|
|
2985
|
+
} else
|
|
2986
|
+
this.mountAndShow("popup_blocked", {
|
|
2987
|
+
renew: i,
|
|
2988
|
+
checkoutPriceId: e,
|
|
2989
|
+
checkoutUrl: h.url
|
|
2990
|
+
});
|
|
2991
|
+
}
|
|
2992
|
+
/** Trial-check без mount'а (для late-mount direct-checkout). Возвращает
|
|
2993
|
+
* true если trial заблокировал — caller должен прекратить flow. На любой
|
|
2994
|
+
* storage-ошибке log+продолжаем (не блокируем продажу). */
|
|
2995
|
+
async checkTrialBeforeCheckout(e) {
|
|
2996
|
+
const r = e.settings.trial;
|
|
2997
|
+
if (!r) return !1;
|
|
2998
|
+
const i = this.ensureTrialStore(r);
|
|
2999
|
+
try {
|
|
3000
|
+
const n = await i.check();
|
|
3001
|
+
if (this.lastTrialStatus = n, n.mode === "none") return !1;
|
|
3002
|
+
if (n.blocked) {
|
|
3003
|
+
const s = await i.recordBlock();
|
|
3004
|
+
return this.lastTrialStatus = s, this.emit("trial_blocked", s), !0;
|
|
3005
|
+
}
|
|
3006
|
+
return this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), !1;
|
|
3007
|
+
} catch (n) {
|
|
3008
|
+
return typeof console < "u" && console.warn("[paywall] trial check failed", n), !1;
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
applyProcessing(e) {
|
|
3012
|
+
this.currentState.processing !== e && this.applyState({ ...this.currentState, processing: e });
|
|
2851
3013
|
}
|
|
2852
3014
|
/**
|
|
2853
3015
|
* Headless anonymous signin без открытия модалки. Внутри:
|
|
@@ -2862,70 +3024,70 @@ class Sr {
|
|
|
2862
3024
|
*/
|
|
2863
3025
|
signInAnonymously() {
|
|
2864
3026
|
return this.auth ? this.auth.signInAnonymously() : Promise.reject(
|
|
2865
|
-
new
|
|
3027
|
+
new L(
|
|
2866
3028
|
"invalid_config",
|
|
2867
3029
|
"signInAnonymously requires managed-auth. Pass `auth: true` to PaywallUI."
|
|
2868
3030
|
)
|
|
2869
3031
|
);
|
|
2870
3032
|
}
|
|
2871
|
-
openInternal(
|
|
3033
|
+
openInternal(e, r) {
|
|
2872
3034
|
r.identity && this.billing.setIdentity(r.identity), this.purchased = !1;
|
|
2873
|
-
const i = r.skipTrial === !0 ||
|
|
3035
|
+
const i = r.skipTrial === !0 || e === "support", n = r.skipVisibility === !0 || e === "support" || e === "auth", s = r.renew === !0;
|
|
2874
3036
|
if (i && n) {
|
|
2875
|
-
this.mountAndShow(
|
|
3037
|
+
this.mountAndShow(e, { renew: s, authMode: r.authMode });
|
|
2876
3038
|
return;
|
|
2877
3039
|
}
|
|
2878
|
-
const
|
|
2879
|
-
if (
|
|
2880
|
-
this.runOpenGates(
|
|
3040
|
+
const o = this.billing.getCachedBootstrap();
|
|
3041
|
+
if (o) {
|
|
3042
|
+
this.runOpenGates(e, o, { skipTrial: i, skipVisibility: n, renew: s });
|
|
2881
3043
|
return;
|
|
2882
3044
|
}
|
|
2883
3045
|
if (this.mountThenLoad) {
|
|
2884
|
-
this.mountAndShow(
|
|
3046
|
+
this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((c) => this.runDelayedGates(c, { skipTrial: i, skipVisibility: n })).catch(() => {
|
|
2885
3047
|
});
|
|
2886
3048
|
return;
|
|
2887
3049
|
}
|
|
2888
3050
|
this.billing.bootstrap().then(
|
|
2889
|
-
(
|
|
3051
|
+
(c) => this.runOpenGates(e, c, { skipTrial: i, skipVisibility: n, renew: s })
|
|
2890
3052
|
).catch(() => {
|
|
2891
|
-
this.mountAndShow(
|
|
3053
|
+
this.mountAndShow(e, { renew: s });
|
|
2892
3054
|
});
|
|
2893
3055
|
}
|
|
2894
3056
|
/** Применить gates ПОСЛЕ того, как модалка уже смонтирована (mount-then-load
|
|
2895
3057
|
* путь). Если gate блокирует — close() + emit. Если юзер уже сам закрыл
|
|
2896
3058
|
* модалку до резолва bootstrap'а — no-op (isOpen=false). */
|
|
2897
|
-
runDelayedGates(
|
|
3059
|
+
runDelayedGates(e, r) {
|
|
2898
3060
|
if (!this.isOpen) return;
|
|
2899
3061
|
if (!r.skipVisibility) {
|
|
2900
|
-
const
|
|
2901
|
-
if (
|
|
2902
|
-
this.close(), this.emit("visibility_blocked",
|
|
3062
|
+
const s = e.settings.visibility;
|
|
3063
|
+
if (s && (this.lastVisibility = s, !s.visible)) {
|
|
3064
|
+
this.close(), this.emit("visibility_blocked", s);
|
|
2903
3065
|
return;
|
|
2904
3066
|
}
|
|
2905
3067
|
}
|
|
2906
3068
|
if (r.skipTrial) return;
|
|
2907
|
-
const i =
|
|
3069
|
+
const i = e.settings.trial;
|
|
2908
3070
|
if (!i) return;
|
|
2909
3071
|
const n = this.ensureTrialStore(i);
|
|
2910
|
-
n.check().then(async (
|
|
2911
|
-
if (this.isOpen && (this.lastTrialStatus =
|
|
2912
|
-
if (
|
|
2913
|
-
const
|
|
2914
|
-
if (this.lastTrialStatus =
|
|
2915
|
-
this.close(), this.emit("trial_blocked",
|
|
3072
|
+
n.check().then(async (s) => {
|
|
3073
|
+
if (this.isOpen && (this.lastTrialStatus = s, s.mode !== "none")) {
|
|
3074
|
+
if (s.blocked) {
|
|
3075
|
+
const o = await n.recordBlock();
|
|
3076
|
+
if (this.lastTrialStatus = o, !this.isOpen) return;
|
|
3077
|
+
this.close(), this.emit("trial_blocked", o);
|
|
2916
3078
|
return;
|
|
2917
3079
|
}
|
|
2918
3080
|
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired"));
|
|
2919
3081
|
}
|
|
2920
|
-
}).catch((
|
|
2921
|
-
typeof console < "u" && console.warn("[paywall] trial check failed",
|
|
3082
|
+
}).catch((s) => {
|
|
3083
|
+
typeof console < "u" && console.warn("[paywall] trial check failed", s);
|
|
2922
3084
|
});
|
|
2923
3085
|
}
|
|
2924
3086
|
// Порядок гейтов: visibility → trial. Country-mismatch ≠ trial-block, и
|
|
2925
3087
|
// вести trial-стейт «осталось N показов» под юзером, который вообще не
|
|
2926
3088
|
// должен увидеть пейвол по таргетингу — бессмысленно: при возврате в
|
|
2927
3089
|
// правильную страну он окажется со «слипшимся» триал-счётчиком.
|
|
2928
|
-
runOpenGates(
|
|
3090
|
+
runOpenGates(e, r, i) {
|
|
2929
3091
|
if (!i.skipVisibility) {
|
|
2930
3092
|
const n = r.settings.visibility;
|
|
2931
3093
|
if (n && (this.lastVisibility = n, !n.visible)) {
|
|
@@ -2934,80 +3096,82 @@ class Sr {
|
|
|
2934
3096
|
}
|
|
2935
3097
|
}
|
|
2936
3098
|
if (i.skipTrial) {
|
|
2937
|
-
this.mountAndShow(
|
|
3099
|
+
this.mountAndShow(e, { renew: i.renew });
|
|
2938
3100
|
return;
|
|
2939
3101
|
}
|
|
2940
|
-
this.gateThroughTrial(
|
|
3102
|
+
this.gateThroughTrial(e, r, i.renew);
|
|
2941
3103
|
}
|
|
2942
|
-
gateThroughTrial(
|
|
2943
|
-
const
|
|
2944
|
-
if (!
|
|
2945
|
-
this.mountAndShow(
|
|
3104
|
+
gateThroughTrial(e, r, i) {
|
|
3105
|
+
const n = r.settings.trial;
|
|
3106
|
+
if (!n) {
|
|
3107
|
+
this.mountAndShow(e, { renew: i });
|
|
2946
3108
|
return;
|
|
2947
3109
|
}
|
|
2948
|
-
const s = this.ensureTrialStore(
|
|
2949
|
-
s.check().then(async (
|
|
2950
|
-
if (this.lastTrialStatus =
|
|
2951
|
-
this.mountAndShow(
|
|
3110
|
+
const s = this.ensureTrialStore(n);
|
|
3111
|
+
s.check().then(async (o) => {
|
|
3112
|
+
if (this.lastTrialStatus = o, o.mode === "none") {
|
|
3113
|
+
this.mountAndShow(e, { renew: i });
|
|
2952
3114
|
return;
|
|
2953
3115
|
}
|
|
2954
|
-
if (
|
|
2955
|
-
const
|
|
2956
|
-
this.lastTrialStatus =
|
|
3116
|
+
if (o.blocked) {
|
|
3117
|
+
const c = await s.recordBlock();
|
|
3118
|
+
this.lastTrialStatus = c, this.emit("trial_blocked", c);
|
|
2957
3119
|
return;
|
|
2958
3120
|
}
|
|
2959
|
-
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(
|
|
2960
|
-
}).catch((
|
|
2961
|
-
typeof console < "u" && console.warn("[paywall] trial check failed",
|
|
3121
|
+
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: i });
|
|
3122
|
+
}).catch((o) => {
|
|
3123
|
+
typeof console < "u" && console.warn("[paywall] trial check failed", o), this.mountAndShow(e, { renew: i });
|
|
2962
3124
|
});
|
|
2963
3125
|
}
|
|
2964
|
-
ensureTrialStore(
|
|
2965
|
-
if (this.trialStore && this.trialStoreConfig &&
|
|
3126
|
+
ensureTrialStore(e) {
|
|
3127
|
+
if (this.trialStore && this.trialStoreConfig && mr(this.trialStoreConfig, e))
|
|
2966
3128
|
return this.trialStore;
|
|
2967
|
-
this.trialStoreConfig =
|
|
3129
|
+
this.trialStoreConfig = e;
|
|
2968
3130
|
const r = this.billing.createTrialStore;
|
|
2969
|
-
return this.trialStore = typeof r == "function" ? r.call(this.billing,
|
|
3131
|
+
return this.trialStore = typeof r == "function" ? r.call(this.billing, e) : Ye(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
|
|
2970
3132
|
}
|
|
2971
|
-
mountAndShow(
|
|
2972
|
-
const i = r.renew === !0, n = r.authMode, o =
|
|
3133
|
+
mountAndShow(e, r = {}) {
|
|
3134
|
+
const i = r.renew === !0, n = r.authMode, o = e === "auth" || e === "awaiting_payment" || e === "popup_blocked" ? r.checkoutPriceId ?? null : null, c = e === "awaiting_payment" || e === "popup_blocked" ? r.checkoutUrl ?? null : null;
|
|
2973
3135
|
if (this.handle) {
|
|
2974
3136
|
this.isOpen = !0, this.handle.update({
|
|
2975
3137
|
open: !0,
|
|
2976
|
-
initialView:
|
|
3138
|
+
initialView: e,
|
|
2977
3139
|
initialAuthMode: n,
|
|
2978
3140
|
initialCheckoutPriceId: o,
|
|
3141
|
+
initialCheckoutUrl: c,
|
|
2979
3142
|
purchased: !1,
|
|
2980
3143
|
renew: i
|
|
2981
3144
|
}), this.emit("open");
|
|
2982
3145
|
return;
|
|
2983
3146
|
}
|
|
2984
|
-
this.isOpen = !0, this.handle =
|
|
2985
|
-
|
|
3147
|
+
this.isOpen = !0, this.handle = Je(
|
|
3148
|
+
nr,
|
|
2986
3149
|
{
|
|
2987
3150
|
client: this.billing,
|
|
2988
3151
|
open: !0,
|
|
2989
|
-
initialView:
|
|
3152
|
+
initialView: e,
|
|
2990
3153
|
initialAuthMode: n,
|
|
2991
3154
|
initialCheckoutPriceId: o,
|
|
3155
|
+
initialCheckoutUrl: c,
|
|
2992
3156
|
purchased: !1,
|
|
2993
3157
|
renew: i,
|
|
2994
3158
|
onClose: () => this.close(),
|
|
2995
|
-
onEvent: (
|
|
2996
|
-
this.emit(
|
|
3159
|
+
onEvent: (l, p) => {
|
|
3160
|
+
this.emit(l, p), l === "checkout_started" && this.startUserWatcher();
|
|
2997
3161
|
},
|
|
2998
|
-
onState: (
|
|
3162
|
+
onState: (l) => this.applyState(l),
|
|
2999
3163
|
inline: this.inline,
|
|
3000
3164
|
locale: this.forceLocale
|
|
3001
3165
|
},
|
|
3002
3166
|
{ host: this.host, shadowMode: this.shadowMode, inline: this.inline }
|
|
3003
3167
|
), this.emit("open");
|
|
3004
3168
|
}
|
|
3005
|
-
applyState(
|
|
3006
|
-
if (!
|
|
3007
|
-
this.currentState =
|
|
3169
|
+
applyState(e) {
|
|
3170
|
+
if (!wr(this.currentState, e)) {
|
|
3171
|
+
this.currentState = e;
|
|
3008
3172
|
for (const r of this.stateListeners)
|
|
3009
3173
|
try {
|
|
3010
|
-
r(
|
|
3174
|
+
r(e);
|
|
3011
3175
|
} catch (i) {
|
|
3012
3176
|
console.warn("[paywall] onStateChange listener threw", i);
|
|
3013
3177
|
}
|
|
@@ -3034,24 +3198,24 @@ class Sr {
|
|
|
3034
3198
|
*
|
|
3035
3199
|
* Возвращает unsubscribe.
|
|
3036
3200
|
*/
|
|
3037
|
-
onStateChange(
|
|
3038
|
-
this.stateListeners.add(
|
|
3201
|
+
onStateChange(e, r = {}) {
|
|
3202
|
+
this.stateListeners.add(e);
|
|
3039
3203
|
const i = r.immediate ?? "microtask";
|
|
3040
3204
|
if (i !== "none") {
|
|
3041
3205
|
const n = this.currentState;
|
|
3042
3206
|
if (i === "sync")
|
|
3043
3207
|
try {
|
|
3044
|
-
|
|
3045
|
-
} catch (
|
|
3046
|
-
console.warn("[paywall] onStateChange initial sync threw",
|
|
3208
|
+
e(n);
|
|
3209
|
+
} catch (s) {
|
|
3210
|
+
console.warn("[paywall] onStateChange initial sync threw", s);
|
|
3047
3211
|
}
|
|
3048
3212
|
else
|
|
3049
3213
|
queueMicrotask(() => {
|
|
3050
|
-
this.stateListeners.has(
|
|
3214
|
+
this.stateListeners.has(e) && e(n);
|
|
3051
3215
|
});
|
|
3052
3216
|
}
|
|
3053
3217
|
return () => {
|
|
3054
|
-
this.stateListeners.delete(
|
|
3218
|
+
this.stateListeners.delete(e);
|
|
3055
3219
|
};
|
|
3056
3220
|
}
|
|
3057
3221
|
/** Sync-доступ к последнему известному статусу триала. null — `paywall.open()`
|
|
@@ -3074,8 +3238,8 @@ class Sr {
|
|
|
3074
3238
|
* pricing-страниц/карточек на сайте, где host хочет показать те же цены,
|
|
3075
3239
|
* что и в модалке, не вытаскивая bootstrap руками.
|
|
3076
3240
|
*/
|
|
3077
|
-
getPrices(
|
|
3078
|
-
return this.billing.getPrices(
|
|
3241
|
+
getPrices(e = {}) {
|
|
3242
|
+
return this.billing.getPrices(e);
|
|
3079
3243
|
}
|
|
3080
3244
|
/** Sync-снимок цен. null — bootstrap ещё не загружали. */
|
|
3081
3245
|
getCachedPrices() {
|
|
@@ -3102,13 +3266,13 @@ class Sr {
|
|
|
3102
3266
|
* этого использовать React-хук `usePaywallOffer(priceId)` из sdk-react
|
|
3103
3267
|
* либо обёртку поверх `setInterval(1000)` + повторный вызов этого метода.
|
|
3104
3268
|
*/
|
|
3105
|
-
getOfferForPrice(
|
|
3269
|
+
getOfferForPrice(e) {
|
|
3106
3270
|
const r = this.billing.getCachedOffers();
|
|
3107
3271
|
if (!r) return null;
|
|
3108
|
-
const i =
|
|
3109
|
-
return i ? $
|
|
3272
|
+
const i = N(r, e);
|
|
3273
|
+
return i ? $e(i, {
|
|
3110
3274
|
now: Date.now(),
|
|
3111
|
-
readStart:
|
|
3275
|
+
readStart: Ve
|
|
3112
3276
|
}) : null;
|
|
3113
3277
|
}
|
|
3114
3278
|
/** Снимок текущего «языка юзера» — proxy над `billing.getUserLanguage()`.
|
|
@@ -3138,25 +3302,25 @@ class Sr {
|
|
|
3138
3302
|
* `getVisibility()` / `getTrialStatus()` видели свежие данные после первого
|
|
3139
3303
|
* `getAccess()`, а не только после первого `open()`.
|
|
3140
3304
|
*/
|
|
3141
|
-
async getAccess(
|
|
3305
|
+
async getAccess(e = {}) {
|
|
3142
3306
|
let r = this.billing.getCachedBootstrap();
|
|
3143
3307
|
if (!r)
|
|
3144
3308
|
try {
|
|
3145
|
-
r = await this.billing.bootstrap({ signal:
|
|
3309
|
+
r = await this.billing.bootstrap({ signal: e.signal });
|
|
3146
3310
|
} catch {
|
|
3147
|
-
const
|
|
3148
|
-
return
|
|
3311
|
+
const o = this.billing.getCachedUser();
|
|
3312
|
+
return o?.has_active_subscription ? {
|
|
3149
3313
|
access: "granted",
|
|
3150
3314
|
reason: "has_subscription",
|
|
3151
3315
|
visibility: null,
|
|
3152
3316
|
trial: null,
|
|
3153
|
-
user:
|
|
3317
|
+
user: o
|
|
3154
3318
|
} : {
|
|
3155
3319
|
access: "blocked",
|
|
3156
3320
|
reason: "no_subscription",
|
|
3157
3321
|
visibility: null,
|
|
3158
3322
|
trial: null,
|
|
3159
|
-
user:
|
|
3323
|
+
user: o
|
|
3160
3324
|
};
|
|
3161
3325
|
}
|
|
3162
3326
|
const i = r.user ?? null;
|
|
@@ -3169,23 +3333,23 @@ class Sr {
|
|
|
3169
3333
|
user: i
|
|
3170
3334
|
};
|
|
3171
3335
|
let n = null;
|
|
3172
|
-
if (!
|
|
3173
|
-
const
|
|
3174
|
-
if (
|
|
3336
|
+
if (!e.skipVisibility) {
|
|
3337
|
+
const o = r.settings.visibility;
|
|
3338
|
+
if (o && (n = o, this.lastVisibility = o, !o.visible))
|
|
3175
3339
|
return { access: "granted", reason: "visibility_blocked", visibility: n, trial: null, user: i };
|
|
3176
3340
|
}
|
|
3177
|
-
let
|
|
3178
|
-
if (!
|
|
3179
|
-
const
|
|
3180
|
-
if (
|
|
3341
|
+
let s = null;
|
|
3342
|
+
if (!e.skipTrial) {
|
|
3343
|
+
const o = r.settings.trial;
|
|
3344
|
+
if (o)
|
|
3181
3345
|
try {
|
|
3182
|
-
if (
|
|
3183
|
-
return { access: "granted", reason: "trial_blocked", visibility: n, trial:
|
|
3346
|
+
if (s = await this.ensureTrialStore(o).check(), this.lastTrialStatus = s, s.blocked)
|
|
3347
|
+
return { access: "granted", reason: "trial_blocked", visibility: n, trial: s, user: i };
|
|
3184
3348
|
} catch (c) {
|
|
3185
3349
|
typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", c);
|
|
3186
3350
|
}
|
|
3187
3351
|
}
|
|
3188
|
-
return { access: "blocked", reason: "no_subscription", visibility: n, trial:
|
|
3352
|
+
return { access: "blocked", reason: "no_subscription", visibility: n, trial: s, user: i };
|
|
3189
3353
|
}
|
|
3190
3354
|
/** Сбросить состояние триала в storage. Полезно для дев-режима / админ-кнопки
|
|
3191
3355
|
* «прогнать сценарий заново». В проде хост обычно не дёргает. */
|
|
@@ -3199,9 +3363,9 @@ class Sr {
|
|
|
3199
3363
|
// В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
|
|
3200
3364
|
// bootstrap при следующем открытии.
|
|
3201
3365
|
startUserWatcher() {
|
|
3202
|
-
this.watcher ||
|
|
3366
|
+
this.watcher || hr() && (this.watcher = new pr({
|
|
3203
3367
|
client: this.billing,
|
|
3204
|
-
onActive: (
|
|
3368
|
+
onActive: (e) => {
|
|
3205
3369
|
this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
|
|
3206
3370
|
const r = this.billing.getCachedBootstrap()?.settings.success_redirect_url;
|
|
3207
3371
|
if (r && typeof window < "u")
|
|
@@ -3218,7 +3382,7 @@ class Sr {
|
|
|
3218
3382
|
}), this.watcher.start());
|
|
3219
3383
|
}
|
|
3220
3384
|
close() {
|
|
3221
|
-
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(
|
|
3385
|
+
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(oe), this.emit("close"));
|
|
3222
3386
|
}
|
|
3223
3387
|
/**
|
|
3224
3388
|
* Сканирует текущий URL на маркеры возврата с checkout и эмитит
|
|
@@ -3228,79 +3392,79 @@ class Sr {
|
|
|
3228
3392
|
*/
|
|
3229
3393
|
checkReturn() {
|
|
3230
3394
|
if (typeof window > "u") return;
|
|
3231
|
-
const
|
|
3395
|
+
const e = new URL(window.location.href), r = Ce(e.hash.replace(/^#/, "")), i = Ce(e.search.replace(/^\?/, "")), n = r ?? i;
|
|
3232
3396
|
n && (n.status === "paid" ? (this.emit("purchase_completed", {
|
|
3233
3397
|
priceId: n.priceId,
|
|
3234
3398
|
sessionId: n.sessionId
|
|
3235
|
-
}),
|
|
3399
|
+
}), br(n)) : (n.status === "failed" || n.status === "cancelled") && this.emit("purchase_failed", { reason: n.status }), yr(e));
|
|
3236
3400
|
}
|
|
3237
3401
|
destroy() {
|
|
3238
|
-
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 =
|
|
3402
|
+
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 = oe;
|
|
3239
3403
|
}
|
|
3240
3404
|
}
|
|
3241
|
-
function
|
|
3242
|
-
if (!
|
|
3243
|
-
if (
|
|
3244
|
-
return { auth:
|
|
3245
|
-
const
|
|
3405
|
+
function gr(t) {
|
|
3406
|
+
if (!t.auth) return { auth: void 0, ownsAuth: !1 };
|
|
3407
|
+
if (t.auth instanceof de || fr(t.auth))
|
|
3408
|
+
return { auth: t.auth, ownsAuth: !1 };
|
|
3409
|
+
const e = t.auth === !0 ? {} : t.auth;
|
|
3246
3410
|
return {
|
|
3247
|
-
auth: new
|
|
3248
|
-
paywallId:
|
|
3249
|
-
apiOrigin:
|
|
3250
|
-
storage:
|
|
3251
|
-
fetch:
|
|
3252
|
-
openPopup:
|
|
3411
|
+
auth: new de({
|
|
3412
|
+
paywallId: t.paywallId,
|
|
3413
|
+
apiOrigin: e.apiOrigin ?? t.apiOrigin,
|
|
3414
|
+
storage: e.storage ?? t.storage,
|
|
3415
|
+
fetch: e.fetch ?? t.fetch,
|
|
3416
|
+
openPopup: e.openPopup
|
|
3253
3417
|
}),
|
|
3254
3418
|
ownsAuth: !0
|
|
3255
3419
|
};
|
|
3256
3420
|
}
|
|
3257
|
-
function
|
|
3258
|
-
if (typeof
|
|
3259
|
-
const
|
|
3260
|
-
return typeof
|
|
3421
|
+
function fr(t) {
|
|
3422
|
+
if (typeof t != "object" || t === null) return !1;
|
|
3423
|
+
const e = t;
|
|
3424
|
+
return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
|
|
3261
3425
|
}
|
|
3262
|
-
function
|
|
3263
|
-
return
|
|
3426
|
+
function wr(t, e) {
|
|
3427
|
+
return t.open === e.open && t.view === e.view && t.error === e.error && t.processing === e.processing;
|
|
3264
3428
|
}
|
|
3265
|
-
function
|
|
3266
|
-
return
|
|
3429
|
+
function mr(t, e) {
|
|
3430
|
+
return t.mode === e.mode && t.payload === e.payload && t.storage === e.storage;
|
|
3267
3431
|
}
|
|
3268
|
-
function
|
|
3269
|
-
if (!
|
|
3270
|
-
const
|
|
3432
|
+
function Ce(t) {
|
|
3433
|
+
if (!t) return null;
|
|
3434
|
+
const e = new URLSearchParams(t), r = e.get(H.status);
|
|
3271
3435
|
return r ? {
|
|
3272
3436
|
status: r,
|
|
3273
|
-
priceId:
|
|
3274
|
-
sessionId:
|
|
3437
|
+
priceId: e.get(H.priceId),
|
|
3438
|
+
sessionId: e.get(H.sessionId)
|
|
3275
3439
|
} : null;
|
|
3276
3440
|
}
|
|
3277
|
-
function
|
|
3441
|
+
function br(t) {
|
|
3278
3442
|
if (!(typeof window > "u" || !window.opener))
|
|
3279
3443
|
try {
|
|
3280
3444
|
window.opener.postMessage(
|
|
3281
3445
|
{
|
|
3282
3446
|
type: "paywall_purchase",
|
|
3283
|
-
status:
|
|
3284
|
-
priceId:
|
|
3285
|
-
sessionId:
|
|
3447
|
+
status: t.status,
|
|
3448
|
+
priceId: t.priceId,
|
|
3449
|
+
sessionId: t.sessionId
|
|
3286
3450
|
},
|
|
3287
3451
|
"*"
|
|
3288
3452
|
);
|
|
3289
3453
|
} catch {
|
|
3290
3454
|
}
|
|
3291
3455
|
}
|
|
3292
|
-
function
|
|
3293
|
-
const
|
|
3456
|
+
function yr(t) {
|
|
3457
|
+
const e = (i, n) => {
|
|
3294
3458
|
if (!i) return "";
|
|
3295
|
-
const
|
|
3296
|
-
|
|
3297
|
-
const
|
|
3298
|
-
return
|
|
3299
|
-
}, r =
|
|
3459
|
+
const s = new URLSearchParams(i.replace(/^[?#]/, ""));
|
|
3460
|
+
s.delete(H.status), s.delete(H.priceId), s.delete(H.sessionId);
|
|
3461
|
+
const o = s.toString();
|
|
3462
|
+
return o ? n + o : "";
|
|
3463
|
+
}, r = t.pathname + e(t.search, "?") + e(t.hash, "#");
|
|
3300
3464
|
window.history.replaceState(null, "", r);
|
|
3301
3465
|
}
|
|
3302
3466
|
export {
|
|
3303
|
-
|
|
3304
|
-
|
|
3467
|
+
Cr as P,
|
|
3468
|
+
er as b
|
|
3305
3469
|
};
|
|
3306
|
-
//# sourceMappingURL=PaywallUI-
|
|
3470
|
+
//# sourceMappingURL=PaywallUI-vv6Hw8su.js.map
|