@onside/install-widget 1.0.2 → 1.0.3
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/README.md +13 -0
- package/dist-lib/{AndroidPlatformModal-B8lt-w-V.js → AndroidPlatformModal-2Ykjo2V7.js} +14 -13
- package/dist-lib/AndroidPlatformModal-DTglyxUG.cjs +1 -0
- package/dist-lib/{Dialog-DXOEeh8t.js → Dialog-yEP-7Deb.js} +1 -1
- package/dist-lib/{Dialog-D53Br-Xy.cjs → Dialog-yZ9bWtK1.cjs} +1 -1
- package/dist-lib/{GoToSafariModal-CLxmpCng.js → GoToSafariModal-C_KBizh8.js} +27 -26
- package/dist-lib/GoToSafariModal-Cgx0X0rg.cjs +1 -0
- package/dist-lib/{UpdateIOSModal-ms1UJmHc.js → UpdateIOSModal-BGWvssyd.js} +20 -19
- package/dist-lib/UpdateIOSModal-CE-d3YCr.cjs +1 -0
- package/dist-lib/hooks.cjs +1 -0
- package/dist-lib/hooks.d.ts +45 -0
- package/dist-lib/hooks.js +5 -0
- package/dist-lib/install-package-B17QfMPy.cjs +1 -0
- package/dist-lib/{install-package-CyWo-B7v.js → install-package-DowlG4hO.js} +600 -969
- package/dist-lib/install-package.cjs +1 -1
- package/dist-lib/install-package.d.ts +106 -1
- package/dist-lib/install-package.js +21 -6
- package/dist-lib/install-widget.css +1 -1
- package/dist-lib/installUrlService-AjG03i8i.cjs +1 -0
- package/dist-lib/installUrlService-CrJfYPwM.js +95 -0
- package/dist-lib/useInstallUrl-CjUspi0p.cjs +1 -0
- package/dist-lib/useInstallUrl-JIdkWpgj.js +87 -0
- package/dist-lib/utils.cjs +1 -0
- package/dist-lib/utils.d.ts +93 -0
- package/dist-lib/utils.js +279 -0
- package/package.json +22 -2
- package/dist-lib/AndroidPlatformModal-BNghy_S2.cjs +0 -1
- package/dist-lib/GoToSafariModal-DJDoZzSN.cjs +0 -1
- package/dist-lib/UpdateIOSModal-Cd2FI2Dl.cjs +0 -1
- package/dist-lib/install-package-q3ncGygt.cjs +0 -1
package/README.md
CHANGED
|
@@ -19,6 +19,8 @@ It is the source of truth for UX + analytics for partner integrations.
|
|
|
19
19
|
### Notes
|
|
20
20
|
|
|
21
21
|
- Required analytics context in GTM payload: `location`, `page`, `onside_token`, `attribution_token`, `platform`, `browser`.
|
|
22
|
+
- Optional additive device fields (for richer analytics/debug): `iosDeviceClass`, `isInAppBrowser`, `browserDetail`.
|
|
23
|
+
Existing required fields remain backward-compatible.
|
|
22
24
|
- If a modal is shown, redirect must not happen in the same click action.
|
|
23
25
|
- `onside_token` cookie must be present before requesting install URL.
|
|
24
26
|
|
|
@@ -77,6 +79,17 @@ function App() {
|
|
|
77
79
|
}
|
|
78
80
|
```
|
|
79
81
|
|
|
82
|
+
Core modules can be imported via subpaths (without the UI layer):
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
import { useInstallUrl } from "@onside/install-widget/hooks";
|
|
86
|
+
import {
|
|
87
|
+
getDeviceInfo,
|
|
88
|
+
resolveInstallConditions,
|
|
89
|
+
getInstallUrl,
|
|
90
|
+
} from "@onside/install-widget/utils";
|
|
91
|
+
```
|
|
92
|
+
|
|
80
93
|
Style customization:
|
|
81
94
|
|
|
82
95
|
```tsx
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import {
|
|
4
|
-
import { D as
|
|
5
|
-
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as s } from "react";
|
|
3
|
+
import { B as d } from "./install-package-DowlG4hO.js";
|
|
4
|
+
import { D as c } from "./Dialog-yEP-7Deb.js";
|
|
5
|
+
import { trackModalEvent as m } from "./utils.js";
|
|
6
|
+
const N = ({
|
|
6
7
|
open: t,
|
|
7
8
|
onClose: l
|
|
8
9
|
}) => {
|
|
9
|
-
const n = "is_android", a =
|
|
10
|
-
|
|
11
|
-
}, [l]), i =
|
|
10
|
+
const n = "is_android", a = s(() => {
|
|
11
|
+
m(n, "click", "close"), l();
|
|
12
|
+
}, [l]), i = s(
|
|
12
13
|
(r) => {
|
|
13
14
|
r || a();
|
|
14
15
|
},
|
|
15
16
|
[a]
|
|
16
17
|
);
|
|
17
18
|
return /* @__PURE__ */ e(
|
|
18
|
-
|
|
19
|
+
c,
|
|
19
20
|
{
|
|
20
21
|
"aria-labelledby": n,
|
|
21
22
|
className: "outline-hidden",
|
|
22
23
|
isDisplayingMargins: !0,
|
|
23
24
|
open: t,
|
|
24
25
|
onOpenChange: i,
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-between text-center", children: [
|
|
27
|
+
/* @__PURE__ */ o("div", { className: "m-auto", children: [
|
|
27
28
|
/* @__PURE__ */ e("p", { className: "text-2xl font-bold", children: "Onside is for iPhone and iPad" }),
|
|
28
29
|
/* @__PURE__ */ e("p", { className: "mt-3 px-10 font-sans text-xs font-normal", children: "To install Onside, please use an iPhone or iPad." })
|
|
29
30
|
] }),
|
|
30
31
|
/* @__PURE__ */ e(
|
|
31
|
-
|
|
32
|
+
d,
|
|
32
33
|
{
|
|
33
34
|
className: "mt-2 w-full",
|
|
34
35
|
onClick: a,
|
|
@@ -43,5 +44,5 @@ const x = ({
|
|
|
43
44
|
);
|
|
44
45
|
};
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
N as AndroidPlatformModal
|
|
47
48
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),r=require("./install-package-B17QfMPy.cjs"),c=require("./Dialog-yZ9bWtK1.cjs"),d=require("./utils.cjs"),u=({open:t,onClose:s})=>{const a="is_android",l=n.useCallback(()=>{d.trackModalEvent(a,"click","close"),s()},[s]),i=n.useCallback(o=>{o||l()},[l]);return e.jsx(c.Dialog,{"aria-labelledby":a,className:"outline-hidden",isDisplayingMargins:!0,open:t,onOpenChange:i,children:e.jsxs("div",{className:"flex h-full flex-col items-center justify-between text-center",children:[e.jsxs("div",{className:"m-auto",children:[e.jsx("p",{className:"text-2xl font-bold",children:"Onside is for iPhone and iPad"}),e.jsx("p",{className:"mt-3 px-10 font-sans text-xs font-normal",children:"To install Onside, please use an iPhone or iPad."})]}),e.jsx(r.Button,{className:"mt-2 w-full",onClick:l,size:"lg",type:"button",variant:"secondary",children:"Close"})]})})};exports.AndroidPlatformModal=u;
|
|
@@ -3,7 +3,7 @@ import * as i from "react";
|
|
|
3
3
|
import { useState as Ae, forwardRef as st, useEffect as ct } from "react";
|
|
4
4
|
import * as ut from "react-dom";
|
|
5
5
|
import lt from "react-dom";
|
|
6
|
-
import { a as me, B as dt } from "./install-package-
|
|
6
|
+
import { a as me, B as dt } from "./install-package-DowlG4hO.js";
|
|
7
7
|
function T(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
8
8
|
return function(o) {
|
|
9
9
|
if (e?.(o), n === !1 || !o.defaultPrevented)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const m=require("react/jsx-runtime"),W=require("react"),Oe=require("react-dom"),ee=require("./install-package-q3ncGygt.cjs");function De(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const i=De(W),ct=De(Oe);function T(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function me(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ae(...e){return t=>{let n=!1;const r=e.map(o=>{const a=me(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():me(e[o],null)}}}}function M(...e){return i.useCallback(Ae(...e),e)}function ut(e,t){const n=i.createContext(t),r=a=>{const{children:c,...s}=a,d=i.useMemo(()=>s,Object.values(s));return m.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(a){const c=i.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function lt(e,t=[]){let n=[];function r(a,c){const s=i.createContext(c),d=n.length;n=[...n,c];const l=v=>{const{scope:p,children:h,...b}=v,u=p?.[e]?.[d]||s,g=i.useMemo(()=>b,Object.values(b));return m.jsx(u.Provider,{value:g,children:h})};l.displayName=a+"Provider";function f(v,p){const h=p?.[e]?.[d]||s,b=i.useContext(h);if(b)return b;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${a}\``)}return[l,f]}const o=()=>{const a=n.map(c=>i.createContext(c));return function(s){const d=s?.[e]||a;return i.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,dt(o,...t)]}function dt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=r.reduce((s,{useScope:d,scopeName:l})=>{const v=d(a)[`__scope${l}`];return{...s,...v}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var B=globalThis?.document?i.useLayoutEffect:()=>{},ft=i[" useId ".trim().toString()]||(()=>{}),vt=0;function te(e){const[t,n]=i.useState(ft());return B(()=>{n(r=>r??String(vt++))},[e]),e||(t?`radix-${t}`:"")}var mt=i[" useInsertionEffect ".trim().toString()]||B;function pt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,c]=ht({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=i.useRef(e!==void 0);i.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const l=i.useCallback(f=>{if(s){const v=gt(f)?f(e):f;v!==e&&c.current?.(v)}else a(f)},[s,e,a,c]);return[d,l]}function ht({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return mt(()=>{a.current=t},[t]),i.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}function gt(e){return typeof e=="function"}function Te(e){const t=yt(e),n=i.forwardRef((r,o)=>{const{children:a,...c}=r,s=i.Children.toArray(a),d=s.find(bt);if(d){const l=d.props.children,f=s.map(v=>v===d?i.Children.count(l)>1?i.Children.only(null):i.isValidElement(l)?l.props.children:null:v);return m.jsx(t,{...c,ref:o,children:i.isValidElement(l)?i.cloneElement(l,void 0,f):null})}return m.jsx(t,{...c,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function yt(e){const t=i.forwardRef((n,r)=>{const{children:o,...a}=n;if(i.isValidElement(o)){const c=wt(o),s=Ct(a,o.props);return o.type!==i.Fragment&&(s.ref=r?Ae(r,c):c),i.cloneElement(o,s)}return i.Children.count(o)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Et=Symbol("radix.slottable");function bt(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Et}function Ct(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const d=a(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function wt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var St=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=St.reduce((e,t)=>{const n=Te(`Primitive.${t}`),r=i.forwardRef((o,a)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(d,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xt(e,t){e&&ct.flushSync(()=>e.dispatchEvent(t))}function U(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>t.current?.(...n),[])}function Rt(e,t=globalThis?.document){const n=U(e);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Nt="DismissableLayer",ue="dismissableLayer.update",Pt="dismissableLayer.pointerDownOutside",Ot="dismissableLayer.focusOutside",pe,Ie=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Me=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:s,...d}=e,l=i.useContext(Ie),[f,v]=i.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=i.useState({}),b=M(t,E=>v(E)),u=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=u.indexOf(g),C=f?u.indexOf(f):-1,w=l.layersWithOutsidePointerEventsDisabled.size>0,S=C>=y,x=Tt(E=>{const O=E.target,j=[...l.branches].some(J=>J.contains(O));!S||j||(o?.(E),c?.(E),E.defaultPrevented||s?.())},p),P=It(E=>{const O=E.target;[...l.branches].some(J=>J.contains(O))||(a?.(E),c?.(E),E.defaultPrevented||s?.())},p);return Rt(E=>{C===l.layers.size-1&&(r?.(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},p),i.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(pe=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),he(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=pe)}},[f,p,n,l]),i.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),he())},[f,l]),i.useEffect(()=>{const E=()=>h({});return document.addEventListener(ue,E),()=>document.removeEventListener(ue,E)},[]),m.jsx(D.div,{...d,ref:b,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:T(e.onFocusCapture,P.onFocusCapture),onBlurCapture:T(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:T(e.onPointerDownCapture,x.onPointerDownCapture)})});Me.displayName=Nt;var Dt="DismissableLayerBranch",At=i.forwardRef((e,t)=>{const n=i.useContext(Ie),r=i.useRef(null),o=M(t,r);return i.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),m.jsx(D.div,{...e,ref:o})});At.displayName=Dt;function Tt(e,t=globalThis?.document){const n=U(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let d=function(){ke(Pt,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function It(e,t=globalThis?.document){const n=U(e),r=i.useRef(!1);return i.useEffect(()=>{const o=a=>{a.target&&!r.current&&ke(Ot,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function he(){const e=new CustomEvent(ue);document.dispatchEvent(e)}function ke(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?xt(o,a):o.dispatchEvent(a)}var ne="focusScope.autoFocusOnMount",re="focusScope.autoFocusOnUnmount",ge={bubbles:!1,cancelable:!0},Mt="FocusScope",Le=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[s,d]=i.useState(null),l=U(o),f=U(a),v=i.useRef(null),p=M(t,u=>d(u)),h=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let u=function(w){if(h.paused||!s)return;const S=w.target;s.contains(S)?v.current=S:A(v.current,{select:!0})},g=function(w){if(h.paused||!s)return;const S=w.relatedTarget;S!==null&&(s.contains(S)||A(v.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&A(s)};document.addEventListener("focusin",u),document.addEventListener("focusout",g);const C=new MutationObserver(y);return s&&C.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",g),C.disconnect()}}},[r,s,h.paused]),i.useEffect(()=>{if(s){Ee.add(h);const u=document.activeElement;if(!s.contains(u)){const y=new CustomEvent(ne,ge);s.addEventListener(ne,l),s.dispatchEvent(y),y.defaultPrevented||(kt(Wt(_e(s)),{select:!0}),document.activeElement===u&&A(s))}return()=>{s.removeEventListener(ne,l),setTimeout(()=>{const y=new CustomEvent(re,ge);s.addEventListener(re,f),s.dispatchEvent(y),y.defaultPrevented||A(u??document.body,{select:!0}),s.removeEventListener(re,f),Ee.remove(h)},0)}}},[s,l,f,h]);const b=i.useCallback(u=>{if(!n&&!r||h.paused)return;const g=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,y=document.activeElement;if(g&&y){const C=u.currentTarget,[w,S]=Lt(C);w&&S?!u.shiftKey&&y===S?(u.preventDefault(),n&&A(w,{select:!0})):u.shiftKey&&y===w&&(u.preventDefault(),n&&A(S,{select:!0})):y===C&&u.preventDefault()}},[n,r,h.paused]);return m.jsx(D.div,{tabIndex:-1,...c,ref:p,onKeyDown:b})});Le.displayName=Mt;function kt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(A(r,{select:t}),document.activeElement!==n)return}function Lt(e){const t=_e(e),n=ye(t,e),r=ye(t.reverse(),e);return[n,r]}function _e(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ye(e,t){for(const n of e)if(!_t(n,{upTo:t}))return n}function _t(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ft(e){return e instanceof HTMLInputElement&&"select"in e}function A(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ft(e)&&t&&e.select()}}var Ee=jt();function jt(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=be(e,t),e.unshift(t)},remove(t){e=be(e,t),e[0]?.resume()}}}function be(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Wt(e){return e.filter(t=>t.tagName!=="A")}var Bt="Portal",Fe=i.forwardRef((e,t)=>{const{container:n,...r}=e,[o,a]=i.useState(!1);B(()=>a(!0),[]);const c=n||o&&globalThis?.document?.body;return c?Oe.createPortal(m.jsx(D.div,{...r,ref:t}),c):null});Fe.displayName=Bt;function Ut(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var q=e=>{const{present:t,children:n}=e,r=$t(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),a=M(r.ref,Vt(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:a}):null};q.displayName="Presence";function $t(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),c=e?"mounted":"unmounted",[s,d]=Ut(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const l=$(r.current);a.current=s==="mounted"?l:"none"},[s]),B(()=>{const l=r.current,f=o.current;if(f!==e){const p=a.current,h=$(l);e?d("MOUNT"):h==="none"||l?.display==="none"?d("UNMOUNT"):d(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),B(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,v=h=>{const u=$(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&u&&(d("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=h=>{h.target===t&&(a.current=$(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function $(e){return e?.animationName||"none"}function Vt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oe=0;function Ht(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ce()),document.body.insertAdjacentElement("beforeend",e[1]??Ce()),oe++,()=>{oe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),oe--}},[])}function Ce(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var N=function(){return N=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},N.apply(this,arguments)};function je(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function zt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var G="right-scroll-bar-position",Y="width-before-scroll-bar",Kt="with-scroll-bars-hidden",Gt="--removed-body-scroll-bar-size";function ae(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yt(e,t){var n=W.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Xt=typeof window<"u"?i.useLayoutEffect:i.useEffect,we=new WeakMap;function qt(e,t){var n=Yt(null,function(r){return e.forEach(function(o){return ae(o,r)})});return Xt(function(){var r=we.get(n);if(r){var o=new Set(r),a=new Set(e),c=n.current;o.forEach(function(s){a.has(s)||ae(s,null)}),a.forEach(function(s){o.has(s)||ae(s,c)})}we.set(n,e)},[e]),n}function Zt(e){return e}function Qt(e,t){t===void 0&&(t=Zt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var c=t(a,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(a){for(r=!0;n.length;){var c=n;n=[],c.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(a),c=n}var d=function(){var f=c;c=[],f.forEach(a)},l=function(){return Promise.resolve().then(d)};l(),n={push:function(f){c.push(f),l()},filter:function(f){return c=c.filter(f),n}}}};return o}function Jt(e){e===void 0&&(e={});var t=Qt(null);return t.options=N({async:!0,ssr:!1},e),t}var We=function(e){var t=e.sideCar,n=je(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,N({},n))};We.isSideCarExport=!0;function en(e,t){return e.useMedium(t),We}var Be=Jt(),ie=function(){},Z=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ie,onWheelCapture:ie,onTouchMoveCapture:ie}),o=r[0],a=r[1],c=e.forwardProps,s=e.children,d=e.className,l=e.removeScrollBar,f=e.enabled,v=e.shards,p=e.sideCar,h=e.noRelative,b=e.noIsolation,u=e.inert,g=e.allowPinchZoom,y=e.as,C=y===void 0?"div":y,w=e.gapMode,S=je(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=p,P=qt([n,t]),E=N(N({},S),o);return i.createElement(i.Fragment,null,f&&i.createElement(x,{sideCar:Be,removeScrollBar:l,shards:v,noRelative:h,noIsolation:b,inert:u,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:w}),c?i.cloneElement(i.Children.only(s),N(N({},E),{ref:P})):i.createElement(C,N({},E,{className:d,ref:P}),s))});Z.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Z.classNames={fullWidth:Y,zeroRight:G};var tn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tn();return t&&e.setAttribute("nonce",t),e}function rn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function on(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var an=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nn())&&(rn(t,n),on(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sn=function(){var e=an();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ue=function(){var e=sn(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},cn={left:0,top:0,right:0,gap:0},se=function(e){return parseInt(e||"",10)||0},un=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[se(n),se(r),se(o)]},ln=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cn;var t=un(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dn=Ue(),F="data-scroll-locked",fn=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
"use strict";const m=require("react/jsx-runtime"),W=require("react"),Oe=require("react-dom"),ee=require("./install-package-B17QfMPy.cjs");function De(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const i=De(W),ct=De(Oe);function T(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function me(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ae(...e){return t=>{let n=!1;const r=e.map(o=>{const a=me(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():me(e[o],null)}}}}function M(...e){return i.useCallback(Ae(...e),e)}function ut(e,t){const n=i.createContext(t),r=a=>{const{children:c,...s}=a,d=i.useMemo(()=>s,Object.values(s));return m.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(a){const c=i.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function lt(e,t=[]){let n=[];function r(a,c){const s=i.createContext(c),d=n.length;n=[...n,c];const l=v=>{const{scope:p,children:h,...b}=v,u=p?.[e]?.[d]||s,g=i.useMemo(()=>b,Object.values(b));return m.jsx(u.Provider,{value:g,children:h})};l.displayName=a+"Provider";function f(v,p){const h=p?.[e]?.[d]||s,b=i.useContext(h);if(b)return b;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${a}\``)}return[l,f]}const o=()=>{const a=n.map(c=>i.createContext(c));return function(s){const d=s?.[e]||a;return i.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,dt(o,...t)]}function dt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=r.reduce((s,{useScope:d,scopeName:l})=>{const v=d(a)[`__scope${l}`];return{...s,...v}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var B=globalThis?.document?i.useLayoutEffect:()=>{},ft=i[" useId ".trim().toString()]||(()=>{}),vt=0;function te(e){const[t,n]=i.useState(ft());return B(()=>{n(r=>r??String(vt++))},[e]),e||(t?`radix-${t}`:"")}var mt=i[" useInsertionEffect ".trim().toString()]||B;function pt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,c]=ht({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=i.useRef(e!==void 0);i.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const l=i.useCallback(f=>{if(s){const v=gt(f)?f(e):f;v!==e&&c.current?.(v)}else a(f)},[s,e,a,c]);return[d,l]}function ht({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return mt(()=>{a.current=t},[t]),i.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}function gt(e){return typeof e=="function"}function Te(e){const t=yt(e),n=i.forwardRef((r,o)=>{const{children:a,...c}=r,s=i.Children.toArray(a),d=s.find(bt);if(d){const l=d.props.children,f=s.map(v=>v===d?i.Children.count(l)>1?i.Children.only(null):i.isValidElement(l)?l.props.children:null:v);return m.jsx(t,{...c,ref:o,children:i.isValidElement(l)?i.cloneElement(l,void 0,f):null})}return m.jsx(t,{...c,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function yt(e){const t=i.forwardRef((n,r)=>{const{children:o,...a}=n;if(i.isValidElement(o)){const c=wt(o),s=Ct(a,o.props);return o.type!==i.Fragment&&(s.ref=r?Ae(r,c):c),i.cloneElement(o,s)}return i.Children.count(o)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Et=Symbol("radix.slottable");function bt(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Et}function Ct(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const d=a(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function wt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var St=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=St.reduce((e,t)=>{const n=Te(`Primitive.${t}`),r=i.forwardRef((o,a)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(d,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xt(e,t){e&&ct.flushSync(()=>e.dispatchEvent(t))}function U(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>t.current?.(...n),[])}function Rt(e,t=globalThis?.document){const n=U(e);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Nt="DismissableLayer",ue="dismissableLayer.update",Pt="dismissableLayer.pointerDownOutside",Ot="dismissableLayer.focusOutside",pe,Ie=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Me=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:s,...d}=e,l=i.useContext(Ie),[f,v]=i.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=i.useState({}),b=M(t,E=>v(E)),u=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=u.indexOf(g),C=f?u.indexOf(f):-1,w=l.layersWithOutsidePointerEventsDisabled.size>0,S=C>=y,x=Tt(E=>{const O=E.target,j=[...l.branches].some(J=>J.contains(O));!S||j||(o?.(E),c?.(E),E.defaultPrevented||s?.())},p),P=It(E=>{const O=E.target;[...l.branches].some(J=>J.contains(O))||(a?.(E),c?.(E),E.defaultPrevented||s?.())},p);return Rt(E=>{C===l.layers.size-1&&(r?.(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},p),i.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(pe=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),he(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=pe)}},[f,p,n,l]),i.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),he())},[f,l]),i.useEffect(()=>{const E=()=>h({});return document.addEventListener(ue,E),()=>document.removeEventListener(ue,E)},[]),m.jsx(D.div,{...d,ref:b,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:T(e.onFocusCapture,P.onFocusCapture),onBlurCapture:T(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:T(e.onPointerDownCapture,x.onPointerDownCapture)})});Me.displayName=Nt;var Dt="DismissableLayerBranch",At=i.forwardRef((e,t)=>{const n=i.useContext(Ie),r=i.useRef(null),o=M(t,r);return i.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),m.jsx(D.div,{...e,ref:o})});At.displayName=Dt;function Tt(e,t=globalThis?.document){const n=U(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let d=function(){ke(Pt,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function It(e,t=globalThis?.document){const n=U(e),r=i.useRef(!1);return i.useEffect(()=>{const o=a=>{a.target&&!r.current&&ke(Ot,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function he(){const e=new CustomEvent(ue);document.dispatchEvent(e)}function ke(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?xt(o,a):o.dispatchEvent(a)}var ne="focusScope.autoFocusOnMount",re="focusScope.autoFocusOnUnmount",ge={bubbles:!1,cancelable:!0},Mt="FocusScope",Le=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[s,d]=i.useState(null),l=U(o),f=U(a),v=i.useRef(null),p=M(t,u=>d(u)),h=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let u=function(w){if(h.paused||!s)return;const S=w.target;s.contains(S)?v.current=S:A(v.current,{select:!0})},g=function(w){if(h.paused||!s)return;const S=w.relatedTarget;S!==null&&(s.contains(S)||A(v.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&A(s)};document.addEventListener("focusin",u),document.addEventListener("focusout",g);const C=new MutationObserver(y);return s&&C.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",g),C.disconnect()}}},[r,s,h.paused]),i.useEffect(()=>{if(s){Ee.add(h);const u=document.activeElement;if(!s.contains(u)){const y=new CustomEvent(ne,ge);s.addEventListener(ne,l),s.dispatchEvent(y),y.defaultPrevented||(kt(Wt(_e(s)),{select:!0}),document.activeElement===u&&A(s))}return()=>{s.removeEventListener(ne,l),setTimeout(()=>{const y=new CustomEvent(re,ge);s.addEventListener(re,f),s.dispatchEvent(y),y.defaultPrevented||A(u??document.body,{select:!0}),s.removeEventListener(re,f),Ee.remove(h)},0)}}},[s,l,f,h]);const b=i.useCallback(u=>{if(!n&&!r||h.paused)return;const g=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,y=document.activeElement;if(g&&y){const C=u.currentTarget,[w,S]=Lt(C);w&&S?!u.shiftKey&&y===S?(u.preventDefault(),n&&A(w,{select:!0})):u.shiftKey&&y===w&&(u.preventDefault(),n&&A(S,{select:!0})):y===C&&u.preventDefault()}},[n,r,h.paused]);return m.jsx(D.div,{tabIndex:-1,...c,ref:p,onKeyDown:b})});Le.displayName=Mt;function kt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(A(r,{select:t}),document.activeElement!==n)return}function Lt(e){const t=_e(e),n=ye(t,e),r=ye(t.reverse(),e);return[n,r]}function _e(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ye(e,t){for(const n of e)if(!_t(n,{upTo:t}))return n}function _t(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ft(e){return e instanceof HTMLInputElement&&"select"in e}function A(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ft(e)&&t&&e.select()}}var Ee=jt();function jt(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=be(e,t),e.unshift(t)},remove(t){e=be(e,t),e[0]?.resume()}}}function be(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Wt(e){return e.filter(t=>t.tagName!=="A")}var Bt="Portal",Fe=i.forwardRef((e,t)=>{const{container:n,...r}=e,[o,a]=i.useState(!1);B(()=>a(!0),[]);const c=n||o&&globalThis?.document?.body;return c?Oe.createPortal(m.jsx(D.div,{...r,ref:t}),c):null});Fe.displayName=Bt;function Ut(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var q=e=>{const{present:t,children:n}=e,r=$t(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),a=M(r.ref,Vt(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:a}):null};q.displayName="Presence";function $t(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),c=e?"mounted":"unmounted",[s,d]=Ut(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const l=$(r.current);a.current=s==="mounted"?l:"none"},[s]),B(()=>{const l=r.current,f=o.current;if(f!==e){const p=a.current,h=$(l);e?d("MOUNT"):h==="none"||l?.display==="none"?d("UNMOUNT"):d(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),B(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,v=h=>{const u=$(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&u&&(d("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=h=>{h.target===t&&(a.current=$(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function $(e){return e?.animationName||"none"}function Vt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oe=0;function Ht(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ce()),document.body.insertAdjacentElement("beforeend",e[1]??Ce()),oe++,()=>{oe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),oe--}},[])}function Ce(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var N=function(){return N=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},N.apply(this,arguments)};function je(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function zt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var G="right-scroll-bar-position",Y="width-before-scroll-bar",Kt="with-scroll-bars-hidden",Gt="--removed-body-scroll-bar-size";function ae(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yt(e,t){var n=W.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Xt=typeof window<"u"?i.useLayoutEffect:i.useEffect,we=new WeakMap;function qt(e,t){var n=Yt(null,function(r){return e.forEach(function(o){return ae(o,r)})});return Xt(function(){var r=we.get(n);if(r){var o=new Set(r),a=new Set(e),c=n.current;o.forEach(function(s){a.has(s)||ae(s,null)}),a.forEach(function(s){o.has(s)||ae(s,c)})}we.set(n,e)},[e]),n}function Zt(e){return e}function Qt(e,t){t===void 0&&(t=Zt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var c=t(a,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(a){for(r=!0;n.length;){var c=n;n=[],c.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(a),c=n}var d=function(){var f=c;c=[],f.forEach(a)},l=function(){return Promise.resolve().then(d)};l(),n={push:function(f){c.push(f),l()},filter:function(f){return c=c.filter(f),n}}}};return o}function Jt(e){e===void 0&&(e={});var t=Qt(null);return t.options=N({async:!0,ssr:!1},e),t}var We=function(e){var t=e.sideCar,n=je(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,N({},n))};We.isSideCarExport=!0;function en(e,t){return e.useMedium(t),We}var Be=Jt(),ie=function(){},Z=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ie,onWheelCapture:ie,onTouchMoveCapture:ie}),o=r[0],a=r[1],c=e.forwardProps,s=e.children,d=e.className,l=e.removeScrollBar,f=e.enabled,v=e.shards,p=e.sideCar,h=e.noRelative,b=e.noIsolation,u=e.inert,g=e.allowPinchZoom,y=e.as,C=y===void 0?"div":y,w=e.gapMode,S=je(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=p,P=qt([n,t]),E=N(N({},S),o);return i.createElement(i.Fragment,null,f&&i.createElement(x,{sideCar:Be,removeScrollBar:l,shards:v,noRelative:h,noIsolation:b,inert:u,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:w}),c?i.cloneElement(i.Children.only(s),N(N({},E),{ref:P})):i.createElement(C,N({},E,{className:d,ref:P}),s))});Z.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Z.classNames={fullWidth:Y,zeroRight:G};var tn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tn();return t&&e.setAttribute("nonce",t),e}function rn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function on(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var an=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nn())&&(rn(t,n),on(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sn=function(){var e=an();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ue=function(){var e=sn(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},cn={left:0,top:0,right:0,gap:0},se=function(e){return parseInt(e||"",10)||0},un=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[se(n),se(r),se(o)]},ln=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cn;var t=un(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dn=Ue(),F="data-scroll-locked",fn=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(Kt,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { B as p, c as k } from "./install-package-DowlG4hO.js";
|
|
3
3
|
import * as m from "react";
|
|
4
|
-
import { useState as
|
|
5
|
-
import { D as
|
|
4
|
+
import { useState as w, useCallback as a, useMemo as b } from "react";
|
|
5
|
+
import { D as y } from "./Dialog-yEP-7Deb.js";
|
|
6
|
+
import { getDeviceInfo as C, trackModalEvent as d } from "./utils.js";
|
|
6
7
|
const v = 5e3, S = (n) => {
|
|
7
|
-
const [o, e] =
|
|
8
|
+
const [o, e] = w(!1);
|
|
8
9
|
return {
|
|
9
10
|
handleCopy: a(() => {
|
|
10
11
|
navigator.clipboard.writeText(n), e(!0), setTimeout(() => e(!1), v);
|
|
11
12
|
}, [n]),
|
|
12
13
|
isCopied: o
|
|
13
14
|
};
|
|
14
|
-
}, N = (n) => /* @__PURE__ */ m.createElement("svg", { width: 10, height: 16, viewBox: "0 0 10 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n }, /* @__PURE__ */ m.createElement("path", { d: "M3.9375 12.25L6.35539 9.83211C6.74592 9.44158 6.74592 8.80842 6.35539 8.41789L3.9375 6", stroke: "#1E1C1F", strokeOpacity: 0.6, strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
15
|
+
}, N = (n) => /* @__PURE__ */ m.createElement("svg", { width: 10, height: 16, viewBox: "0 0 10 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n }, /* @__PURE__ */ m.createElement("path", { d: "M3.9375 12.25L6.35539 9.83211C6.74592 9.44158 6.74592 8.80842 6.35539 8.41789L3.9375 6", stroke: "#1E1C1F", strokeOpacity: 0.6, strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })), I = ({
|
|
15
16
|
open: n,
|
|
16
17
|
onClose: o
|
|
17
18
|
}) => {
|
|
18
|
-
const e = typeof window < "u" ? window.location.href.replace(/\/$/, "") : "", s =
|
|
19
|
-
const [
|
|
20
|
-
return
|
|
21
|
-
}, [e]), { handleCopy: l, isCopied: c } = S(e), f =
|
|
22
|
-
(
|
|
23
|
-
|
|
19
|
+
const e = typeof window < "u" ? window.location.href.replace(/\/$/, "") : "", s = b(() => {
|
|
20
|
+
const [r] = e.replace(/^https?:\/\//, "").split(/[?#]/);
|
|
21
|
+
return r?.replace(/\/$/, "") ?? "";
|
|
22
|
+
}, [e]), { handleCopy: l, isCopied: c } = S(e), f = C(), x = f.browser === "opera" && f.platform === "ios", h = a(
|
|
23
|
+
(r) => {
|
|
24
|
+
r || o();
|
|
24
25
|
},
|
|
25
26
|
[o]
|
|
26
|
-
),
|
|
27
|
-
|
|
28
|
-
}, [e]),
|
|
29
|
-
|
|
27
|
+
), u = a(() => {
|
|
28
|
+
d("go_to_safari", "click", "button"), window.location.href = `x-safari-${e}`;
|
|
29
|
+
}, [e]), g = a(() => {
|
|
30
|
+
d("go_to_safari", "click", "link"), l();
|
|
30
31
|
}, [l]);
|
|
31
32
|
return /* @__PURE__ */ t(
|
|
32
|
-
|
|
33
|
+
y,
|
|
33
34
|
{
|
|
34
35
|
"aria-labelledby": "go-to-safari-modal",
|
|
35
36
|
isDisplayingMargins: !0,
|
|
@@ -37,16 +38,16 @@ const v = 5e3, S = (n) => {
|
|
|
37
38
|
onOpenChange: h,
|
|
38
39
|
showCloseButton: !1,
|
|
39
40
|
onBackClick: o,
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col items-center justify-center", children: [
|
|
41
42
|
/* @__PURE__ */ t("h1", { className: "mt-8 text-center font-sans text-5xl font-medium", children: "Open in Safari" }),
|
|
42
43
|
/* @__PURE__ */ t("p", { className: "text-tertiary mt-5 w-11/12 text-center font-sans text-lg font-normal", children: "Copy the link and open it in Safari to continue." }),
|
|
43
44
|
/* @__PURE__ */ t("p", { className: "text-tertiary w-11/12 text-center font-sans text-lg font-normal", children: "Onside can only be installed from the Safari browser on your device." }),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
!x && /* @__PURE__ */
|
|
46
|
-
|
|
45
|
+
/* @__PURE__ */ i("div", { className: "mt-10 flex w-full flex-col items-center gap-5", children: [
|
|
46
|
+
!x && /* @__PURE__ */ i(
|
|
47
|
+
p,
|
|
47
48
|
{
|
|
48
49
|
className: "flex min-w-[206px] items-center justify-center gap-[6px] font-sans text-lg font-normal text-white!",
|
|
49
|
-
onClick:
|
|
50
|
+
onClick: u,
|
|
50
51
|
size: "lg",
|
|
51
52
|
children: [
|
|
52
53
|
"Open in Safari",
|
|
@@ -55,10 +56,10 @@ const v = 5e3, S = (n) => {
|
|
|
55
56
|
}
|
|
56
57
|
),
|
|
57
58
|
/* @__PURE__ */ t(
|
|
58
|
-
|
|
59
|
+
p,
|
|
59
60
|
{
|
|
60
61
|
className: "flex min-w-[206px] items-center justify-center gap-[6px] font-sans text-lg font-normal",
|
|
61
|
-
onClick:
|
|
62
|
+
onClick: g,
|
|
62
63
|
size: "lg",
|
|
63
64
|
variant: "text",
|
|
64
65
|
children: c ? "Link copied" : s
|
|
@@ -68,7 +69,7 @@ const v = 5e3, S = (n) => {
|
|
|
68
69
|
/* @__PURE__ */ t(
|
|
69
70
|
"p",
|
|
70
71
|
{
|
|
71
|
-
className:
|
|
72
|
+
className: k(
|
|
72
73
|
"relative mt-3 rounded-xl bg-black px-4 py-3 font-sans text-xs font-normal text-white transition-[opacity,transform] duration-300",
|
|
73
74
|
"before:absolute before:-top-1 before:left-1/2 before:block before:size-2 before:-translate-x-1/2 before:rotate-45 before:rounded-xs before:bg-black",
|
|
74
75
|
c ? "translate-y-0 opacity-100" : "-translate-y-2 opacity-0"
|
|
@@ -81,5 +82,5 @@ const v = 5e3, S = (n) => {
|
|
|
81
82
|
);
|
|
82
83
|
};
|
|
83
84
|
export {
|
|
84
|
-
|
|
85
|
+
I as GoToSafariModal
|
|
85
86
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("./install-package-B17QfMPy.cjs"),o=require("react"),h=require("./Dialog-yZ9bWtK1.cjs"),l=require("./utils.cjs");function b(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const p=b(o),k=5e3,y=t=>{const[a,e]=o.useState(!1);return{handleCopy:o.useCallback(()=>{navigator.clipboard.writeText(t),e(!0),setTimeout(()=>e(!1),k)},[t]),isCopied:a}},w=t=>p.createElement("svg",{width:10,height:16,viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},p.createElement("path",{d:"M3.9375 12.25L6.35539 9.83211C6.74592 9.44158 6.74592 8.80842 6.35539 8.41789L3.9375 6",stroke:"#1E1C1F",strokeOpacity:.6,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),C=({open:t,onClose:a})=>{const e=typeof window<"u"?window.location.href.replace(/\/$/,""):"",r=o.useMemo(()=>{const[s]=e.replace(/^https?:\/\//,"").split(/[?#]/);return s?.replace(/\/$/,"")??""},[e]),{handleCopy:c,isCopied:f}=y(e),d=l.getDeviceInfo(),u=d.browser==="opera"&&d.platform==="ios",x=o.useCallback(s=>{s||a()},[a]),m=o.useCallback(()=>{l.trackModalEvent("go_to_safari","click","button"),window.location.href=`x-safari-${e}`},[e]),g=o.useCallback(()=>{l.trackModalEvent("go_to_safari","click","link"),c()},[c]);return n.jsx(h.Dialog,{"aria-labelledby":"go-to-safari-modal",isDisplayingMargins:!0,open:t,onOpenChange:x,showCloseButton:!1,onBackClick:a,children:n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center",children:[n.jsx("h1",{className:"mt-8 text-center font-sans text-5xl font-medium",children:"Open in Safari"}),n.jsx("p",{className:"text-tertiary mt-5 w-11/12 text-center font-sans text-lg font-normal",children:"Copy the link and open it in Safari to continue."}),n.jsx("p",{className:"text-tertiary w-11/12 text-center font-sans text-lg font-normal",children:"Onside can only be installed from the Safari browser on your device."}),n.jsxs("div",{className:"mt-10 flex w-full flex-col items-center gap-5",children:[!u&&n.jsxs(i.Button,{className:"flex min-w-[206px] items-center justify-center gap-[6px] font-sans text-lg font-normal text-white!",onClick:m,size:"lg",children:["Open in Safari",n.jsx(w,{})]}),n.jsx(i.Button,{className:"flex min-w-[206px] items-center justify-center gap-[6px] font-sans text-lg font-normal",onClick:g,size:"lg",variant:"text",children:f?"Link copied":r})]}),n.jsx("p",{className:i.clsx("relative mt-3 rounded-xl bg-black px-4 py-3 font-sans text-xs font-normal text-white transition-[opacity,transform] duration-300","before:absolute before:-top-1 before:left-1/2 before:block before:size-2 before:-translate-x-1/2 before:rotate-45 before:rounded-xs before:bg-black",f?"translate-y-0 opacity-100":"-translate-y-2 opacity-0"),children:"Paste the link in Safari"})]})})};exports.GoToSafariModal=C;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as i, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as f, useEffect as m, useCallback as p } from "react";
|
|
3
|
-
import { c as v,
|
|
4
|
-
import { D as
|
|
5
|
-
|
|
3
|
+
import { c as v, B as h } from "./install-package-DowlG4hO.js";
|
|
4
|
+
import { D as b } from "./Dialog-yEP-7Deb.js";
|
|
5
|
+
import { trackModalEvent as w } from "./utils.js";
|
|
6
|
+
const y = "data:image/svg+xml,%3csvg%20width='10'%20height='16'%20viewBox='0%200%2010%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.9375%2012.25L6.35539%209.83211C6.74592%209.44158%206.74592%208.80842%206.35539%208.41789L3.9375%206'%20stroke='%231E1C1F'%20stroke-opacity='0.6'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", x = ({ breadcrumbs: e, className: t }) => /* @__PURE__ */ i("ul", { className: t, children: e.map((n, s) => /* @__PURE__ */ d("li", { className: "inline-flex", children: [
|
|
6
7
|
/* @__PURE__ */ i("p", { className: "rounded-3xl bg-lightGray px-2 py-0.5 text-sm", children: n }),
|
|
7
|
-
|
|
8
|
+
s < e.length - 1 && /* @__PURE__ */ i(
|
|
8
9
|
"img",
|
|
9
10
|
{
|
|
10
11
|
alt: "Arrow icon",
|
|
@@ -16,14 +17,14 @@ const y = "data:image/svg+xml,%3csvg%20width='10'%20height='16'%20viewBox='0%200
|
|
|
16
17
|
}
|
|
17
18
|
)
|
|
18
19
|
] }, n)) }), k = (e) => {
|
|
19
|
-
const { ariaLabel: t, children: n, className:
|
|
20
|
+
const { ariaLabel: t, children: n, className: s, poster: o } = e, r = f(null);
|
|
20
21
|
return m(() => {
|
|
21
22
|
const a = () => {
|
|
22
|
-
|
|
23
|
+
r.current && r.current.paused && (r.current.muted = !0, r.current.play());
|
|
23
24
|
}, l = () => {
|
|
24
|
-
|
|
25
|
+
r.current && (document.visibilityState === "hidden" ? r.current.pause() : document.visibilityState === "visible" && a());
|
|
25
26
|
}, c = () => {
|
|
26
|
-
|
|
27
|
+
r.current && r.current.pause();
|
|
27
28
|
};
|
|
28
29
|
return document.addEventListener("visibilitychange", l), window.addEventListener("focus", a), window.addEventListener("blur", c), () => {
|
|
29
30
|
document.removeEventListener("visibilitychange", l), window.removeEventListener("focus", a), window.removeEventListener("blur", c);
|
|
@@ -35,7 +36,7 @@ const y = "data:image/svg+xml,%3csvg%20width='10'%20height='16'%20viewBox='0%200
|
|
|
35
36
|
autoPlay: !0,
|
|
36
37
|
className: v(
|
|
37
38
|
"mt-2 transform-gpu rounded-2xl object-contain object-top",
|
|
38
|
-
|
|
39
|
+
s
|
|
39
40
|
),
|
|
40
41
|
controls: !1,
|
|
41
42
|
disablePictureInPicture: !0,
|
|
@@ -45,7 +46,7 @@ const y = "data:image/svg+xml,%3csvg%20width='10'%20height='16'%20viewBox='0%200
|
|
|
45
46
|
muted: !0,
|
|
46
47
|
playsInline: !0,
|
|
47
48
|
poster: o,
|
|
48
|
-
ref:
|
|
49
|
+
ref: r,
|
|
49
50
|
"webkit-playsinline": "true",
|
|
50
51
|
"x-webkit-airplay": "deny",
|
|
51
52
|
children: n
|
|
@@ -72,13 +73,13 @@ function N(e) {
|
|
|
72
73
|
return e.replace(/^\//, "");
|
|
73
74
|
}
|
|
74
75
|
function S(e) {
|
|
75
|
-
const t = N(e), n = t.split("/").pop() ?? t,
|
|
76
|
+
const t = N(e), n = t.split("/").pop() ?? t, s = [
|
|
76
77
|
t,
|
|
77
78
|
`/${t}`,
|
|
78
79
|
n,
|
|
79
80
|
`/${n}`
|
|
80
81
|
];
|
|
81
|
-
for (const o of
|
|
82
|
+
for (const o of s)
|
|
82
83
|
if (u[o])
|
|
83
84
|
return u[o];
|
|
84
85
|
return null;
|
|
@@ -93,7 +94,7 @@ function g(e) {
|
|
|
93
94
|
return e;
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
|
-
const j = ["Settings", "General", "Software Update"], L = g("/video/update-ios-poster.png"), P = g("/video/update-ios.h264.mp4"),
|
|
97
|
+
const j = ["Settings", "General", "Software Update"], L = g("/video/update-ios-poster.png"), P = g("/video/update-ios.h264.mp4"), A = ({
|
|
97
98
|
open: e,
|
|
98
99
|
onClose: t
|
|
99
100
|
}) => {
|
|
@@ -110,11 +111,11 @@ const j = ["Settings", "General", "Software Update"], L = g("/video/update-ios-p
|
|
|
110
111
|
o || t();
|
|
111
112
|
},
|
|
112
113
|
[t]
|
|
113
|
-
),
|
|
114
|
-
|
|
114
|
+
), s = p(() => {
|
|
115
|
+
w("update_ios", "click", "close"), t();
|
|
115
116
|
}, [t]);
|
|
116
117
|
return /* @__PURE__ */ i(
|
|
117
|
-
|
|
118
|
+
b,
|
|
118
119
|
{
|
|
119
120
|
"aria-labelledby": "update-ios",
|
|
120
121
|
open: e,
|
|
@@ -150,11 +151,11 @@ const j = ["Settings", "General", "Software Update"], L = g("/video/update-ios-p
|
|
|
150
151
|
}
|
|
151
152
|
) }),
|
|
152
153
|
/* @__PURE__ */ i(
|
|
153
|
-
|
|
154
|
+
h,
|
|
154
155
|
{
|
|
155
156
|
"aria-label": "Close",
|
|
156
157
|
className: "mt-4 w-full",
|
|
157
|
-
onClick:
|
|
158
|
+
onClick: s,
|
|
158
159
|
size: "lg",
|
|
159
160
|
type: "button",
|
|
160
161
|
children: "Close"
|
|
@@ -165,5 +166,5 @@ const j = ["Settings", "General", "Software Update"], L = g("/video/update-ios-p
|
|
|
165
166
|
);
|
|
166
167
|
};
|
|
167
168
|
export {
|
|
168
|
-
|
|
169
|
+
A as UpdateIOSModal
|
|
169
170
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("react"),p=require("./install-package-B17QfMPy.cjs"),m=require("./Dialog-yZ9bWtK1.cjs"),v=require("./utils.cjs"),f="data:image/svg+xml,%3csvg%20width='10'%20height='16'%20viewBox='0%200%2010%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.9375%2012.25L6.35539%209.83211C6.74592%209.44158%206.74592%208.80842%206.35539%208.41789L3.9375%206'%20stroke='%231E1C1F'%20stroke-opacity='0.6'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",h=({breadcrumbs:e,className:t})=>i.jsx("ul",{className:t,children:e.map((n,r)=>i.jsxs("li",{className:"inline-flex",children:[i.jsx("p",{className:"rounded-3xl bg-lightGray px-2 py-0.5 text-sm",children:n}),r<e.length-1&&i.jsx("img",{alt:"Arrow icon","aria-hidden":"true",className:"ml-1",height:16,src:f,width:10})]},n))}),b=e=>{const{ariaLabel:t,children:n,className:r,poster:s}=e,o=a.useRef(null);return a.useEffect(()=>{const l=()=>{o.current&&o.current.paused&&(o.current.muted=!0,o.current.play())},d=()=>{o.current&&(document.visibilityState==="hidden"?o.current.pause():document.visibilityState==="visible"&&l())},c=()=>{o.current&&o.current.pause()};return document.addEventListener("visibilitychange",d),window.addEventListener("focus",l),window.addEventListener("blur",c),()=>{document.removeEventListener("visibilitychange",d),window.removeEventListener("focus",l),window.removeEventListener("blur",c)}},[]),i.jsx("video",{"aria-label":t,autoPlay:!0,className:p.clsx("mt-2 transform-gpu rounded-2xl object-contain object-top",r),controls:!1,disablePictureInPicture:!0,disableRemotePlayback:!0,draggable:!1,loop:!0,muted:!0,playsInline:!0,poster:s,ref:o,"webkit-playsinline":"true","x-webkit-airplay":"deny",children:n},t)},u={"images/.gitkeep":"images/.gitkeep.e3b0c442","images/install-sad-android.png":"images/install-sad-android.8b24a6e1.png","scripts/1.0.0/install-package.cjs":"scripts/1.0.0/install-package.7ac30417.cjs","scripts/1.0.0/install-package.js":"scripts/1.0.0/install-package.65685adc.js","video/.gitkeep":"video/.gitkeep.e3b0c442","video/change-region-poster.png":"video/change-region-poster.bc6bda65.png","video/change-region.h264.mp4":"video/change-region.h264.c47b9282.mp4","video/get-approved-poster.jpg":"video/get-approved-poster.4e7177ac.jpg","video/get-approved.mp4":"video/get-approved.5b7b5f4a.mp4","video/open-onside-poster.jpg":"video/open-onside-poster.6b71cae6.jpg","video/open-onside.av1.mp4":"video/open-onside.av1.32f1aa51.mp4","video/open-onside.h264.mp4":"video/open-onside.h264.6df2feb6.mp4","video/update-ios-poster.png":"video/update-ios-poster.e59e58f8.png","video/update-ios.h264.mp4":"video/update-ios.h264.8054177e.mp4"},x="https://cdn.onside.io/assets/onside-install-widget/";function y(e){return e.replace(/^\//,"")}function w(e){const t=y(e),n=t.split("/").pop()??t,r=[t,`/${t}`,n,`/${n}`];for(const s of r)if(u[s])return u[s];return null}function g(e){if(!e||/^https?:\/\//i.test(e)||e.endsWith(".svg"))return e;const t=w(e);if(!t)return e;try{return new URL(t,x).toString()}catch{return e}}const j=["Settings","General","Software Update"],k=g("/video/update-ios-poster.png"),S=g("/video/update-ios.h264.mp4"),E=({open:e,onClose:t})=>{a.useEffect(()=>{let s;return e&&(s=setTimeout(()=>{document.querySelector("video")?.play()},600)),()=>{clearTimeout(s)}},[e]);const n=a.useCallback(s=>{s||t()},[t]),r=a.useCallback(()=>{v.trackModalEvent("update_ios","click","close"),t()},[t]);return i.jsx(m.Dialog,{"aria-labelledby":"update-ios",open:e,onOpenChange:n,showCloseButton:!1,onBackClick:t,children:i.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[i.jsx("h2",{className:"mt-3 text-center font-sans text-3xl font-medium",id:"update-ios",children:"Update your iOS"}),i.jsxs("section",{className:"mt-2",children:[i.jsx("p",{className:"mt-3 text-center font-sans text-xs font-normal",children:"To install Onside, update your iPhone or iPad to the latest version of iOS."}),i.jsx(h,{breadcrumbs:j,className:"mt-2 flex gap-1"})]}),i.jsx("div",{className:"relative mt-4 flex w-full grow justify-center overflow-hidden rounded-t-2xl bg-lightGray px-7 pt-7",children:i.jsx(b,{ariaLabel:"Instruction demonstrating the update process",className:"shadow-14-50-98 rounded-t-[20px] border-8 border-b-0 border-white",poster:k,children:i.jsx("source",{src:S,type:"video/mp4"})})}),i.jsx(p.Button,{"aria-label":"Close",className:"mt-4 w-full",onClick:r,size:"lg",type:"button",children:"Close"})]})})};exports.UpdateIOSModal=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./useInstallUrl-CjUspi0p.cjs");exports.useInstallUrl=l.useInstallUrl;exports.useInstallUrlStore=l.useInstallUrlStore;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { StoreApi } from 'zustand';
|
|
2
|
+
import { UseBoundStore } from 'zustand';
|
|
3
|
+
|
|
4
|
+
declare type InstallResponse = {
|
|
5
|
+
url: string;
|
|
6
|
+
attribution_token: string;
|
|
7
|
+
exp: number;
|
|
8
|
+
is_eligible: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
declare type InstallResponse_2 = {
|
|
12
|
+
url: string;
|
|
13
|
+
attribution_token: string;
|
|
14
|
+
exp: number;
|
|
15
|
+
is_eligible: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
declare type InstallUrlServiceResponse = InstallResponse & {
|
|
19
|
+
onside_token: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
declare type InstallUrlServiceResponse_2 = InstallResponse_2 & {
|
|
23
|
+
onside_token: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
declare type InstallUrlStatus = "idle" | "loading" | "success" | "error";
|
|
27
|
+
|
|
28
|
+
export declare type InstallUrlStoreData = {
|
|
29
|
+
status: InstallUrlStatus;
|
|
30
|
+
data: InstallUrlServiceResponse_2 | null;
|
|
31
|
+
error: Error | null;
|
|
32
|
+
fetchInstallUrl: () => Promise<void>;
|
|
33
|
+
reset: () => void;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export declare const useInstallUrl: (isAvailable?: boolean) => {
|
|
37
|
+
status: InstallUrlStatus;
|
|
38
|
+
data: InstallUrlServiceResponse | null;
|
|
39
|
+
error: Error | null;
|
|
40
|
+
fetchInstallUrl: () => Promise<void>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export declare const useInstallUrlStore: UseBoundStore<StoreApi<InstallUrlStoreData>>;
|
|
44
|
+
|
|
45
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("react/jsx-runtime"),C=require("react"),$=require("./useInstallUrl-CjUspi0p.cjs"),re=require("./utils.cjs");require("./installUrlService-AjG03i8i.cjs");function Be(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const q=Be(C);function Me(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Me(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Se(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Me(e))&&(o&&(o+=" "),o+=t);return o}const ue="-",Ve=e=>{const t=We(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{const p=i.split(ue);return p[0]===""&&p.length!==1&&p.shift(),ze(p,t)||Ue(i)},getConflictingClassGroupIds:(i,p)=>{const m=r[i]||[];return p&&o[i]?[...m,...o[i]]:m}}},ze=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),a=o?ze(e.slice(1),o):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(ue);return t.validators.find(({validator:i})=>i(l))?.classGroupId},ye=/^\[(.+)\]$/,Ue=e=>{if(ye.test(e)){const t=ye.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},We=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const a in r)ce(r[a],o,a,t);return o},ce=(e,t,r,o)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:ve(t,a);l.classGroupId=r;return}if(typeof a=="function"){if(qe(a)){ce(a(o),t,r,o);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([l,i])=>{ce(i,ve(t,l),r,o)})})},ve=(e,t)=>{let r=e;return t.split(ue).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},qe=e=>e.isThemeGetter,$e=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const a=(l,i)=>{r.set(l,i),t++,t>e&&(t=0,o=r,r=new Map)};return{get(l){let i=r.get(l);if(i!==void 0)return i;if((i=o.get(l))!==void 0)return a(l,i),i},set(l,i){r.has(l)?r.set(l,i):a(l,i)}}},de="!",me=":",De=me.length,He=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=a=>{const l=[];let i=0,p=0,m=0,h;for(let g=0;g<a.length;g++){let k=a[g];if(i===0&&p===0){if(k===me){l.push(a.slice(m,g)),m=g+De;continue}if(k==="/"){h=g;continue}}k==="["?i++:k==="]"?i--:k==="("?p++:k===")"&&p--}const b=l.length===0?a:a.substring(m),S=Ke(b),T=S!==b,I=h&&h>m?h-m:void 0;return{modifiers:l,hasImportantModifier:T,baseClassName:S,maybePostfixModifierPosition:I}};if(t){const a=t+me,l=o;o=i=>i.startsWith(a)?l(i.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(r){const a=o;o=l=>r({className:l,parseClassName:a})}return o},Ke=e=>e.endsWith(de)?e.substring(0,e.length-1):e.startsWith(de)?e.substring(1):e,Ze=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const a=[];let l=[];return o.forEach(i=>{i[0]==="["||t[i]?(a.push(...l.sort(),i),l=[]):l.push(i)}),a.push(...l.sort()),a}},Ye=e=>({cache:$e(e.cacheSize),parseClassName:He(e),sortModifiers:Ze(e),...Ve(e)}),Je=/\s+/,Xe=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:l}=t,i=[],p=e.trim().split(Je);let m="";for(let h=p.length-1;h>=0;h-=1){const b=p[h],{isExternal:S,modifiers:T,hasImportantModifier:I,baseClassName:g,maybePostfixModifierPosition:k}=r(b);if(S){m=b+(m.length>0?" "+m:m);continue}let A=!!k,y=o(A?g.substring(0,k):g);if(!y){if(!A){m=b+(m.length>0?" "+m:m);continue}if(y=o(g),!y){m=b+(m.length>0?" "+m:m);continue}A=!1}const E=l(T).join(":"),_=I?E+de:E,P=_+y;if(i.includes(P))continue;i.push(P);const j=a(y,A);for(let N=0;N<j.length;++N){const R=j[N];i.push(_+R)}m=b+(m.length>0?" "+m:m)}return m};function Qe(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Ae(t))&&(o&&(o+=" "),o+=r);return o}const Ae=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Ae(e[o]))&&(r&&(r+=" "),r+=t);return r};function et(e,...t){let r,o,a,l=i;function i(m){const h=t.reduce((b,S)=>S(b),e());return r=Ye(h),o=r.cache.get,a=r.cache.set,l=p,p(m)}function p(m){const h=o(m);if(h)return h;const b=Xe(m,r);return a(m,b),b}return function(){return l(Qe.apply(null,arguments))}}const x=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ee=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_e=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tt=/^\d+\/\d+$/,ot=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,st=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,at=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=e=>tt.test(e),u=e=>!!e&&!Number.isNaN(Number(e)),F=e=>!!e&&Number.isInteger(Number(e)),ie=e=>e.endsWith("%")&&u(e.slice(0,-1)),L=e=>ot.test(e),it=()=>!0,lt=e=>rt.test(e)&&!nt.test(e),Ne=()=>!1,ct=e=>st.test(e),dt=e=>at.test(e),mt=e=>!n(e)&&!s(e),ut=e=>D(e,Te,Ne),n=e=>Ee.test(e),V=e=>D(e,Re,lt),le=e=>D(e,ht,u),Ce=e=>D(e,Pe,Ne),pt=e=>D(e,je,dt),te=e=>D(e,Ge,ct),s=e=>_e.test(e),K=e=>H(e,Re),ft=e=>H(e,xt),Ie=e=>H(e,Pe),bt=e=>H(e,Te),gt=e=>H(e,je),oe=e=>H(e,Ge,!0),D=(e,t,r)=>{const o=Ee.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},H=(e,t,r=!1)=>{const o=_e.exec(e);return o?o[1]?t(o[1]):r:!1},Pe=e=>e==="position"||e==="percentage",je=e=>e==="image"||e==="url",Te=e=>e==="length"||e==="size"||e==="bg-size",Re=e=>e==="length",ht=e=>e==="number",xt=e=>e==="family-name",Ge=e=>e==="shadow",wt=()=>{const e=x("color"),t=x("font"),r=x("text"),o=x("font-weight"),a=x("tracking"),l=x("leading"),i=x("breakpoint"),p=x("container"),m=x("spacing"),h=x("radius"),b=x("shadow"),S=x("inset-shadow"),T=x("text-shadow"),I=x("drop-shadow"),g=x("blur"),k=x("perspective"),A=x("aspect"),y=x("ease"),E=x("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...P(),s,n],N=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],c=()=>[s,n,m],z=()=>[W,"full","auto",...c()],pe=()=>[F,"none","subgrid",s,n],fe=()=>["auto",{span:["full",F,s,n]},F,s,n],Y=()=>[F,"auto",s,n],be=()=>["auto","min","max","fr",s,n],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...c()],B=()=>[W,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...c()],d=()=>[e,s,n],ge=()=>[...P(),Ie,Ce,{position:[s,n]}],he=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",bt,ut,{size:[s,n]}],se=()=>[ie,K,V],v=()=>["","none","full",h,s,n],M=()=>["",u,K,V],J=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],w=()=>[u,ie,Ie,Ce],ke=()=>["","none",g,s,n],X=()=>["none",u,s,n],Q=()=>["none",u,s,n],ae=()=>[u,s,n],ee=()=>[W,"full",...c()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[L],breakpoint:[L],color:[it],container:[L],"drop-shadow":[L],ease:["in","out","in-out"],font:[mt],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[L],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[L],shadow:[L],spacing:["px",u],text:[L],"text-shadow":[L],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",W,n,s,A]}],container:["container"],columns:[{columns:[u,n,s,p]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:j()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[F,"auto",s,n]}],basis:[{basis:[W,"full","auto",p,...c()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[u,W,"auto","initial","none",n]}],grow:[{grow:["",u,s,n]}],shrink:[{shrink:["",u,s,n]}],order:[{order:[F,"first","last","none",s,n]}],"grid-cols":[{"grid-cols":pe()}],"col-start-end":[{col:fe()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":pe()}],"row-start-end":[{row:fe()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":be()}],"auto-rows":[{"auto-rows":be()}],gap:[{gap:c()}],"gap-x":[{"gap-x":c()}],"gap-y":[{"gap-y":c()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:c()}],px:[{px:c()}],py:[{py:c()}],ps:[{ps:c()}],pe:[{pe:c()}],pt:[{pt:c()}],pr:[{pr:c()}],pb:[{pb:c()}],pl:[{pl:c()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":c()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":c()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[p,"screen",...B()]}],"min-w":[{"min-w":[p,"screen","none",...B()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[i]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",r,K,V]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,s,le]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ie,n]}],"font-family":[{font:[ft,n,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,s,n]}],"line-clamp":[{"line-clamp":[u,"none",s,le]}],leading:[{leading:[l,...c()]}],"list-image":[{"list-image":["none",s,n]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",s,n]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:d()}],"text-color":[{text:d()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[u,"from-font","auto",s,V]}],"text-decoration-color":[{decoration:d()}],"underline-offset":[{"underline-offset":[u,"auto",s,n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:c()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",s,n]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",s,n]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ge()}],"bg-repeat":[{bg:he()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},F,s,n],radial:["",s,n],conic:[F,s,n]},gt,pt]}],"bg-color":[{bg:d()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:d()}],"gradient-via":[{via:d()}],"gradient-to":[{to:d()}],rounded:[{rounded:v()}],"rounded-s":[{"rounded-s":v()}],"rounded-e":[{"rounded-e":v()}],"rounded-t":[{"rounded-t":v()}],"rounded-r":[{"rounded-r":v()}],"rounded-b":[{"rounded-b":v()}],"rounded-l":[{"rounded-l":v()}],"rounded-ss":[{"rounded-ss":v()}],"rounded-se":[{"rounded-se":v()}],"rounded-ee":[{"rounded-ee":v()}],"rounded-es":[{"rounded-es":v()}],"rounded-tl":[{"rounded-tl":v()}],"rounded-tr":[{"rounded-tr":v()}],"rounded-br":[{"rounded-br":v()}],"rounded-bl":[{"rounded-bl":v()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:d()}],"border-color-x":[{"border-x":d()}],"border-color-y":[{"border-y":d()}],"border-color-s":[{"border-s":d()}],"border-color-e":[{"border-e":d()}],"border-color-t":[{"border-t":d()}],"border-color-r":[{"border-r":d()}],"border-color-b":[{"border-b":d()}],"border-color-l":[{"border-l":d()}],"divide-color":[{divide:d()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[u,s,n]}],"outline-w":[{outline:["",u,K,V]}],"outline-color":[{outline:d()}],shadow:[{shadow:["","none",b,oe,te]}],"shadow-color":[{shadow:d()}],"inset-shadow":[{"inset-shadow":["none",S,oe,te]}],"inset-shadow-color":[{"inset-shadow":d()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:d()}],"ring-offset-w":[{"ring-offset":[u,V]}],"ring-offset-color":[{"ring-offset":d()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":d()}],"text-shadow":[{"text-shadow":["none",T,oe,te]}],"text-shadow-color":[{"text-shadow":d()}],opacity:[{opacity:[u,s,n]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[u]}],"mask-image-linear-from-pos":[{"mask-linear-from":w()}],"mask-image-linear-to-pos":[{"mask-linear-to":w()}],"mask-image-linear-from-color":[{"mask-linear-from":d()}],"mask-image-linear-to-color":[{"mask-linear-to":d()}],"mask-image-t-from-pos":[{"mask-t-from":w()}],"mask-image-t-to-pos":[{"mask-t-to":w()}],"mask-image-t-from-color":[{"mask-t-from":d()}],"mask-image-t-to-color":[{"mask-t-to":d()}],"mask-image-r-from-pos":[{"mask-r-from":w()}],"mask-image-r-to-pos":[{"mask-r-to":w()}],"mask-image-r-from-color":[{"mask-r-from":d()}],"mask-image-r-to-color":[{"mask-r-to":d()}],"mask-image-b-from-pos":[{"mask-b-from":w()}],"mask-image-b-to-pos":[{"mask-b-to":w()}],"mask-image-b-from-color":[{"mask-b-from":d()}],"mask-image-b-to-color":[{"mask-b-to":d()}],"mask-image-l-from-pos":[{"mask-l-from":w()}],"mask-image-l-to-pos":[{"mask-l-to":w()}],"mask-image-l-from-color":[{"mask-l-from":d()}],"mask-image-l-to-color":[{"mask-l-to":d()}],"mask-image-x-from-pos":[{"mask-x-from":w()}],"mask-image-x-to-pos":[{"mask-x-to":w()}],"mask-image-x-from-color":[{"mask-x-from":d()}],"mask-image-x-to-color":[{"mask-x-to":d()}],"mask-image-y-from-pos":[{"mask-y-from":w()}],"mask-image-y-to-pos":[{"mask-y-to":w()}],"mask-image-y-from-color":[{"mask-y-from":d()}],"mask-image-y-to-color":[{"mask-y-to":d()}],"mask-image-radial":[{"mask-radial":[s,n]}],"mask-image-radial-from-pos":[{"mask-radial-from":w()}],"mask-image-radial-to-pos":[{"mask-radial-to":w()}],"mask-image-radial-from-color":[{"mask-radial-from":d()}],"mask-image-radial-to-color":[{"mask-radial-to":d()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[u]}],"mask-image-conic-from-pos":[{"mask-conic-from":w()}],"mask-image-conic-to-pos":[{"mask-conic-to":w()}],"mask-image-conic-from-color":[{"mask-conic-from":d()}],"mask-image-conic-to-color":[{"mask-conic-to":d()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ge()}],"mask-repeat":[{mask:he()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",s,n]}],filter:[{filter:["","none",s,n]}],blur:[{blur:ke()}],brightness:[{brightness:[u,s,n]}],contrast:[{contrast:[u,s,n]}],"drop-shadow":[{"drop-shadow":["","none",I,oe,te]}],"drop-shadow-color":[{"drop-shadow":d()}],grayscale:[{grayscale:["",u,s,n]}],"hue-rotate":[{"hue-rotate":[u,s,n]}],invert:[{invert:["",u,s,n]}],saturate:[{saturate:[u,s,n]}],sepia:[{sepia:["",u,s,n]}],"backdrop-filter":[{"backdrop-filter":["","none",s,n]}],"backdrop-blur":[{"backdrop-blur":ke()}],"backdrop-brightness":[{"backdrop-brightness":[u,s,n]}],"backdrop-contrast":[{"backdrop-contrast":[u,s,n]}],"backdrop-grayscale":[{"backdrop-grayscale":["",u,s,n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u,s,n]}],"backdrop-invert":[{"backdrop-invert":["",u,s,n]}],"backdrop-opacity":[{"backdrop-opacity":[u,s,n]}],"backdrop-saturate":[{"backdrop-saturate":[u,s,n]}],"backdrop-sepia":[{"backdrop-sepia":["",u,s,n]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":c()}],"border-spacing-x":[{"border-spacing-x":c()}],"border-spacing-y":[{"border-spacing-y":c()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",s,n]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[u,"initial",s,n]}],ease:[{ease:["linear","initial",y,s,n]}],delay:[{delay:[u,s,n]}],animate:[{animate:["none",E,s,n]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,s,n]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[s,n,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ee()}],"translate-x":[{"translate-x":ee()}],"translate-y":[{"translate-y":ee()}],"translate-z":[{"translate-z":ee()}],"translate-none":["translate-none"],accent:[{accent:d()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:d()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",s,n]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":c()}],"scroll-mx":[{"scroll-mx":c()}],"scroll-my":[{"scroll-my":c()}],"scroll-ms":[{"scroll-ms":c()}],"scroll-me":[{"scroll-me":c()}],"scroll-mt":[{"scroll-mt":c()}],"scroll-mr":[{"scroll-mr":c()}],"scroll-mb":[{"scroll-mb":c()}],"scroll-ml":[{"scroll-ml":c()}],"scroll-p":[{"scroll-p":c()}],"scroll-px":[{"scroll-px":c()}],"scroll-py":[{"scroll-py":c()}],"scroll-ps":[{"scroll-ps":c()}],"scroll-pe":[{"scroll-pe":c()}],"scroll-pt":[{"scroll-pt":c()}],"scroll-pr":[{"scroll-pr":c()}],"scroll-pb":[{"scroll-pb":c()}],"scroll-pl":[{"scroll-pl":c()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",s,n]}],fill:[{fill:["none",...d()]}],"stroke-w":[{stroke:[u,K,V,le]}],stroke:[{stroke:["none",...d()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},kt=et(wt);function O(...e){return kt(Se(e))}const yt={primary:"rounded-[var(--onside-btn-radius,9999px)] whitespace-nowrap leading-none !font-medium transition-bg duration-300 flex items-center justify-center text-center",secondary:"rounded-[var(--onside-btn-radius,9999px)] whitespace-nowrap leading-none !font-medium bg-transparent border transition-bg transition-color duration-300 flex items-center justify-center text-center",text:"whitespace-nowrap leading-none !font-medium transition-colors duration-300 flex items-center justify-center text-center",transparent:"rounded-[var(--onside-btn-radius,9999px)] whitespace-nowrap leading-none !font-medium transition-opacity duration-300 flex items-center justify-center text-center"},vt={primary:{blue:"bg-[var(--onside-btn-bg,#0A5EFF)] text-[color:var(--onside-btn-text,#FFFFFF)] hover:bg-[var(--onside-btn-bg-hover,#337AFF)] focus:bg-[var(--onside-btn-bg,#0A5EFF)] disabled:bg-[var(--onside-btn-disabled-bg,rgba(10,94,255,0.2))]",lightBlue:"bg-[#e2eaf8] text-blue hover:opacity-60 focus:opacity-100",white:"bg-white text-blue hover:opacity-90 focus:opacity-100 disabled:opacity-50"},secondary:{blue:"border-blue text-blue hover:bg-blue hover:text-white focus:bg-blue focus:text-white",lightBlue:"border-[#e2eaf8] text-[#e2eaf8] hover:bg-[#e2eaf8] hover:text-white focus:bg-[#e2eaf8] focus:text-white",white:"border-white text-white hover:bg-white hover:text-blue focus:bg-white focus:text-blue"},text:{blue:"bg-transparent text-blue hover:underline focus:underline",lightBlue:"bg-transparent text-[#e2eaf8] hover:underline focus:underline",white:"bg-transparent text-white hover:underline focus:underline"},transparent:{blue:"bg-transparent text-blue hover:opacity-75",lightBlue:"bg-transparent text-[#e2eaf8] hover:opacity-75",white:"bg-transparent text-white hover:opacity-75"}},Ct={lg:"py-[var(--onside-btn-py,1rem)] px-[var(--onside-btn-px,2rem)] text-[length:var(--onside-btn-font-size,1.125rem)] font-medium",md:"py-[var(--onside-btn-py,0.75rem)] px-[var(--onside-btn-px,1.25rem)] text-[length:var(--onside-btn-font-size,1rem)] font-medium"};function Z({className:e,...t}){const r=t.variant??"primary",o=t.color??"blue",a=t.size??"md",l=O(yt[r],Ct[r!=="text"?a:"md"],vt[r][o],e);if(typeof t.href>"u"){const m=t;return f.jsx("button",{className:l,...m})}const i=t,p=("rel"in i?i.rel:void 0)??(i.target==="_blank"?"noopener noreferrer":void 0);return f.jsx("a",{className:l,rel:p,...i})}const It=7*$.SEC_MS,Mt=7*$.SEC_MS,Le=2*$.SEC_MS,Oe=$.create(e=>({activeModal:null,openModal:t=>e({activeModal:t}),closeModal:()=>e({activeModal:null})})),St={INSTALL_BUTTON_CLICK:"install_button_click"},zt=(e={},t)=>({trackInstallEvent:a=>{const l=re.trackEvent(St.INSTALL_BUTTON_CLICK,{...e,event_type:a});l&&t?.onEvent?.(l)},trackOpenModalEvent:a=>{const l=re.trackModalEvent(a,"opened","install_button",{...e});l&&t?.onEvent?.(l)}}),At=e=>e?"ios_18_6_plus":"install_click",Et=(e,t)=>{e(At(t))},_t=e=>{e("no_condition_matched")},Nt=e=>{window.location.assign(e)},Pt=(e,t=Nt)=>{t(e)},jt=e=>{const{id:t,location:r="hero",customAnalytics:o,handleCustomStep:a,pathname:l}=e,i=re.resolveInstallConditions(re.getDeviceInfo()),p=i.installState==="install_available",{data:m,error:h}=$.useInstallUrl(p),b=m?.url??null,S=m?.onside_token??null,T=m?.attribution_token??null,I=m?.is_eligible??null,{openModal:g}=Oe(),[k,A]=C.useState(!1),{trackOpenModalEvent:y,trackInstallEvent:E}=zt({page:l,location:r,button_id:t??void 0,onside_token:S??void 0,attribution_token:T??void 0},o),_=C.useCallback(()=>{A(!0);const c=setTimeout(()=>{A(!1),clearTimeout(c)},Le)},[]),P=C.useCallback(c=>{if(!b||!$.isProduction){c.preventDefault();return}if(a){a();return}Et(E,i.usesNewInstallFlow),Pt(b)},[b,a,i.usesNewInstallFlow,E]),j=C.useCallback(()=>{if(i.installState==="go_to_safari"){y("go_to_safari"),g("goToSafari");return}if(i.installState==="update_ios"){y("update_ios"),g("updateIOS");return}_(),_t(E)},[i.installState,g,_,E,y]),N=C.useCallback(()=>{y("is_android"),g("isAndroid")},[g,y]);return{viewMode:i.installState==="android"?"android":k?"loading":b&&p?"link":"button",installUrl:b,error:h,isEligible:I,conditions:i,handleInstallClick:P,handleModalFlowClick:j,handleAndroidClick:N}},Tt=e=>q.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},q.createElement("path",{d:"M12.1268 5.74646C11.3368 5.74646 10.1139 4.84824 8.82613 4.88071C7.12708 4.90235 5.56872 5.8655 4.69214 7.39139C2.92817 10.454 4.23762 14.9776 5.95831 17.4667C6.80243 18.6787 7.79805 20.0423 9.11832 19.999C10.3845 19.9449 10.8607 19.1765 12.3974 19.1765C13.9233 19.1765 14.3562 19.999 15.6981 19.9665C17.0617 19.9449 17.9274 18.7328 18.7607 17.5099C19.7239 16.1031 20.1243 14.7395 20.1459 14.6638C20.1134 14.653 17.4945 13.6465 17.4621 10.6164C17.4404 8.084 19.5291 6.87195 19.6265 6.81784C18.436 5.0755 16.6071 4.88071 15.9686 4.83742C14.3021 4.70755 12.906 5.74646 12.1268 5.74646ZM14.9406 3.19248C15.644 2.34837 16.1093 1.16877 15.9795 0C14.973 0.0432878 13.761 0.670965 13.0359 1.51508C12.3866 2.26179 11.8238 3.46303 11.9753 4.61016C13.09 4.69673 14.2371 4.03659 14.9406 3.19248Z",fill:"currentColor"})),Rt=({className:e,onClick:t,children:r,id:o,androidClassName:a,androidTextClassName:l})=>f.jsx(Z,{id:o,className:O("bg-white px-7",e,a),variant:"secondary",size:"lg",onClick:t,children:f.jsxs("span",{className:"flex flex-row items-center gap-1",children:[f.jsx(Tt,{className:l?"text-[#FF465D]":void 0}),f.jsx("span",{className:O("flex-1",l),children:r})]})}),Gt=({href:e,onClick:t,children:r,className:o,id:a})=>f.jsx(Z,{id:a,href:e,size:"lg",onClick:t,className:o,children:r}),Lt=e=>q.createElement("svg",{stroke:"customColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},q.createElement("style",null,".spinner_V8m1{transform-origin:center;animation:spinner_zKoa 2s linear infinite}.spinner_V8m1 circle{stroke-linecap:round;animation:spinner_YpZS 1.5s ease-in-out infinite}@keyframes spinner_zKoa{100%{transform:rotate(360deg)}}@keyframes spinner_YpZS{0%{stroke-dasharray:0 150;stroke-dashoffset:0}47.5%{stroke-dasharray:42 150;stroke-dashoffset:-16}95%,100%{stroke-dasharray:42 150;stroke-dashoffset:-59}}"),q.createElement("g",{className:"spinner_V8m1"},q.createElement("circle",{cx:12,cy:12,r:9.5,fill:"none",strokeWidth:3}))),Ot=e=>{const{id:t,className:r,children:o="Loading...",showLoaderOnly:a}=e;return f.jsx(Z,{id:t,className:O("px-8 py-4",r),disabled:!0,children:f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(Lt,{className:"size-5 animate-spin stroke-blue"}),!a&&o]})})},Ft=()=>f.jsx("p",{className:"mt-2 text-center text-sm text-red-600",children:"Unable to load install link. Please try again."}),Fe=C.createContext(!1),Bt=()=>typeof window<"u"?window.location.pathname:"",Vt=e=>{const{className:t,children:r="Install Onside",handleCustomStep:o,location:a="hero",caption:l,captionClassName:i,showCaption:p=!0,showLoaderOnly:m=!1,androidClassName:h,androidTextClassName:b,customAnalytics:S,styleVars:T,id:I}=e,g=C.useRef(Bt()),k=C.useContext(Fe),{viewMode:A,installUrl:y,error:E,isEligible:_,handleInstallClick:P,handleModalFlowClick:j,handleAndroidClick:N}=jt({id:I,location:a,customAnalytics:S,handleCustomStep:o,pathname:g.current});C.useEffect(()=>{},[k]);const R=p&&(!_||l)&&f.jsx("div",{className:O("text-2xs font-mono opacity-60 [color:var(--onside-caption-color,rgba(30,28,31,0.6))] [font-size:var(--onside-caption-size,var(--text-2xs))] [line-height:var(--onside-caption-line-height,var(--text-2xs--line-height))]",i),children:_?l:"Only available in the EU. Install from an eligible region."}),c={"data-provider-widget-host":"",style:T},z={android:f.jsx(Rt,{id:I,className:t,androidClassName:h,androidTextClassName:b,onClick:N,children:"Onside is for iPhone and iPad"}),loading:f.jsx(Ot,{showLoaderOnly:m,id:I,className:O("bg-buttonHover!",t)}),link:f.jsxs(f.Fragment,{children:[f.jsxs(Gt,{id:I,className:O(t,"flex-col gap-1"),href:y??"",onClick:P,children:[r,R]}),E&&f.jsx(Ft,{})]}),button:f.jsxs(Z,{id:I,className:O(t,"flex-col gap-1"),size:"lg",onClick:j,children:[r,R]})};return f.jsx("div",{...c,children:z[A]??z.button})},Ut=C.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./AndroidPlatformModal-DTglyxUG.cjs"))).AndroidPlatformModal})),Wt=C.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./GoToSafariModal-Cgx0X0rg.cjs"))).GoToSafariModal})),qt=C.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./UpdateIOSModal-CE-d3YCr.cjs"))).UpdateIOSModal})),$t=()=>{const{activeModal:e,closeModal:t}=Oe();return f.jsxs(C.Suspense,{fallback:null,children:[f.jsx(Wt,{open:e==="goToSafari",onClose:t}),f.jsx(qt,{open:e==="updateIOS",onClose:t}),f.jsx(Ut,{open:e==="isAndroid",onClose:t})]})},Dt=({children:e})=>f.jsxs(Fe.Provider,{value:!0,children:[e,f.jsx($t,{})]});exports.AVERAGE_CHECK_TIME=Mt;exports.AVERAGE_INSTALL_TIME=It;exports.AVERAGE_LOADING_TIME=Le;exports.Button=Z;exports.InstallAppButton=Vt;exports.InstallWidgetProvider=Dt;exports.clsx=Se;exports.cn=O;
|