@monetize.software/sdk 3.0.0-alpha.10 → 3.0.0-alpha.12
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-DQ1Jke8b.js → PaywallUI-CSgfmhHq.js} +4 -4
- package/dist/chunks/PaywallUI-CSgfmhHq.js.map +1 -0
- package/dist/chunks/{PaywallUI-CQG9HCwo.js → PaywallUI-pb7JpLr6.js} +950 -889
- package/dist/chunks/PaywallUI-pb7JpLr6.js.map +1 -0
- package/dist/core.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +35 -0
- package/dist/ui.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/PaywallUI-CQG9HCwo.js.map +0 -1
- package/dist/chunks/PaywallUI-DQ1Jke8b.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PaywallError as O, findApplicableOffer as H, BillingClient as
|
|
2
|
-
import { render as Y, h as dt, createContext as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { useContext as
|
|
1
|
+
import { PaywallError as O, findApplicableOffer as H, BillingClient as Dt, EventTracker as Nt, resolveOffer as $t, readBrowserOfferStart as Ht, AuthClient as ct } from "../core.js";
|
|
2
|
+
import { render as Y, h as dt, createContext as Vt } from "preact";
|
|
3
|
+
import { jsx as a, jsxs as d, Fragment as ot } from "preact/jsx-runtime";
|
|
4
|
+
import { useContext as Gt, useState as x, useEffect as T, useRef as F, useMemo as qt, useLayoutEffect as Wt } from "preact/hooks";
|
|
5
5
|
const ut = 3600 * 1e3;
|
|
6
6
|
function X(e) {
|
|
7
7
|
return `paywall-${e}-trial-time-first-open`;
|
|
@@ -33,18 +33,18 @@ class Ct {
|
|
|
33
33
|
remainingMs: t,
|
|
34
34
|
totalMs: t
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const n = i + t, o = Math.max(0, n - Date.now());
|
|
37
37
|
return {
|
|
38
38
|
mode: "time",
|
|
39
39
|
blocked: o > 0,
|
|
40
40
|
startedAt: i,
|
|
41
|
-
expiresAt:
|
|
41
|
+
expiresAt: n,
|
|
42
42
|
remainingMs: o,
|
|
43
43
|
totalMs: t
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
async checkOpens() {
|
|
47
|
-
const t = this.config.payload, r = await this.storage.getItem(J(this.paywallId)), i = r ? Number(r) : 0,
|
|
47
|
+
const t = this.config.payload, r = await this.storage.getItem(J(this.paywallId)), i = r ? Number(r) : 0, n = Number.isFinite(i) ? i : 0, o = n < t, s = Math.max(0, t - n);
|
|
48
48
|
return {
|
|
49
49
|
mode: "opens",
|
|
50
50
|
blocked: o,
|
|
@@ -54,32 +54,32 @@ class Ct {
|
|
|
54
54
|
}
|
|
55
55
|
async recordTime() {
|
|
56
56
|
const t = this.config.payload * ut, r = X(this.paywallId), i = await this.storage.getItem(r);
|
|
57
|
-
let
|
|
58
|
-
(!
|
|
59
|
-
const o =
|
|
57
|
+
let n = i ? Number(i) : null;
|
|
58
|
+
(!n || !Number.isFinite(n)) && (n = Date.now(), await this.storage.setItem(r, String(n)));
|
|
59
|
+
const o = n + t, s = Math.max(0, o - Date.now());
|
|
60
60
|
return {
|
|
61
61
|
mode: "time",
|
|
62
62
|
blocked: s > 0,
|
|
63
|
-
startedAt:
|
|
63
|
+
startedAt: n,
|
|
64
64
|
expiresAt: o,
|
|
65
65
|
remainingMs: s,
|
|
66
66
|
totalMs: t
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
async recordOpens() {
|
|
70
|
-
const t = this.config.payload, r = J(this.paywallId), i = await this.storage.getItem(r),
|
|
70
|
+
const t = this.config.payload, r = J(this.paywallId), i = await this.storage.getItem(r), n = i ? Number(i) : 0, o = Number.isFinite(n) ? n : 0, s = Math.min(t, o + 1);
|
|
71
71
|
await this.storage.setItem(r, String(s));
|
|
72
|
-
const
|
|
72
|
+
const c = Math.max(0, t - s);
|
|
73
73
|
return {
|
|
74
74
|
mode: "opens",
|
|
75
75
|
blocked: s < t,
|
|
76
|
-
remainingActions:
|
|
76
|
+
remainingActions: c,
|
|
77
77
|
totalActions: t
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
let pt = !1;
|
|
82
|
-
class
|
|
82
|
+
class Zt {
|
|
83
83
|
constructor(t, r, i) {
|
|
84
84
|
pt || (pt = !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.'
|
|
@@ -95,12 +95,12 @@ class Wt {
|
|
|
95
95
|
return this.fallback.reset();
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
return r.storage === "server" ? new
|
|
98
|
+
function Kt(e, t, r) {
|
|
99
|
+
return r.storage === "server" ? new Zt(e, t, r) : new Ct(e, t, r);
|
|
100
100
|
}
|
|
101
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
102
|
let ht = !1;
|
|
103
|
-
function
|
|
103
|
+
function Yt() {
|
|
104
104
|
if (ht || (ht = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
|
|
105
105
|
let e;
|
|
106
106
|
try {
|
|
@@ -123,13 +123,13 @@ function Kt() {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Xt(e, t, r = {}) {
|
|
127
127
|
if (typeof document > "u")
|
|
128
128
|
throw new Error("mountShadow called in non-DOM environment");
|
|
129
|
-
|
|
129
|
+
Yt();
|
|
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
|
|
132
|
+
const n = i.attachShadow({ mode: r.shadowMode ?? "closed" }), o = `
|
|
133
133
|
:host {
|
|
134
134
|
all: initial !important;
|
|
135
135
|
display: block !important;
|
|
@@ -148,23 +148,23 @@ function Yt(e, t, r = {}) {
|
|
|
148
148
|
visibility: visible !important;
|
|
149
149
|
}
|
|
150
150
|
`, s = document.createElement("style");
|
|
151
|
-
s.textContent = o + It + (r.injectCss ?? ""),
|
|
152
|
-
const
|
|
153
|
-
|
|
151
|
+
s.textContent = o + It + (r.injectCss ?? ""), n.appendChild(s);
|
|
152
|
+
const c = document.createElement("div");
|
|
153
|
+
c.style.pointerEvents = "auto", n.appendChild(c);
|
|
154
154
|
let l = t;
|
|
155
|
-
return Y(dt(e, l),
|
|
156
|
-
shadowRoot:
|
|
157
|
-
update(
|
|
158
|
-
l = { ...l, ...
|
|
155
|
+
return Y(dt(e, l), c), {
|
|
156
|
+
shadowRoot: n,
|
|
157
|
+
update(f) {
|
|
158
|
+
l = { ...l, ...f }, Y(dt(e, l), c);
|
|
159
159
|
},
|
|
160
160
|
unmount() {
|
|
161
|
-
Y(null,
|
|
161
|
+
Y(null, c), i.remove();
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
const
|
|
165
|
+
const Jt = (e, t, r) => {
|
|
166
166
|
const i = e[t];
|
|
167
|
-
return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((
|
|
167
|
+
return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((n, o) => {
|
|
168
168
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
169
169
|
o.bind(
|
|
170
170
|
null,
|
|
@@ -174,7 +174,7 @@ const Xt = (e, t, r) => {
|
|
|
174
174
|
)
|
|
175
175
|
);
|
|
176
176
|
});
|
|
177
|
-
},
|
|
177
|
+
}, Qt = [
|
|
178
178
|
"ru",
|
|
179
179
|
"uk",
|
|
180
180
|
"de",
|
|
@@ -202,19 +202,19 @@ const Xt = (e, t, r) => {
|
|
|
202
202
|
"th",
|
|
203
203
|
"vi",
|
|
204
204
|
"he"
|
|
205
|
-
], At = (e, t, r) => Lt(t, r), Mt =
|
|
205
|
+
], At = (e, t, r) => Lt(t, r), Mt = Vt({ t: At, locale: "en" });
|
|
206
206
|
function Lt(e, t) {
|
|
207
207
|
if (!t) return e;
|
|
208
208
|
let r = e;
|
|
209
|
-
for (const [i,
|
|
210
|
-
r = r.split(`{${i}}`).join(String(
|
|
209
|
+
for (const [i, n] of Object.entries(t))
|
|
210
|
+
r = r.split(`{${i}}`).join(String(n));
|
|
211
211
|
return r;
|
|
212
212
|
}
|
|
213
213
|
const Q = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map();
|
|
214
214
|
function Pt(e) {
|
|
215
|
-
return
|
|
215
|
+
return Qt.includes(e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function te(e) {
|
|
218
218
|
const t = [];
|
|
219
219
|
if (typeof navigator < "u" && navigator.language) {
|
|
220
220
|
t.push(navigator.language);
|
|
@@ -231,19 +231,19 @@ function Qt(e) {
|
|
|
231
231
|
if (Pt(i)) return i;
|
|
232
232
|
return null;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function ee(e, t) {
|
|
235
235
|
return !!e.locales && e.locales[t] !== void 0;
|
|
236
236
|
}
|
|
237
|
-
async function
|
|
237
|
+
async function re(e) {
|
|
238
238
|
const t = Q.get(e);
|
|
239
239
|
if (t) return t;
|
|
240
240
|
const r = tt.get(e);
|
|
241
241
|
if (r) return r;
|
|
242
|
-
const i =
|
|
243
|
-
const o =
|
|
242
|
+
const i = Jt(/* @__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/${e}.ts`, 3).then((n) => {
|
|
243
|
+
const o = n.default ?? {};
|
|
244
244
|
return Q.set(e, o), o;
|
|
245
|
-
}).catch((
|
|
246
|
-
console.warn(`[paywall] failed to load locale chunk "${e}"`,
|
|
245
|
+
}).catch((n) => {
|
|
246
|
+
console.warn(`[paywall] failed to load locale chunk "${e}"`, n);
|
|
247
247
|
const o = {};
|
|
248
248
|
return Q.set(e, o), o;
|
|
249
249
|
}).finally(() => {
|
|
@@ -251,95 +251,95 @@ async function ee(e) {
|
|
|
251
251
|
});
|
|
252
252
|
return tt.set(e, i), i;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
const [i,
|
|
256
|
-
|
|
257
|
-
const
|
|
254
|
+
function ie({ bootstrap: e, forceLocale: t, children: r }) {
|
|
255
|
+
const [i, n] = x("en"), [o, s] = x(null);
|
|
256
|
+
T(() => {
|
|
257
|
+
const f = (t && Pt(t) ? t : null) ?? (() => {
|
|
258
258
|
if (!e) return null;
|
|
259
|
-
const
|
|
260
|
-
return !
|
|
259
|
+
const h = te(e);
|
|
260
|
+
return !h || !ee(e, h) ? null : h;
|
|
261
261
|
})();
|
|
262
|
-
if (!
|
|
263
|
-
(o !== null || i !== "en") && (
|
|
262
|
+
if (!f) {
|
|
263
|
+
(o !== null || i !== "en") && (n("en"), s(null));
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
266
|
-
if (
|
|
267
|
-
let
|
|
268
|
-
return
|
|
269
|
-
|
|
266
|
+
if (f === i && o) return;
|
|
267
|
+
let u = !1;
|
|
268
|
+
return re(f).then((h) => {
|
|
269
|
+
u || (n(f), s(h));
|
|
270
270
|
}), () => {
|
|
271
|
-
|
|
271
|
+
u = !0;
|
|
272
272
|
};
|
|
273
273
|
}, [e, t]);
|
|
274
|
-
const
|
|
274
|
+
const c = {
|
|
275
275
|
locale: i,
|
|
276
|
-
t: o ? (l,
|
|
276
|
+
t: o ? (l, f, u) => Lt(o[l] ?? f, u) : At
|
|
277
277
|
};
|
|
278
|
-
return /* @__PURE__ */
|
|
278
|
+
return /* @__PURE__ */ a(Mt.Provider, { value: c, children: r });
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function k() {
|
|
281
|
+
return Gt(Mt);
|
|
282
282
|
}
|
|
283
283
|
const gt = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
284
|
-
function
|
|
284
|
+
function ne({
|
|
285
285
|
open: e,
|
|
286
286
|
onClose: t,
|
|
287
287
|
labelledBy: r,
|
|
288
288
|
brandColor: i,
|
|
289
|
-
topBanner:
|
|
289
|
+
topBanner: n,
|
|
290
290
|
allowClose: o = !0,
|
|
291
291
|
hideCloseButton: s = !1,
|
|
292
|
-
inline:
|
|
292
|
+
inline: c = !1,
|
|
293
293
|
children: l
|
|
294
294
|
}) {
|
|
295
|
-
const { t:
|
|
296
|
-
return
|
|
295
|
+
const { t: f } = k(), u = F(null), h = F(null);
|
|
296
|
+
return T(() => {
|
|
297
297
|
if (!e) return;
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
298
|
+
h.current = document.activeElement ?? null;
|
|
299
|
+
const S = u.current;
|
|
300
|
+
S && (S.querySelector(gt) ?? S).focus({ preventScroll: !0 });
|
|
301
|
+
const g = (C) => {
|
|
302
|
+
if (C.key === "Escape") {
|
|
303
303
|
if (!o) return;
|
|
304
|
-
|
|
304
|
+
C.stopPropagation(), t();
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
|
|
307
|
+
if (C.key !== "Tab" || !u.current) return;
|
|
308
|
+
const I = Array.from(
|
|
309
|
+
u.current.querySelectorAll(gt)
|
|
310
310
|
).filter((z) => !z.hasAttribute("disabled") && z.tabIndex !== -1);
|
|
311
|
-
if (
|
|
312
|
-
|
|
311
|
+
if (I.length === 0) {
|
|
312
|
+
C.preventDefault();
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
|
-
const A =
|
|
316
|
-
|
|
315
|
+
const A = I[0], E = I[I.length - 1], P = document.activeElement;
|
|
316
|
+
C.shiftKey && P === A ? (C.preventDefault(), E.focus()) : !C.shiftKey && P === E && (C.preventDefault(), A.focus());
|
|
317
317
|
};
|
|
318
|
-
document.addEventListener("keydown",
|
|
319
|
-
const
|
|
320
|
-
return
|
|
321
|
-
document.removeEventListener("keydown",
|
|
318
|
+
document.addEventListener("keydown", g, !0);
|
|
319
|
+
const v = document.body.style.overflow;
|
|
320
|
+
return c || (document.body.style.overflow = "hidden"), () => {
|
|
321
|
+
document.removeEventListener("keydown", g, !0), c || (document.body.style.overflow = v), h.current?.focus?.({ preventScroll: !0 });
|
|
322
322
|
};
|
|
323
|
-
}, [e, t, o,
|
|
323
|
+
}, [e, t, o, c]), e ? /* @__PURE__ */ d(
|
|
324
324
|
"div",
|
|
325
325
|
{
|
|
326
|
-
class: `${
|
|
327
|
-
onClick: (
|
|
328
|
-
o &&
|
|
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: (S) => {
|
|
328
|
+
o && S.target === S.currentTarget && t();
|
|
329
329
|
},
|
|
330
330
|
"data-pw-root": !0,
|
|
331
331
|
children: [
|
|
332
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ d(
|
|
333
333
|
"div",
|
|
334
334
|
{
|
|
335
335
|
class: "relative flex w-full max-w-[400px] flex-col animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",
|
|
336
336
|
style: { "--pw-accent": i ?? "#3b82f6" },
|
|
337
337
|
children: [
|
|
338
|
-
|
|
339
|
-
/* @__PURE__ */
|
|
338
|
+
n,
|
|
339
|
+
/* @__PURE__ */ d(
|
|
340
340
|
"div",
|
|
341
341
|
{
|
|
342
|
-
ref:
|
|
342
|
+
ref: u,
|
|
343
343
|
role: "dialog",
|
|
344
344
|
"aria-modal": "true",
|
|
345
345
|
"aria-labelledby": r,
|
|
@@ -350,14 +350,14 @@ function ie({
|
|
|
350
350
|
},
|
|
351
351
|
children: [
|
|
352
352
|
l,
|
|
353
|
-
o && !s ? /* @__PURE__ */
|
|
353
|
+
o && !s ? /* @__PURE__ */ a(
|
|
354
354
|
"button",
|
|
355
355
|
{
|
|
356
356
|
type: "button",
|
|
357
357
|
onClick: t,
|
|
358
|
-
"aria-label":
|
|
358
|
+
"aria-label": f("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
|
-
children: /* @__PURE__ */
|
|
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",
|
|
362
362
|
{
|
|
363
363
|
d: "M3 3l10 10M13 3L3 13",
|
|
@@ -374,7 +374,7 @@ function ie({
|
|
|
374
374
|
]
|
|
375
375
|
}
|
|
376
376
|
),
|
|
377
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ a("style", { children: `
|
|
378
378
|
@keyframes pw-fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
379
379
|
@keyframes pw-scale-in {
|
|
380
380
|
from { opacity: 0; transform: translateY(12px) scale(0.96) }
|
|
@@ -385,7 +385,7 @@ function ie({
|
|
|
385
385
|
}
|
|
386
386
|
) : null;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function ae(e, t) {
|
|
389
389
|
switch (e) {
|
|
390
390
|
case "google":
|
|
391
391
|
return t("auth.continue_with_google", "Continue with Google");
|
|
@@ -432,29 +432,29 @@ function ft(e, t, r) {
|
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
function Tt({ block: e, ctx: t }) {
|
|
435
|
-
const r = t.auth, i = t.authSession,
|
|
435
|
+
const r = t.auth, i = t.authSession, n = e.allow_signup !== !1, o = e.allow_password_reset !== !1, s = e.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
|
-
const
|
|
439
|
-
return
|
|
440
|
-
}) }) : /* @__PURE__ */
|
|
441
|
-
|
|
438
|
+
const c = i && !i.user.is_anonymous ? i : null;
|
|
439
|
+
return c && s ? null : c ? /* @__PURE__ */ a(oe, { email: c.user.email ?? "", onSignOut: () => r.signOut().catch(() => {
|
|
440
|
+
}) }) : /* @__PURE__ */ a(
|
|
441
|
+
se,
|
|
442
442
|
{
|
|
443
443
|
block: e,
|
|
444
|
-
allowSignup:
|
|
444
|
+
allowSignup: n,
|
|
445
445
|
allowReset: o,
|
|
446
446
|
ctx: t
|
|
447
447
|
}
|
|
448
448
|
);
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
const { t: r } =
|
|
452
|
-
return /* @__PURE__ */
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */
|
|
450
|
+
function oe({ email: e, onSignOut: t }) {
|
|
451
|
+
const { t: r } = k();
|
|
452
|
+
return /* @__PURE__ */ d("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
|
|
453
|
+
/* @__PURE__ */ d("div", { class: "flex flex-col", children: [
|
|
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: e })
|
|
456
456
|
] }),
|
|
457
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ a(
|
|
458
458
|
"button",
|
|
459
459
|
{
|
|
460
460
|
type: "button",
|
|
@@ -465,182 +465,182 @@ function ae({ email: e, onSignOut: t }) {
|
|
|
465
465
|
)
|
|
466
466
|
] });
|
|
467
467
|
}
|
|
468
|
-
function
|
|
469
|
-
const { t:
|
|
470
|
-
|
|
468
|
+
function se({ block: e, allowSignup: t, allowReset: r, ctx: i }) {
|
|
469
|
+
const { t: n } = k(), o = i.auth, s = e.providers ?? [], c = i.initialAuthMode === "signup" && t ? "signup" : "signin", [l, f] = x(c), [u, h] = x(""), [p, _] = x(""), [y, S] = x(""), [g, v] = x(""), [C, I] = x(null), A = F(!1), [E, P] = x(null), [z, B] = x(null), [R, j] = x(!1), [M, D] = x(null);
|
|
470
|
+
T(() => {
|
|
471
471
|
if (typeof o.getLastLogin != "function") return;
|
|
472
|
-
let
|
|
472
|
+
let m = !1;
|
|
473
473
|
return o.getLastLogin().then(
|
|
474
474
|
(L) => {
|
|
475
|
-
|
|
475
|
+
m || !L || (D(L), L.email && h((N) => N === "" ? L.email : N));
|
|
476
476
|
},
|
|
477
477
|
() => {
|
|
478
478
|
}
|
|
479
479
|
), () => {
|
|
480
|
-
|
|
480
|
+
m = !0;
|
|
481
481
|
};
|
|
482
482
|
}, [o]);
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
},
|
|
486
|
-
if (
|
|
483
|
+
const U = (m) => {
|
|
484
|
+
f(m), P(null), B(null), j(!1);
|
|
485
|
+
}, V = async (m) => {
|
|
486
|
+
if (m.preventDefault(), !(A.current || C)) {
|
|
487
487
|
A.current = !0;
|
|
488
488
|
try {
|
|
489
|
-
if (P(null),
|
|
490
|
-
if (!
|
|
491
|
-
|
|
489
|
+
if (P(null), B(null), l === "signup" && !R) {
|
|
490
|
+
if (!u.trim()) return;
|
|
491
|
+
j(!0);
|
|
492
492
|
return;
|
|
493
493
|
}
|
|
494
|
-
if (l === "signup" &&
|
|
495
|
-
P(
|
|
494
|
+
if (l === "signup" && p !== y) {
|
|
495
|
+
P(n("auth.passwords_mismatch", "Passwords don't match"));
|
|
496
496
|
return;
|
|
497
497
|
}
|
|
498
|
-
|
|
498
|
+
I("email");
|
|
499
499
|
try {
|
|
500
|
-
l === "signin" ? await o.signInWithEmail({ email:
|
|
501
|
-
|
|
502
|
-
)) : l === "signup_verify" ? await o.verifyOtp({ email:
|
|
503
|
-
email:
|
|
504
|
-
token:
|
|
505
|
-
type:
|
|
506
|
-
}),
|
|
500
|
+
l === "signin" ? await o.signInWithEmail({ email: u, password: p }) : l === "signup" ? (await o.signUp({ email: u, password: p })).kind === "confirmation_required" && (_(""), f("signup_verify"), B(n("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await o.requestPasswordReset({ email: u }), f("reset_sent"), B(
|
|
501
|
+
n("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
|
|
502
|
+
)) : l === "signup_verify" ? await o.verifyOtp({ email: u, token: g, type: "email" }) : l === "reset_verify" && (await o.verifyOtp({
|
|
503
|
+
email: u,
|
|
504
|
+
token: g,
|
|
505
|
+
type: p ? "recovery" : "email"
|
|
506
|
+
}), p && await o.updatePassword({ password: p }));
|
|
507
507
|
} catch (L) {
|
|
508
|
-
P(ft(L, l === "signup" ? "signup" : l === "signup_verify" || l === "reset_verify" ? "otp" : l === "forgot" ? "reset" : "signin",
|
|
508
|
+
P(ft(L, l === "signup" ? "signup" : l === "signup_verify" || l === "reset_verify" ? "otp" : l === "forgot" ? "reset" : "signin", n));
|
|
509
509
|
} finally {
|
|
510
|
-
|
|
510
|
+
I(null);
|
|
511
511
|
}
|
|
512
512
|
} finally {
|
|
513
513
|
A.current = !1;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
},
|
|
517
|
-
if (!(A.current ||
|
|
518
|
-
A.current = !0,
|
|
516
|
+
}, Z = async (m) => {
|
|
517
|
+
if (!(A.current || C)) {
|
|
518
|
+
A.current = !0, I(m), P(null), B(null);
|
|
519
519
|
try {
|
|
520
520
|
await o.signInWithOAuth({
|
|
521
|
-
provider:
|
|
522
|
-
onPopupOpened: () =>
|
|
521
|
+
provider: m,
|
|
522
|
+
onPopupOpened: () => I(null)
|
|
523
523
|
});
|
|
524
524
|
} catch (L) {
|
|
525
525
|
if (L instanceof O && (L.code === "oauth_cancelled" || L.code === "oauth_timeout"))
|
|
526
526
|
return;
|
|
527
|
-
P(ft(L, "signin",
|
|
527
|
+
P(ft(L, "signin", n));
|
|
528
528
|
} finally {
|
|
529
|
-
A.current = !1,
|
|
529
|
+
A.current = !1, I(null);
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
},
|
|
533
|
-
return /* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
|
|
536
|
-
s.map((
|
|
537
|
-
/* @__PURE__ */
|
|
532
|
+
}, K = s.length > 0 && (l === "signin" || l === "signup"), b = l === "signin" || l === "signup" || l === "forgot", w = l === "signin" || l === "signup" && R;
|
|
533
|
+
return /* @__PURE__ */ d("div", { class: "flex flex-col gap-5", children: [
|
|
534
|
+
/* @__PURE__ */ a(le, { mode: l, customHeading: e.heading, customSubheading: e.subheading }),
|
|
535
|
+
K ? /* @__PURE__ */ d("div", { class: "flex flex-col gap-2.5", children: [
|
|
536
|
+
s.map((m) => /* @__PURE__ */ d("div", { class: "relative", children: [
|
|
537
|
+
/* @__PURE__ */ d(
|
|
538
538
|
"button",
|
|
539
539
|
{
|
|
540
540
|
type: "button",
|
|
541
|
-
onClick: () =>
|
|
542
|
-
disabled:
|
|
541
|
+
onClick: () => Z(m),
|
|
542
|
+
disabled: C !== 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__ */
|
|
545
|
+
C === m ? /* @__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(be, { provider: m }),
|
|
546
|
+
/* @__PURE__ */ a("span", { children: ae(m, n) })
|
|
547
547
|
]
|
|
548
548
|
}
|
|
549
549
|
),
|
|
550
|
-
M?.method ===
|
|
551
|
-
] },
|
|
552
|
-
/* @__PURE__ */
|
|
550
|
+
M?.method === m ? /* @__PURE__ */ a(fe, { email: M.email }) : null
|
|
551
|
+
] }, m)),
|
|
552
|
+
/* @__PURE__ */ a(me, {})
|
|
553
553
|
] }) : null,
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
|
|
554
|
+
/* @__PURE__ */ d("form", { onSubmit: V, class: "flex flex-col gap-3", children: [
|
|
555
|
+
b && /* @__PURE__ */ a(
|
|
556
556
|
wt,
|
|
557
557
|
{
|
|
558
558
|
type: "email",
|
|
559
|
-
placeholder:
|
|
560
|
-
value:
|
|
561
|
-
onInput:
|
|
559
|
+
placeholder: n("auth.email", "Email address"),
|
|
560
|
+
value: u,
|
|
561
|
+
onInput: h,
|
|
562
562
|
autocomplete: "email",
|
|
563
563
|
required: !0
|
|
564
564
|
}
|
|
565
565
|
),
|
|
566
|
-
|
|
566
|
+
w && /* @__PURE__ */ a(
|
|
567
567
|
et,
|
|
568
568
|
{
|
|
569
|
-
placeholder:
|
|
570
|
-
value:
|
|
571
|
-
onInput:
|
|
569
|
+
placeholder: n("auth.password", "Password"),
|
|
570
|
+
value: p,
|
|
571
|
+
onInput: _,
|
|
572
572
|
autocomplete: l === "signin" ? "current-password" : "new-password",
|
|
573
573
|
required: !0
|
|
574
574
|
}
|
|
575
575
|
),
|
|
576
|
-
l === "signup" &&
|
|
576
|
+
l === "signup" && R && /* @__PURE__ */ a(
|
|
577
577
|
et,
|
|
578
578
|
{
|
|
579
|
-
placeholder:
|
|
580
|
-
value:
|
|
581
|
-
onInput:
|
|
579
|
+
placeholder: n("auth.repeat_password", "Repeat password"),
|
|
580
|
+
value: y,
|
|
581
|
+
onInput: S,
|
|
582
582
|
autocomplete: "new-password",
|
|
583
583
|
required: !0
|
|
584
584
|
}
|
|
585
585
|
),
|
|
586
|
-
(l === "signup_verify" || l === "reset_verify") && /* @__PURE__ */
|
|
586
|
+
(l === "signup_verify" || l === "reset_verify") && /* @__PURE__ */ a(
|
|
587
587
|
wt,
|
|
588
588
|
{
|
|
589
589
|
type: "text",
|
|
590
|
-
placeholder:
|
|
591
|
-
value:
|
|
592
|
-
onInput:
|
|
590
|
+
placeholder: n("auth.confirmation_code", "Confirmation code"),
|
|
591
|
+
value: g,
|
|
592
|
+
onInput: v,
|
|
593
593
|
autocomplete: "one-time-code",
|
|
594
594
|
inputMode: "numeric",
|
|
595
595
|
required: !0
|
|
596
596
|
}
|
|
597
597
|
),
|
|
598
|
-
l === "reset_verify" && /* @__PURE__ */
|
|
598
|
+
l === "reset_verify" && /* @__PURE__ */ a(
|
|
599
599
|
et,
|
|
600
600
|
{
|
|
601
|
-
placeholder:
|
|
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: p,
|
|
606
|
+
onInput: _,
|
|
607
607
|
autocomplete: "new-password"
|
|
608
608
|
}
|
|
609
609
|
),
|
|
610
|
-
l === "reset_sent" && z && /* @__PURE__ */
|
|
611
|
-
l === "signin" && r && /* @__PURE__ */
|
|
612
|
-
|
|
613
|
-
z && l !== "reset_sent" && /* @__PURE__ */
|
|
614
|
-
l !== "reset_sent" && /* @__PURE__ */
|
|
615
|
-
|
|
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: () => U("forgot"), children: n("auth.forgot_password", "Forgot password?") }) }),
|
|
612
|
+
E && /* @__PURE__ */ a("p", { class: "text-sm text-red-600", children: E }),
|
|
613
|
+
z && l !== "reset_sent" && /* @__PURE__ */ a("p", { class: "text-sm text-gray-500", children: z }),
|
|
614
|
+
l !== "reset_sent" && /* @__PURE__ */ a(
|
|
615
|
+
pe,
|
|
616
616
|
{
|
|
617
|
-
busy:
|
|
618
|
-
label:
|
|
617
|
+
busy: C === "email",
|
|
618
|
+
label: de(l, R, e.submit_label ?? e.heading, n)
|
|
619
619
|
}
|
|
620
620
|
)
|
|
621
621
|
] }),
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
|
|
622
|
+
/* @__PURE__ */ a(
|
|
623
|
+
ue,
|
|
624
624
|
{
|
|
625
625
|
mode: l,
|
|
626
626
|
allowSignup: t,
|
|
627
|
-
onSwitch:
|
|
627
|
+
onSwitch: U
|
|
628
628
|
}
|
|
629
629
|
)
|
|
630
630
|
] });
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function le({
|
|
633
633
|
mode: e,
|
|
634
634
|
customHeading: t,
|
|
635
635
|
customSubheading: r
|
|
636
636
|
}) {
|
|
637
|
-
const { t: i } =
|
|
638
|
-
return /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
|
|
637
|
+
const { t: i } = k(), n = ce(e, i), o = e === "signin" || e === "signup", s = o && t ? t : n.title, c = o && r !== void 0 ? r || null : n.subtitle;
|
|
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: s }),
|
|
640
|
+
c ? /* @__PURE__ */ a("p", { class: "text-base leading-relaxed text-gray-600", children: c }) : null
|
|
641
641
|
] });
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function ce(e, t) {
|
|
644
644
|
switch (e) {
|
|
645
645
|
case "signin":
|
|
646
646
|
return {
|
|
@@ -683,7 +683,7 @@ function le(e, t) {
|
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function de(e, t, r, i) {
|
|
687
687
|
if (e === "signin" && r) return r;
|
|
688
688
|
switch (e) {
|
|
689
689
|
case "signin":
|
|
@@ -699,31 +699,31 @@ function ce(e, t, r, i) {
|
|
|
699
699
|
return i("cta.continue", "Continue");
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function ue({
|
|
703
703
|
mode: e,
|
|
704
704
|
allowSignup: t,
|
|
705
705
|
onSwitch: r
|
|
706
706
|
}) {
|
|
707
|
-
const { t: i } =
|
|
708
|
-
return e === "signin" && t ? /* @__PURE__ */
|
|
707
|
+
const { t: i } = k();
|
|
708
|
+
return e === "signin" && t ? /* @__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
|
-
/* @__PURE__ */
|
|
712
|
-
] }) : e === "signup" || e === "signup_verify" ? /* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ a(W, { onClick: () => r("signup"), children: i("auth.sign_up_link", "Sign Up") })
|
|
712
|
+
] }) : e === "signup" || e === "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
|
-
/* @__PURE__ */
|
|
716
|
-
] }) : e === "forgot" || e === "reset_sent" || e === "reset_verify" ? /* @__PURE__ */
|
|
715
|
+
/* @__PURE__ */ a(W, { onClick: () => r("signin"), children: i("auth.log_in_link", "Log In") })
|
|
716
|
+
] }) : e === "forgot" || e === "reset_sent" || e === "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
|
-
/* @__PURE__ */
|
|
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
723
|
onClick: e,
|
|
724
724
|
children: t
|
|
725
725
|
}) {
|
|
726
|
-
return /* @__PURE__ */
|
|
726
|
+
return /* @__PURE__ */ a(
|
|
727
727
|
"button",
|
|
728
728
|
{
|
|
729
729
|
type: "button",
|
|
@@ -734,8 +734,8 @@ function W({
|
|
|
734
734
|
}
|
|
735
735
|
);
|
|
736
736
|
}
|
|
737
|
-
function
|
|
738
|
-
return /* @__PURE__ */
|
|
737
|
+
function pe({ busy: e, label: t }) {
|
|
738
|
+
return /* @__PURE__ */ a(
|
|
739
739
|
"button",
|
|
740
740
|
{
|
|
741
741
|
type: "submit",
|
|
@@ -745,62 +745,62 @@ function ue({ busy: e, label: t }) {
|
|
|
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: e ? /* @__PURE__ */
|
|
748
|
+
children: e ? /* @__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: t })
|
|
749
749
|
}
|
|
750
750
|
);
|
|
751
751
|
}
|
|
752
|
-
function wt({ type: e, placeholder: t, value: r, onInput: i, autocomplete:
|
|
753
|
-
return /* @__PURE__ */
|
|
752
|
+
function wt({ type: e, placeholder: t, value: r, onInput: i, autocomplete: n, inputMode: o, required: s }) {
|
|
753
|
+
return /* @__PURE__ */ a(
|
|
754
754
|
"input",
|
|
755
755
|
{
|
|
756
756
|
type: e,
|
|
757
757
|
value: r,
|
|
758
758
|
placeholder: t,
|
|
759
|
-
onInput: (
|
|
760
|
-
autocomplete:
|
|
759
|
+
onInput: (c) => i(c.target.value),
|
|
760
|
+
autocomplete: n,
|
|
761
761
|
inputMode: o,
|
|
762
762
|
required: s,
|
|
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 et({ placeholder: e, value: t, onInput: r, autocomplete: i, required:
|
|
768
|
-
const { t: o } =
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
|
|
767
|
+
function et({ placeholder: e, value: t, onInput: r, autocomplete: i, required: n }) {
|
|
768
|
+
const { t: o } = k(), [s, c] = x(!1), l = F(null);
|
|
769
|
+
T(() => {
|
|
770
|
+
const h = l.current;
|
|
771
|
+
h && h.value !== t && (h.value = t);
|
|
772
772
|
}, [s, t]);
|
|
773
|
-
const
|
|
774
|
-
return /* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
773
|
+
const f = o("auth.show_password", "Show password"), u = o("auth.hide_password", "Hide password");
|
|
774
|
+
return /* @__PURE__ */ d("div", { class: "relative", children: [
|
|
775
|
+
/* @__PURE__ */ a(
|
|
776
776
|
"input",
|
|
777
777
|
{
|
|
778
778
|
ref: l,
|
|
779
779
|
type: s ? "text" : "password",
|
|
780
780
|
value: t,
|
|
781
781
|
placeholder: e,
|
|
782
|
-
onInput: (
|
|
782
|
+
onInput: (h) => r(h.target.value),
|
|
783
783
|
autocomplete: i,
|
|
784
|
-
required:
|
|
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)]"
|
|
786
786
|
}
|
|
787
787
|
),
|
|
788
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ a(
|
|
789
789
|
"button",
|
|
790
790
|
{
|
|
791
791
|
type: "button",
|
|
792
|
-
onClick: () =>
|
|
793
|
-
"aria-label": s ?
|
|
792
|
+
onClick: () => c((h) => !h),
|
|
793
|
+
"aria-label": s ? u : f,
|
|
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: s ? /* @__PURE__ */
|
|
796
|
+
children: s ? /* @__PURE__ */ a(ge, {}) : /* @__PURE__ */ a(he, {})
|
|
797
797
|
}
|
|
798
798
|
)
|
|
799
799
|
] });
|
|
800
800
|
}
|
|
801
|
-
function
|
|
802
|
-
return /* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
801
|
+
function he() {
|
|
802
|
+
return /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
803
|
+
/* @__PURE__ */ a(
|
|
804
804
|
"path",
|
|
805
805
|
{
|
|
806
806
|
d: "M1.667 10S4.583 4.167 10 4.167 18.333 10 18.333 10 15.417 15.833 10 15.833 1.667 10 1.667 10Z",
|
|
@@ -810,12 +810,12 @@ function pe() {
|
|
|
810
810
|
"stroke-linejoin": "round"
|
|
811
811
|
}
|
|
812
812
|
),
|
|
813
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ a("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
|
|
814
814
|
] });
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
/* @__PURE__ */
|
|
816
|
+
function ge() {
|
|
817
|
+
return /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
818
|
+
/* @__PURE__ */ a(
|
|
819
819
|
"path",
|
|
820
820
|
{
|
|
821
821
|
d: "M8.236 4.293A6.96 6.96 0 0 1 10 4.167C15.417 4.167 18.333 10 18.333 10a13.5 13.5 0 0 1-1.92 2.755M11.768 11.768A2.5 2.5 0 0 1 8.233 8.233",
|
|
@@ -825,7 +825,7 @@ function he() {
|
|
|
825
825
|
"stroke-linejoin": "round"
|
|
826
826
|
}
|
|
827
827
|
),
|
|
828
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ a(
|
|
829
829
|
"path",
|
|
830
830
|
{
|
|
831
831
|
d: "M14.953 14.953A8.84 8.84 0 0 1 10 15.833C4.583 15.833 1.667 10 1.667 10a13.5 13.5 0 0 1 3.38-3.953M1.667 1.667l16.666 16.666",
|
|
@@ -837,46 +837,46 @@ function he() {
|
|
|
837
837
|
)
|
|
838
838
|
] });
|
|
839
839
|
}
|
|
840
|
-
function
|
|
841
|
-
const { t } =
|
|
842
|
-
return /* @__PURE__ */
|
|
840
|
+
function fe({ email: e }) {
|
|
841
|
+
const { t } = k(), r = e ? t("auth.last_used", "Last · {email}", { email: we(e) }) : t("auth.last_used_no_email", "Last");
|
|
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
|
|
844
|
+
function we(e) {
|
|
845
845
|
const [t, r] = e.split("@");
|
|
846
846
|
return r ? `${t.slice(0, 3)}*****@${r}` : e;
|
|
847
847
|
}
|
|
848
|
-
function
|
|
849
|
-
const { t: e } =
|
|
850
|
-
return /* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
/* @__PURE__ */
|
|
848
|
+
function me() {
|
|
849
|
+
const { t: e } = k();
|
|
850
|
+
return /* @__PURE__ */ d("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
|
|
851
|
+
/* @__PURE__ */ a("div", { class: "h-px flex-1 bg-gray-200" }),
|
|
852
|
+
/* @__PURE__ */ a("span", { children: e("auth.or", "or") }),
|
|
853
|
+
/* @__PURE__ */ a("div", { class: "h-px flex-1 bg-gray-200" })
|
|
854
854
|
] });
|
|
855
855
|
}
|
|
856
|
-
function
|
|
857
|
-
return e === "google" ? /* @__PURE__ */
|
|
858
|
-
/* @__PURE__ */
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
/* @__PURE__ */
|
|
861
|
-
/* @__PURE__ */
|
|
856
|
+
function be({ provider: e }) {
|
|
857
|
+
return e === "google" ? /* @__PURE__ */ d("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
|
|
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
|
+
/* @__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
|
+
/* @__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
|
+
/* @__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
|
] }) : e === "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
|
-
/* @__PURE__ */
|
|
867
|
-
) : e === "github" ? /* @__PURE__ */
|
|
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
|
+
) : e === "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
|
|
869
|
+
function xe({
|
|
870
870
|
block: e,
|
|
871
871
|
bootstrap: t,
|
|
872
872
|
auth: r,
|
|
873
873
|
authSession: i,
|
|
874
|
-
onBack:
|
|
874
|
+
onBack: n,
|
|
875
875
|
showBack: o = !0,
|
|
876
876
|
intent: s = "preauth",
|
|
877
|
-
initialMode:
|
|
877
|
+
initialMode: c
|
|
878
878
|
}) {
|
|
879
|
-
const { t: l } =
|
|
879
|
+
const { t: l } = k(), f = {
|
|
880
880
|
bootstrap: t,
|
|
881
881
|
selectedPriceId: null,
|
|
882
882
|
setSelectedPriceId: () => {
|
|
@@ -885,8 +885,8 @@ function be({
|
|
|
885
885
|
},
|
|
886
886
|
auth: r,
|
|
887
887
|
authSession: i,
|
|
888
|
-
initialAuthMode:
|
|
889
|
-
},
|
|
888
|
+
initialAuthMode: c
|
|
889
|
+
}, u = s === "restore" ? {
|
|
890
890
|
...e,
|
|
891
891
|
heading: l("auth.restore_purchases_heading", "Restore Purchases"),
|
|
892
892
|
subheading: l(
|
|
@@ -906,21 +906,21 @@ function be({
|
|
|
906
906
|
// переносятся на 2 строки. Явный короткий submit_label решает.
|
|
907
907
|
submit_label: l("auth.log_in", "Sign In")
|
|
908
908
|
} : e;
|
|
909
|
-
return /* @__PURE__ */
|
|
910
|
-
o ? /* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
909
|
+
return /* @__PURE__ */ d("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
|
|
910
|
+
o ? /* @__PURE__ */ a(ye, { onClick: n, ariaLabel: l("nav.back_aria", "Back") }) : null,
|
|
911
|
+
/* @__PURE__ */ a(Tt, { block: u, ctx: f })
|
|
912
912
|
] });
|
|
913
913
|
}
|
|
914
|
-
function
|
|
915
|
-
return /* @__PURE__ */
|
|
914
|
+
function ye({ onClick: e, ariaLabel: t }) {
|
|
915
|
+
return /* @__PURE__ */ a(
|
|
916
916
|
"button",
|
|
917
917
|
{
|
|
918
918
|
type: "button",
|
|
919
919
|
onClick: e,
|
|
920
920
|
"aria-label": t,
|
|
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
|
-
children: /* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
922
|
+
children: /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
923
|
+
/* @__PURE__ */ a(
|
|
924
924
|
"path",
|
|
925
925
|
{
|
|
926
926
|
d: "M5 8h8a4 4 0 0 1 0 8H9",
|
|
@@ -930,7 +930,7 @@ function xe({ onClick: e, ariaLabel: t }) {
|
|
|
930
930
|
"stroke-linejoin": "round"
|
|
931
931
|
}
|
|
932
932
|
),
|
|
933
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ a(
|
|
934
934
|
"path",
|
|
935
935
|
{
|
|
936
936
|
d: "M8 4 4 8l4 4",
|
|
@@ -955,7 +955,7 @@ function rt(e) {
|
|
|
955
955
|
expired: !1
|
|
956
956
|
};
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function ve(e) {
|
|
959
959
|
if (e.expires_at) {
|
|
960
960
|
const t = Date.parse(e.expires_at);
|
|
961
961
|
return Number.isFinite(t) ? t : null;
|
|
@@ -981,17 +981,17 @@ function jt(e, t) {
|
|
|
981
981
|
return e.find((r) => r.expires_at || r.duration_minutes) ?? null;
|
|
982
982
|
}
|
|
983
983
|
function zt(e) {
|
|
984
|
-
const t = e ?
|
|
984
|
+
const t = e ? ve(e) : null, [r, i] = x(
|
|
985
985
|
() => t !== null ? rt(t) : null
|
|
986
|
-
),
|
|
987
|
-
return
|
|
986
|
+
), n = F(t);
|
|
987
|
+
return n.current = t, T(() => {
|
|
988
988
|
if (t === null) {
|
|
989
989
|
i(null);
|
|
990
990
|
return;
|
|
991
991
|
}
|
|
992
992
|
i(rt(t));
|
|
993
993
|
const o = setInterval(() => {
|
|
994
|
-
const s = rt(
|
|
994
|
+
const s = rt(n.current ?? 0);
|
|
995
995
|
if (i(s), s.expired && (clearInterval(o), e?.duration_minutes && typeof window < "u"))
|
|
996
996
|
try {
|
|
997
997
|
window.localStorage.removeItem(Et(e.id));
|
|
@@ -1001,11 +1001,11 @@ function zt(e) {
|
|
|
1001
1001
|
return () => clearInterval(o);
|
|
1002
1002
|
}, [t, e?.duration_minutes, e?.id]), r;
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1005
|
-
const { t: r } =
|
|
1006
|
-
if (!i ||
|
|
1004
|
+
function ke({ block: e, ctx: t }) {
|
|
1005
|
+
const { t: r } = k(), i = jt(t.bootstrap.offers, e.offer_id), n = zt(i);
|
|
1006
|
+
if (!i || n === null || n.expired && !e.force) return null;
|
|
1007
1007
|
const o = e.title ?? i.label ?? r("offer.limited_time", "Limited-time offer"), s = i.discount_percent ? `${o} ${i.discount_percent}%` : o;
|
|
1008
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ d(
|
|
1009
1009
|
"div",
|
|
1010
1010
|
{
|
|
1011
1011
|
class: "flex flex-wrap items-center justify-center gap-2 rounded-2xl px-4 py-3 text-[15px] font-semibold leading-tight text-white",
|
|
@@ -1015,35 +1015,35 @@ function ve({ block: e, ctx: t }) {
|
|
|
1015
1015
|
},
|
|
1016
1016
|
role: "status",
|
|
1017
1017
|
children: [
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
1018
|
+
/* @__PURE__ */ a(Ot, {}),
|
|
1019
|
+
/* @__PURE__ */ a("span", { children: s }),
|
|
1020
|
+
/* @__PURE__ */ a(Bt, { value: n, t: r })
|
|
1021
1021
|
]
|
|
1022
1022
|
}
|
|
1023
1023
|
);
|
|
1024
1024
|
}
|
|
1025
1025
|
function Bt({ value: e, t }) {
|
|
1026
|
-
return /* @__PURE__ */
|
|
1027
|
-
e.days > 0 ? /* @__PURE__ */
|
|
1028
|
-
/* @__PURE__ */
|
|
1029
|
-
/* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ d("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
|
|
1027
|
+
e.days > 0 ? /* @__PURE__ */ d(ot, { children: [
|
|
1028
|
+
/* @__PURE__ */ a(G, { children: String(e.days) }),
|
|
1029
|
+
/* @__PURE__ */ a("span", { class: "text-xs", children: t("countdown.d", "d") })
|
|
1030
1030
|
] }) : null,
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
1031
|
+
/* @__PURE__ */ a(G, { children: String(e.hours).padStart(2, "0") }),
|
|
1032
|
+
/* @__PURE__ */ a("span", { class: "text-xs", children: t("countdown.h", "h") }),
|
|
1033
|
+
/* @__PURE__ */ a(G, { children: String(e.minutes).padStart(2, "0") }),
|
|
1034
|
+
/* @__PURE__ */ a("span", { class: "text-xs", children: t("countdown.m", "m") }),
|
|
1035
|
+
/* @__PURE__ */ a(G, { children: String(e.seconds).padStart(2, "0") }),
|
|
1036
|
+
/* @__PURE__ */ a("span", { class: "text-xs", children: t("countdown.s", "s") })
|
|
1037
1037
|
] });
|
|
1038
1038
|
}
|
|
1039
1039
|
function G({ children: e }) {
|
|
1040
|
-
return /* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ a("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: e });
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1043
|
-
const { t } =
|
|
1042
|
+
function _e({ offer: e }) {
|
|
1043
|
+
const { t } = k(), r = zt(e);
|
|
1044
1044
|
if (r === null || r.expired) return null;
|
|
1045
|
-
const i = e.label ?? t("offer.limited_time", "Limited-time offer"),
|
|
1046
|
-
return /* @__PURE__ */
|
|
1045
|
+
const i = e.label ?? t("offer.limited_time", "Limited-time offer"), n = e.discount_percent ? `${i} ${e.discount_percent}%` : i;
|
|
1046
|
+
return /* @__PURE__ */ d(
|
|
1047
1047
|
"div",
|
|
1048
1048
|
{
|
|
1049
1049
|
class: "-mb-2 flex flex-wrap items-center justify-center gap-2 rounded-t-xl px-4 pb-5 pt-3 text-[15px] font-semibold leading-tight text-white",
|
|
@@ -1053,15 +1053,15 @@ function ke({ offer: e }) {
|
|
|
1053
1053
|
},
|
|
1054
1054
|
role: "status",
|
|
1055
1055
|
children: [
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ a(Ot, {}),
|
|
1057
|
+
/* @__PURE__ */ a("span", { children: n }),
|
|
1058
|
+
/* @__PURE__ */ a(Bt, { value: r, t })
|
|
1059
1059
|
]
|
|
1060
1060
|
}
|
|
1061
1061
|
);
|
|
1062
1062
|
}
|
|
1063
1063
|
function Ot() {
|
|
1064
|
-
return /* @__PURE__ */
|
|
1064
|
+
return /* @__PURE__ */ a(
|
|
1065
1065
|
"svg",
|
|
1066
1066
|
{
|
|
1067
1067
|
width: "16",
|
|
@@ -1069,7 +1069,7 @@ function Ot() {
|
|
|
1069
1069
|
viewBox: "0 0 12 12",
|
|
1070
1070
|
fill: "none",
|
|
1071
1071
|
"aria-hidden": "true",
|
|
1072
|
-
children: /* @__PURE__ */
|
|
1072
|
+
children: /* @__PURE__ */ a(
|
|
1073
1073
|
"path",
|
|
1074
1074
|
{
|
|
1075
1075
|
fill: "currentColor",
|
|
@@ -1079,41 +1079,41 @@ function Ot() {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
);
|
|
1081
1081
|
}
|
|
1082
|
-
const mt = 3, bt = 200, xt = 5e3, it = 5,
|
|
1083
|
-
function
|
|
1084
|
-
const { t:
|
|
1085
|
-
const
|
|
1086
|
-
return M ?
|
|
1082
|
+
const mt = 3, bt = 200, xt = 5e3, it = 5, Se = 10 * 1024 * 1024, yt = ["image/jpeg", "image/png", "image/webp"], Ce = /.+@.+\..+/;
|
|
1083
|
+
function Ie({ client: e, authSession: t, origin: r, onBack: i }) {
|
|
1084
|
+
const { t: n } = k(), o = t?.user.email ?? "", s = o || null, [c, l] = x(o), [f, u] = x(""), [h, p] = x(""), [_, y] = x([]), [S, g] = x(!1), [v, C] = x(null), [I, A] = x({}), E = () => {
|
|
1085
|
+
const j = {}, M = (s ?? c).trim(), D = f.trim(), U = h.trim();
|
|
1086
|
+
return M ? Ce.test(M.toLowerCase()) || (j.email = n("support.invalid_email", "Invalid email")) : j.email = n("support.required", "Required"), (D.length < mt || D.length > bt) && (j.subject = n("support.subject_length", "{min}–{max} characters", {
|
|
1087
1087
|
min: mt,
|
|
1088
1088
|
max: bt
|
|
1089
|
-
})), (
|
|
1089
|
+
})), (U.length < 1 || U.length > xt) && (j.message = n("support.message_length", "{min}–{max} characters", {
|
|
1090
1090
|
min: 1,
|
|
1091
1091
|
max: xt
|
|
1092
|
-
})), A(
|
|
1093
|
-
}, P = async (
|
|
1094
|
-
if (
|
|
1095
|
-
|
|
1092
|
+
})), A(j), Object.keys(j).length === 0;
|
|
1093
|
+
}, P = async (j) => {
|
|
1094
|
+
if (j.preventDefault(), !S && E()) {
|
|
1095
|
+
g(!0), A((M) => ({ ...M, submit: void 0 }));
|
|
1096
1096
|
try {
|
|
1097
|
-
const M = (s ??
|
|
1097
|
+
const M = (s ?? c).trim();
|
|
1098
1098
|
await e.createSupportTicket({
|
|
1099
|
-
subject:
|
|
1100
|
-
content:
|
|
1099
|
+
subject: f.trim(),
|
|
1100
|
+
content: h.trim(),
|
|
1101
1101
|
email: M || void 0,
|
|
1102
|
-
files:
|
|
1103
|
-
}),
|
|
1102
|
+
files: _.length > 0 ? _ : void 0
|
|
1103
|
+
}), C(M);
|
|
1104
1104
|
} catch (M) {
|
|
1105
1105
|
const D = M instanceof O && M.message || "Failed to send. Please try again.";
|
|
1106
|
-
A((
|
|
1106
|
+
A((U) => ({ ...U, submit: D }));
|
|
1107
1107
|
} finally {
|
|
1108
|
-
|
|
1108
|
+
g(!1);
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
}, z = () => {
|
|
1112
|
-
|
|
1113
|
-
},
|
|
1114
|
-
return
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1112
|
+
u(""), p(""), y([]), A({}), C(null);
|
|
1113
|
+
}, B = "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 v ? /* @__PURE__ */ d("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
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
|
+
/* @__PURE__ */ a(
|
|
1117
1117
|
"div",
|
|
1118
1118
|
{
|
|
1119
1119
|
class: "flex h-14 w-14 items-center justify-center rounded-full",
|
|
@@ -1123,7 +1123,7 @@ function Ce({ client: e, authSession: t, origin: r, onBack: i }) {
|
|
|
1123
1123
|
boxShadow: "0 0 0 8px color-mix(in srgb, var(--pw-accent) 12%, transparent), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 45%, transparent)"
|
|
1124
1124
|
},
|
|
1125
1125
|
"aria-hidden": "true",
|
|
1126
|
-
children: /* @__PURE__ */
|
|
1126
|
+
children: /* @__PURE__ */ a("svg", { viewBox: "0 0 24 24", class: "h-7 w-7", children: /* @__PURE__ */ a(
|
|
1127
1127
|
"path",
|
|
1128
1128
|
{
|
|
1129
1129
|
fill: "currentColor",
|
|
@@ -1132,28 +1132,28 @@ function Ce({ client: e, authSession: t, origin: r, onBack: i }) {
|
|
|
1132
1132
|
) })
|
|
1133
1133
|
}
|
|
1134
1134
|
),
|
|
1135
|
-
/* @__PURE__ */
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
|
|
1135
|
+
/* @__PURE__ */ a("div", { class: "text-lg font-semibold tracking-tight text-gray-900", children: n("support.success_heading", "Request submitted") }),
|
|
1136
|
+
/* @__PURE__ */ d("div", { class: "max-w-[320px] text-sm leading-relaxed text-gray-500", children: [
|
|
1137
|
+
n(
|
|
1138
1138
|
"support.success_message_prefix",
|
|
1139
1139
|
"We've received your message and will respond to"
|
|
1140
1140
|
),
|
|
1141
1141
|
" ",
|
|
1142
|
-
/* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ a("b", { class: "text-gray-700", children: v }),
|
|
1143
1143
|
"."
|
|
1144
1144
|
] })
|
|
1145
1145
|
] }),
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
1146
|
+
/* @__PURE__ */ a("div", { class: B, style: R, children: /* @__PURE__ */ d("div", { class: "flex items-center justify-center gap-3", children: [
|
|
1147
|
+
/* @__PURE__ */ a(
|
|
1148
1148
|
"button",
|
|
1149
1149
|
{
|
|
1150
1150
|
type: "button",
|
|
1151
1151
|
onClick: i,
|
|
1152
1152
|
class: "rounded-xl px-3 py-2 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
1153
|
-
children: r === "standalone" ?
|
|
1153
|
+
children: r === "standalone" ? n("support.done_button", "Done") : n("nav.back_aria", "Back")
|
|
1154
1154
|
}
|
|
1155
1155
|
),
|
|
1156
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ a(
|
|
1157
1157
|
"button",
|
|
1158
1158
|
{
|
|
1159
1159
|
type: "button",
|
|
@@ -1163,98 +1163,98 @@ function Ce({ client: e, authSession: t, origin: r, onBack: i }) {
|
|
|
1163
1163
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1164
1164
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1165
1165
|
},
|
|
1166
|
-
children:
|
|
1166
|
+
children: n("support.send_another", "Send another request")
|
|
1167
1167
|
}
|
|
1168
1168
|
)
|
|
1169
1169
|
] }) })
|
|
1170
|
-
] }) : /* @__PURE__ */
|
|
1171
|
-
/* @__PURE__ */
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
/* @__PURE__ */
|
|
1170
|
+
] }) : /* @__PURE__ */ d("form", { onSubmit: P, class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1171
|
+
/* @__PURE__ */ a(Ae, { onClick: i, ariaLabel: n("nav.back_aria", "Back") }),
|
|
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
|
+
/* @__PURE__ */ d("div", { class: "flex flex-col gap-2 pr-10", children: [
|
|
1174
|
+
/* @__PURE__ */ a("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: n("support.heading", "Support") }),
|
|
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
|
-
/* @__PURE__ */
|
|
1178
|
-
s ? /* @__PURE__ */
|
|
1179
|
-
|
|
1177
|
+
/* @__PURE__ */ d("div", { class: "flex flex-col gap-3", children: [
|
|
1178
|
+
s ? /* @__PURE__ */ d("div", { class: "rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600", children: [
|
|
1179
|
+
n("support.sending_as", "Sending as"),
|
|
1180
1180
|
" ",
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
] }) : /* @__PURE__ */
|
|
1181
|
+
/* @__PURE__ */ a("b", { class: "font-medium text-gray-900", children: s })
|
|
1182
|
+
] }) : /* @__PURE__ */ a(
|
|
1183
1183
|
vt,
|
|
1184
1184
|
{
|
|
1185
1185
|
type: "email",
|
|
1186
|
-
placeholder:
|
|
1187
|
-
value:
|
|
1186
|
+
placeholder: n("support.email_placeholder", "Enter your email *"),
|
|
1187
|
+
value: c,
|
|
1188
1188
|
onInput: l,
|
|
1189
|
-
error:
|
|
1189
|
+
error: I.email,
|
|
1190
1190
|
autocomplete: "email",
|
|
1191
1191
|
required: !0
|
|
1192
1192
|
}
|
|
1193
1193
|
),
|
|
1194
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ a(
|
|
1195
1195
|
vt,
|
|
1196
1196
|
{
|
|
1197
1197
|
type: "text",
|
|
1198
|
-
placeholder:
|
|
1199
|
-
value:
|
|
1200
|
-
onInput:
|
|
1201
|
-
error:
|
|
1198
|
+
placeholder: n("support.subject_placeholder", "Enter your subject *"),
|
|
1199
|
+
value: f,
|
|
1200
|
+
onInput: u,
|
|
1201
|
+
error: I.subject,
|
|
1202
1202
|
required: !0
|
|
1203
1203
|
}
|
|
1204
1204
|
),
|
|
1205
|
-
/* @__PURE__ */
|
|
1206
|
-
|
|
1205
|
+
/* @__PURE__ */ a(
|
|
1206
|
+
Me,
|
|
1207
1207
|
{
|
|
1208
|
-
placeholder:
|
|
1209
|
-
value:
|
|
1210
|
-
onInput:
|
|
1211
|
-
error:
|
|
1208
|
+
placeholder: n("support.message_placeholder", "Enter your message *"),
|
|
1209
|
+
value: h,
|
|
1210
|
+
onInput: p,
|
|
1211
|
+
error: I.message,
|
|
1212
1212
|
required: !0
|
|
1213
1213
|
}
|
|
1214
1214
|
),
|
|
1215
|
-
/* @__PURE__ */
|
|
1215
|
+
/* @__PURE__ */ a(Le, { files: _, onChange: y, disabled: S })
|
|
1216
1216
|
] })
|
|
1217
1217
|
] }) }),
|
|
1218
|
-
/* @__PURE__ */
|
|
1219
|
-
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ d("div", { class: B, style: R, children: [
|
|
1219
|
+
I.submit && /* @__PURE__ */ a("p", { class: "text-sm text-red-600", children: I.submit }),
|
|
1220
|
+
/* @__PURE__ */ d("div", { class: "flex items-center justify-end gap-3", children: [
|
|
1221
|
+
/* @__PURE__ */ a(
|
|
1222
1222
|
"button",
|
|
1223
1223
|
{
|
|
1224
1224
|
type: "button",
|
|
1225
1225
|
onClick: i,
|
|
1226
|
-
disabled:
|
|
1226
|
+
disabled: S,
|
|
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
|
-
children: r === "standalone" ?
|
|
1228
|
+
children: r === "standalone" ? n("support.close_button", "Close") : n("nav.back_aria", "Back")
|
|
1229
1229
|
}
|
|
1230
1230
|
),
|
|
1231
|
-
/* @__PURE__ */
|
|
1231
|
+
/* @__PURE__ */ a(
|
|
1232
1232
|
"button",
|
|
1233
1233
|
{
|
|
1234
1234
|
type: "submit",
|
|
1235
|
-
disabled:
|
|
1235
|
+
disabled: S,
|
|
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: S ? /* @__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
|
|
1249
|
-
return /* @__PURE__ */
|
|
1248
|
+
function Ae({ onClick: e, ariaLabel: t }) {
|
|
1249
|
+
return /* @__PURE__ */ a(
|
|
1250
1250
|
"button",
|
|
1251
1251
|
{
|
|
1252
1252
|
type: "button",
|
|
1253
1253
|
onClick: e,
|
|
1254
1254
|
"aria-label": t,
|
|
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
|
-
children: /* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */
|
|
1256
|
+
children: /* @__PURE__ */ d("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1257
|
+
/* @__PURE__ */ a(
|
|
1258
1258
|
"path",
|
|
1259
1259
|
{
|
|
1260
1260
|
d: "M5 8h8a4 4 0 0 1 0 8H9",
|
|
@@ -1264,7 +1264,7 @@ function Ie({ onClick: e, ariaLabel: t }) {
|
|
|
1264
1264
|
"stroke-linejoin": "round"
|
|
1265
1265
|
}
|
|
1266
1266
|
),
|
|
1267
|
-
/* @__PURE__ */
|
|
1267
|
+
/* @__PURE__ */ a(
|
|
1268
1268
|
"path",
|
|
1269
1269
|
{
|
|
1270
1270
|
d: "M8 4 4 8l4 4",
|
|
@@ -1283,171 +1283,171 @@ function vt({
|
|
|
1283
1283
|
placeholder: t,
|
|
1284
1284
|
value: r,
|
|
1285
1285
|
onInput: i,
|
|
1286
|
-
error:
|
|
1286
|
+
error: n,
|
|
1287
1287
|
autocomplete: o,
|
|
1288
1288
|
required: s
|
|
1289
1289
|
}) {
|
|
1290
|
-
return /* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
1291
|
+
/* @__PURE__ */ a(
|
|
1292
1292
|
"input",
|
|
1293
1293
|
{
|
|
1294
1294
|
type: e,
|
|
1295
1295
|
value: r,
|
|
1296
1296
|
placeholder: t,
|
|
1297
|
-
onInput: (
|
|
1297
|
+
onInput: (c) => i(c.target.value),
|
|
1298
1298
|
autocomplete: o,
|
|
1299
1299
|
required: s,
|
|
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 ${
|
|
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
|
|
1306
|
+
function Me({
|
|
1307
1307
|
placeholder: e,
|
|
1308
1308
|
value: t,
|
|
1309
1309
|
onInput: r,
|
|
1310
1310
|
error: i,
|
|
1311
|
-
required:
|
|
1311
|
+
required: n
|
|
1312
1312
|
}) {
|
|
1313
|
-
return /* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1313
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
1314
|
+
/* @__PURE__ */ a(
|
|
1315
1315
|
"textarea",
|
|
1316
1316
|
{
|
|
1317
1317
|
value: t,
|
|
1318
1318
|
placeholder: e,
|
|
1319
1319
|
onInput: (o) => r(o.target.value),
|
|
1320
|
-
required:
|
|
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)]"}`
|
|
1323
1323
|
}
|
|
1324
1324
|
),
|
|
1325
|
-
i && /* @__PURE__ */
|
|
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 } =
|
|
1330
|
-
if (!
|
|
1328
|
+
function Le({ files: e, onChange: t, disabled: r }) {
|
|
1329
|
+
const { t: i } = k(), n = F(null), [o, s] = x(!1), [c, l] = x(null), f = (u) => {
|
|
1330
|
+
if (!u || r) return;
|
|
1331
1331
|
l(null);
|
|
1332
|
-
const
|
|
1333
|
-
if (e.length +
|
|
1332
|
+
const h = Array.from(u);
|
|
1333
|
+
if (e.length + h.length > it) {
|
|
1334
1334
|
l(i("support.too_many_files", "Up to {max} files", { max: it }));
|
|
1335
1335
|
return;
|
|
1336
1336
|
}
|
|
1337
|
-
const
|
|
1338
|
-
(
|
|
1337
|
+
const p = h.filter(
|
|
1338
|
+
(_) => yt.includes(_.type) && _.size <= Se
|
|
1339
1339
|
);
|
|
1340
|
-
if (
|
|
1340
|
+
if (p.length !== h.length) {
|
|
1341
1341
|
l(i("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
|
|
1342
1342
|
return;
|
|
1343
1343
|
}
|
|
1344
|
-
t([...e, ...
|
|
1344
|
+
t([...e, ...p]);
|
|
1345
1345
|
};
|
|
1346
|
-
return /* @__PURE__ */
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
1347
|
+
/* @__PURE__ */ a("span", { class: "text-xs font-medium text-gray-700", children: i("support.attachments_label", "Attachments (optional)") }),
|
|
1348
|
+
/* @__PURE__ */ d(
|
|
1349
1349
|
"div",
|
|
1350
1350
|
{
|
|
1351
1351
|
role: "button",
|
|
1352
1352
|
tabIndex: 0,
|
|
1353
1353
|
"aria-label": i("support.attachments_aria", "Attachments upload"),
|
|
1354
|
-
onClick: () => !r &&
|
|
1355
|
-
onDragOver: (
|
|
1356
|
-
|
|
1354
|
+
onClick: () => !r && n.current?.click(),
|
|
1355
|
+
onDragOver: (u) => {
|
|
1356
|
+
u.preventDefault(), r || s(!0);
|
|
1357
1357
|
},
|
|
1358
1358
|
onDragLeave: () => s(!1),
|
|
1359
|
-
onDrop: (
|
|
1360
|
-
|
|
1359
|
+
onDrop: (u) => {
|
|
1360
|
+
u.preventDefault(), s(!1), f(u.dataTransfer?.files ?? null);
|
|
1361
1361
|
},
|
|
1362
1362
|
class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${o ? "border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]" : "border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${r ? "cursor-not-allowed opacity-60" : ""}`,
|
|
1363
1363
|
children: [
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
/* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ a("div", { class: "text-xs text-gray-500", children: i("support.dropzone_text", "Drop images here or click to select") }),
|
|
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
1366
|
max: it
|
|
1367
1367
|
}) })
|
|
1368
1368
|
]
|
|
1369
1369
|
}
|
|
1370
1370
|
),
|
|
1371
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ a(
|
|
1372
1372
|
"input",
|
|
1373
1373
|
{
|
|
1374
|
-
ref:
|
|
1374
|
+
ref: n,
|
|
1375
1375
|
type: "file",
|
|
1376
1376
|
multiple: !0,
|
|
1377
1377
|
accept: yt.join(","),
|
|
1378
1378
|
class: "hidden",
|
|
1379
|
-
onChange: (
|
|
1380
|
-
|
|
1379
|
+
onChange: (u) => {
|
|
1380
|
+
f(u.target.files), u.currentTarget.value = "";
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
1383
|
),
|
|
1384
|
-
|
|
1385
|
-
e.length > 0 && /* @__PURE__ */
|
|
1384
|
+
c && /* @__PURE__ */ a("p", { class: "mt-1 text-xs text-red-600", children: c }),
|
|
1385
|
+
e.length > 0 && /* @__PURE__ */ a("ul", { class: "mt-2 flex flex-col gap-1", children: e.map((u, h) => /* @__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",
|
|
1389
1389
|
children: [
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ a("span", { class: "truncate text-gray-700", children: u.name }),
|
|
1391
|
+
/* @__PURE__ */ a(
|
|
1392
1392
|
"button",
|
|
1393
1393
|
{
|
|
1394
1394
|
type: "button",
|
|
1395
1395
|
onClick: () => {
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1396
|
+
const p = [...e];
|
|
1397
|
+
p.splice(h, 1), t(p);
|
|
1398
1398
|
},
|
|
1399
1399
|
disabled: r,
|
|
1400
1400
|
class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
|
|
1401
|
-
"aria-label": i("support.remove_file_aria", "Remove {filename}", { filename:
|
|
1401
|
+
"aria-label": i("support.remove_file_aria", "Remove {filename}", { filename: u.name }),
|
|
1402
1402
|
children: "✕"
|
|
1403
1403
|
}
|
|
1404
1404
|
)
|
|
1405
1405
|
]
|
|
1406
1406
|
},
|
|
1407
|
-
`${
|
|
1407
|
+
`${u.name}-${u.size}-${h}`
|
|
1408
1408
|
)) })
|
|
1409
1409
|
] });
|
|
1410
1410
|
}
|
|
1411
|
-
const
|
|
1411
|
+
const Pe = {
|
|
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
|
+
}, Te = {
|
|
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
|
|
1422
|
+
function Ee(e, t, r, i) {
|
|
1423
1423
|
if (t === "close") return i("cta.close", "Close");
|
|
1424
1424
|
if (!e) return i("cta.continue", "Continue");
|
|
1425
1425
|
if (!r && e.trial_days && e.interval && e.interval !== "lifetime")
|
|
1426
1426
|
return i("cta.start_trial", "Start {days}-Day Free Trial", { days: e.trial_days });
|
|
1427
1427
|
if (!e.interval || e.interval === "lifetime")
|
|
1428
1428
|
return i("cta.get_lifetime_access", "Get Lifetime Access");
|
|
1429
|
-
const
|
|
1430
|
-
return
|
|
1431
|
-
interval:
|
|
1429
|
+
const n = Pe[e.interval];
|
|
1430
|
+
return n ? i(n, Te[e.interval]) : i("cta.get_plan_generic", "Get {interval} Plan", {
|
|
1431
|
+
interval: je(e.interval)
|
|
1432
1432
|
});
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function je(e) {
|
|
1435
1435
|
return e.length ? e[0].toUpperCase() + e.slice(1) : e;
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1438
|
-
const { t: r } =
|
|
1439
|
-
return /* @__PURE__ */
|
|
1437
|
+
function ze({ block: e, ctx: t }) {
|
|
1438
|
+
const { t: r } = k(), [i, n] = x(!1), o = e.priceId ?? t.selectedPriceId, s = i || e.action === "checkout" && !o, c = o ? t.bootstrap.prices.find((h) => h.id === o) ?? null : null, l = t.bootstrap.user?.had_previous_trial ?? !1, f = e.label ?? Ee(c, e.action, l, r);
|
|
1439
|
+
return /* @__PURE__ */ d(
|
|
1440
1440
|
"button",
|
|
1441
1441
|
{
|
|
1442
1442
|
type: "button",
|
|
1443
1443
|
disabled: s,
|
|
1444
1444
|
onClick: async () => {
|
|
1445
1445
|
if (!s) {
|
|
1446
|
-
|
|
1446
|
+
n(!0);
|
|
1447
1447
|
try {
|
|
1448
1448
|
await t.onAction(e.action, { priceId: o });
|
|
1449
1449
|
} finally {
|
|
1450
|
-
|
|
1450
|
+
n(!1);
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
1453
|
},
|
|
@@ -1457,7 +1457,7 @@ function je({ block: e, ctx: t }) {
|
|
|
1457
1457
|
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)"
|
|
1458
1458
|
},
|
|
1459
1459
|
children: [
|
|
1460
|
-
/* @__PURE__ */
|
|
1460
|
+
/* @__PURE__ */ a(
|
|
1461
1461
|
"span",
|
|
1462
1462
|
{
|
|
1463
1463
|
class: "absolute inset-0 opacity-40",
|
|
@@ -1467,16 +1467,16 @@ function je({ block: e, ctx: t }) {
|
|
|
1467
1467
|
"aria-hidden": "true"
|
|
1468
1468
|
}
|
|
1469
1469
|
),
|
|
1470
|
-
i ? /* @__PURE__ */
|
|
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: f })
|
|
1471
1471
|
]
|
|
1472
1472
|
}
|
|
1473
1473
|
);
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const { t } =
|
|
1475
|
+
function Be({ ctx: e }) {
|
|
1476
|
+
const { t } = k(), r = e.authSession, i = e.auth, [n, o] = x(!1), s = () => e.onAction("support");
|
|
1477
1477
|
if (r && !r.user.is_anonymous) {
|
|
1478
|
-
const
|
|
1479
|
-
if (!(!i ||
|
|
1478
|
+
const c = async () => {
|
|
1479
|
+
if (!(!i || n)) {
|
|
1480
1480
|
o(!0);
|
|
1481
1481
|
try {
|
|
1482
1482
|
await i.signOut();
|
|
@@ -1486,23 +1486,23 @@ function ze({ ctx: e }) {
|
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
1488
|
};
|
|
1489
|
-
return /* @__PURE__ */
|
|
1490
|
-
/* @__PURE__ */
|
|
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
|
+
/* @__PURE__ */ d("span", { children: [
|
|
1491
1491
|
t("session.signed_in_as_prefix", "Signed in as"),
|
|
1492
1492
|
" ",
|
|
1493
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ a("b", { class: "font-medium text-gray-700", children: r.user.email })
|
|
1494
1494
|
] }),
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ d("div", { class: "flex items-center justify-center gap-3", children: [
|
|
1496
|
+
/* @__PURE__ */ a(q, { onClick: c, disabled: !i || n, children: n ? t("session.signing_out", "Signing out…") : t("session.sign_out", "Sign Out") }),
|
|
1497
|
+
/* @__PURE__ */ a(kt, {}),
|
|
1498
|
+
/* @__PURE__ */ a(q, { onClick: s, children: t("session.contact_support", "Contact Support") })
|
|
1499
1499
|
] })
|
|
1500
1500
|
] });
|
|
1501
1501
|
}
|
|
1502
|
-
return /* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
/* @__PURE__ */
|
|
1505
|
-
/* @__PURE__ */
|
|
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(q, { onClick: () => e.onAction("restore"), children: t("session.restore_purchases", "Restore purchases") }),
|
|
1504
|
+
/* @__PURE__ */ a(kt, {}),
|
|
1505
|
+
/* @__PURE__ */ a(q, { onClick: s, children: t("session.contact_support", "Contact Support") })
|
|
1506
1506
|
] });
|
|
1507
1507
|
}
|
|
1508
1508
|
function q({
|
|
@@ -1510,7 +1510,7 @@ function q({
|
|
|
1510
1510
|
disabled: t,
|
|
1511
1511
|
children: r
|
|
1512
1512
|
}) {
|
|
1513
|
-
return /* @__PURE__ */
|
|
1513
|
+
return /* @__PURE__ */ a(
|
|
1514
1514
|
"button",
|
|
1515
1515
|
{
|
|
1516
1516
|
type: "button",
|
|
@@ -1523,11 +1523,11 @@ function q({
|
|
|
1523
1523
|
);
|
|
1524
1524
|
}
|
|
1525
1525
|
function kt() {
|
|
1526
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ a("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1529
|
-
return e.items.length ? /* @__PURE__ */
|
|
1530
|
-
/* @__PURE__ */
|
|
1528
|
+
function Oe({ block: e }) {
|
|
1529
|
+
return e.items.length ? /* @__PURE__ */ a("ul", { class: "flex flex-col gap-2.5", role: "list", children: e.items.map((t) => /* @__PURE__ */ d("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
|
|
1530
|
+
/* @__PURE__ */ a(
|
|
1531
1531
|
"svg",
|
|
1532
1532
|
{
|
|
1533
1533
|
width: "18",
|
|
@@ -1536,7 +1536,7 @@ function Be({ block: e }) {
|
|
|
1536
1536
|
fill: "none",
|
|
1537
1537
|
class: "mt-0.5 flex-shrink-0 text-emerald-500",
|
|
1538
1538
|
"aria-hidden": "true",
|
|
1539
|
-
children: /* @__PURE__ */
|
|
1539
|
+
children: /* @__PURE__ */ a(
|
|
1540
1540
|
"path",
|
|
1541
1541
|
{
|
|
1542
1542
|
d: "M4 10.5l3.5 3.5 8.5-8.5",
|
|
@@ -1548,32 +1548,32 @@ function Be({ block: e }) {
|
|
|
1548
1548
|
)
|
|
1549
1549
|
}
|
|
1550
1550
|
),
|
|
1551
|
-
/* @__PURE__ */
|
|
1552
|
-
/* @__PURE__ */
|
|
1553
|
-
t.desc ? /* @__PURE__ */
|
|
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: t.name }),
|
|
1553
|
+
t.desc ? /* @__PURE__ */ a("span", { class: "text-xs leading-relaxed text-gray-400", children: t.desc }) : null
|
|
1554
1554
|
] })
|
|
1555
1555
|
] }, t.id)) }) : null;
|
|
1556
1556
|
}
|
|
1557
|
-
function
|
|
1558
|
-
const { t } =
|
|
1559
|
-
return /* @__PURE__ */
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
|
|
1562
|
-
o ? /* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1557
|
+
function Fe({ block: e }) {
|
|
1558
|
+
const { t } = k(), r = e.title ?? t("pricing.money_back", "30-day money-back guarantee"), i = e.subtitle, n = (e.icon ?? "dollar_shield") !== "none", o = Re(r);
|
|
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
|
+
/* @__PURE__ */ d("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
|
|
1561
|
+
n ? /* @__PURE__ */ a(Ue, {}) : null,
|
|
1562
|
+
o ? /* @__PURE__ */ d("span", { children: [
|
|
1563
|
+
/* @__PURE__ */ a("b", { class: "font-bold text-gray-900", children: o.bold }),
|
|
1564
1564
|
" ",
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
] }) : /* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ a("span", { class: "font-medium", children: o.rest })
|
|
1566
|
+
] }) : /* @__PURE__ */ a("span", { class: "font-medium", children: r })
|
|
1567
1567
|
] }),
|
|
1568
|
-
i ? /* @__PURE__ */
|
|
1568
|
+
i ? /* @__PURE__ */ a("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: i }) : null
|
|
1569
1569
|
] });
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1571
|
+
function Re(e) {
|
|
1572
1572
|
const t = e.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
|
|
1573
1573
|
return t ? { bold: t[1], rest: t[2] } : null;
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return /* @__PURE__ */
|
|
1575
|
+
function Ue() {
|
|
1576
|
+
return /* @__PURE__ */ d(
|
|
1577
1577
|
"svg",
|
|
1578
1578
|
{
|
|
1579
1579
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1584,7 +1584,7 @@ function Re() {
|
|
|
1584
1584
|
class: "flex-shrink-0 text-emerald-500",
|
|
1585
1585
|
"aria-hidden": "true",
|
|
1586
1586
|
children: [
|
|
1587
|
-
/* @__PURE__ */
|
|
1587
|
+
/* @__PURE__ */ a(
|
|
1588
1588
|
"path",
|
|
1589
1589
|
{
|
|
1590
1590
|
d: "M12 2 4 5v6c0 5.25 3.5 9.5 8 11 4.5-1.5 8-5.75 8-11V5l-8-3Z",
|
|
@@ -1593,7 +1593,7 @@ function Re() {
|
|
|
1593
1593
|
"stroke-linejoin": "round"
|
|
1594
1594
|
}
|
|
1595
1595
|
),
|
|
1596
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ a(
|
|
1597
1597
|
"path",
|
|
1598
1598
|
{
|
|
1599
1599
|
d: "m9 12 2 2 4-4",
|
|
@@ -1607,22 +1607,22 @@ function Re() {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
);
|
|
1609
1609
|
}
|
|
1610
|
-
const Ft = 24,
|
|
1611
|
-
function
|
|
1612
|
-
const r = t *
|
|
1610
|
+
const Ft = 24, De = 16, Ne = 2;
|
|
1611
|
+
function $e(e, t) {
|
|
1612
|
+
const r = t * Ne;
|
|
1613
1613
|
let i = Ft;
|
|
1614
|
-
for (e.style.fontSize = `${i}px`; e.scrollHeight > r && i >
|
|
1614
|
+
for (e.style.fontSize = `${i}px`; e.scrollHeight > r && i > De; )
|
|
1615
1615
|
i -= 1, e.style.fontSize = `${i}px`;
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1618
|
-
const r = e.level ?? 1, i = `h${r}`,
|
|
1619
|
-
return
|
|
1617
|
+
function He({ block: e, ctx: t }) {
|
|
1618
|
+
const r = e.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", o = F(null), s = r === 1 && !!t.bootstrap.settings.title_auto_fit;
|
|
1619
|
+
return T(() => {
|
|
1620
1620
|
if (!s || !o.current) return;
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1623
|
-
}, [s, e.text]), /* @__PURE__ */
|
|
1621
|
+
const c = getComputedStyle(o.current), l = parseFloat(c.lineHeight) || Ft * 1.5;
|
|
1622
|
+
$e(o.current, l);
|
|
1623
|
+
}, [s, e.text]), /* @__PURE__ */ a(i, { ref: o, class: n, children: e.text });
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1625
|
+
function Ve(e) {
|
|
1626
1626
|
const t = e.local ?? { currency: e.currency, amount: e.amount };
|
|
1627
1627
|
if (e.interval === "year") {
|
|
1628
1628
|
const r = (e.interval_count ?? 1) * 12;
|
|
@@ -1640,21 +1640,21 @@ function nt(e, t) {
|
|
|
1640
1640
|
maximumFractionDigits: r,
|
|
1641
1641
|
minimumFractionDigits: r
|
|
1642
1642
|
}).formatToParts(e);
|
|
1643
|
-
let
|
|
1643
|
+
let n = "", o = "";
|
|
1644
1644
|
for (const s of i)
|
|
1645
|
-
s.type === "currency" ?
|
|
1646
|
-
return { currency:
|
|
1645
|
+
s.type === "currency" ? n = s.value : s.type !== "literal" && (o += s.value);
|
|
1646
|
+
return { currency: n || t, amount: o.trim() };
|
|
1647
1647
|
} catch {
|
|
1648
1648
|
return { currency: t, amount: String(e) };
|
|
1649
1649
|
}
|
|
1650
1650
|
}
|
|
1651
1651
|
function st(e, t) {
|
|
1652
|
-
const { amount: r, currency: i } =
|
|
1652
|
+
const { amount: r, currency: i } = Ve(e);
|
|
1653
1653
|
if (!t) {
|
|
1654
|
-
const { currency:
|
|
1655
|
-
return { currency:
|
|
1654
|
+
const { currency: c, amount: l } = nt(r, i);
|
|
1655
|
+
return { currency: c, amount: l, originalAmount: null };
|
|
1656
1656
|
}
|
|
1657
|
-
const
|
|
1657
|
+
const n = r * (1 - t / 100), o = nt(n, i), s = nt(r, i);
|
|
1658
1658
|
return {
|
|
1659
1659
|
currency: o.currency,
|
|
1660
1660
|
amount: o.amount,
|
|
@@ -1680,23 +1680,23 @@ function lt(e, t) {
|
|
|
1680
1680
|
const r = e.interval_count ?? 1;
|
|
1681
1681
|
return r === 1 ? t(`pricing.interval.${e.interval}`, e.interval) : `${r} ${e.interval}s`;
|
|
1682
1682
|
}
|
|
1683
|
-
function
|
|
1684
|
-
const { t: r } =
|
|
1685
|
-
if (
|
|
1686
|
-
return /* @__PURE__ */
|
|
1683
|
+
function Ge({ block: e, ctx: t }) {
|
|
1684
|
+
const { t: r } = k(), i = e.priceIds && e.priceIds.length > 0 ? new Set(e.priceIds) : null, n = t.bootstrap.prices.filter((s) => !i || i.has(s.id));
|
|
1685
|
+
if (n.length === 0)
|
|
1686
|
+
return /* @__PURE__ */ a("p", { class: "text-sm text-gray-500", children: r("pricing.no_prices", "No prices available.") });
|
|
1687
1687
|
const o = e.popular_label ?? r("pricing.most_popular", "Most popular");
|
|
1688
1688
|
if (e.view === "compact")
|
|
1689
|
-
return /* @__PURE__ */
|
|
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:
|
|
1696
|
-
|
|
1695
|
+
children: n.map((s, c) => /* @__PURE__ */ a(
|
|
1696
|
+
We,
|
|
1697
1697
|
{
|
|
1698
1698
|
price: s,
|
|
1699
|
-
isLast:
|
|
1699
|
+
isLast: c === n.length - 1,
|
|
1700
1700
|
isPopular: e.popular_price_id === s.id,
|
|
1701
1701
|
popularLabel: o,
|
|
1702
1702
|
offer: H(t.bootstrap.offers, s.id),
|
|
@@ -1711,24 +1711,24 @@ function Ve({ block: e, ctx: t }) {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
);
|
|
1713
1713
|
if (e.view === "horizontal") {
|
|
1714
|
-
const s = Math.min(
|
|
1714
|
+
const s = Math.min(n.length, 3), c = n.some(
|
|
1715
1715
|
(l) => (H(t.bootstrap.offers, l.id)?.discount_percent ?? 0) > 0
|
|
1716
1716
|
);
|
|
1717
|
-
return /* @__PURE__ */
|
|
1717
|
+
return /* @__PURE__ */ a(
|
|
1718
1718
|
"div",
|
|
1719
1719
|
{
|
|
1720
1720
|
class: "grid items-stretch gap-2",
|
|
1721
1721
|
style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
|
|
1722
1722
|
role: "radiogroup",
|
|
1723
1723
|
"aria-label": r("pricing.plans_aria", "Plans"),
|
|
1724
|
-
children:
|
|
1725
|
-
|
|
1724
|
+
children: n.map((l) => /* @__PURE__ */ a(
|
|
1725
|
+
Ze,
|
|
1726
1726
|
{
|
|
1727
1727
|
price: l,
|
|
1728
1728
|
isPopular: e.popular_price_id === l.id,
|
|
1729
1729
|
popularLabel: o,
|
|
1730
1730
|
offer: H(t.bootstrap.offers, l.id),
|
|
1731
|
-
reserveStrikeRow:
|
|
1731
|
+
reserveStrikeRow: c,
|
|
1732
1732
|
selected: t.selectedPriceId === l.id,
|
|
1733
1733
|
onSelect: () => {
|
|
1734
1734
|
t.setSelectedPriceId(l.id), t.onAction("price_selected", { priceId: l.id, price: l });
|
|
@@ -1740,20 +1740,20 @@ function Ve({ block: e, ctx: t }) {
|
|
|
1740
1740
|
}
|
|
1741
1741
|
);
|
|
1742
1742
|
}
|
|
1743
|
-
return /* @__PURE__ */
|
|
1743
|
+
return /* @__PURE__ */ a(
|
|
1744
1744
|
"div",
|
|
1745
1745
|
{
|
|
1746
1746
|
class: "flex flex-col gap-2",
|
|
1747
1747
|
role: "radiogroup",
|
|
1748
1748
|
"aria-label": r("pricing.plans_aria", "Plans"),
|
|
1749
|
-
children:
|
|
1750
|
-
const
|
|
1751
|
-
return /* @__PURE__ */
|
|
1749
|
+
children: n.map((s) => {
|
|
1750
|
+
const c = t.selectedPriceId === s.id, l = e.popular_price_id === s.id, u = H(t.bootstrap.offers, s.id)?.discount_percent ?? null, { currency: h, amount: p, originalAmount: _ } = st(s, u);
|
|
1751
|
+
return /* @__PURE__ */ d(
|
|
1752
1752
|
"button",
|
|
1753
1753
|
{
|
|
1754
1754
|
type: "button",
|
|
1755
1755
|
role: "radio",
|
|
1756
|
-
"aria-checked":
|
|
1756
|
+
"aria-checked": c,
|
|
1757
1757
|
onClick: () => {
|
|
1758
1758
|
t.setSelectedPriceId(s.id), t.onAction("price_selected", { priceId: s.id, price: s });
|
|
1759
1759
|
},
|
|
@@ -1762,26 +1762,26 @@ function Ve({ block: e, ctx: t }) {
|
|
|
1762
1762
|
// Везде border 2px — selection выражается только цветом, layout
|
|
1763
1763
|
// не прыгает (равная толщина у selected/unselected). Цветовая
|
|
1764
1764
|
// разница accent vs gray достаточно сильная для visual hierarchy.
|
|
1765
|
-
|
|
1765
|
+
c ? "border-[var(--pw-accent)] bg-transparent" : "border-gray-200 bg-transparent hover:bg-gray-50"
|
|
1766
1766
|
].join(" "),
|
|
1767
1767
|
children: [
|
|
1768
|
-
/* @__PURE__ */
|
|
1768
|
+
/* @__PURE__ */ a(
|
|
1769
1769
|
"span",
|
|
1770
1770
|
{
|
|
1771
1771
|
class: [
|
|
1772
1772
|
"flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
1773
|
-
|
|
1773
|
+
c ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent",
|
|
1774
1774
|
// Popular-label badge сидит absolute сверху-справа карточки и
|
|
1775
1775
|
// визуально сдвигает центр content'а вниз. flex items-center
|
|
1776
1776
|
// на карточке держит галочку по геометрическому центру, что
|
|
1777
1777
|
// делает её визуально выше — компенсируем небольшим mt'ом.
|
|
1778
1778
|
l ? "mt-3" : ""
|
|
1779
1779
|
].join(" "),
|
|
1780
|
-
style:
|
|
1780
|
+
style: c ? {
|
|
1781
1781
|
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%)"
|
|
1782
1782
|
} : void 0,
|
|
1783
1783
|
"aria-hidden": "true",
|
|
1784
|
-
children: /* @__PURE__ */
|
|
1784
|
+
children: /* @__PURE__ */ a(
|
|
1785
1785
|
"svg",
|
|
1786
1786
|
{
|
|
1787
1787
|
width: "14",
|
|
@@ -1789,8 +1789,8 @@ function Ve({ block: e, ctx: t }) {
|
|
|
1789
1789
|
viewBox: "0 0 17 12",
|
|
1790
1790
|
fill: "none",
|
|
1791
1791
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1792
|
-
class:
|
|
1793
|
-
children: /* @__PURE__ */
|
|
1792
|
+
class: c ? "opacity-100" : "opacity-0",
|
|
1793
|
+
children: /* @__PURE__ */ a(
|
|
1794
1794
|
"path",
|
|
1795
1795
|
{
|
|
1796
1796
|
d: "M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",
|
|
@@ -1801,37 +1801,37 @@ function Ve({ block: e, ctx: t }) {
|
|
|
1801
1801
|
)
|
|
1802
1802
|
}
|
|
1803
1803
|
),
|
|
1804
|
-
/* @__PURE__ */
|
|
1805
|
-
/* @__PURE__ */
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
|
|
1804
|
+
/* @__PURE__ */ d("div", { class: "flex flex-1 flex-col gap-0.5", children: [
|
|
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: Rt(s, r) }),
|
|
1807
|
+
_ ? (
|
|
1808
1808
|
// opacity-60 приглушает strike: глаз сначала ловит label
|
|
1809
1809
|
// и discount-badge, потом main price; original «бывшая цена»
|
|
1810
1810
|
// — третичная информация, не должна конкурировать с label.
|
|
1811
|
-
/* @__PURE__ */
|
|
1811
|
+
/* @__PURE__ */ a("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: _ })
|
|
1812
1812
|
) : null,
|
|
1813
|
-
|
|
1813
|
+
u ? (
|
|
1814
1814
|
// Emerald pill — фиксированный «успех/выгода», не зависит от
|
|
1815
1815
|
// brand_color. Читается даже на тёмных бренд-акцентах.
|
|
1816
|
-
/* @__PURE__ */
|
|
1816
|
+
/* @__PURE__ */ d("span", { class: "rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700", children: [
|
|
1817
1817
|
"-",
|
|
1818
|
-
|
|
1818
|
+
u,
|
|
1819
1819
|
"%"
|
|
1820
1820
|
] })
|
|
1821
1821
|
) : null
|
|
1822
1822
|
] }),
|
|
1823
|
-
/* @__PURE__ */
|
|
1824
|
-
/* @__PURE__ */
|
|
1825
|
-
|
|
1826
|
-
/* @__PURE__ */
|
|
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: h }),
|
|
1825
|
+
p,
|
|
1826
|
+
/* @__PURE__ */ d("span", { class: "text-sm font-normal text-gray-500", children: [
|
|
1827
1827
|
" ",
|
|
1828
1828
|
"/ ",
|
|
1829
1829
|
lt(s, r)
|
|
1830
1830
|
] })
|
|
1831
1831
|
] }) }),
|
|
1832
|
-
s.description ? /* @__PURE__ */
|
|
1832
|
+
s.description ? /* @__PURE__ */ a("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: s.description }) : null
|
|
1833
1833
|
] }),
|
|
1834
|
-
l ? /* @__PURE__ */
|
|
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",
|
|
@@ -1847,21 +1847,21 @@ function Ve({ block: e, ctx: t }) {
|
|
|
1847
1847
|
}
|
|
1848
1848
|
);
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function qe(e, t) {
|
|
1851
1851
|
return e.label ? e.label : !e.interval || e.interval === "lifetime" ? t("pricing.interval.lifetime_short", "lifetime") : t(`pricing.interval.${e.interval}`, e.interval);
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1853
|
+
function We({
|
|
1854
1854
|
price: e,
|
|
1855
1855
|
isLast: t,
|
|
1856
1856
|
isPopular: r,
|
|
1857
1857
|
popularLabel: i,
|
|
1858
|
-
offer:
|
|
1858
|
+
offer: n,
|
|
1859
1859
|
selected: o,
|
|
1860
1860
|
onSelect: s,
|
|
1861
|
-
t:
|
|
1861
|
+
t: c
|
|
1862
1862
|
}) {
|
|
1863
|
-
const l =
|
|
1864
|
-
return /* @__PURE__ */
|
|
1863
|
+
const l = n?.discount_percent ?? null, { currency: f, amount: u, originalAmount: h } = st(e, l);
|
|
1864
|
+
return /* @__PURE__ */ d(
|
|
1865
1865
|
"button",
|
|
1866
1866
|
{
|
|
1867
1867
|
type: "button",
|
|
@@ -1870,7 +1870,7 @@ function qe({
|
|
|
1870
1870
|
onClick: s,
|
|
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
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ a(
|
|
1874
1874
|
"span",
|
|
1875
1875
|
{
|
|
1876
1876
|
class: [
|
|
@@ -1881,7 +1881,7 @@ function qe({
|
|
|
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",
|
|
1884
|
-
children: /* @__PURE__ */
|
|
1884
|
+
children: /* @__PURE__ */ a(
|
|
1885
1885
|
"svg",
|
|
1886
1886
|
{
|
|
1887
1887
|
width: "14",
|
|
@@ -1890,7 +1890,7 @@ function qe({
|
|
|
1890
1890
|
fill: "none",
|
|
1891
1891
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1892
1892
|
class: o ? "opacity-100" : "opacity-0",
|
|
1893
|
-
children: /* @__PURE__ */
|
|
1893
|
+
children: /* @__PURE__ */ a(
|
|
1894
1894
|
"path",
|
|
1895
1895
|
{
|
|
1896
1896
|
d: "M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",
|
|
@@ -1901,7 +1901,7 @@ function qe({
|
|
|
1901
1901
|
)
|
|
1902
1902
|
}
|
|
1903
1903
|
),
|
|
1904
|
-
/* @__PURE__ */
|
|
1904
|
+
/* @__PURE__ */ d(
|
|
1905
1905
|
"div",
|
|
1906
1906
|
{
|
|
1907
1907
|
class: [
|
|
@@ -1909,13 +1909,13 @@ function qe({
|
|
|
1909
1909
|
t ? "" : "border-b border-gray-200"
|
|
1910
1910
|
].join(" "),
|
|
1911
1911
|
children: [
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
/* @__PURE__ */
|
|
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: qe(e, c) }),
|
|
1914
1914
|
r ? (
|
|
1915
1915
|
// Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
|
|
1916
1916
|
// Низкий visual weight: pill про "имя плана" (most popular), а не
|
|
1917
1917
|
// про savings — не должна конкурировать с -X% discount-pill.
|
|
1918
|
-
/* @__PURE__ */
|
|
1918
|
+
/* @__PURE__ */ a(
|
|
1919
1919
|
"span",
|
|
1920
1920
|
{
|
|
1921
1921
|
class: "rounded-[9px] px-2 py-1 text-[10px] font-bold",
|
|
@@ -1927,22 +1927,22 @@ function qe({
|
|
|
1927
1927
|
}
|
|
1928
1928
|
)
|
|
1929
1929
|
) : null,
|
|
1930
|
-
l ? /* @__PURE__ */
|
|
1930
|
+
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: [
|
|
1931
1931
|
"-",
|
|
1932
1932
|
l,
|
|
1933
1933
|
"%"
|
|
1934
1934
|
] }) : null
|
|
1935
1935
|
] }),
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1941
|
-
|
|
1942
|
-
/* @__PURE__ */
|
|
1936
|
+
/* @__PURE__ */ a("div", { class: "flex-1" }),
|
|
1937
|
+
/* @__PURE__ */ d("span", { class: "flex items-baseline gap-1.5 text-base font-normal text-gray-600", children: [
|
|
1938
|
+
h ? /* @__PURE__ */ a("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: h }) : null,
|
|
1939
|
+
/* @__PURE__ */ d("span", { class: "whitespace-nowrap", children: [
|
|
1940
|
+
/* @__PURE__ */ a("span", { class: "opacity-90", children: f }),
|
|
1941
|
+
u,
|
|
1942
|
+
/* @__PURE__ */ d("span", { class: "text-xs text-gray-400", children: [
|
|
1943
1943
|
" ",
|
|
1944
1944
|
"/ ",
|
|
1945
|
-
lt(e,
|
|
1945
|
+
lt(e, c)
|
|
1946
1946
|
] })
|
|
1947
1947
|
] })
|
|
1948
1948
|
] })
|
|
@@ -1953,18 +1953,18 @@ function qe({
|
|
|
1953
1953
|
}
|
|
1954
1954
|
);
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1956
|
+
function Ze({
|
|
1957
1957
|
price: e,
|
|
1958
1958
|
isPopular: t,
|
|
1959
1959
|
popularLabel: r,
|
|
1960
1960
|
offer: i,
|
|
1961
|
-
reserveStrikeRow:
|
|
1961
|
+
reserveStrikeRow: n,
|
|
1962
1962
|
selected: o,
|
|
1963
1963
|
onSelect: s,
|
|
1964
|
-
t:
|
|
1964
|
+
t: c
|
|
1965
1965
|
}) {
|
|
1966
|
-
const l = i?.discount_percent ?? null, { currency:
|
|
1967
|
-
return /* @__PURE__ */
|
|
1966
|
+
const l = i?.discount_percent ?? null, { currency: f, amount: u, originalAmount: h } = st(e, l);
|
|
1967
|
+
return /* @__PURE__ */ d(
|
|
1968
1968
|
"button",
|
|
1969
1969
|
{
|
|
1970
1970
|
type: "button",
|
|
@@ -1977,24 +1977,24 @@ function We({
|
|
|
1977
1977
|
].join(" "),
|
|
1978
1978
|
style: o ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
|
|
1979
1979
|
children: [
|
|
1980
|
-
/* @__PURE__ */
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
l ? /* @__PURE__ */
|
|
1980
|
+
/* @__PURE__ */ a("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: Rt(e, c) }),
|
|
1981
|
+
n ? /* @__PURE__ */ d("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
|
|
1982
|
+
h ? /* @__PURE__ */ a("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: h }) : null,
|
|
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,
|
|
1986
1986
|
"%"
|
|
1987
1987
|
] }) : null
|
|
1988
1988
|
] }) : null,
|
|
1989
|
-
/* @__PURE__ */
|
|
1990
|
-
/* @__PURE__ */
|
|
1991
|
-
|
|
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: f }),
|
|
1991
|
+
u
|
|
1992
1992
|
] }),
|
|
1993
|
-
/* @__PURE__ */
|
|
1993
|
+
/* @__PURE__ */ d("span", { class: "text-xs font-normal text-gray-500", children: [
|
|
1994
1994
|
"/ ",
|
|
1995
|
-
lt(e,
|
|
1995
|
+
lt(e, c)
|
|
1996
1996
|
] }),
|
|
1997
|
-
t ? /* @__PURE__ */
|
|
1997
|
+
t ? /* @__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,29 +2006,29 @@ function We({
|
|
|
2006
2006
|
}
|
|
2007
2007
|
);
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2010
|
-
return /* @__PURE__ */
|
|
2009
|
+
function Ke({ block: e }) {
|
|
2010
|
+
return /* @__PURE__ */ a("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: e.text });
|
|
2011
2011
|
}
|
|
2012
|
-
const
|
|
2012
|
+
const Ye = {
|
|
2013
2013
|
week: 0.25,
|
|
2014
2014
|
month: 1,
|
|
2015
2015
|
year: 12
|
|
2016
2016
|
};
|
|
2017
|
-
function
|
|
2017
|
+
function Xe(e, t) {
|
|
2018
2018
|
return e ? t(`pricing.interval.${e}`, e) : t("pricing.interval.period", "period");
|
|
2019
2019
|
}
|
|
2020
|
-
function
|
|
2021
|
-
const { t: r } =
|
|
2020
|
+
function Je({ block: e, ctx: t }) {
|
|
2021
|
+
const { t: r } = k();
|
|
2022
2022
|
if (!e.queries.length) return null;
|
|
2023
|
-
const
|
|
2024
|
-
return /* @__PURE__ */
|
|
2025
|
-
/* @__PURE__ */
|
|
2026
|
-
interval:
|
|
2023
|
+
const n = t.bootstrap.prices.find((s) => s.id === t.selectedPriceId)?.interval ?? null, o = n ? Ye[n] : void 0;
|
|
2024
|
+
return /* @__PURE__ */ d("div", { class: "flex flex-col gap-2", children: [
|
|
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: Xe(n, r)
|
|
2027
2027
|
}) }),
|
|
2028
|
-
/* @__PURE__ */
|
|
2029
|
-
const
|
|
2030
|
-
return /* @__PURE__ */
|
|
2031
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ a("ul", { class: "flex flex-col gap-2", role: "list", children: e.queries.map((s) => {
|
|
2029
|
+
const c = Number.isFinite(s.count) ? s.count : 0, l = o !== void 0 ? Math.round(c * o) : c;
|
|
2030
|
+
return /* @__PURE__ */ d("li", { class: `flex gap-3 ${s.desc ? "items-start" : "items-center"}`, children: [
|
|
2031
|
+
/* @__PURE__ */ a(
|
|
2032
2032
|
"svg",
|
|
2033
2033
|
{
|
|
2034
2034
|
width: "18",
|
|
@@ -2037,7 +2037,7 @@ function Xe({ block: e, ctx: t }) {
|
|
|
2037
2037
|
fill: "none",
|
|
2038
2038
|
class: `flex-shrink-0 text-emerald-500 ${s.desc ? "mt-0.5" : ""}`,
|
|
2039
2039
|
"aria-hidden": "true",
|
|
2040
|
-
children: /* @__PURE__ */
|
|
2040
|
+
children: /* @__PURE__ */ a(
|
|
2041
2041
|
"path",
|
|
2042
2042
|
{
|
|
2043
2043
|
d: "M4 10.5l3.5 3.5 8.5-8.5",
|
|
@@ -2049,223 +2049,235 @@ function Xe({ block: e, ctx: t }) {
|
|
|
2049
2049
|
)
|
|
2050
2050
|
}
|
|
2051
2051
|
),
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2052
|
+
/* @__PURE__ */ d("div", { children: [
|
|
2053
|
+
/* @__PURE__ */ a("span", { class: "font-semibold text-gray-900 text-sm", children: l }),
|
|
2054
2054
|
" ",
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
s.desc ? /* @__PURE__ */
|
|
2057
|
-
/* @__PURE__ */
|
|
2058
|
-
/* @__PURE__ */
|
|
2055
|
+
/* @__PURE__ */ a("span", { class: "text-sm text-gray-800", children: s.name }),
|
|
2056
|
+
s.desc ? /* @__PURE__ */ d(ot, { children: [
|
|
2057
|
+
/* @__PURE__ */ a("br", {}),
|
|
2058
|
+
/* @__PURE__ */ a("span", { class: "text-xs text-gray-400", children: s.desc })
|
|
2059
2059
|
] }) : null
|
|
2060
2060
|
] })
|
|
2061
2061
|
] }, s.id);
|
|
2062
2062
|
}) })
|
|
2063
2063
|
] });
|
|
2064
2064
|
}
|
|
2065
|
-
const
|
|
2066
|
-
heading:
|
|
2067
|
-
text:
|
|
2068
|
-
price_grid:
|
|
2069
|
-
cta_button:
|
|
2065
|
+
const Qe = {
|
|
2066
|
+
heading: He,
|
|
2067
|
+
text: Ke,
|
|
2068
|
+
price_grid: Ge,
|
|
2069
|
+
cta_button: ze,
|
|
2070
2070
|
auth_panel: Tt,
|
|
2071
|
-
current_session:
|
|
2072
|
-
features_list:
|
|
2073
|
-
tokenization_gate:
|
|
2074
|
-
guarantee_badge:
|
|
2075
|
-
offer_banner:
|
|
2071
|
+
current_session: Be,
|
|
2072
|
+
features_list: Oe,
|
|
2073
|
+
tokenization_gate: Je,
|
|
2074
|
+
guarantee_badge: Fe,
|
|
2075
|
+
offer_banner: ke
|
|
2076
2076
|
};
|
|
2077
|
-
function
|
|
2078
|
-
const s =
|
|
2079
|
-
for (const
|
|
2080
|
-
if (
|
|
2081
|
-
return
|
|
2077
|
+
function tr({ layout: e, bootstrap: t, onAction: r, auth: i, authSession: n, hasTopBanner: o }) {
|
|
2078
|
+
const s = qt(() => {
|
|
2079
|
+
for (const y of e.blocks)
|
|
2080
|
+
if (y.type === "price_grid" && y.popular_price_id && t.prices.some((S) => S.id === y.popular_price_id))
|
|
2081
|
+
return y.popular_price_id;
|
|
2082
2082
|
return t.prices[0]?.id ?? null;
|
|
2083
|
-
}, [e.blocks, t.prices]), [
|
|
2083
|
+
}, [e.blocks, t.prices]), [c, l] = x(s), f = {
|
|
2084
2084
|
bootstrap: t,
|
|
2085
|
-
selectedPriceId:
|
|
2085
|
+
selectedPriceId: c,
|
|
2086
2086
|
setSelectedPriceId: l,
|
|
2087
2087
|
onAction: r,
|
|
2088
2088
|
auth: i,
|
|
2089
|
-
authSession:
|
|
2090
|
-
},
|
|
2091
|
-
const
|
|
2092
|
-
return
|
|
2089
|
+
authSession: n
|
|
2090
|
+
}, u = e.blocks.findIndex((y) => y.type === "cta_button"), h = u === -1 ? e.blocks : e.blocks.slice(0, u), p = u === -1 ? [] : e.blocks.slice(u), _ = (y, S) => {
|
|
2091
|
+
const g = Qe[y.type];
|
|
2092
|
+
return g ? /* @__PURE__ */ a(g, { block: y, ctx: f }, `${y.type}-${S}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${y.type}`), null);
|
|
2093
2093
|
};
|
|
2094
|
-
return /* @__PURE__ */
|
|
2095
|
-
/* @__PURE__ */
|
|
2096
|
-
|
|
2094
|
+
return /* @__PURE__ */ d(ot, { 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: h.map(_) }) }),
|
|
2096
|
+
p.length > 0 ? (
|
|
2097
2097
|
// Тонкий shadow-top вместо border-t — создаёт depth, читается как
|
|
2098
2098
|
// «footer закреплён к низу dialog'а». Линия выглядела как divider
|
|
2099
2099
|
// в обычном flow, не передавала sticky-character.
|
|
2100
|
-
/* @__PURE__ */
|
|
2100
|
+
/* @__PURE__ */ a(
|
|
2101
2101
|
"div",
|
|
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: p.map((y, S) => _(y, h.length + S))
|
|
2106
2106
|
}
|
|
2107
2107
|
)
|
|
2108
2108
|
) : null
|
|
2109
2109
|
] });
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2112
|
-
return e ? i ? { open: !0, view: "purchased", error: null } : t.status === "idle" || t.status === "loading" ? { open: !0, view: "loading", error: null } : t.status === "error" ? { open: !0, view: "error", error: t.error } : r.kind === "support" ? { open: !0, view: "support", error: null } : r.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : r.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : r.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : r.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : r.kind === "verifying" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
|
|
2111
|
+
function er(e, t, r, i) {
|
|
2112
|
+
return e ? i ? { open: !0, view: "purchased", error: null } : t.status === "idle" || t.status === "loading" ? { open: !0, view: "loading", error: null } : t.status === "error" ? { open: !0, view: "error", error: t.error } : r.kind === "support" ? { open: !0, view: "support", error: null } : r.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : r.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : r.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : r.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : r.kind === "verifying" || r.kind === "direct_checkout_pending" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2114
|
+
function rr(e, t) {
|
|
2115
2115
|
return e.open === t.open && e.view === t.view && e.error === t.error;
|
|
2116
2116
|
}
|
|
2117
|
-
function
|
|
2117
|
+
function ir({
|
|
2118
2118
|
client: e,
|
|
2119
2119
|
open: t,
|
|
2120
2120
|
onClose: r,
|
|
2121
2121
|
onEvent: i,
|
|
2122
|
-
initialView:
|
|
2122
|
+
initialView: n,
|
|
2123
2123
|
initialAuthMode: o,
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2124
|
+
initialCheckoutPriceId: s,
|
|
2125
|
+
purchased: c,
|
|
2126
|
+
renew: l,
|
|
2127
|
+
onState: f,
|
|
2128
|
+
inline: u,
|
|
2129
|
+
locale: h
|
|
2129
2130
|
}) {
|
|
2130
|
-
const [
|
|
2131
|
+
const [p, _] = x({ status: "idle" }), [y, S] = x(
|
|
2131
2132
|
() => e.auth?.getCachedSession() ?? null
|
|
2132
|
-
), [
|
|
2133
|
-
|
|
2134
|
-
if (!
|
|
2135
|
-
const
|
|
2136
|
-
|
|
2137
|
-
}, [t,
|
|
2133
|
+
), [g, v] = x(() => n === "support" ? { kind: "support", origin: "standalone" } : n === "auth" ? { kind: "auth_gate", origin: "standalone" } : n === "checkout" && s ? { kind: "direct_checkout_pending", priceId: s } : { kind: "layout" }), C = n === "checkout", I = F(!1), A = F(null);
|
|
2134
|
+
T(() => {
|
|
2135
|
+
if (!f) return;
|
|
2136
|
+
const b = er(t, p, g, c), w = A.current;
|
|
2137
|
+
w && rr(w, b) || (A.current = b, f(b));
|
|
2138
|
+
}, [t, p, g, c, f]), T(() => {
|
|
2138
2139
|
if (e.auth)
|
|
2139
|
-
return e.auth.onAuthChange((
|
|
2140
|
-
}, [e.auth]),
|
|
2140
|
+
return e.auth.onAuthChange((b, w) => S(w));
|
|
2141
|
+
}, [e.auth]), T(() => {
|
|
2141
2142
|
if (typeof e.onBootstrapChange == "function")
|
|
2142
|
-
return e.onBootstrapChange((
|
|
2143
|
-
|
|
2144
|
-
(
|
|
2143
|
+
return e.onBootstrapChange((b) => {
|
|
2144
|
+
_(
|
|
2145
|
+
(w) => w.status === "ready" ? { status: "ready", data: b } : w
|
|
2145
2146
|
);
|
|
2146
2147
|
});
|
|
2147
|
-
}, [e]),
|
|
2148
|
-
if (!t ||
|
|
2149
|
-
let
|
|
2150
|
-
return
|
|
2151
|
-
|
|
2152
|
-
|
|
2148
|
+
}, [e]), T(() => {
|
|
2149
|
+
if (!t || p.status === "ready" || p.status === "loading") return;
|
|
2150
|
+
let b = !1;
|
|
2151
|
+
return _({ status: "loading" }), e.bootstrap().then((w) => {
|
|
2152
|
+
if (b) return;
|
|
2153
|
+
_({ status: "ready", data: w }), i("ready", w);
|
|
2154
|
+
const m = n === "support" || n === "auth";
|
|
2155
|
+
w.user?.has_active_subscription && !l && !m && (i("purchase_completed", {
|
|
2156
|
+
priceId: s ?? null,
|
|
2153
2157
|
sessionId: null,
|
|
2154
2158
|
restored: !0
|
|
2155
|
-
}),
|
|
2156
|
-
}).catch((
|
|
2157
|
-
if (
|
|
2158
|
-
const
|
|
2159
|
-
|
|
2159
|
+
}), C ? r() : v({ kind: "purchase_success", restored: !0 }));
|
|
2160
|
+
}).catch((w) => {
|
|
2161
|
+
if (b) return;
|
|
2162
|
+
const m = w instanceof O ? w : new O("unknown", "Failed to load paywall", { cause: w });
|
|
2163
|
+
_({ status: "error", error: m }), i("error", m);
|
|
2160
2164
|
}), () => {
|
|
2161
|
-
|
|
2165
|
+
b = !0;
|
|
2162
2166
|
};
|
|
2163
|
-
}, [t, e]),
|
|
2167
|
+
}, [t, e]), Wt(() => {
|
|
2164
2168
|
if (!t) {
|
|
2165
|
-
|
|
2169
|
+
v({ kind: "layout" }), I.current = !1;
|
|
2166
2170
|
return;
|
|
2167
2171
|
}
|
|
2168
|
-
|
|
2169
|
-
}, [t,
|
|
2170
|
-
const
|
|
2172
|
+
n === "support" ? v({ kind: "support", origin: "standalone" }) : n === "auth" ? v({ kind: "auth_gate", origin: "standalone" }) : n === "checkout" && s && v({ kind: "direct_checkout_pending", priceId: s });
|
|
2173
|
+
}, [t, n, s]);
|
|
2174
|
+
const E = async (b) => {
|
|
2171
2175
|
try {
|
|
2172
|
-
const
|
|
2173
|
-
priceId:
|
|
2174
|
-
ignoreActivePurchase:
|
|
2176
|
+
const w = await e.createCheckout({
|
|
2177
|
+
priceId: b,
|
|
2178
|
+
ignoreActivePurchase: l === !0
|
|
2175
2179
|
});
|
|
2176
|
-
if (i("checkout_started", { priceId:
|
|
2177
|
-
const
|
|
2178
|
-
if (
|
|
2180
|
+
if (i("checkout_started", { priceId: b, url: w.url, acquiring: w.acquiring }), typeof window > "u" || !w.url) return;
|
|
2181
|
+
const m = window.open(w.url, "_blank");
|
|
2182
|
+
if (m) {
|
|
2179
2183
|
try {
|
|
2180
|
-
|
|
2184
|
+
m.opener = null;
|
|
2181
2185
|
} catch {
|
|
2182
2186
|
}
|
|
2183
|
-
|
|
2187
|
+
v({ kind: "awaiting_payment", priceId: b, url: w.url });
|
|
2184
2188
|
} else
|
|
2185
|
-
|
|
2186
|
-
} catch (
|
|
2187
|
-
if (
|
|
2189
|
+
v({ kind: "popup_blocked", priceId: b, url: w.url });
|
|
2190
|
+
} catch (w) {
|
|
2191
|
+
if (w instanceof O && w.code === "already_purchased") {
|
|
2188
2192
|
try {
|
|
2189
2193
|
await e.getUser({ force: !0 });
|
|
2190
2194
|
} catch {
|
|
2191
2195
|
}
|
|
2192
|
-
i("purchase_completed", { priceId:
|
|
2196
|
+
i("purchase_completed", { priceId: b, sessionId: null, restored: !0 }), C ? r() : v({ kind: "purchase_success", restored: !0 });
|
|
2193
2197
|
return;
|
|
2194
2198
|
}
|
|
2195
|
-
const
|
|
2196
|
-
i("error",
|
|
2199
|
+
const m = w instanceof O ? w : new O("checkout_failed", "Checkout failed", { cause: w });
|
|
2200
|
+
i("error", m), C ? r() : v({ kind: "layout" });
|
|
2197
2201
|
}
|
|
2198
|
-
},
|
|
2202
|
+
}, P = (b, w) => {
|
|
2199
2203
|
if (typeof window > "u") return;
|
|
2200
|
-
const
|
|
2201
|
-
if (
|
|
2204
|
+
const m = window.open(w, "_blank");
|
|
2205
|
+
if (m) {
|
|
2202
2206
|
try {
|
|
2203
|
-
|
|
2207
|
+
m.opener = null;
|
|
2204
2208
|
} catch {
|
|
2205
2209
|
}
|
|
2206
|
-
|
|
2210
|
+
v({ kind: "awaiting_payment", priceId: b, url: w });
|
|
2207
2211
|
}
|
|
2208
2212
|
};
|
|
2209
|
-
|
|
2210
|
-
if (
|
|
2211
|
-
|
|
2212
|
-
const
|
|
2213
|
-
|
|
2214
|
-
if (!
|
|
2213
|
+
T(() => {
|
|
2214
|
+
if (g.kind !== "auth_gate" || !y || y.user.is_anonymous || I.current) return;
|
|
2215
|
+
I.current = !0;
|
|
2216
|
+
const b = g.pendingCheckout, w = g.origin;
|
|
2217
|
+
v({ kind: "verifying" }), (async () => {
|
|
2218
|
+
if (!l)
|
|
2215
2219
|
try {
|
|
2216
2220
|
if ((await e.getUser({ force: !0 })).has_active_subscription) {
|
|
2217
2221
|
i("purchase_completed", {
|
|
2218
|
-
priceId:
|
|
2222
|
+
priceId: b?.priceId ?? null,
|
|
2219
2223
|
sessionId: null,
|
|
2220
2224
|
restored: !0
|
|
2221
|
-
}),
|
|
2225
|
+
}), b?.direct ? r() : v({ kind: "purchase_success", restored: !0 });
|
|
2222
2226
|
return;
|
|
2223
2227
|
}
|
|
2224
2228
|
} catch {
|
|
2225
2229
|
}
|
|
2226
|
-
if (!
|
|
2227
|
-
|
|
2230
|
+
if (!b) {
|
|
2231
|
+
w === "standalone" ? r() : v({ kind: "layout" });
|
|
2228
2232
|
return;
|
|
2229
2233
|
}
|
|
2230
|
-
await
|
|
2234
|
+
await E(b.priceId);
|
|
2231
2235
|
})().finally(() => {
|
|
2232
|
-
|
|
2236
|
+
I.current = !1;
|
|
2233
2237
|
});
|
|
2234
|
-
}, [y,
|
|
2235
|
-
|
|
2236
|
-
|
|
2238
|
+
}, [y, g]), T(() => {
|
|
2239
|
+
if (p.status !== "ready" || g.kind !== "direct_checkout_pending") return;
|
|
2240
|
+
const b = g.priceId, w = p.data.settings.checkout_mode ?? "guest", m = e.auth?.getCachedSession() ?? null, L = !!m && !m.user.is_anonymous;
|
|
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") {
|
|
2237
2249
|
r();
|
|
2238
2250
|
return;
|
|
2239
2251
|
}
|
|
2240
|
-
if (
|
|
2241
|
-
i("price_selected",
|
|
2252
|
+
if (b === "price_selected") {
|
|
2253
|
+
i("price_selected", w);
|
|
2242
2254
|
return;
|
|
2243
2255
|
}
|
|
2244
|
-
if (
|
|
2256
|
+
if (b === "restore") {
|
|
2245
2257
|
if (!e.auth) return;
|
|
2246
|
-
const
|
|
2247
|
-
if (
|
|
2248
|
-
|
|
2258
|
+
const m = e.auth.getCachedSession();
|
|
2259
|
+
if (m && !m.user.is_anonymous) return;
|
|
2260
|
+
v({ kind: "auth_gate", intent: "restore" });
|
|
2249
2261
|
return;
|
|
2250
2262
|
}
|
|
2251
|
-
if (
|
|
2252
|
-
|
|
2263
|
+
if (b === "support") {
|
|
2264
|
+
v({ kind: "support", origin: "layout" });
|
|
2253
2265
|
return;
|
|
2254
2266
|
}
|
|
2255
|
-
if (
|
|
2256
|
-
const
|
|
2257
|
-
if (!
|
|
2267
|
+
if (b === "checkout" && p.status === "ready") {
|
|
2268
|
+
const m = w?.priceId;
|
|
2269
|
+
if (!m) {
|
|
2258
2270
|
i("error", new O("no_price", "No price selected"));
|
|
2259
2271
|
return;
|
|
2260
2272
|
}
|
|
2261
|
-
const
|
|
2262
|
-
if (
|
|
2263
|
-
|
|
2273
|
+
const L = p.data.settings.checkout_mode ?? "guest", N = e.auth?.getCachedSession() ?? null, Ut = !!N && !N.user.is_anonymous;
|
|
2274
|
+
if (L === "preauth" && !!e.auth && !Ut) {
|
|
2275
|
+
v({ kind: "auth_gate", pendingCheckout: { priceId: m } });
|
|
2264
2276
|
return;
|
|
2265
2277
|
}
|
|
2266
|
-
await
|
|
2278
|
+
await E(m);
|
|
2267
2279
|
}
|
|
2268
|
-
},
|
|
2280
|
+
}, B = p.status === "ready" ? p.data.settings.brand_color : null, R = p.status === "ready" ? p.data.settings.allow_close !== !1 : !0, M = g.kind === "layout" && p.status === "ready" ? jt(p.data.offers) : null, D = M ? /* @__PURE__ */ a(_e, { offer: M }) : null, U = {
|
|
2269
2281
|
type: "auth_panel",
|
|
2270
2282
|
// Заголовок не задаём — AuthGate сам решит по intent'у (restore →
|
|
2271
2283
|
// "Restore Purchases", остальные → дефолтный "Welcome back!").
|
|
@@ -2274,65 +2286,65 @@ function rr({
|
|
|
2274
2286
|
// Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
|
|
2275
2287
|
// чем хотим показывать "Signed in as ..." промежуточным экраном.
|
|
2276
2288
|
hide_when_authenticated: !1,
|
|
2277
|
-
providers:
|
|
2278
|
-
},
|
|
2279
|
-
|
|
2289
|
+
providers: p.status === "ready" ? p.data.settings.auth_providers : void 0
|
|
2290
|
+
}, V = g.kind === "support" ? /* @__PURE__ */ a(
|
|
2291
|
+
Ie,
|
|
2280
2292
|
{
|
|
2281
2293
|
client: e,
|
|
2282
2294
|
authSession: y,
|
|
2283
|
-
origin:
|
|
2295
|
+
origin: g.origin,
|
|
2284
2296
|
onBack: () => {
|
|
2285
|
-
|
|
2297
|
+
g.origin === "standalone" ? r() : v({ kind: "layout" });
|
|
2286
2298
|
}
|
|
2287
2299
|
}
|
|
2288
|
-
) : null,
|
|
2289
|
-
return /* @__PURE__ */
|
|
2290
|
-
|
|
2300
|
+
) : null, Z = g.kind === "auth_gate" && g.origin !== "standalone" || g.kind === "support", K = p.status === "ready" ? p.data : null;
|
|
2301
|
+
return /* @__PURE__ */ a(ie, { bootstrap: K, forceLocale: h, children: /* @__PURE__ */ a(
|
|
2302
|
+
ne,
|
|
2291
2303
|
{
|
|
2292
2304
|
open: t,
|
|
2293
2305
|
onClose: r,
|
|
2294
|
-
brandColor:
|
|
2295
|
-
topBanner:
|
|
2296
|
-
allowClose:
|
|
2297
|
-
hideCloseButton:
|
|
2298
|
-
inline:
|
|
2306
|
+
brandColor: B,
|
|
2307
|
+
topBanner: D,
|
|
2308
|
+
allowClose: R,
|
|
2309
|
+
hideCloseButton: Z,
|
|
2310
|
+
inline: u,
|
|
2299
2311
|
labelledBy: "pw-title",
|
|
2300
|
-
children:
|
|
2301
|
-
|
|
2312
|
+
children: c ? /* @__PURE__ */ a(_t, { onContinue: r }) : g.kind === "purchase_success" ? /* @__PURE__ */ a(_t, { restored: g.restored, onContinue: r }) : V || (p.status === "loading" || p.status === "idle" || g.kind === "verifying" || g.kind === "direct_checkout_pending" ? /* @__PURE__ */ a(nr, { verifying: g.kind === "verifying" }) : p.status === "error" ? /* @__PURE__ */ a(ar, { message: p.error.message }) : g.kind === "auth_gate" && e.auth ? /* @__PURE__ */ a(
|
|
2313
|
+
xe,
|
|
2302
2314
|
{
|
|
2303
|
-
block:
|
|
2304
|
-
bootstrap:
|
|
2315
|
+
block: U,
|
|
2316
|
+
bootstrap: p.data,
|
|
2305
2317
|
auth: e.auth,
|
|
2306
2318
|
authSession: y,
|
|
2307
|
-
showBack:
|
|
2308
|
-
intent:
|
|
2309
|
-
initialMode:
|
|
2319
|
+
showBack: g.origin !== "standalone",
|
|
2320
|
+
intent: g.intent ?? (g.origin === "standalone" ? "standalone" : "preauth"),
|
|
2321
|
+
initialMode: g.origin === "standalone" ? o : void 0,
|
|
2310
2322
|
onBack: () => {
|
|
2311
|
-
|
|
2323
|
+
g.origin === "standalone" ? r() : v({ kind: "layout" });
|
|
2312
2324
|
}
|
|
2313
2325
|
}
|
|
2314
|
-
) :
|
|
2315
|
-
|
|
2326
|
+
) : g.kind === "awaiting_payment" ? /* @__PURE__ */ a(
|
|
2327
|
+
sr,
|
|
2316
2328
|
{
|
|
2317
2329
|
client: e,
|
|
2318
|
-
onBack: () =>
|
|
2330
|
+
onBack: () => v({ kind: "layout" }),
|
|
2319
2331
|
onReopen: () => {
|
|
2320
2332
|
if (typeof window > "u") return;
|
|
2321
|
-
const
|
|
2322
|
-
if (
|
|
2333
|
+
const b = window.open(g.url, "_blank");
|
|
2334
|
+
if (b)
|
|
2323
2335
|
try {
|
|
2324
|
-
|
|
2336
|
+
b.opener = null;
|
|
2325
2337
|
} catch {
|
|
2326
2338
|
}
|
|
2327
2339
|
},
|
|
2328
|
-
onRetry: () =>
|
|
2340
|
+
onRetry: () => E(g.priceId)
|
|
2329
2341
|
}
|
|
2330
|
-
) :
|
|
2331
|
-
|
|
2342
|
+
) : g.kind === "popup_blocked" ? /* @__PURE__ */ a(or, { onReopen: () => P(g.priceId, g.url) }) : /* @__PURE__ */ a(
|
|
2343
|
+
tr,
|
|
2332
2344
|
{
|
|
2333
|
-
layout:
|
|
2334
|
-
bootstrap:
|
|
2335
|
-
onAction:
|
|
2345
|
+
layout: p.data.layout,
|
|
2346
|
+
bootstrap: p.data,
|
|
2347
|
+
onAction: z,
|
|
2336
2348
|
auth: e.auth,
|
|
2337
2349
|
authSession: y
|
|
2338
2350
|
}
|
|
@@ -2340,42 +2352,42 @@ function rr({
|
|
|
2340
2352
|
}
|
|
2341
2353
|
) });
|
|
2342
2354
|
}
|
|
2343
|
-
function
|
|
2344
|
-
const { t } =
|
|
2345
|
-
return /* @__PURE__ */
|
|
2346
|
-
/* @__PURE__ */
|
|
2347
|
-
/* @__PURE__ */
|
|
2355
|
+
function nr({ verifying: e }) {
|
|
2356
|
+
const { t } = k();
|
|
2357
|
+
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
|
|
2358
|
+
/* @__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: e ? t("modal.verifying_subscription", "Checking your subscription…") : t("modal.loading", "Loading…") })
|
|
2348
2360
|
] });
|
|
2349
2361
|
}
|
|
2350
|
-
function
|
|
2351
|
-
const { t } =
|
|
2352
|
-
return /* @__PURE__ */
|
|
2353
|
-
/* @__PURE__ */
|
|
2354
|
-
/* @__PURE__ */
|
|
2355
|
-
/* @__PURE__ */
|
|
2362
|
+
function ar({ message: e }) {
|
|
2363
|
+
const { t } = k();
|
|
2364
|
+
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
2365
|
+
/* @__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
|
+
/* @__PURE__ */ a("path", { d: "M10 6v5M10 14h.01", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round" }),
|
|
2367
|
+
/* @__PURE__ */ a("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
|
|
2356
2368
|
] }) }),
|
|
2357
|
-
/* @__PURE__ */
|
|
2358
|
-
/* @__PURE__ */
|
|
2369
|
+
/* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: t("modal.error_generic", "Something went wrong") }),
|
|
2370
|
+
/* @__PURE__ */ a("p", { class: "text-xs leading-relaxed text-gray-500", children: e })
|
|
2359
2371
|
] });
|
|
2360
2372
|
}
|
|
2361
|
-
function
|
|
2362
|
-
const { t } =
|
|
2363
|
-
return /* @__PURE__ */
|
|
2364
|
-
/* @__PURE__ */
|
|
2373
|
+
function or({ onReopen: e }) {
|
|
2374
|
+
const { t } = k();
|
|
2375
|
+
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
2376
|
+
/* @__PURE__ */ a(
|
|
2365
2377
|
"div",
|
|
2366
2378
|
{
|
|
2367
2379
|
class: "flex h-11 w-11 items-center justify-center rounded-full",
|
|
2368
2380
|
style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
|
|
2369
2381
|
"aria-hidden": "true",
|
|
2370
|
-
children: /* @__PURE__ */
|
|
2371
|
-
/* @__PURE__ */
|
|
2372
|
-
/* @__PURE__ */
|
|
2382
|
+
children: /* @__PURE__ */ d("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
2383
|
+
/* @__PURE__ */ a("path", { d: "M4 5h12v10H4z", stroke: "currentColor", "stroke-width": "1.75", "stroke-linejoin": "round" }),
|
|
2384
|
+
/* @__PURE__ */ a("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
|
|
2373
2385
|
] })
|
|
2374
2386
|
}
|
|
2375
2387
|
),
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
2378
|
-
/* @__PURE__ */
|
|
2388
|
+
/* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: t("payment.popup_blocked_title", "Allow popups to continue") }),
|
|
2389
|
+
/* @__PURE__ */ a("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: t("payment.popup_blocked_message", "Your browser blocked the checkout tab. Click below to open it.") }),
|
|
2390
|
+
/* @__PURE__ */ a(
|
|
2379
2391
|
"button",
|
|
2380
2392
|
{
|
|
2381
2393
|
type: "button",
|
|
@@ -2390,17 +2402,17 @@ function ar({ onReopen: e }) {
|
|
|
2390
2402
|
)
|
|
2391
2403
|
] });
|
|
2392
2404
|
}
|
|
2393
|
-
function
|
|
2405
|
+
function sr({
|
|
2394
2406
|
client: e,
|
|
2395
2407
|
onBack: t,
|
|
2396
2408
|
onReopen: r,
|
|
2397
2409
|
onRetry: i
|
|
2398
2410
|
}) {
|
|
2399
|
-
const { t:
|
|
2400
|
-
|
|
2401
|
-
|
|
2411
|
+
const { t: n } = k(), [o, s] = x(!1), [c, l] = x(!1), f = F(null);
|
|
2412
|
+
T(() => () => {
|
|
2413
|
+
f.current !== null && clearTimeout(f.current);
|
|
2402
2414
|
}, []);
|
|
2403
|
-
const
|
|
2415
|
+
const u = async () => {
|
|
2404
2416
|
if (!o) {
|
|
2405
2417
|
s(!0), l(!1);
|
|
2406
2418
|
try {
|
|
@@ -2408,8 +2420,8 @@ function or({
|
|
|
2408
2420
|
typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
|
|
2409
2421
|
return;
|
|
2410
2422
|
}
|
|
2411
|
-
l(!0),
|
|
2412
|
-
l(!1),
|
|
2423
|
+
l(!0), f.current !== null && clearTimeout(f.current), f.current = setTimeout(() => {
|
|
2424
|
+
l(!1), f.current = null;
|
|
2413
2425
|
}, 5e3);
|
|
2414
2426
|
} catch {
|
|
2415
2427
|
l(!0);
|
|
@@ -2418,19 +2430,19 @@ function or({
|
|
|
2418
2430
|
}
|
|
2419
2431
|
}
|
|
2420
2432
|
};
|
|
2421
|
-
return /* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2433
|
+
return /* @__PURE__ */ d("div", { class: "flex flex-col gap-3 px-6 pb-6 pt-4 sm:px-8 sm:pb-8 sm:pt-5", children: [
|
|
2434
|
+
/* @__PURE__ */ a(
|
|
2423
2435
|
"button",
|
|
2424
2436
|
{
|
|
2425
2437
|
type: "button",
|
|
2426
2438
|
onClick: t,
|
|
2427
2439
|
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)]",
|
|
2428
|
-
children:
|
|
2440
|
+
children: n("nav.back", "← Back")
|
|
2429
2441
|
}
|
|
2430
2442
|
),
|
|
2431
|
-
/* @__PURE__ */
|
|
2432
|
-
/* @__PURE__ */
|
|
2433
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-3 py-6 text-center", children: [
|
|
2444
|
+
/* @__PURE__ */ d("div", { class: "relative flex h-12 w-12 items-center justify-center", children: [
|
|
2445
|
+
/* @__PURE__ */ a(
|
|
2434
2446
|
"span",
|
|
2435
2447
|
{
|
|
2436
2448
|
class: "absolute inset-0 animate-ping rounded-full opacity-40",
|
|
@@ -2438,48 +2450,48 @@ function or({
|
|
|
2438
2450
|
"aria-hidden": "true"
|
|
2439
2451
|
}
|
|
2440
2452
|
),
|
|
2441
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ a("span", { class: "relative inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" })
|
|
2442
2454
|
] }),
|
|
2443
|
-
/* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ a("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: n("payment.awaiting_title", "Complete payment in the new tab") }),
|
|
2456
|
+
/* @__PURE__ */ a("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children: n(
|
|
2445
2457
|
"payment.awaiting_subtitle",
|
|
2446
2458
|
"We'll detect your payment automatically — or click below once you're done."
|
|
2447
2459
|
) }),
|
|
2448
|
-
/* @__PURE__ */
|
|
2460
|
+
/* @__PURE__ */ a(
|
|
2449
2461
|
"button",
|
|
2450
2462
|
{
|
|
2451
2463
|
type: "button",
|
|
2452
|
-
onClick:
|
|
2464
|
+
onClick: u,
|
|
2453
2465
|
disabled: o,
|
|
2454
2466
|
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)]",
|
|
2455
2467
|
style: {
|
|
2456
2468
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
2457
2469
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
2458
2470
|
},
|
|
2459
|
-
children: o ?
|
|
2471
|
+
children: o ? n("payment.checking", "Checking…") : n("payment.ive_paid", "I've paid")
|
|
2460
2472
|
}
|
|
2461
2473
|
),
|
|
2462
|
-
|
|
2474
|
+
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
|
|
2463
2475
|
] }),
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */
|
|
2466
|
-
/* @__PURE__ */
|
|
2476
|
+
/* @__PURE__ */ d("div", { class: "rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5", children: [
|
|
2477
|
+
/* @__PURE__ */ a("p", { class: "text-xs leading-relaxed text-gray-600", children: n("payment.popup_help_text", "Checkout window didn't open or got blocked? Click here to open it again.") }),
|
|
2478
|
+
/* @__PURE__ */ a(
|
|
2467
2479
|
"button",
|
|
2468
2480
|
{
|
|
2469
2481
|
type: "button",
|
|
2470
2482
|
onClick: r,
|
|
2471
2483
|
class: "mt-2.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
2472
|
-
children:
|
|
2484
|
+
children: n("payment.open_checkout_again", "Open checkout again")
|
|
2473
2485
|
}
|
|
2474
2486
|
)
|
|
2475
2487
|
] }),
|
|
2476
|
-
/* @__PURE__ */
|
|
2488
|
+
/* @__PURE__ */ a(
|
|
2477
2489
|
"button",
|
|
2478
2490
|
{
|
|
2479
2491
|
type: "button",
|
|
2480
2492
|
onClick: i,
|
|
2481
2493
|
class: "self-center rounded-md px-2 py-1 text-xs text-gray-500 underline-offset-2 hover:text-gray-900 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
2482
|
-
children:
|
|
2494
|
+
children: n("payment.tab_closed_retry", "Tab closed? Try again")
|
|
2483
2495
|
}
|
|
2484
2496
|
)
|
|
2485
2497
|
] });
|
|
@@ -2488,9 +2500,9 @@ function _t({
|
|
|
2488
2500
|
onContinue: e,
|
|
2489
2501
|
restored: t = !1
|
|
2490
2502
|
}) {
|
|
2491
|
-
const { t: r } =
|
|
2492
|
-
return /* @__PURE__ */
|
|
2493
|
-
/* @__PURE__ */
|
|
2503
|
+
const { t: r } = k();
|
|
2504
|
+
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
2505
|
+
/* @__PURE__ */ a(
|
|
2494
2506
|
"div",
|
|
2495
2507
|
{
|
|
2496
2508
|
class: "flex h-14 w-14 items-center justify-center rounded-full ring-8",
|
|
@@ -2501,7 +2513,7 @@ function _t({
|
|
|
2501
2513
|
boxShadow: "0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"
|
|
2502
2514
|
},
|
|
2503
2515
|
"aria-hidden": "true",
|
|
2504
|
-
children: /* @__PURE__ */
|
|
2516
|
+
children: /* @__PURE__ */ a("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ a(
|
|
2505
2517
|
"path",
|
|
2506
2518
|
{
|
|
2507
2519
|
d: "M5 13l4 4L19 7",
|
|
@@ -2513,12 +2525,12 @@ function _t({
|
|
|
2513
2525
|
) })
|
|
2514
2526
|
}
|
|
2515
2527
|
),
|
|
2516
|
-
/* @__PURE__ */
|
|
2517
|
-
/* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ a("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: t ? r("modal.purchase_restored_title", "Subscription restored") : r("modal.purchase_success_title", "Payment received") }),
|
|
2529
|
+
/* @__PURE__ */ a("p", { class: "text-sm leading-relaxed text-gray-500", children: t ? r(
|
|
2518
2530
|
"modal.purchase_restored_subtitle",
|
|
2519
2531
|
"Welcome back — your subscription is already active."
|
|
2520
2532
|
) : r("modal.purchase_success_subtitle", "Your subscription is now active.") }),
|
|
2521
|
-
/* @__PURE__ */
|
|
2533
|
+
/* @__PURE__ */ a(
|
|
2522
2534
|
"button",
|
|
2523
2535
|
{
|
|
2524
2536
|
type: "button",
|
|
@@ -2533,17 +2545,17 @@ function _t({
|
|
|
2533
2545
|
)
|
|
2534
2546
|
] });
|
|
2535
2547
|
}
|
|
2536
|
-
const
|
|
2537
|
-
class
|
|
2548
|
+
const lr = 10 * 6e4, cr = 5e3, dr = 3e4;
|
|
2549
|
+
class ur {
|
|
2538
2550
|
constructor(t) {
|
|
2539
2551
|
this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
|
|
2540
2552
|
client: t.client,
|
|
2541
2553
|
onActive: t.onActive,
|
|
2542
2554
|
onTimeout: t.onTimeout ?? (() => {
|
|
2543
2555
|
}),
|
|
2544
|
-
timeoutMs: t.timeoutMs ??
|
|
2545
|
-
visibleIntervalMs: t.visibleIntervalMs ??
|
|
2546
|
-
hiddenIntervalMs: t.hiddenIntervalMs ??
|
|
2556
|
+
timeoutMs: t.timeoutMs ?? lr,
|
|
2557
|
+
visibleIntervalMs: t.visibleIntervalMs ?? cr,
|
|
2558
|
+
hiddenIntervalMs: t.hiddenIntervalMs ?? dr
|
|
2547
2559
|
};
|
|
2548
2560
|
}
|
|
2549
2561
|
start() {
|
|
@@ -2582,7 +2594,7 @@ class dr {
|
|
|
2582
2594
|
!r || typeof r != "object" || r.type === "paywall_purchase" && this.check();
|
|
2583
2595
|
}
|
|
2584
2596
|
}
|
|
2585
|
-
function
|
|
2597
|
+
function pr() {
|
|
2586
2598
|
return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
|
|
2587
2599
|
}
|
|
2588
2600
|
const at = { open: !1, view: null, error: null }, $ = {
|
|
@@ -2590,14 +2602,14 @@ const at = { open: !1, view: null, error: null }, $ = {
|
|
|
2590
2602
|
priceId: "paywall_price_id",
|
|
2591
2603
|
sessionId: "paywall_session_id"
|
|
2592
2604
|
};
|
|
2593
|
-
class
|
|
2605
|
+
class Sr {
|
|
2594
2606
|
constructor(t) {
|
|
2595
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 = at, this.stateListeners = /* @__PURE__ */ new Set();
|
|
2596
|
-
const { auth: r, ownsAuth: i } =
|
|
2597
|
-
this.auth = r, this.ownsAuth = i, this.billing = t.client ?? new
|
|
2598
|
-
this.emit("userChange",
|
|
2599
|
-
}), this.auth && (this.authUnsub = this.auth.onAuthChange((
|
|
2600
|
-
this.emit("authChange", { event:
|
|
2608
|
+
const { auth: r, ownsAuth: i } = hr(t);
|
|
2609
|
+
this.auth = r, this.ownsAuth = i, this.billing = t.client ?? new Dt({ ...t, auth: this.auth }), this.host = t.host, this.shadowMode = t.shadowMode ?? "closed", this.mountThenLoad = t.mountThenLoad ?? !0, this.inline = t.inline === !0, this.forceLocale = t.locale ?? null, this.userUnsub = this.billing.onUserChange((n) => {
|
|
2610
|
+
this.emit("userChange", n);
|
|
2611
|
+
}), this.auth && (this.authUnsub = this.auth.onAuthChange((n, o) => {
|
|
2612
|
+
this.emit("authChange", { event: n, session: o });
|
|
2601
2613
|
})), this.initTracker(t.analytics), t.autoDetectReturn !== !1 && typeof window < "u" && queueMicrotask(() => this.checkReturn());
|
|
2602
2614
|
}
|
|
2603
2615
|
initTracker(t) {
|
|
@@ -2605,7 +2617,7 @@ class kr {
|
|
|
2605
2617
|
const r = typeof t == "object" && t !== null ? t : {};
|
|
2606
2618
|
if (r.enabled === !1) return;
|
|
2607
2619
|
const i = r.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
|
|
2608
|
-
this.tracker = new
|
|
2620
|
+
this.tracker = new Nt({
|
|
2609
2621
|
endpoint: i,
|
|
2610
2622
|
paywallId: this.billing.paywallId,
|
|
2611
2623
|
capabilities: this.billing.capabilities,
|
|
@@ -2618,45 +2630,45 @@ class kr {
|
|
|
2618
2630
|
sendBeacon: r.sendBeacon
|
|
2619
2631
|
}), this.on("open", () => this.tracker?.track("paywall_opened")), this.on(
|
|
2620
2632
|
"ready",
|
|
2621
|
-
(
|
|
2622
|
-
is_test_mode:
|
|
2623
|
-
prices_count:
|
|
2624
|
-
offers_count:
|
|
2633
|
+
(n) => this.tracker?.track("paywall_viewed", {
|
|
2634
|
+
is_test_mode: n.settings.is_test_mode,
|
|
2635
|
+
prices_count: n.prices.length,
|
|
2636
|
+
offers_count: n.offers.length
|
|
2625
2637
|
})
|
|
2626
2638
|
), this.on(
|
|
2627
2639
|
"price_selected",
|
|
2628
|
-
(
|
|
2640
|
+
(n) => this.tracker?.track("price_selected", { price_id: n.priceId })
|
|
2629
2641
|
), this.on(
|
|
2630
2642
|
"checkout_started",
|
|
2631
|
-
(
|
|
2632
|
-
price_id:
|
|
2633
|
-
acquiring:
|
|
2643
|
+
(n) => this.tracker?.track("checkout_started", {
|
|
2644
|
+
price_id: n.priceId,
|
|
2645
|
+
acquiring: n.acquiring
|
|
2634
2646
|
})
|
|
2635
2647
|
), this.on(
|
|
2636
2648
|
"purchase_completed",
|
|
2637
|
-
(
|
|
2638
|
-
price_id:
|
|
2639
|
-
session_id:
|
|
2649
|
+
(n) => this.tracker?.track("purchase_completed", {
|
|
2650
|
+
price_id: n.priceId,
|
|
2651
|
+
session_id: n.sessionId
|
|
2640
2652
|
})
|
|
2641
2653
|
), this.on(
|
|
2642
2654
|
"purchase_failed",
|
|
2643
|
-
(
|
|
2655
|
+
(n) => this.tracker?.track("purchase_failed", { reason: n.reason })
|
|
2644
2656
|
), this.on("close", () => this.tracker?.track("paywall_closed")), this.on(
|
|
2645
2657
|
"trial_blocked",
|
|
2646
|
-
(
|
|
2647
|
-
mode:
|
|
2648
|
-
...
|
|
2658
|
+
(n) => this.tracker?.track("trial_blocked", {
|
|
2659
|
+
mode: n.mode,
|
|
2660
|
+
...n.mode === "time" ? { remaining_ms: n.remainingMs, total_ms: n.totalMs } : n.mode === "opens" ? { remaining_actions: n.remainingActions, total_actions: n.totalActions } : {}
|
|
2649
2661
|
})
|
|
2650
2662
|
), this.on("trial_expired", () => this.tracker?.track("trial_expired")), this.on(
|
|
2651
2663
|
"visibility_blocked",
|
|
2652
|
-
(
|
|
2653
|
-
reason:
|
|
2654
|
-
country:
|
|
2655
|
-
tier:
|
|
2664
|
+
(n) => this.tracker?.track("visibility_blocked", {
|
|
2665
|
+
reason: n.reason,
|
|
2666
|
+
country: n.country,
|
|
2667
|
+
tier: n.tier
|
|
2656
2668
|
})
|
|
2657
2669
|
), this.on(
|
|
2658
2670
|
"error",
|
|
2659
|
-
(
|
|
2671
|
+
(n) => this.tracker?.track("error", { code: n.code, message: n.message })
|
|
2660
2672
|
);
|
|
2661
2673
|
}
|
|
2662
2674
|
/**
|
|
@@ -2714,10 +2726,10 @@ class kr {
|
|
|
2714
2726
|
emit(t, ...r) {
|
|
2715
2727
|
const i = this.listeners.get(t);
|
|
2716
2728
|
if (!i) return;
|
|
2717
|
-
const
|
|
2729
|
+
const n = r[0];
|
|
2718
2730
|
for (const o of i)
|
|
2719
2731
|
try {
|
|
2720
|
-
o(
|
|
2732
|
+
o(n);
|
|
2721
2733
|
} catch (s) {
|
|
2722
2734
|
typeof console < "u" && console.error("[paywall] listener error", s);
|
|
2723
2735
|
}
|
|
@@ -2792,6 +2804,51 @@ class kr {
|
|
|
2792
2804
|
openSignup(t = {}) {
|
|
2793
2805
|
this.auth && this.openInternal("auth", { ...t, skipTrial: !0, authMode: "signup" });
|
|
2794
2806
|
}
|
|
2807
|
+
/**
|
|
2808
|
+
* Direct-checkout: открыть модалку и сразу перейти к /start-checkout по
|
|
2809
|
+
* конкретной цене, минуя layout с тарифами. Полезно когда host-приложение
|
|
2810
|
+
* рендерит pricing-карточки/таблицу собственным UI и хочет, чтобы клик по
|
|
2811
|
+
* «Buy / Get this plan» вёл прямо в платёжного провайдера, без второго
|
|
2812
|
+
* выбора плана в модалке SDK.
|
|
2813
|
+
*
|
|
2814
|
+
* Что переиспользуется из обычного `open()`-flow:
|
|
2815
|
+
* - `checkout_mode='preauth'` + managed-auth → auth-gate (форма signin'а),
|
|
2816
|
+
* после успеха auto-resume в createCheckout;
|
|
2817
|
+
* - popup_blocked / awaiting_payment / purchase_success views;
|
|
2818
|
+
* - UserWatcher polling после `checkout_started`;
|
|
2819
|
+
* - аналитика `checkout_started`/`purchase_completed`/`purchase_failed`.
|
|
2820
|
+
*
|
|
2821
|
+
* Что отличается от `open()`:
|
|
2822
|
+
* - layout с тарифами не показывается ни на один кадр (включая откат после
|
|
2823
|
+
* ошибки — модалка закрывается, эмитится `error`);
|
|
2824
|
+
* - already-paid сценарий (cached user, fresh bootstrap, preauth-resume,
|
|
2825
|
+
* 409 hasActivePurchase от бэка) — НЕ показывает restored success-view,
|
|
2826
|
+
* эмитит `purchase_completed{restored:true}` и закрывает/не открывает
|
|
2827
|
+
* модалку. Host сам решает как сообщить юзеру.
|
|
2828
|
+
*
|
|
2829
|
+
* Требования:
|
|
2830
|
+
* - `identity.email` должен быть выставлен (через `opts.identity`, либо
|
|
2831
|
+
* managed-auth, либо ранний `setIdentity`/`paywall.open({identity})`).
|
|
2832
|
+
* Без email бэк `/start-checkout` 400'нёт; SDK эмитнет `error`.
|
|
2833
|
+
* - В `checkout_mode='preauth'` без managed-auth — backend требует
|
|
2834
|
+
* email-юзера; убедись что `identity.email` явно задан.
|
|
2835
|
+
*
|
|
2836
|
+
* Без модалки/полностью headless (когда host рендерит свой checkout-UI и
|
|
2837
|
+
* хочет только URL) — используй `paywall.billing.createCheckout({priceId})`
|
|
2838
|
+
* напрямую, но тогда auth-gate / popup_blocked / awaiting_payment придётся
|
|
2839
|
+
* рисовать самостоятельно.
|
|
2840
|
+
*/
|
|
2841
|
+
checkout(t, r = {}) {
|
|
2842
|
+
if (r.renew !== !0 && this.billing.getCachedUser()?.has_active_subscription) {
|
|
2843
|
+
this.emit("purchase_completed", {
|
|
2844
|
+
priceId: t,
|
|
2845
|
+
sessionId: null,
|
|
2846
|
+
restored: !0
|
|
2847
|
+
});
|
|
2848
|
+
return;
|
|
2849
|
+
}
|
|
2850
|
+
this.openInternal("checkout", { ...r, checkoutPriceId: t });
|
|
2851
|
+
}
|
|
2795
2852
|
/**
|
|
2796
2853
|
* Headless anonymous signin без открытия модалки. Внутри:
|
|
2797
2854
|
* idempotent (если уже анон — instant return) → resume через сохранённый
|
|
@@ -2813,23 +2870,25 @@ class kr {
|
|
|
2813
2870
|
}
|
|
2814
2871
|
openInternal(t, r) {
|
|
2815
2872
|
r.identity && this.billing.setIdentity(r.identity), this.purchased = !1;
|
|
2816
|
-
const i = r.skipTrial === !0 || t === "support",
|
|
2817
|
-
if (i &&
|
|
2818
|
-
this.mountAndShow(t, { renew: o, authMode: r.authMode });
|
|
2873
|
+
const i = r.skipTrial === !0 || t === "support", n = r.skipVisibility === !0 || t === "support" || t === "auth", o = r.renew === !0, s = r.checkoutPriceId;
|
|
2874
|
+
if (i && n) {
|
|
2875
|
+
this.mountAndShow(t, { renew: o, authMode: r.authMode, checkoutPriceId: s });
|
|
2819
2876
|
return;
|
|
2820
2877
|
}
|
|
2821
|
-
const
|
|
2822
|
-
if (
|
|
2823
|
-
this.runOpenGates(t,
|
|
2878
|
+
const c = this.billing.getCachedBootstrap();
|
|
2879
|
+
if (c) {
|
|
2880
|
+
this.runOpenGates(t, c, { skipTrial: i, skipVisibility: n, renew: o, checkoutPriceId: s });
|
|
2824
2881
|
return;
|
|
2825
2882
|
}
|
|
2826
2883
|
if (this.mountThenLoad) {
|
|
2827
|
-
this.mountAndShow(t, { renew: o }), this.billing.bootstrap().then((
|
|
2884
|
+
this.mountAndShow(t, { renew: o, checkoutPriceId: s }), this.billing.bootstrap().then((l) => this.runDelayedGates(l, { skipTrial: i, skipVisibility: n })).catch(() => {
|
|
2828
2885
|
});
|
|
2829
2886
|
return;
|
|
2830
2887
|
}
|
|
2831
|
-
this.billing.bootstrap().then(
|
|
2832
|
-
this.
|
|
2888
|
+
this.billing.bootstrap().then(
|
|
2889
|
+
(l) => this.runOpenGates(t, l, { skipTrial: i, skipVisibility: n, renew: o, checkoutPriceId: s })
|
|
2890
|
+
).catch(() => {
|
|
2891
|
+
this.mountAndShow(t, { renew: o, checkoutPriceId: s });
|
|
2833
2892
|
});
|
|
2834
2893
|
}
|
|
2835
2894
|
/** Применить gates ПОСЛЕ того, как модалка уже смонтирована (mount-then-load
|
|
@@ -2847,11 +2906,11 @@ class kr {
|
|
|
2847
2906
|
if (r.skipTrial) return;
|
|
2848
2907
|
const i = t.settings.trial;
|
|
2849
2908
|
if (!i) return;
|
|
2850
|
-
const
|
|
2851
|
-
|
|
2909
|
+
const n = this.ensureTrialStore(i);
|
|
2910
|
+
n.check().then(async (o) => {
|
|
2852
2911
|
if (this.isOpen && (this.lastTrialStatus = o, o.mode !== "none")) {
|
|
2853
2912
|
if (o.blocked) {
|
|
2854
|
-
const s = await
|
|
2913
|
+
const s = await n.recordBlock();
|
|
2855
2914
|
if (this.lastTrialStatus = s, !this.isOpen) return;
|
|
2856
2915
|
this.close(), this.emit("trial_blocked", s);
|
|
2857
2916
|
return;
|
|
@@ -2868,73 +2927,75 @@ class kr {
|
|
|
2868
2927
|
// правильную страну он окажется со «слипшимся» триал-счётчиком.
|
|
2869
2928
|
runOpenGates(t, r, i) {
|
|
2870
2929
|
if (!i.skipVisibility) {
|
|
2871
|
-
const
|
|
2872
|
-
if (
|
|
2873
|
-
this.emit("visibility_blocked",
|
|
2930
|
+
const n = r.settings.visibility;
|
|
2931
|
+
if (n && (this.lastVisibility = n, !n.visible)) {
|
|
2932
|
+
this.emit("visibility_blocked", n);
|
|
2874
2933
|
return;
|
|
2875
2934
|
}
|
|
2876
2935
|
}
|
|
2877
2936
|
if (i.skipTrial) {
|
|
2878
|
-
this.mountAndShow(t, { renew: i.renew });
|
|
2937
|
+
this.mountAndShow(t, { renew: i.renew, checkoutPriceId: i.checkoutPriceId });
|
|
2879
2938
|
return;
|
|
2880
2939
|
}
|
|
2881
|
-
this.gateThroughTrial(t, r, i.renew);
|
|
2940
|
+
this.gateThroughTrial(t, r, i.renew, i.checkoutPriceId);
|
|
2882
2941
|
}
|
|
2883
|
-
gateThroughTrial(t, r, i) {
|
|
2884
|
-
const
|
|
2885
|
-
if (!
|
|
2886
|
-
this.mountAndShow(t, { renew: i });
|
|
2942
|
+
gateThroughTrial(t, r, i, n) {
|
|
2943
|
+
const o = r.settings.trial;
|
|
2944
|
+
if (!o) {
|
|
2945
|
+
this.mountAndShow(t, { renew: i, checkoutPriceId: n });
|
|
2887
2946
|
return;
|
|
2888
2947
|
}
|
|
2889
|
-
const
|
|
2890
|
-
|
|
2891
|
-
if (this.lastTrialStatus =
|
|
2892
|
-
this.mountAndShow(t, { renew: i });
|
|
2948
|
+
const s = this.ensureTrialStore(o);
|
|
2949
|
+
s.check().then(async (c) => {
|
|
2950
|
+
if (this.lastTrialStatus = c, c.mode === "none") {
|
|
2951
|
+
this.mountAndShow(t, { renew: i, checkoutPriceId: n });
|
|
2893
2952
|
return;
|
|
2894
2953
|
}
|
|
2895
|
-
if (
|
|
2896
|
-
const
|
|
2897
|
-
this.lastTrialStatus =
|
|
2954
|
+
if (c.blocked) {
|
|
2955
|
+
const l = await s.recordBlock();
|
|
2956
|
+
this.lastTrialStatus = l, this.emit("trial_blocked", l);
|
|
2898
2957
|
return;
|
|
2899
2958
|
}
|
|
2900
|
-
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(t, { renew: i });
|
|
2901
|
-
}).catch((
|
|
2902
|
-
typeof console < "u" && console.warn("[paywall] trial check failed",
|
|
2959
|
+
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(t, { renew: i, checkoutPriceId: n });
|
|
2960
|
+
}).catch((c) => {
|
|
2961
|
+
typeof console < "u" && console.warn("[paywall] trial check failed", c), this.mountAndShow(t, { renew: i, checkoutPriceId: n });
|
|
2903
2962
|
});
|
|
2904
2963
|
}
|
|
2905
2964
|
ensureTrialStore(t) {
|
|
2906
|
-
if (this.trialStore && this.trialStoreConfig &&
|
|
2965
|
+
if (this.trialStore && this.trialStoreConfig && wr(this.trialStoreConfig, t))
|
|
2907
2966
|
return this.trialStore;
|
|
2908
2967
|
this.trialStoreConfig = t;
|
|
2909
2968
|
const r = this.billing.createTrialStore;
|
|
2910
|
-
return this.trialStore = typeof r == "function" ? r.call(this.billing, t) :
|
|
2969
|
+
return this.trialStore = typeof r == "function" ? r.call(this.billing, t) : Kt(this.billing.getStorage(), this.billing.paywallId, t), this.trialStore;
|
|
2911
2970
|
}
|
|
2912
2971
|
mountAndShow(t, r = {}) {
|
|
2913
|
-
const i = r.renew === !0,
|
|
2972
|
+
const i = r.renew === !0, n = r.authMode, o = t === "checkout" ? r.checkoutPriceId ?? null : null;
|
|
2914
2973
|
if (this.handle) {
|
|
2915
2974
|
this.isOpen = !0, this.handle.update({
|
|
2916
2975
|
open: !0,
|
|
2917
2976
|
initialView: t,
|
|
2918
|
-
initialAuthMode:
|
|
2977
|
+
initialAuthMode: n,
|
|
2978
|
+
initialCheckoutPriceId: o,
|
|
2919
2979
|
purchased: !1,
|
|
2920
2980
|
renew: i
|
|
2921
2981
|
}), this.emit("open");
|
|
2922
2982
|
return;
|
|
2923
2983
|
}
|
|
2924
|
-
this.isOpen = !0, this.handle =
|
|
2925
|
-
|
|
2984
|
+
this.isOpen = !0, this.handle = Xt(
|
|
2985
|
+
ir,
|
|
2926
2986
|
{
|
|
2927
2987
|
client: this.billing,
|
|
2928
2988
|
open: !0,
|
|
2929
2989
|
initialView: t,
|
|
2930
|
-
initialAuthMode:
|
|
2990
|
+
initialAuthMode: n,
|
|
2991
|
+
initialCheckoutPriceId: o,
|
|
2931
2992
|
purchased: !1,
|
|
2932
2993
|
renew: i,
|
|
2933
2994
|
onClose: () => this.close(),
|
|
2934
|
-
onEvent: (
|
|
2935
|
-
this.emit(
|
|
2995
|
+
onEvent: (s, c) => {
|
|
2996
|
+
this.emit(s, c), s === "checkout_started" && this.startUserWatcher();
|
|
2936
2997
|
},
|
|
2937
|
-
onState: (
|
|
2998
|
+
onState: (s) => this.applyState(s),
|
|
2938
2999
|
inline: this.inline,
|
|
2939
3000
|
locale: this.forceLocale
|
|
2940
3001
|
},
|
|
@@ -2942,7 +3003,7 @@ class kr {
|
|
|
2942
3003
|
), this.emit("open");
|
|
2943
3004
|
}
|
|
2944
3005
|
applyState(t) {
|
|
2945
|
-
if (!
|
|
3006
|
+
if (!fr(this.currentState, t)) {
|
|
2946
3007
|
this.currentState = t;
|
|
2947
3008
|
for (const r of this.stateListeners)
|
|
2948
3009
|
try {
|
|
@@ -2977,16 +3038,16 @@ class kr {
|
|
|
2977
3038
|
this.stateListeners.add(t);
|
|
2978
3039
|
const i = r.immediate ?? "microtask";
|
|
2979
3040
|
if (i !== "none") {
|
|
2980
|
-
const
|
|
3041
|
+
const n = this.currentState;
|
|
2981
3042
|
if (i === "sync")
|
|
2982
3043
|
try {
|
|
2983
|
-
t(
|
|
3044
|
+
t(n);
|
|
2984
3045
|
} catch (o) {
|
|
2985
3046
|
console.warn("[paywall] onStateChange initial sync threw", o);
|
|
2986
3047
|
}
|
|
2987
3048
|
else
|
|
2988
3049
|
queueMicrotask(() => {
|
|
2989
|
-
this.stateListeners.has(t) && t(
|
|
3050
|
+
this.stateListeners.has(t) && t(n);
|
|
2990
3051
|
});
|
|
2991
3052
|
}
|
|
2992
3053
|
return () => {
|
|
@@ -3045,9 +3106,9 @@ class kr {
|
|
|
3045
3106
|
const r = this.billing.getCachedOffers();
|
|
3046
3107
|
if (!r) return null;
|
|
3047
3108
|
const i = H(r, t);
|
|
3048
|
-
return i ?
|
|
3109
|
+
return i ? $t(i, {
|
|
3049
3110
|
now: Date.now(),
|
|
3050
|
-
readStart:
|
|
3111
|
+
readStart: Ht
|
|
3051
3112
|
}) : null;
|
|
3052
3113
|
}
|
|
3053
3114
|
/** Снимок текущего «языка юзера» — proxy над `billing.getUserLanguage()`.
|
|
@@ -3107,11 +3168,11 @@ class kr {
|
|
|
3107
3168
|
trial: null,
|
|
3108
3169
|
user: i
|
|
3109
3170
|
};
|
|
3110
|
-
let
|
|
3171
|
+
let n = null;
|
|
3111
3172
|
if (!t.skipVisibility) {
|
|
3112
3173
|
const s = r.settings.visibility;
|
|
3113
|
-
if (s && (
|
|
3114
|
-
return { access: "granted", reason: "visibility_blocked", visibility:
|
|
3174
|
+
if (s && (n = s, this.lastVisibility = s, !s.visible))
|
|
3175
|
+
return { access: "granted", reason: "visibility_blocked", visibility: n, trial: null, user: i };
|
|
3115
3176
|
}
|
|
3116
3177
|
let o = null;
|
|
3117
3178
|
if (!t.skipTrial) {
|
|
@@ -3119,12 +3180,12 @@ class kr {
|
|
|
3119
3180
|
if (s)
|
|
3120
3181
|
try {
|
|
3121
3182
|
if (o = await this.ensureTrialStore(s).check(), this.lastTrialStatus = o, o.blocked)
|
|
3122
|
-
return { access: "granted", reason: "trial_blocked", visibility:
|
|
3123
|
-
} catch (
|
|
3124
|
-
typeof console < "u" && console.warn("[paywall] getAccess: trial check failed",
|
|
3183
|
+
return { access: "granted", reason: "trial_blocked", visibility: n, trial: o, user: i };
|
|
3184
|
+
} catch (c) {
|
|
3185
|
+
typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", c);
|
|
3125
3186
|
}
|
|
3126
3187
|
}
|
|
3127
|
-
return { access: "blocked", reason: "no_subscription", visibility:
|
|
3188
|
+
return { access: "blocked", reason: "no_subscription", visibility: n, trial: o, user: i };
|
|
3128
3189
|
}
|
|
3129
3190
|
/** Сбросить состояние триала в storage. Полезно для дев-режима / админ-кнопки
|
|
3130
3191
|
* «прогнать сценарий заново». В проде хост обычно не дёргает. */
|
|
@@ -3138,7 +3199,7 @@ class kr {
|
|
|
3138
3199
|
// В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
|
|
3139
3200
|
// bootstrap при следующем открытии.
|
|
3140
3201
|
startUserWatcher() {
|
|
3141
|
-
this.watcher ||
|
|
3202
|
+
this.watcher || pr() && (this.watcher = new ur({
|
|
3142
3203
|
client: this.billing,
|
|
3143
3204
|
onActive: (t) => {
|
|
3144
3205
|
this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
|
|
@@ -3167,19 +3228,19 @@ class kr {
|
|
|
3167
3228
|
*/
|
|
3168
3229
|
checkReturn() {
|
|
3169
3230
|
if (typeof window > "u") return;
|
|
3170
|
-
const t = new URL(window.location.href), r = St(t.hash.replace(/^#/, "")), i = St(t.search.replace(/^\?/, "")),
|
|
3171
|
-
|
|
3172
|
-
priceId:
|
|
3173
|
-
sessionId:
|
|
3174
|
-
}),
|
|
3231
|
+
const t = new URL(window.location.href), r = St(t.hash.replace(/^#/, "")), i = St(t.search.replace(/^\?/, "")), n = r ?? i;
|
|
3232
|
+
n && (n.status === "paid" ? (this.emit("purchase_completed", {
|
|
3233
|
+
priceId: n.priceId,
|
|
3234
|
+
sessionId: n.sessionId
|
|
3235
|
+
}), mr(n)) : (n.status === "failed" || n.status === "cancelled") && this.emit("purchase_failed", { reason: n.status }), br(t));
|
|
3175
3236
|
}
|
|
3176
3237
|
destroy() {
|
|
3177
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 = at;
|
|
3178
3239
|
}
|
|
3179
3240
|
}
|
|
3180
|
-
function
|
|
3241
|
+
function hr(e) {
|
|
3181
3242
|
if (!e.auth) return { auth: void 0, ownsAuth: !1 };
|
|
3182
|
-
if (e.auth instanceof ct ||
|
|
3243
|
+
if (e.auth instanceof ct || gr(e.auth))
|
|
3183
3244
|
return { auth: e.auth, ownsAuth: !1 };
|
|
3184
3245
|
const t = e.auth === !0 ? {} : e.auth;
|
|
3185
3246
|
return {
|
|
@@ -3193,15 +3254,15 @@ function pr(e) {
|
|
|
3193
3254
|
ownsAuth: !0
|
|
3194
3255
|
};
|
|
3195
3256
|
}
|
|
3196
|
-
function
|
|
3257
|
+
function gr(e) {
|
|
3197
3258
|
if (typeof e != "object" || e === null) return !1;
|
|
3198
3259
|
const t = e;
|
|
3199
3260
|
return typeof t.onAuthChange == "function" && typeof t.getCachedSession == "function" && typeof t.signOut == "function";
|
|
3200
3261
|
}
|
|
3201
|
-
function
|
|
3262
|
+
function fr(e, t) {
|
|
3202
3263
|
return e.open === t.open && e.view === t.view && e.error === t.error;
|
|
3203
3264
|
}
|
|
3204
|
-
function
|
|
3265
|
+
function wr(e, t) {
|
|
3205
3266
|
return e.mode === t.mode && e.payload === t.payload && e.storage === t.storage;
|
|
3206
3267
|
}
|
|
3207
3268
|
function St(e) {
|
|
@@ -3213,7 +3274,7 @@ function St(e) {
|
|
|
3213
3274
|
sessionId: t.get($.sessionId)
|
|
3214
3275
|
} : null;
|
|
3215
3276
|
}
|
|
3216
|
-
function
|
|
3277
|
+
function mr(e) {
|
|
3217
3278
|
if (!(typeof window > "u" || !window.opener))
|
|
3218
3279
|
try {
|
|
3219
3280
|
window.opener.postMessage(
|
|
@@ -3228,18 +3289,18 @@ function wr(e) {
|
|
|
3228
3289
|
} catch {
|
|
3229
3290
|
}
|
|
3230
3291
|
}
|
|
3231
|
-
function
|
|
3232
|
-
const t = (i,
|
|
3292
|
+
function br(e) {
|
|
3293
|
+
const t = (i, n) => {
|
|
3233
3294
|
if (!i) return "";
|
|
3234
3295
|
const o = new URLSearchParams(i.replace(/^[?#]/, ""));
|
|
3235
3296
|
o.delete($.status), o.delete($.priceId), o.delete($.sessionId);
|
|
3236
3297
|
const s = o.toString();
|
|
3237
|
-
return s ?
|
|
3298
|
+
return s ? n + s : "";
|
|
3238
3299
|
}, r = e.pathname + t(e.search, "?") + t(e.hash, "#");
|
|
3239
3300
|
window.history.replaceState(null, "", r);
|
|
3240
3301
|
}
|
|
3241
3302
|
export {
|
|
3242
|
-
|
|
3243
|
-
|
|
3303
|
+
Sr as P,
|
|
3304
|
+
Qe as b
|
|
3244
3305
|
};
|
|
3245
|
-
//# sourceMappingURL=PaywallUI-
|
|
3306
|
+
//# sourceMappingURL=PaywallUI-pb7JpLr6.js.map
|