@betterstore/react 0.3.3 → 0.3.5
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/CHANGELOG.md +12 -0
- package/dist/components/cart/useCart.d.ts +1 -2
- package/dist/components/checkout-embed/checkout-form.d.ts +2 -1
- package/dist/components/checkout-embed/checkout-schema.d.ts +18 -18
- package/dist/components/checkout-embed/steps/summary/discount-code.d.ts +5 -0
- package/dist/components/checkout-embed/steps/summary/index.d.ts +8 -4
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/index.cjs.js +1541 -254
- package/dist/index.mjs +1541 -254
- package/dist/lib/betterstore.d.ts +1 -0
- package/package.json +4 -2
package/dist/index.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var sdk = require('@betterstore/sdk');
|
|
5
|
+
var ReactDOM = require('react-dom');
|
|
5
6
|
var reactSlot = require('@radix-ui/react-slot');
|
|
6
7
|
var LabelPrimitive = require('@radix-ui/react-label');
|
|
7
8
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
8
|
-
require('react-dom');
|
|
9
9
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
|
|
@@ -86,7 +86,7 @@ function createJSONStorage(getStorage, options) {
|
|
|
86
86
|
if (str2 === null) {
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
89
|
-
return JSON.parse(str2,
|
|
89
|
+
return JSON.parse(str2, void 0 );
|
|
90
90
|
};
|
|
91
91
|
const str = (_a = storage.getItem(name)) != null ? _a : null;
|
|
92
92
|
if (str instanceof Promise) {
|
|
@@ -96,7 +96,7 @@ function createJSONStorage(getStorage, options) {
|
|
|
96
96
|
},
|
|
97
97
|
setItem: (name, newValue) => storage.setItem(
|
|
98
98
|
name,
|
|
99
|
-
JSON.stringify(newValue,
|
|
99
|
+
JSON.stringify(newValue, void 0 )
|
|
100
100
|
),
|
|
101
101
|
removeItem: (name) => storage.removeItem(name)
|
|
102
102
|
};
|
|
@@ -184,7 +184,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
184
184
|
var _a2;
|
|
185
185
|
return cb((_a2 = get()) != null ? _a2 : configResult);
|
|
186
186
|
});
|
|
187
|
-
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ?
|
|
187
|
+
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;
|
|
188
188
|
return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
|
|
189
189
|
if (deserializedStorageValue) {
|
|
190
190
|
if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
|
|
@@ -205,7 +205,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
205
205
|
return [false, deserializedStorageValue.state];
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
return [false,
|
|
208
|
+
return [false, void 0];
|
|
209
209
|
}).then((migrationResult) => {
|
|
210
210
|
var _a2;
|
|
211
211
|
const [migrated, migratedState] = migrationResult;
|
|
@@ -218,12 +218,12 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
218
218
|
return setItem();
|
|
219
219
|
}
|
|
220
220
|
}).then(() => {
|
|
221
|
-
postRehydrationCallback == null ?
|
|
221
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
|
|
222
222
|
stateFromStorage = get();
|
|
223
223
|
hasHydrated = true;
|
|
224
224
|
finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
|
|
225
225
|
}).catch((e) => {
|
|
226
|
-
postRehydrationCallback == null ?
|
|
226
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
229
|
api.persist = {
|
|
@@ -237,7 +237,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
239
|
clearStorage: () => {
|
|
240
|
-
storage == null ?
|
|
240
|
+
storage == null ? void 0 : storage.removeItem(options.name);
|
|
241
241
|
},
|
|
242
242
|
getOptions: () => options,
|
|
243
243
|
rehydrate: () => hydrate(),
|
|
@@ -2654,6 +2654,7 @@ const serializeCookie = function (name, val) {
|
|
|
2654
2654
|
throw new TypeError('option sameSite is invalid');
|
|
2655
2655
|
}
|
|
2656
2656
|
}
|
|
2657
|
+
if (opt.partitioned) str += '; Partitioned';
|
|
2657
2658
|
return str;
|
|
2658
2659
|
};
|
|
2659
2660
|
const cookie = {
|
|
@@ -3038,7 +3039,7 @@ const hasLoadedNamespace = (ns, i18n, options = {}) => {
|
|
|
3038
3039
|
});
|
|
3039
3040
|
};
|
|
3040
3041
|
const isString$1 = obj => typeof obj === 'string';
|
|
3041
|
-
const isObject$
|
|
3042
|
+
const isObject$2 = obj => typeof obj === 'object' && obj !== null;
|
|
3042
3043
|
|
|
3043
3044
|
const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3044
3045
|
const htmlEntities = {
|
|
@@ -3136,7 +3137,7 @@ const useTranslation = (ns, props = {}) => {
|
|
|
3136
3137
|
warnOnce$1(i18n, 'NO_I18NEXT_INSTANCE', 'useTranslation: You will need to pass in an i18next instance by using initReactI18next');
|
|
3137
3138
|
const notReadyT = (k, optsOrDefaultValue) => {
|
|
3138
3139
|
if (isString$1(optsOrDefaultValue)) return optsOrDefaultValue;
|
|
3139
|
-
if (isObject$
|
|
3140
|
+
if (isObject$2(optsOrDefaultValue) && isString$1(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
|
|
3140
3141
|
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
3141
3142
|
};
|
|
3142
3143
|
const retNotReady = [notReadyT, {}, false];
|
|
@@ -3257,7 +3258,12 @@ const CheckoutEmbed$2 = {
|
|
|
3257
3258
|
subtotal: "Mezisoučet",
|
|
3258
3259
|
tax: "Daň",
|
|
3259
3260
|
title: "Shrnutí",
|
|
3260
|
-
total: "Celkem"
|
|
3261
|
+
total: "Celkem",
|
|
3262
|
+
discountCodeApply: "Aplikovat",
|
|
3263
|
+
discountCodePlaceholder: "Slevový kód nebo dárková karta",
|
|
3264
|
+
discountCodeError: "Už dostáváte nejlepší nabídku!",
|
|
3265
|
+
free: "Zdarma",
|
|
3266
|
+
discountCodeSuccess: "Slevový kód byl úspěšně použit."
|
|
3261
3267
|
},
|
|
3262
3268
|
loading: "Načítání ...",
|
|
3263
3269
|
Payment: {
|
|
@@ -3304,7 +3310,12 @@ const CheckoutEmbed$1 = {
|
|
|
3304
3310
|
subtotal: "Subtotal",
|
|
3305
3311
|
shipping: "Shipping",
|
|
3306
3312
|
calculatedAtNextStep: "Calculated at next step",
|
|
3307
|
-
tax: "Tax"
|
|
3313
|
+
tax: "Tax",
|
|
3314
|
+
discountCodePlaceholder: "Discount code or gift card",
|
|
3315
|
+
discountCodeApply: "Apply",
|
|
3316
|
+
discountCodeError: "You're already getting the best offer!",
|
|
3317
|
+
free: "Free",
|
|
3318
|
+
discountCodeSuccess: "Discount code applied successfully."
|
|
3308
3319
|
},
|
|
3309
3320
|
CustomerForm: {
|
|
3310
3321
|
address: {
|
|
@@ -3392,6 +3403,1135 @@ const createI18nInstance = (locale) => __awaiter(void 0, void 0, void 0, functio
|
|
|
3392
3403
|
return instance;
|
|
3393
3404
|
});
|
|
3394
3405
|
|
|
3406
|
+
var M$1=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x=React__namespace.createContext(void 0),U$1={setTheme:e=>{},themes:[]},z$1=()=>{var e;return (e=React__namespace.useContext(x))!=null?e:U$1};React__namespace.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React__namespace.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M$1.toString()})(${p})`}})});
|
|
3407
|
+
|
|
3408
|
+
function __insertCSS(code) {
|
|
3409
|
+
if (typeof document == 'undefined') return
|
|
3410
|
+
let head = document.head || document.getElementsByTagName('head')[0];
|
|
3411
|
+
let style = document.createElement('style');
|
|
3412
|
+
style.type = 'text/css';
|
|
3413
|
+
head.appendChild(style)
|
|
3414
|
+
;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code));
|
|
3415
|
+
}
|
|
3416
|
+
|
|
3417
|
+
const getAsset = (type)=>{
|
|
3418
|
+
switch(type){
|
|
3419
|
+
case 'success':
|
|
3420
|
+
return SuccessIcon;
|
|
3421
|
+
case 'info':
|
|
3422
|
+
return InfoIcon;
|
|
3423
|
+
case 'warning':
|
|
3424
|
+
return WarningIcon;
|
|
3425
|
+
case 'error':
|
|
3426
|
+
return ErrorIcon;
|
|
3427
|
+
default:
|
|
3428
|
+
return null;
|
|
3429
|
+
}
|
|
3430
|
+
};
|
|
3431
|
+
const bars = Array(12).fill(0);
|
|
3432
|
+
const Loader$1 = ({ visible, className })=>{
|
|
3433
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
3434
|
+
className: [
|
|
3435
|
+
'sonner-loading-wrapper',
|
|
3436
|
+
className
|
|
3437
|
+
].filter(Boolean).join(' '),
|
|
3438
|
+
"data-visible": visible
|
|
3439
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
3440
|
+
className: "sonner-spinner"
|
|
3441
|
+
}, bars.map((_, i)=>/*#__PURE__*/ React.createElement("div", {
|
|
3442
|
+
className: "sonner-loading-bar",
|
|
3443
|
+
key: `spinner-bar-${i}`
|
|
3444
|
+
}))));
|
|
3445
|
+
};
|
|
3446
|
+
const SuccessIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3447
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3448
|
+
viewBox: "0 0 20 20",
|
|
3449
|
+
fill: "currentColor",
|
|
3450
|
+
height: "20",
|
|
3451
|
+
width: "20"
|
|
3452
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
3453
|
+
fillRule: "evenodd",
|
|
3454
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
|
|
3455
|
+
clipRule: "evenodd"
|
|
3456
|
+
}));
|
|
3457
|
+
const WarningIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3458
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3459
|
+
viewBox: "0 0 24 24",
|
|
3460
|
+
fill: "currentColor",
|
|
3461
|
+
height: "20",
|
|
3462
|
+
width: "20"
|
|
3463
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
3464
|
+
fillRule: "evenodd",
|
|
3465
|
+
d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
|
|
3466
|
+
clipRule: "evenodd"
|
|
3467
|
+
}));
|
|
3468
|
+
const InfoIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3469
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3470
|
+
viewBox: "0 0 20 20",
|
|
3471
|
+
fill: "currentColor",
|
|
3472
|
+
height: "20",
|
|
3473
|
+
width: "20"
|
|
3474
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
3475
|
+
fillRule: "evenodd",
|
|
3476
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
|
|
3477
|
+
clipRule: "evenodd"
|
|
3478
|
+
}));
|
|
3479
|
+
const ErrorIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3480
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3481
|
+
viewBox: "0 0 20 20",
|
|
3482
|
+
fill: "currentColor",
|
|
3483
|
+
height: "20",
|
|
3484
|
+
width: "20"
|
|
3485
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
3486
|
+
fillRule: "evenodd",
|
|
3487
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
|
|
3488
|
+
clipRule: "evenodd"
|
|
3489
|
+
}));
|
|
3490
|
+
const CloseIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3491
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3492
|
+
width: "12",
|
|
3493
|
+
height: "12",
|
|
3494
|
+
viewBox: "0 0 24 24",
|
|
3495
|
+
fill: "none",
|
|
3496
|
+
stroke: "currentColor",
|
|
3497
|
+
strokeWidth: "1.5",
|
|
3498
|
+
strokeLinecap: "round",
|
|
3499
|
+
strokeLinejoin: "round"
|
|
3500
|
+
}, /*#__PURE__*/ React.createElement("line", {
|
|
3501
|
+
x1: "18",
|
|
3502
|
+
y1: "6",
|
|
3503
|
+
x2: "6",
|
|
3504
|
+
y2: "18"
|
|
3505
|
+
}), /*#__PURE__*/ React.createElement("line", {
|
|
3506
|
+
x1: "6",
|
|
3507
|
+
y1: "6",
|
|
3508
|
+
x2: "18",
|
|
3509
|
+
y2: "18"
|
|
3510
|
+
}));
|
|
3511
|
+
|
|
3512
|
+
const useIsDocumentHidden = ()=>{
|
|
3513
|
+
const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden);
|
|
3514
|
+
React.useEffect(()=>{
|
|
3515
|
+
const callback = ()=>{
|
|
3516
|
+
setIsDocumentHidden(document.hidden);
|
|
3517
|
+
};
|
|
3518
|
+
document.addEventListener('visibilitychange', callback);
|
|
3519
|
+
return ()=>window.removeEventListener('visibilitychange', callback);
|
|
3520
|
+
}, []);
|
|
3521
|
+
return isDocumentHidden;
|
|
3522
|
+
};
|
|
3523
|
+
|
|
3524
|
+
let toastsCounter = 1;
|
|
3525
|
+
class Observer {
|
|
3526
|
+
constructor(){
|
|
3527
|
+
// We use arrow functions to maintain the correct `this` reference
|
|
3528
|
+
this.subscribe = (subscriber)=>{
|
|
3529
|
+
this.subscribers.push(subscriber);
|
|
3530
|
+
return ()=>{
|
|
3531
|
+
const index = this.subscribers.indexOf(subscriber);
|
|
3532
|
+
this.subscribers.splice(index, 1);
|
|
3533
|
+
};
|
|
3534
|
+
};
|
|
3535
|
+
this.publish = (data)=>{
|
|
3536
|
+
this.subscribers.forEach((subscriber)=>subscriber(data));
|
|
3537
|
+
};
|
|
3538
|
+
this.addToast = (data)=>{
|
|
3539
|
+
this.publish(data);
|
|
3540
|
+
this.toasts = [
|
|
3541
|
+
...this.toasts,
|
|
3542
|
+
data
|
|
3543
|
+
];
|
|
3544
|
+
};
|
|
3545
|
+
this.create = (data)=>{
|
|
3546
|
+
var _data_id;
|
|
3547
|
+
const { message, ...rest } = data;
|
|
3548
|
+
const id = typeof (data == null ? void 0 : data.id) === 'number' || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
|
|
3549
|
+
const alreadyExists = this.toasts.find((toast)=>{
|
|
3550
|
+
return toast.id === id;
|
|
3551
|
+
});
|
|
3552
|
+
const dismissible = data.dismissible === undefined ? true : data.dismissible;
|
|
3553
|
+
if (this.dismissedToasts.has(id)) {
|
|
3554
|
+
this.dismissedToasts.delete(id);
|
|
3555
|
+
}
|
|
3556
|
+
if (alreadyExists) {
|
|
3557
|
+
this.toasts = this.toasts.map((toast)=>{
|
|
3558
|
+
if (toast.id === id) {
|
|
3559
|
+
this.publish({
|
|
3560
|
+
...toast,
|
|
3561
|
+
...data,
|
|
3562
|
+
id,
|
|
3563
|
+
title: message
|
|
3564
|
+
});
|
|
3565
|
+
return {
|
|
3566
|
+
...toast,
|
|
3567
|
+
...data,
|
|
3568
|
+
id,
|
|
3569
|
+
dismissible,
|
|
3570
|
+
title: message
|
|
3571
|
+
};
|
|
3572
|
+
}
|
|
3573
|
+
return toast;
|
|
3574
|
+
});
|
|
3575
|
+
} else {
|
|
3576
|
+
this.addToast({
|
|
3577
|
+
title: message,
|
|
3578
|
+
...rest,
|
|
3579
|
+
dismissible,
|
|
3580
|
+
id
|
|
3581
|
+
});
|
|
3582
|
+
}
|
|
3583
|
+
return id;
|
|
3584
|
+
};
|
|
3585
|
+
this.dismiss = (id)=>{
|
|
3586
|
+
if (id) {
|
|
3587
|
+
this.dismissedToasts.add(id);
|
|
3588
|
+
requestAnimationFrame(()=>this.subscribers.forEach((subscriber)=>subscriber({
|
|
3589
|
+
id,
|
|
3590
|
+
dismiss: true
|
|
3591
|
+
})));
|
|
3592
|
+
} else {
|
|
3593
|
+
this.toasts.forEach((toast)=>{
|
|
3594
|
+
this.subscribers.forEach((subscriber)=>subscriber({
|
|
3595
|
+
id: toast.id,
|
|
3596
|
+
dismiss: true
|
|
3597
|
+
}));
|
|
3598
|
+
});
|
|
3599
|
+
}
|
|
3600
|
+
return id;
|
|
3601
|
+
};
|
|
3602
|
+
this.message = (message, data)=>{
|
|
3603
|
+
return this.create({
|
|
3604
|
+
...data,
|
|
3605
|
+
message
|
|
3606
|
+
});
|
|
3607
|
+
};
|
|
3608
|
+
this.error = (message, data)=>{
|
|
3609
|
+
return this.create({
|
|
3610
|
+
...data,
|
|
3611
|
+
message,
|
|
3612
|
+
type: 'error'
|
|
3613
|
+
});
|
|
3614
|
+
};
|
|
3615
|
+
this.success = (message, data)=>{
|
|
3616
|
+
return this.create({
|
|
3617
|
+
...data,
|
|
3618
|
+
type: 'success',
|
|
3619
|
+
message
|
|
3620
|
+
});
|
|
3621
|
+
};
|
|
3622
|
+
this.info = (message, data)=>{
|
|
3623
|
+
return this.create({
|
|
3624
|
+
...data,
|
|
3625
|
+
type: 'info',
|
|
3626
|
+
message
|
|
3627
|
+
});
|
|
3628
|
+
};
|
|
3629
|
+
this.warning = (message, data)=>{
|
|
3630
|
+
return this.create({
|
|
3631
|
+
...data,
|
|
3632
|
+
type: 'warning',
|
|
3633
|
+
message
|
|
3634
|
+
});
|
|
3635
|
+
};
|
|
3636
|
+
this.loading = (message, data)=>{
|
|
3637
|
+
return this.create({
|
|
3638
|
+
...data,
|
|
3639
|
+
type: 'loading',
|
|
3640
|
+
message
|
|
3641
|
+
});
|
|
3642
|
+
};
|
|
3643
|
+
this.promise = (promise, data)=>{
|
|
3644
|
+
if (!data) {
|
|
3645
|
+
// Nothing to show
|
|
3646
|
+
return;
|
|
3647
|
+
}
|
|
3648
|
+
let id = undefined;
|
|
3649
|
+
if (data.loading !== undefined) {
|
|
3650
|
+
id = this.create({
|
|
3651
|
+
...data,
|
|
3652
|
+
promise,
|
|
3653
|
+
type: 'loading',
|
|
3654
|
+
message: data.loading,
|
|
3655
|
+
description: typeof data.description !== 'function' ? data.description : undefined
|
|
3656
|
+
});
|
|
3657
|
+
}
|
|
3658
|
+
const p = Promise.resolve(promise instanceof Function ? promise() : promise);
|
|
3659
|
+
let shouldDismiss = id !== undefined;
|
|
3660
|
+
let result;
|
|
3661
|
+
const originalPromise = p.then(async (response)=>{
|
|
3662
|
+
result = [
|
|
3663
|
+
'resolve',
|
|
3664
|
+
response
|
|
3665
|
+
];
|
|
3666
|
+
const isReactElementResponse = React.isValidElement(response);
|
|
3667
|
+
if (isReactElementResponse) {
|
|
3668
|
+
shouldDismiss = false;
|
|
3669
|
+
this.create({
|
|
3670
|
+
id,
|
|
3671
|
+
type: 'default',
|
|
3672
|
+
message: response
|
|
3673
|
+
});
|
|
3674
|
+
} else if (isHttpResponse(response) && !response.ok) {
|
|
3675
|
+
shouldDismiss = false;
|
|
3676
|
+
const promiseData = typeof data.error === 'function' ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
|
|
3677
|
+
const description = typeof data.description === 'function' ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
|
|
3678
|
+
const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);
|
|
3679
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3680
|
+
message: promiseData
|
|
3681
|
+
};
|
|
3682
|
+
this.create({
|
|
3683
|
+
id,
|
|
3684
|
+
type: 'error',
|
|
3685
|
+
description,
|
|
3686
|
+
...toastSettings
|
|
3687
|
+
});
|
|
3688
|
+
} else if (response instanceof Error) {
|
|
3689
|
+
shouldDismiss = false;
|
|
3690
|
+
const promiseData = typeof data.error === 'function' ? await data.error(response) : data.error;
|
|
3691
|
+
const description = typeof data.description === 'function' ? await data.description(response) : data.description;
|
|
3692
|
+
const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);
|
|
3693
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3694
|
+
message: promiseData
|
|
3695
|
+
};
|
|
3696
|
+
this.create({
|
|
3697
|
+
id,
|
|
3698
|
+
type: 'error',
|
|
3699
|
+
description,
|
|
3700
|
+
...toastSettings
|
|
3701
|
+
});
|
|
3702
|
+
} else if (data.success !== undefined) {
|
|
3703
|
+
shouldDismiss = false;
|
|
3704
|
+
const promiseData = typeof data.success === 'function' ? await data.success(response) : data.success;
|
|
3705
|
+
const description = typeof data.description === 'function' ? await data.description(response) : data.description;
|
|
3706
|
+
const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);
|
|
3707
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3708
|
+
message: promiseData
|
|
3709
|
+
};
|
|
3710
|
+
this.create({
|
|
3711
|
+
id,
|
|
3712
|
+
type: 'success',
|
|
3713
|
+
description,
|
|
3714
|
+
...toastSettings
|
|
3715
|
+
});
|
|
3716
|
+
}
|
|
3717
|
+
}).catch(async (error)=>{
|
|
3718
|
+
result = [
|
|
3719
|
+
'reject',
|
|
3720
|
+
error
|
|
3721
|
+
];
|
|
3722
|
+
if (data.error !== undefined) {
|
|
3723
|
+
shouldDismiss = false;
|
|
3724
|
+
const promiseData = typeof data.error === 'function' ? await data.error(error) : data.error;
|
|
3725
|
+
const description = typeof data.description === 'function' ? await data.description(error) : data.description;
|
|
3726
|
+
const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);
|
|
3727
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3728
|
+
message: promiseData
|
|
3729
|
+
};
|
|
3730
|
+
this.create({
|
|
3731
|
+
id,
|
|
3732
|
+
type: 'error',
|
|
3733
|
+
description,
|
|
3734
|
+
...toastSettings
|
|
3735
|
+
});
|
|
3736
|
+
}
|
|
3737
|
+
}).finally(()=>{
|
|
3738
|
+
if (shouldDismiss) {
|
|
3739
|
+
// Toast is still in load state (and will be indefinitely — dismiss it)
|
|
3740
|
+
this.dismiss(id);
|
|
3741
|
+
id = undefined;
|
|
3742
|
+
}
|
|
3743
|
+
data.finally == null ? void 0 : data.finally.call(data);
|
|
3744
|
+
});
|
|
3745
|
+
const unwrap = ()=>new Promise((resolve, reject)=>originalPromise.then(()=>result[0] === 'reject' ? reject(result[1]) : resolve(result[1])).catch(reject));
|
|
3746
|
+
if (typeof id !== 'string' && typeof id !== 'number') {
|
|
3747
|
+
// cannot Object.assign on undefined
|
|
3748
|
+
return {
|
|
3749
|
+
unwrap
|
|
3750
|
+
};
|
|
3751
|
+
} else {
|
|
3752
|
+
return Object.assign(id, {
|
|
3753
|
+
unwrap
|
|
3754
|
+
});
|
|
3755
|
+
}
|
|
3756
|
+
};
|
|
3757
|
+
this.custom = (jsx, data)=>{
|
|
3758
|
+
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
3759
|
+
this.create({
|
|
3760
|
+
jsx: jsx(id),
|
|
3761
|
+
id,
|
|
3762
|
+
...data
|
|
3763
|
+
});
|
|
3764
|
+
return id;
|
|
3765
|
+
};
|
|
3766
|
+
this.getActiveToasts = ()=>{
|
|
3767
|
+
return this.toasts.filter((toast)=>!this.dismissedToasts.has(toast.id));
|
|
3768
|
+
};
|
|
3769
|
+
this.subscribers = [];
|
|
3770
|
+
this.toasts = [];
|
|
3771
|
+
this.dismissedToasts = new Set();
|
|
3772
|
+
}
|
|
3773
|
+
}
|
|
3774
|
+
const ToastState = new Observer();
|
|
3775
|
+
// bind this to the toast function
|
|
3776
|
+
const toastFunction = (message, data)=>{
|
|
3777
|
+
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
3778
|
+
ToastState.addToast({
|
|
3779
|
+
title: message,
|
|
3780
|
+
...data,
|
|
3781
|
+
id
|
|
3782
|
+
});
|
|
3783
|
+
return id;
|
|
3784
|
+
};
|
|
3785
|
+
const isHttpResponse = (data)=>{
|
|
3786
|
+
return data && typeof data === 'object' && 'ok' in data && typeof data.ok === 'boolean' && 'status' in data && typeof data.status === 'number';
|
|
3787
|
+
};
|
|
3788
|
+
const basicToast = toastFunction;
|
|
3789
|
+
const getHistory = ()=>ToastState.toasts;
|
|
3790
|
+
const getToasts = ()=>ToastState.getActiveToasts();
|
|
3791
|
+
// We use `Object.assign` to maintain the correct types as we would lose them otherwise
|
|
3792
|
+
const toast = Object.assign(basicToast, {
|
|
3793
|
+
success: ToastState.success,
|
|
3794
|
+
info: ToastState.info,
|
|
3795
|
+
warning: ToastState.warning,
|
|
3796
|
+
error: ToastState.error,
|
|
3797
|
+
custom: ToastState.custom,
|
|
3798
|
+
message: ToastState.message,
|
|
3799
|
+
promise: ToastState.promise,
|
|
3800
|
+
dismiss: ToastState.dismiss,
|
|
3801
|
+
loading: ToastState.loading
|
|
3802
|
+
}, {
|
|
3803
|
+
getHistory,
|
|
3804
|
+
getToasts
|
|
3805
|
+
});
|
|
3806
|
+
|
|
3807
|
+
__insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
3808
|
+
|
|
3809
|
+
function isAction(action) {
|
|
3810
|
+
return action.label !== undefined;
|
|
3811
|
+
}
|
|
3812
|
+
|
|
3813
|
+
// Visible toasts amount
|
|
3814
|
+
const VISIBLE_TOASTS_AMOUNT = 3;
|
|
3815
|
+
// Viewport padding
|
|
3816
|
+
const VIEWPORT_OFFSET = '24px';
|
|
3817
|
+
// Mobile viewport padding
|
|
3818
|
+
const MOBILE_VIEWPORT_OFFSET = '16px';
|
|
3819
|
+
// Default lifetime of a toasts (in ms)
|
|
3820
|
+
const TOAST_LIFETIME = 4000;
|
|
3821
|
+
// Default toast width
|
|
3822
|
+
const TOAST_WIDTH = 356;
|
|
3823
|
+
// Default gap between toasts
|
|
3824
|
+
const GAP = 14;
|
|
3825
|
+
// Threshold to dismiss a toast
|
|
3826
|
+
const SWIPE_THRESHOLD = 45;
|
|
3827
|
+
// Equal to exit animation duration
|
|
3828
|
+
const TIME_BEFORE_UNMOUNT = 200;
|
|
3829
|
+
function cn$1(...classes) {
|
|
3830
|
+
return classes.filter(Boolean).join(' ');
|
|
3831
|
+
}
|
|
3832
|
+
function getDefaultSwipeDirections(position) {
|
|
3833
|
+
const [y, x] = position.split('-');
|
|
3834
|
+
const directions = [];
|
|
3835
|
+
if (y) {
|
|
3836
|
+
directions.push(y);
|
|
3837
|
+
}
|
|
3838
|
+
if (x) {
|
|
3839
|
+
directions.push(x);
|
|
3840
|
+
}
|
|
3841
|
+
return directions;
|
|
3842
|
+
}
|
|
3843
|
+
const Toast = (props)=>{
|
|
3844
|
+
var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
|
|
3845
|
+
const { invert: ToasterInvert, toast, unstyled, interacting, setHeights, visibleToasts, heights, index, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = '', descriptionClassName = '', duration: durationFromToaster, position, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = 'Close toast' } = props;
|
|
3846
|
+
const [swipeDirection, setSwipeDirection] = React.useState(null);
|
|
3847
|
+
const [swipeOutDirection, setSwipeOutDirection] = React.useState(null);
|
|
3848
|
+
const [mounted, setMounted] = React.useState(false);
|
|
3849
|
+
const [removed, setRemoved] = React.useState(false);
|
|
3850
|
+
const [swiping, setSwiping] = React.useState(false);
|
|
3851
|
+
const [swipeOut, setSwipeOut] = React.useState(false);
|
|
3852
|
+
const [isSwiped, setIsSwiped] = React.useState(false);
|
|
3853
|
+
const [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);
|
|
3854
|
+
const [initialHeight, setInitialHeight] = React.useState(0);
|
|
3855
|
+
const remainingTime = React.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME);
|
|
3856
|
+
const dragStartTime = React.useRef(null);
|
|
3857
|
+
const toastRef = React.useRef(null);
|
|
3858
|
+
const isFront = index === 0;
|
|
3859
|
+
const isVisible = index + 1 <= visibleToasts;
|
|
3860
|
+
const toastType = toast.type;
|
|
3861
|
+
const dismissible = toast.dismissible !== false;
|
|
3862
|
+
const toastClassname = toast.className || '';
|
|
3863
|
+
const toastDescriptionClassname = toast.descriptionClassName || '';
|
|
3864
|
+
// Height index is used to calculate the offset as it gets updated before the toast array, which means we can calculate the new layout faster.
|
|
3865
|
+
const heightIndex = React.useMemo(()=>heights.findIndex((height)=>height.toastId === toast.id) || 0, [
|
|
3866
|
+
heights,
|
|
3867
|
+
toast.id
|
|
3868
|
+
]);
|
|
3869
|
+
const closeButton = React.useMemo(()=>{
|
|
3870
|
+
var _toast_closeButton;
|
|
3871
|
+
return (_toast_closeButton = toast.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
|
|
3872
|
+
}, [
|
|
3873
|
+
toast.closeButton,
|
|
3874
|
+
closeButtonFromToaster
|
|
3875
|
+
]);
|
|
3876
|
+
const duration = React.useMemo(()=>toast.duration || durationFromToaster || TOAST_LIFETIME, [
|
|
3877
|
+
toast.duration,
|
|
3878
|
+
durationFromToaster
|
|
3879
|
+
]);
|
|
3880
|
+
const closeTimerStartTimeRef = React.useRef(0);
|
|
3881
|
+
const offset = React.useRef(0);
|
|
3882
|
+
const lastCloseTimerStartTimeRef = React.useRef(0);
|
|
3883
|
+
const pointerStartRef = React.useRef(null);
|
|
3884
|
+
const [y, x] = position.split('-');
|
|
3885
|
+
const toastsHeightBefore = React.useMemo(()=>{
|
|
3886
|
+
return heights.reduce((prev, curr, reducerIndex)=>{
|
|
3887
|
+
// Calculate offset up until current toast
|
|
3888
|
+
if (reducerIndex >= heightIndex) {
|
|
3889
|
+
return prev;
|
|
3890
|
+
}
|
|
3891
|
+
return prev + curr.height;
|
|
3892
|
+
}, 0);
|
|
3893
|
+
}, [
|
|
3894
|
+
heights,
|
|
3895
|
+
heightIndex
|
|
3896
|
+
]);
|
|
3897
|
+
const isDocumentHidden = useIsDocumentHidden();
|
|
3898
|
+
const invert = toast.invert || ToasterInvert;
|
|
3899
|
+
const disabled = toastType === 'loading';
|
|
3900
|
+
offset.current = React.useMemo(()=>heightIndex * gap + toastsHeightBefore, [
|
|
3901
|
+
heightIndex,
|
|
3902
|
+
toastsHeightBefore
|
|
3903
|
+
]);
|
|
3904
|
+
React.useEffect(()=>{
|
|
3905
|
+
remainingTime.current = duration;
|
|
3906
|
+
}, [
|
|
3907
|
+
duration
|
|
3908
|
+
]);
|
|
3909
|
+
React.useEffect(()=>{
|
|
3910
|
+
// Trigger enter animation without using CSS animation
|
|
3911
|
+
setMounted(true);
|
|
3912
|
+
}, []);
|
|
3913
|
+
React.useEffect(()=>{
|
|
3914
|
+
const toastNode = toastRef.current;
|
|
3915
|
+
if (toastNode) {
|
|
3916
|
+
const height = toastNode.getBoundingClientRect().height;
|
|
3917
|
+
// Add toast height to heights array after the toast is mounted
|
|
3918
|
+
setInitialHeight(height);
|
|
3919
|
+
setHeights((h)=>[
|
|
3920
|
+
{
|
|
3921
|
+
toastId: toast.id,
|
|
3922
|
+
height,
|
|
3923
|
+
position: toast.position
|
|
3924
|
+
},
|
|
3925
|
+
...h
|
|
3926
|
+
]);
|
|
3927
|
+
return ()=>setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));
|
|
3928
|
+
}
|
|
3929
|
+
}, [
|
|
3930
|
+
setHeights,
|
|
3931
|
+
toast.id
|
|
3932
|
+
]);
|
|
3933
|
+
React.useLayoutEffect(()=>{
|
|
3934
|
+
if (!mounted) return;
|
|
3935
|
+
const toastNode = toastRef.current;
|
|
3936
|
+
const originalHeight = toastNode.style.height;
|
|
3937
|
+
toastNode.style.height = 'auto';
|
|
3938
|
+
const newHeight = toastNode.getBoundingClientRect().height;
|
|
3939
|
+
toastNode.style.height = originalHeight;
|
|
3940
|
+
setInitialHeight(newHeight);
|
|
3941
|
+
setHeights((heights)=>{
|
|
3942
|
+
const alreadyExists = heights.find((height)=>height.toastId === toast.id);
|
|
3943
|
+
if (!alreadyExists) {
|
|
3944
|
+
return [
|
|
3945
|
+
{
|
|
3946
|
+
toastId: toast.id,
|
|
3947
|
+
height: newHeight,
|
|
3948
|
+
position: toast.position
|
|
3949
|
+
},
|
|
3950
|
+
...heights
|
|
3951
|
+
];
|
|
3952
|
+
} else {
|
|
3953
|
+
return heights.map((height)=>height.toastId === toast.id ? {
|
|
3954
|
+
...height,
|
|
3955
|
+
height: newHeight
|
|
3956
|
+
} : height);
|
|
3957
|
+
}
|
|
3958
|
+
});
|
|
3959
|
+
}, [
|
|
3960
|
+
mounted,
|
|
3961
|
+
toast.title,
|
|
3962
|
+
toast.description,
|
|
3963
|
+
setHeights,
|
|
3964
|
+
toast.id
|
|
3965
|
+
]);
|
|
3966
|
+
const deleteToast = React.useCallback(()=>{
|
|
3967
|
+
// Save the offset for the exit swipe animation
|
|
3968
|
+
setRemoved(true);
|
|
3969
|
+
setOffsetBeforeRemove(offset.current);
|
|
3970
|
+
setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));
|
|
3971
|
+
setTimeout(()=>{
|
|
3972
|
+
removeToast(toast);
|
|
3973
|
+
}, TIME_BEFORE_UNMOUNT);
|
|
3974
|
+
}, [
|
|
3975
|
+
toast,
|
|
3976
|
+
removeToast,
|
|
3977
|
+
setHeights,
|
|
3978
|
+
offset
|
|
3979
|
+
]);
|
|
3980
|
+
React.useEffect(()=>{
|
|
3981
|
+
if (toast.promise && toastType === 'loading' || toast.duration === Infinity || toast.type === 'loading') return;
|
|
3982
|
+
let timeoutId;
|
|
3983
|
+
// Pause the timer on each hover
|
|
3984
|
+
const pauseTimer = ()=>{
|
|
3985
|
+
if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
|
|
3986
|
+
// Get the elapsed time since the timer started
|
|
3987
|
+
const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current;
|
|
3988
|
+
remainingTime.current = remainingTime.current - elapsedTime;
|
|
3989
|
+
}
|
|
3990
|
+
lastCloseTimerStartTimeRef.current = new Date().getTime();
|
|
3991
|
+
};
|
|
3992
|
+
const startTimer = ()=>{
|
|
3993
|
+
// setTimeout(, Infinity) behaves as if the delay is 0.
|
|
3994
|
+
// As a result, the toast would be closed immediately, giving the appearance that it was never rendered.
|
|
3995
|
+
// See: https://github.com/denysdovhan/wtfjs?tab=readme-ov-file#an-infinite-timeout
|
|
3996
|
+
if (remainingTime.current === Infinity) return;
|
|
3997
|
+
closeTimerStartTimeRef.current = new Date().getTime();
|
|
3998
|
+
// Let the toast know it has started
|
|
3999
|
+
timeoutId = setTimeout(()=>{
|
|
4000
|
+
toast.onAutoClose == null ? void 0 : toast.onAutoClose.call(toast, toast);
|
|
4001
|
+
deleteToast();
|
|
4002
|
+
}, remainingTime.current);
|
|
4003
|
+
};
|
|
4004
|
+
if (expanded || interacting || isDocumentHidden) {
|
|
4005
|
+
pauseTimer();
|
|
4006
|
+
} else {
|
|
4007
|
+
startTimer();
|
|
4008
|
+
}
|
|
4009
|
+
return ()=>clearTimeout(timeoutId);
|
|
4010
|
+
}, [
|
|
4011
|
+
expanded,
|
|
4012
|
+
interacting,
|
|
4013
|
+
toast,
|
|
4014
|
+
toastType,
|
|
4015
|
+
isDocumentHidden,
|
|
4016
|
+
deleteToast
|
|
4017
|
+
]);
|
|
4018
|
+
React.useEffect(()=>{
|
|
4019
|
+
if (toast.delete) {
|
|
4020
|
+
deleteToast();
|
|
4021
|
+
}
|
|
4022
|
+
}, [
|
|
4023
|
+
deleteToast,
|
|
4024
|
+
toast.delete
|
|
4025
|
+
]);
|
|
4026
|
+
function getLoadingIcon() {
|
|
4027
|
+
var _toast_classNames;
|
|
4028
|
+
if (icons == null ? void 0 : icons.loading) {
|
|
4029
|
+
var _toast_classNames1;
|
|
4030
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
4031
|
+
className: cn$1(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1.loader, 'sonner-loader'),
|
|
4032
|
+
"data-visible": toastType === 'loading'
|
|
4033
|
+
}, icons.loading);
|
|
4034
|
+
}
|
|
4035
|
+
return /*#__PURE__*/ React.createElement(Loader$1, {
|
|
4036
|
+
className: cn$1(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.loader),
|
|
4037
|
+
visible: toastType === 'loading'
|
|
4038
|
+
});
|
|
4039
|
+
}
|
|
4040
|
+
const icon = toast.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
|
|
4041
|
+
var _toast_richColors, _icons_close;
|
|
4042
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
4043
|
+
tabIndex: 0,
|
|
4044
|
+
ref: toastRef,
|
|
4045
|
+
className: cn$1(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1[toastType]),
|
|
4046
|
+
"data-sonner-toast": "",
|
|
4047
|
+
"data-rich-colors": (_toast_richColors = toast.richColors) != null ? _toast_richColors : defaultRichColors,
|
|
4048
|
+
"data-styled": !Boolean(toast.jsx || toast.unstyled || unstyled),
|
|
4049
|
+
"data-mounted": mounted,
|
|
4050
|
+
"data-promise": Boolean(toast.promise),
|
|
4051
|
+
"data-swiped": isSwiped,
|
|
4052
|
+
"data-removed": removed,
|
|
4053
|
+
"data-visible": isVisible,
|
|
4054
|
+
"data-y-position": y,
|
|
4055
|
+
"data-x-position": x,
|
|
4056
|
+
"data-index": index,
|
|
4057
|
+
"data-front": isFront,
|
|
4058
|
+
"data-swiping": swiping,
|
|
4059
|
+
"data-dismissible": dismissible,
|
|
4060
|
+
"data-type": toastType,
|
|
4061
|
+
"data-invert": invert,
|
|
4062
|
+
"data-swipe-out": swipeOut,
|
|
4063
|
+
"data-swipe-direction": swipeOutDirection,
|
|
4064
|
+
"data-expanded": Boolean(expanded || expandByDefault && mounted),
|
|
4065
|
+
style: {
|
|
4066
|
+
'--index': index,
|
|
4067
|
+
'--toasts-before': index,
|
|
4068
|
+
'--z-index': toasts.length - index,
|
|
4069
|
+
'--offset': `${removed ? offsetBeforeRemove : offset.current}px`,
|
|
4070
|
+
'--initial-height': expandByDefault ? 'auto' : `${initialHeight}px`,
|
|
4071
|
+
...style,
|
|
4072
|
+
...toast.style
|
|
4073
|
+
},
|
|
4074
|
+
onDragEnd: ()=>{
|
|
4075
|
+
setSwiping(false);
|
|
4076
|
+
setSwipeDirection(null);
|
|
4077
|
+
pointerStartRef.current = null;
|
|
4078
|
+
},
|
|
4079
|
+
onPointerDown: (event)=>{
|
|
4080
|
+
if (disabled || !dismissible) return;
|
|
4081
|
+
dragStartTime.current = new Date();
|
|
4082
|
+
setOffsetBeforeRemove(offset.current);
|
|
4083
|
+
// Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)
|
|
4084
|
+
event.target.setPointerCapture(event.pointerId);
|
|
4085
|
+
if (event.target.tagName === 'BUTTON') return;
|
|
4086
|
+
setSwiping(true);
|
|
4087
|
+
pointerStartRef.current = {
|
|
4088
|
+
x: event.clientX,
|
|
4089
|
+
y: event.clientY
|
|
4090
|
+
};
|
|
4091
|
+
},
|
|
4092
|
+
onPointerUp: ()=>{
|
|
4093
|
+
var _toastRef_current, _toastRef_current1, _dragStartTime_current;
|
|
4094
|
+
if (swipeOut || !dismissible) return;
|
|
4095
|
+
pointerStartRef.current = null;
|
|
4096
|
+
const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue('--swipe-amount-x').replace('px', '')) || 0);
|
|
4097
|
+
const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue('--swipe-amount-y').replace('px', '')) || 0);
|
|
4098
|
+
const timeTaken = new Date().getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
|
|
4099
|
+
const swipeAmount = swipeDirection === 'x' ? swipeAmountX : swipeAmountY;
|
|
4100
|
+
const velocity = Math.abs(swipeAmount) / timeTaken;
|
|
4101
|
+
if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
|
|
4102
|
+
setOffsetBeforeRemove(offset.current);
|
|
4103
|
+
toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);
|
|
4104
|
+
if (swipeDirection === 'x') {
|
|
4105
|
+
setSwipeOutDirection(swipeAmountX > 0 ? 'right' : 'left');
|
|
4106
|
+
} else {
|
|
4107
|
+
setSwipeOutDirection(swipeAmountY > 0 ? 'down' : 'up');
|
|
4108
|
+
}
|
|
4109
|
+
deleteToast();
|
|
4110
|
+
setSwipeOut(true);
|
|
4111
|
+
return;
|
|
4112
|
+
} else {
|
|
4113
|
+
var _toastRef_current2, _toastRef_current3;
|
|
4114
|
+
(_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty('--swipe-amount-x', `0px`);
|
|
4115
|
+
(_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty('--swipe-amount-y', `0px`);
|
|
4116
|
+
}
|
|
4117
|
+
setIsSwiped(false);
|
|
4118
|
+
setSwiping(false);
|
|
4119
|
+
setSwipeDirection(null);
|
|
4120
|
+
},
|
|
4121
|
+
onPointerMove: (event)=>{
|
|
4122
|
+
var _window_getSelection, // Apply transform using both x and y values
|
|
4123
|
+
_toastRef_current, _toastRef_current1;
|
|
4124
|
+
if (!pointerStartRef.current || !dismissible) return;
|
|
4125
|
+
const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
|
|
4126
|
+
if (isHighlighted) return;
|
|
4127
|
+
const yDelta = event.clientY - pointerStartRef.current.y;
|
|
4128
|
+
const xDelta = event.clientX - pointerStartRef.current.x;
|
|
4129
|
+
var _props_swipeDirections;
|
|
4130
|
+
const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
|
|
4131
|
+
// Determine swipe direction if not already locked
|
|
4132
|
+
if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
|
|
4133
|
+
setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');
|
|
4134
|
+
}
|
|
4135
|
+
let swipeAmount = {
|
|
4136
|
+
x: 0,
|
|
4137
|
+
y: 0
|
|
4138
|
+
};
|
|
4139
|
+
const getDampening = (delta)=>{
|
|
4140
|
+
const factor = Math.abs(delta) / 20;
|
|
4141
|
+
return 1 / (1.5 + factor);
|
|
4142
|
+
};
|
|
4143
|
+
// Only apply swipe in the locked direction
|
|
4144
|
+
if (swipeDirection === 'y') {
|
|
4145
|
+
// Handle vertical swipes
|
|
4146
|
+
if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {
|
|
4147
|
+
if (swipeDirections.includes('top') && yDelta < 0 || swipeDirections.includes('bottom') && yDelta > 0) {
|
|
4148
|
+
swipeAmount.y = yDelta;
|
|
4149
|
+
} else {
|
|
4150
|
+
// Smoothly transition to dampened movement
|
|
4151
|
+
const dampenedDelta = yDelta * getDampening(yDelta);
|
|
4152
|
+
// Ensure we don't jump when transitioning to dampened movement
|
|
4153
|
+
swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
} else if (swipeDirection === 'x') {
|
|
4157
|
+
// Handle horizontal swipes
|
|
4158
|
+
if (swipeDirections.includes('left') || swipeDirections.includes('right')) {
|
|
4159
|
+
if (swipeDirections.includes('left') && xDelta < 0 || swipeDirections.includes('right') && xDelta > 0) {
|
|
4160
|
+
swipeAmount.x = xDelta;
|
|
4161
|
+
} else {
|
|
4162
|
+
// Smoothly transition to dampened movement
|
|
4163
|
+
const dampenedDelta = xDelta * getDampening(xDelta);
|
|
4164
|
+
// Ensure we don't jump when transitioning to dampened movement
|
|
4165
|
+
swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
|
|
4166
|
+
}
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
|
|
4170
|
+
setIsSwiped(true);
|
|
4171
|
+
}
|
|
4172
|
+
(_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty('--swipe-amount-x', `${swipeAmount.x}px`);
|
|
4173
|
+
(_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty('--swipe-amount-y', `${swipeAmount.y}px`);
|
|
4174
|
+
}
|
|
4175
|
+
}, closeButton && !toast.jsx && toastType !== 'loading' ? /*#__PURE__*/ React.createElement("button", {
|
|
4176
|
+
"aria-label": closeButtonAriaLabel,
|
|
4177
|
+
"data-disabled": disabled,
|
|
4178
|
+
"data-close-button": true,
|
|
4179
|
+
onClick: disabled || !dismissible ? ()=>{} : ()=>{
|
|
4180
|
+
deleteToast();
|
|
4181
|
+
toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);
|
|
4182
|
+
},
|
|
4183
|
+
className: cn$1(classNames == null ? void 0 : classNames.closeButton, toast == null ? void 0 : (_toast_classNames2 = toast.classNames) == null ? void 0 : _toast_classNames2.closeButton)
|
|
4184
|
+
}, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast.icon || toast.promise) && toast.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast.icon) ? /*#__PURE__*/ React.createElement("div", {
|
|
4185
|
+
"data-icon": "",
|
|
4186
|
+
className: cn$1(classNames == null ? void 0 : classNames.icon, toast == null ? void 0 : (_toast_classNames3 = toast.classNames) == null ? void 0 : _toast_classNames3.icon)
|
|
4187
|
+
}, toast.promise || toast.type === 'loading' && !toast.icon ? toast.icon || getLoadingIcon() : null, toast.type !== 'loading' ? icon : null) : null, /*#__PURE__*/ React.createElement("div", {
|
|
4188
|
+
"data-content": "",
|
|
4189
|
+
className: cn$1(classNames == null ? void 0 : classNames.content, toast == null ? void 0 : (_toast_classNames4 = toast.classNames) == null ? void 0 : _toast_classNames4.content)
|
|
4190
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
4191
|
+
"data-title": "",
|
|
4192
|
+
className: cn$1(classNames == null ? void 0 : classNames.title, toast == null ? void 0 : (_toast_classNames5 = toast.classNames) == null ? void 0 : _toast_classNames5.title)
|
|
4193
|
+
}, toast.jsx ? toast.jsx : typeof toast.title === 'function' ? toast.title() : toast.title), toast.description ? /*#__PURE__*/ React.createElement("div", {
|
|
4194
|
+
"data-description": "",
|
|
4195
|
+
className: cn$1(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast == null ? void 0 : (_toast_classNames6 = toast.classNames) == null ? void 0 : _toast_classNames6.description)
|
|
4196
|
+
}, typeof toast.description === 'function' ? toast.description() : toast.description) : null), /*#__PURE__*/ React.isValidElement(toast.cancel) ? toast.cancel : toast.cancel && isAction(toast.cancel) ? /*#__PURE__*/ React.createElement("button", {
|
|
4197
|
+
"data-button": true,
|
|
4198
|
+
"data-cancel": true,
|
|
4199
|
+
style: toast.cancelButtonStyle || cancelButtonStyle,
|
|
4200
|
+
onClick: (event)=>{
|
|
4201
|
+
// We need to check twice because typescript
|
|
4202
|
+
if (!isAction(toast.cancel)) return;
|
|
4203
|
+
if (!dismissible) return;
|
|
4204
|
+
toast.cancel.onClick == null ? void 0 : toast.cancel.onClick.call(toast.cancel, event);
|
|
4205
|
+
deleteToast();
|
|
4206
|
+
},
|
|
4207
|
+
className: cn$1(classNames == null ? void 0 : classNames.cancelButton, toast == null ? void 0 : (_toast_classNames7 = toast.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
|
|
4208
|
+
}, toast.cancel.label) : null, /*#__PURE__*/ React.isValidElement(toast.action) ? toast.action : toast.action && isAction(toast.action) ? /*#__PURE__*/ React.createElement("button", {
|
|
4209
|
+
"data-button": true,
|
|
4210
|
+
"data-action": true,
|
|
4211
|
+
style: toast.actionButtonStyle || actionButtonStyle,
|
|
4212
|
+
onClick: (event)=>{
|
|
4213
|
+
// We need to check twice because typescript
|
|
4214
|
+
if (!isAction(toast.action)) return;
|
|
4215
|
+
toast.action.onClick == null ? void 0 : toast.action.onClick.call(toast.action, event);
|
|
4216
|
+
if (event.defaultPrevented) return;
|
|
4217
|
+
deleteToast();
|
|
4218
|
+
},
|
|
4219
|
+
className: cn$1(classNames == null ? void 0 : classNames.actionButton, toast == null ? void 0 : (_toast_classNames8 = toast.classNames) == null ? void 0 : _toast_classNames8.actionButton)
|
|
4220
|
+
}, toast.action.label) : null);
|
|
4221
|
+
};
|
|
4222
|
+
function getDocumentDirection() {
|
|
4223
|
+
if (typeof window === 'undefined') return 'ltr';
|
|
4224
|
+
if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose
|
|
4225
|
+
const dirAttribute = document.documentElement.getAttribute('dir');
|
|
4226
|
+
if (dirAttribute === 'auto' || !dirAttribute) {
|
|
4227
|
+
return window.getComputedStyle(document.documentElement).direction;
|
|
4228
|
+
}
|
|
4229
|
+
return dirAttribute;
|
|
4230
|
+
}
|
|
4231
|
+
function assignOffset(defaultOffset, mobileOffset) {
|
|
4232
|
+
const styles = {};
|
|
4233
|
+
[
|
|
4234
|
+
defaultOffset,
|
|
4235
|
+
mobileOffset
|
|
4236
|
+
].forEach((offset, index)=>{
|
|
4237
|
+
const isMobile = index === 1;
|
|
4238
|
+
const prefix = isMobile ? '--mobile-offset' : '--offset';
|
|
4239
|
+
const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
|
|
4240
|
+
function assignAll(offset) {
|
|
4241
|
+
[
|
|
4242
|
+
'top',
|
|
4243
|
+
'right',
|
|
4244
|
+
'bottom',
|
|
4245
|
+
'left'
|
|
4246
|
+
].forEach((key)=>{
|
|
4247
|
+
styles[`${prefix}-${key}`] = typeof offset === 'number' ? `${offset}px` : offset;
|
|
4248
|
+
});
|
|
4249
|
+
}
|
|
4250
|
+
if (typeof offset === 'number' || typeof offset === 'string') {
|
|
4251
|
+
assignAll(offset);
|
|
4252
|
+
} else if (typeof offset === 'object') {
|
|
4253
|
+
[
|
|
4254
|
+
'top',
|
|
4255
|
+
'right',
|
|
4256
|
+
'bottom',
|
|
4257
|
+
'left'
|
|
4258
|
+
].forEach((key)=>{
|
|
4259
|
+
if (offset[key] === undefined) {
|
|
4260
|
+
styles[`${prefix}-${key}`] = defaultValue;
|
|
4261
|
+
} else {
|
|
4262
|
+
styles[`${prefix}-${key}`] = typeof offset[key] === 'number' ? `${offset[key]}px` : offset[key];
|
|
4263
|
+
}
|
|
4264
|
+
});
|
|
4265
|
+
} else {
|
|
4266
|
+
assignAll(defaultValue);
|
|
4267
|
+
}
|
|
4268
|
+
});
|
|
4269
|
+
return styles;
|
|
4270
|
+
}
|
|
4271
|
+
const Toaster$1 = /*#__PURE__*/ React.forwardRef(function Toaster(props, ref) {
|
|
4272
|
+
const { invert, position = 'bottom-right', hotkey = [
|
|
4273
|
+
'altKey',
|
|
4274
|
+
'KeyT'
|
|
4275
|
+
], expand, closeButton, className, offset, mobileOffset, theme = 'light', richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = 'Notifications' } = props;
|
|
4276
|
+
const [toasts, setToasts] = React.useState([]);
|
|
4277
|
+
const possiblePositions = React.useMemo(()=>{
|
|
4278
|
+
return Array.from(new Set([
|
|
4279
|
+
position
|
|
4280
|
+
].concat(toasts.filter((toast)=>toast.position).map((toast)=>toast.position))));
|
|
4281
|
+
}, [
|
|
4282
|
+
toasts,
|
|
4283
|
+
position
|
|
4284
|
+
]);
|
|
4285
|
+
const [heights, setHeights] = React.useState([]);
|
|
4286
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
4287
|
+
const [interacting, setInteracting] = React.useState(false);
|
|
4288
|
+
const [actualTheme, setActualTheme] = React.useState(theme !== 'system' ? theme : typeof window !== 'undefined' ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' : 'light');
|
|
4289
|
+
const listRef = React.useRef(null);
|
|
4290
|
+
const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');
|
|
4291
|
+
const lastFocusedElementRef = React.useRef(null);
|
|
4292
|
+
const isFocusWithinRef = React.useRef(false);
|
|
4293
|
+
const removeToast = React.useCallback((toastToRemove)=>{
|
|
4294
|
+
setToasts((toasts)=>{
|
|
4295
|
+
var _toasts_find;
|
|
4296
|
+
if (!((_toasts_find = toasts.find((toast)=>toast.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
|
|
4297
|
+
ToastState.dismiss(toastToRemove.id);
|
|
4298
|
+
}
|
|
4299
|
+
return toasts.filter(({ id })=>id !== toastToRemove.id);
|
|
4300
|
+
});
|
|
4301
|
+
}, []);
|
|
4302
|
+
React.useEffect(()=>{
|
|
4303
|
+
return ToastState.subscribe((toast)=>{
|
|
4304
|
+
if (toast.dismiss) {
|
|
4305
|
+
// Prevent batching of other state updates
|
|
4306
|
+
requestAnimationFrame(()=>{
|
|
4307
|
+
setToasts((toasts)=>toasts.map((t)=>t.id === toast.id ? {
|
|
4308
|
+
...t,
|
|
4309
|
+
delete: true
|
|
4310
|
+
} : t));
|
|
4311
|
+
});
|
|
4312
|
+
return;
|
|
4313
|
+
}
|
|
4314
|
+
// Prevent batching, temp solution.
|
|
4315
|
+
setTimeout(()=>{
|
|
4316
|
+
ReactDOM.flushSync(()=>{
|
|
4317
|
+
setToasts((toasts)=>{
|
|
4318
|
+
const indexOfExistingToast = toasts.findIndex((t)=>t.id === toast.id);
|
|
4319
|
+
// Update the toast if it already exists
|
|
4320
|
+
if (indexOfExistingToast !== -1) {
|
|
4321
|
+
return [
|
|
4322
|
+
...toasts.slice(0, indexOfExistingToast),
|
|
4323
|
+
{
|
|
4324
|
+
...toasts[indexOfExistingToast],
|
|
4325
|
+
...toast
|
|
4326
|
+
},
|
|
4327
|
+
...toasts.slice(indexOfExistingToast + 1)
|
|
4328
|
+
];
|
|
4329
|
+
}
|
|
4330
|
+
return [
|
|
4331
|
+
toast,
|
|
4332
|
+
...toasts
|
|
4333
|
+
];
|
|
4334
|
+
});
|
|
4335
|
+
});
|
|
4336
|
+
});
|
|
4337
|
+
});
|
|
4338
|
+
}, [
|
|
4339
|
+
toasts
|
|
4340
|
+
]);
|
|
4341
|
+
React.useEffect(()=>{
|
|
4342
|
+
if (theme !== 'system') {
|
|
4343
|
+
setActualTheme(theme);
|
|
4344
|
+
return;
|
|
4345
|
+
}
|
|
4346
|
+
if (theme === 'system') {
|
|
4347
|
+
// check if current preference is dark
|
|
4348
|
+
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
4349
|
+
// it's currently dark
|
|
4350
|
+
setActualTheme('dark');
|
|
4351
|
+
} else {
|
|
4352
|
+
// it's not dark
|
|
4353
|
+
setActualTheme('light');
|
|
4354
|
+
}
|
|
4355
|
+
}
|
|
4356
|
+
if (typeof window === 'undefined') return;
|
|
4357
|
+
const darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
4358
|
+
try {
|
|
4359
|
+
// Chrome & Firefox
|
|
4360
|
+
darkMediaQuery.addEventListener('change', ({ matches })=>{
|
|
4361
|
+
if (matches) {
|
|
4362
|
+
setActualTheme('dark');
|
|
4363
|
+
} else {
|
|
4364
|
+
setActualTheme('light');
|
|
4365
|
+
}
|
|
4366
|
+
});
|
|
4367
|
+
} catch (error) {
|
|
4368
|
+
// Safari < 14
|
|
4369
|
+
darkMediaQuery.addListener(({ matches })=>{
|
|
4370
|
+
try {
|
|
4371
|
+
if (matches) {
|
|
4372
|
+
setActualTheme('dark');
|
|
4373
|
+
} else {
|
|
4374
|
+
setActualTheme('light');
|
|
4375
|
+
}
|
|
4376
|
+
} catch (e) {
|
|
4377
|
+
console.error(e);
|
|
4378
|
+
}
|
|
4379
|
+
});
|
|
4380
|
+
}
|
|
4381
|
+
}, [
|
|
4382
|
+
theme
|
|
4383
|
+
]);
|
|
4384
|
+
React.useEffect(()=>{
|
|
4385
|
+
// Ensure expanded is always false when no toasts are present / only one left
|
|
4386
|
+
if (toasts.length <= 1) {
|
|
4387
|
+
setExpanded(false);
|
|
4388
|
+
}
|
|
4389
|
+
}, [
|
|
4390
|
+
toasts
|
|
4391
|
+
]);
|
|
4392
|
+
React.useEffect(()=>{
|
|
4393
|
+
const handleKeyDown = (event)=>{
|
|
4394
|
+
var _listRef_current;
|
|
4395
|
+
const isHotkeyPressed = hotkey.every((key)=>event[key] || event.code === key);
|
|
4396
|
+
if (isHotkeyPressed) {
|
|
4397
|
+
var _listRef_current1;
|
|
4398
|
+
setExpanded(true);
|
|
4399
|
+
(_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
|
|
4400
|
+
}
|
|
4401
|
+
if (event.code === 'Escape' && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
|
|
4402
|
+
setExpanded(false);
|
|
4403
|
+
}
|
|
4404
|
+
};
|
|
4405
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
4406
|
+
return ()=>document.removeEventListener('keydown', handleKeyDown);
|
|
4407
|
+
}, [
|
|
4408
|
+
hotkey
|
|
4409
|
+
]);
|
|
4410
|
+
React.useEffect(()=>{
|
|
4411
|
+
if (listRef.current) {
|
|
4412
|
+
return ()=>{
|
|
4413
|
+
if (lastFocusedElementRef.current) {
|
|
4414
|
+
lastFocusedElementRef.current.focus({
|
|
4415
|
+
preventScroll: true
|
|
4416
|
+
});
|
|
4417
|
+
lastFocusedElementRef.current = null;
|
|
4418
|
+
isFocusWithinRef.current = false;
|
|
4419
|
+
}
|
|
4420
|
+
};
|
|
4421
|
+
}
|
|
4422
|
+
}, [
|
|
4423
|
+
listRef.current
|
|
4424
|
+
]);
|
|
4425
|
+
return(// Remove item from normal navigation flow, only available via hotkey
|
|
4426
|
+
/*#__PURE__*/ React.createElement("section", {
|
|
4427
|
+
ref: ref,
|
|
4428
|
+
"aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
|
|
4429
|
+
tabIndex: -1,
|
|
4430
|
+
"aria-live": "polite",
|
|
4431
|
+
"aria-relevant": "additions text",
|
|
4432
|
+
"aria-atomic": "false",
|
|
4433
|
+
suppressHydrationWarning: true
|
|
4434
|
+
}, possiblePositions.map((position, index)=>{
|
|
4435
|
+
var _heights_;
|
|
4436
|
+
const [y, x] = position.split('-');
|
|
4437
|
+
if (!toasts.length) return null;
|
|
4438
|
+
return /*#__PURE__*/ React.createElement("ol", {
|
|
4439
|
+
key: position,
|
|
4440
|
+
dir: dir === 'auto' ? getDocumentDirection() : dir,
|
|
4441
|
+
tabIndex: -1,
|
|
4442
|
+
ref: listRef,
|
|
4443
|
+
className: className,
|
|
4444
|
+
"data-sonner-toaster": true,
|
|
4445
|
+
"data-sonner-theme": actualTheme,
|
|
4446
|
+
"data-y-position": y,
|
|
4447
|
+
"data-lifted": expanded && toasts.length > 1 && !expand,
|
|
4448
|
+
"data-x-position": x,
|
|
4449
|
+
style: {
|
|
4450
|
+
'--front-toast-height': `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
|
|
4451
|
+
'--width': `${TOAST_WIDTH}px`,
|
|
4452
|
+
'--gap': `${gap}px`,
|
|
4453
|
+
...style,
|
|
4454
|
+
...assignOffset(offset, mobileOffset)
|
|
4455
|
+
},
|
|
4456
|
+
onBlur: (event)=>{
|
|
4457
|
+
if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
|
|
4458
|
+
isFocusWithinRef.current = false;
|
|
4459
|
+
if (lastFocusedElementRef.current) {
|
|
4460
|
+
lastFocusedElementRef.current.focus({
|
|
4461
|
+
preventScroll: true
|
|
4462
|
+
});
|
|
4463
|
+
lastFocusedElementRef.current = null;
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4466
|
+
},
|
|
4467
|
+
onFocus: (event)=>{
|
|
4468
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';
|
|
4469
|
+
if (isNotDismissible) return;
|
|
4470
|
+
if (!isFocusWithinRef.current) {
|
|
4471
|
+
isFocusWithinRef.current = true;
|
|
4472
|
+
lastFocusedElementRef.current = event.relatedTarget;
|
|
4473
|
+
}
|
|
4474
|
+
},
|
|
4475
|
+
onMouseEnter: ()=>setExpanded(true),
|
|
4476
|
+
onMouseMove: ()=>setExpanded(true),
|
|
4477
|
+
onMouseLeave: ()=>{
|
|
4478
|
+
// Avoid setting expanded to false when interacting with a toast, e.g. swiping
|
|
4479
|
+
if (!interacting) {
|
|
4480
|
+
setExpanded(false);
|
|
4481
|
+
}
|
|
4482
|
+
},
|
|
4483
|
+
onDragEnd: ()=>setExpanded(false),
|
|
4484
|
+
onPointerDown: (event)=>{
|
|
4485
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';
|
|
4486
|
+
if (isNotDismissible) return;
|
|
4487
|
+
setInteracting(true);
|
|
4488
|
+
},
|
|
4489
|
+
onPointerUp: ()=>setInteracting(false)
|
|
4490
|
+
}, toasts.filter((toast)=>!toast.position && index === 0 || toast.position === position).map((toast, index)=>{
|
|
4491
|
+
var _toastOptions_duration, _toastOptions_closeButton;
|
|
4492
|
+
return /*#__PURE__*/ React.createElement(Toast, {
|
|
4493
|
+
key: toast.id,
|
|
4494
|
+
icons: icons,
|
|
4495
|
+
index: index,
|
|
4496
|
+
toast: toast,
|
|
4497
|
+
defaultRichColors: richColors,
|
|
4498
|
+
duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration,
|
|
4499
|
+
className: toastOptions == null ? void 0 : toastOptions.className,
|
|
4500
|
+
descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
|
|
4501
|
+
invert: invert,
|
|
4502
|
+
visibleToasts: visibleToasts,
|
|
4503
|
+
closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
|
|
4504
|
+
interacting: interacting,
|
|
4505
|
+
position: position,
|
|
4506
|
+
style: toastOptions == null ? void 0 : toastOptions.style,
|
|
4507
|
+
unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
|
|
4508
|
+
classNames: toastOptions == null ? void 0 : toastOptions.classNames,
|
|
4509
|
+
cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
|
|
4510
|
+
actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
|
|
4511
|
+
closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
|
|
4512
|
+
removeToast: removeToast,
|
|
4513
|
+
toasts: toasts.filter((t)=>t.position == toast.position),
|
|
4514
|
+
heights: heights.filter((h)=>h.position == toast.position),
|
|
4515
|
+
setHeights: setHeights,
|
|
4516
|
+
expandByDefault: expand,
|
|
4517
|
+
gap: gap,
|
|
4518
|
+
expanded: expanded,
|
|
4519
|
+
swipeDirections: props.swipeDirections
|
|
4520
|
+
});
|
|
4521
|
+
}));
|
|
4522
|
+
})));
|
|
4523
|
+
});
|
|
4524
|
+
|
|
4525
|
+
const Toaster = (_a) => {
|
|
4526
|
+
var props = __rest(_a, []);
|
|
4527
|
+
const { theme = "system" } = z$1();
|
|
4528
|
+
return (React.createElement(Toaster$1, Object.assign({ theme: theme, className: "toaster group", style: {
|
|
4529
|
+
"--normal-bg": "var(--popover)",
|
|
4530
|
+
"--normal-text": "var(--popover-foreground)",
|
|
4531
|
+
"--normal-border": "var(--border)",
|
|
4532
|
+
} }, props)));
|
|
4533
|
+
};
|
|
4534
|
+
|
|
3395
4535
|
const appearance = {
|
|
3396
4536
|
variables: {
|
|
3397
4537
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Geist", "Gill Sans", sans-serif'}};
|
|
@@ -3606,6 +4746,18 @@ const MotionConfigContext = React.createContext({
|
|
|
3606
4746
|
reducedMotion: "never",
|
|
3607
4747
|
});
|
|
3608
4748
|
|
|
4749
|
+
function isObject$1(value) {
|
|
4750
|
+
return typeof value === "object" && value !== null;
|
|
4751
|
+
}
|
|
4752
|
+
|
|
4753
|
+
/**
|
|
4754
|
+
* Checks if an element is an HTML element in a way
|
|
4755
|
+
* that works across iframes
|
|
4756
|
+
*/
|
|
4757
|
+
function isHTMLElement$1(element) {
|
|
4758
|
+
return isObject$1(element) && "offsetHeight" in element;
|
|
4759
|
+
}
|
|
4760
|
+
|
|
3609
4761
|
/**
|
|
3610
4762
|
* Measurement functionality has to be within a separate component
|
|
3611
4763
|
* to leverage snapshot lifecycle.
|
|
@@ -3615,7 +4767,9 @@ class PopChildMeasure extends React__namespace.Component {
|
|
|
3615
4767
|
const element = this.props.childRef.current;
|
|
3616
4768
|
if (element && prevProps.isPresent && !this.props.isPresent) {
|
|
3617
4769
|
const parent = element.offsetParent;
|
|
3618
|
-
const parentWidth = parent
|
|
4770
|
+
const parentWidth = isHTMLElement$1(parent)
|
|
4771
|
+
? parent.offsetWidth || 0
|
|
4772
|
+
: 0;
|
|
3619
4773
|
const size = this.props.sizeRef.current;
|
|
3620
4774
|
size.height = element.offsetHeight || 0;
|
|
3621
4775
|
size.width = element.offsetWidth || 0;
|
|
@@ -3675,7 +4829,9 @@ function PopChild({ children, isPresent, anchorX }) {
|
|
|
3675
4829
|
`);
|
|
3676
4830
|
}
|
|
3677
4831
|
return () => {
|
|
3678
|
-
document.head.
|
|
4832
|
+
if (document.head.contains(style)) {
|
|
4833
|
+
document.head.removeChild(style);
|
|
4834
|
+
}
|
|
3679
4835
|
};
|
|
3680
4836
|
}, [isPresent]);
|
|
3681
4837
|
return (jsxRuntime.jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React__namespace.cloneElement(children, { ref }) }));
|
|
@@ -4702,8 +5858,6 @@ function isForcedMotionValue(key, { layout, layoutId }) {
|
|
|
4702
5858
|
(!!scaleCorrectors[key] || key === "opacity")));
|
|
4703
5859
|
}
|
|
4704
5860
|
|
|
4705
|
-
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
4706
|
-
|
|
4707
5861
|
/**
|
|
4708
5862
|
* Provided a value and a ValueType, returns the value as that value type.
|
|
4709
5863
|
*/
|
|
@@ -4950,6 +6104,8 @@ const createHtmlRenderState = () => ({
|
|
|
4950
6104
|
vars: {},
|
|
4951
6105
|
});
|
|
4952
6106
|
|
|
6107
|
+
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
6108
|
+
|
|
4953
6109
|
function copyRawValuesOnly(target, source, props) {
|
|
4954
6110
|
for (const key in source) {
|
|
4955
6111
|
if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
|
|
@@ -5000,65 +6156,6 @@ function useHTMLProps(props, visualState) {
|
|
|
5000
6156
|
return htmlProps;
|
|
5001
6157
|
}
|
|
5002
6158
|
|
|
5003
|
-
/**
|
|
5004
|
-
* We keep these listed separately as we use the lowercase tag names as part
|
|
5005
|
-
* of the runtime bundle to detect SVG components
|
|
5006
|
-
*/
|
|
5007
|
-
const lowercaseSVGElements = [
|
|
5008
|
-
"animate",
|
|
5009
|
-
"circle",
|
|
5010
|
-
"defs",
|
|
5011
|
-
"desc",
|
|
5012
|
-
"ellipse",
|
|
5013
|
-
"g",
|
|
5014
|
-
"image",
|
|
5015
|
-
"line",
|
|
5016
|
-
"filter",
|
|
5017
|
-
"marker",
|
|
5018
|
-
"mask",
|
|
5019
|
-
"metadata",
|
|
5020
|
-
"path",
|
|
5021
|
-
"pattern",
|
|
5022
|
-
"polygon",
|
|
5023
|
-
"polyline",
|
|
5024
|
-
"rect",
|
|
5025
|
-
"stop",
|
|
5026
|
-
"switch",
|
|
5027
|
-
"symbol",
|
|
5028
|
-
"svg",
|
|
5029
|
-
"text",
|
|
5030
|
-
"tspan",
|
|
5031
|
-
"use",
|
|
5032
|
-
"view",
|
|
5033
|
-
];
|
|
5034
|
-
|
|
5035
|
-
function isSVGComponent(Component) {
|
|
5036
|
-
if (
|
|
5037
|
-
/**
|
|
5038
|
-
* If it's not a string, it's a custom React component. Currently we only support
|
|
5039
|
-
* HTML custom React components.
|
|
5040
|
-
*/
|
|
5041
|
-
typeof Component !== "string" ||
|
|
5042
|
-
/**
|
|
5043
|
-
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
5044
|
-
*/
|
|
5045
|
-
Component.includes("-")) {
|
|
5046
|
-
return false;
|
|
5047
|
-
}
|
|
5048
|
-
else if (
|
|
5049
|
-
/**
|
|
5050
|
-
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
5051
|
-
*/
|
|
5052
|
-
lowercaseSVGElements.indexOf(Component) > -1 ||
|
|
5053
|
-
/**
|
|
5054
|
-
* If it contains a capital letter, it's an SVG component
|
|
5055
|
-
*/
|
|
5056
|
-
/[A-Z]/u.test(Component)) {
|
|
5057
|
-
return true;
|
|
5058
|
-
}
|
|
5059
|
-
return false;
|
|
5060
|
-
}
|
|
5061
|
-
|
|
5062
6159
|
const dashKeys = {
|
|
5063
6160
|
offset: "stroke-dashoffset",
|
|
5064
6161
|
array: "stroke-dasharray",
|
|
@@ -5093,7 +6190,7 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
|
|
|
5093
6190
|
*/
|
|
5094
6191
|
function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0,
|
|
5095
6192
|
// This is object creation, which we try to avoid per-frame.
|
|
5096
|
-
...latest }, isSVGTag, transformTemplate) {
|
|
6193
|
+
...latest }, isSVGTag, transformTemplate, styleProp) {
|
|
5097
6194
|
buildHTMLStyles(state, latest, transformTemplate);
|
|
5098
6195
|
/**
|
|
5099
6196
|
* For svg tags we just want to make sure viewBox is animatable and treat all the styles
|
|
@@ -5125,7 +6222,7 @@ function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing
|
|
|
5125
6222
|
* SVG's element transform-origin uses its own median as a reference.
|
|
5126
6223
|
* Therefore, transformBox becomes a fill-box
|
|
5127
6224
|
*/
|
|
5128
|
-
style.transformBox = "fill-box";
|
|
6225
|
+
style.transformBox = styleProp?.transformBox ?? "fill-box";
|
|
5129
6226
|
delete attrs.transformBox;
|
|
5130
6227
|
}
|
|
5131
6228
|
// Render attrX/attrY/attrScale as attributes
|
|
@@ -5151,7 +6248,7 @@ const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"
|
|
|
5151
6248
|
function useSVGProps(props, visualState, _isStatic, Component) {
|
|
5152
6249
|
const visualProps = React.useMemo(() => {
|
|
5153
6250
|
const state = createSvgRenderState();
|
|
5154
|
-
buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate);
|
|
6251
|
+
buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);
|
|
5155
6252
|
return {
|
|
5156
6253
|
...state.attrs,
|
|
5157
6254
|
style: { ...state.style },
|
|
@@ -5165,6 +6262,65 @@ function useSVGProps(props, visualState, _isStatic, Component) {
|
|
|
5165
6262
|
return visualProps;
|
|
5166
6263
|
}
|
|
5167
6264
|
|
|
6265
|
+
/**
|
|
6266
|
+
* We keep these listed separately as we use the lowercase tag names as part
|
|
6267
|
+
* of the runtime bundle to detect SVG components
|
|
6268
|
+
*/
|
|
6269
|
+
const lowercaseSVGElements = [
|
|
6270
|
+
"animate",
|
|
6271
|
+
"circle",
|
|
6272
|
+
"defs",
|
|
6273
|
+
"desc",
|
|
6274
|
+
"ellipse",
|
|
6275
|
+
"g",
|
|
6276
|
+
"image",
|
|
6277
|
+
"line",
|
|
6278
|
+
"filter",
|
|
6279
|
+
"marker",
|
|
6280
|
+
"mask",
|
|
6281
|
+
"metadata",
|
|
6282
|
+
"path",
|
|
6283
|
+
"pattern",
|
|
6284
|
+
"polygon",
|
|
6285
|
+
"polyline",
|
|
6286
|
+
"rect",
|
|
6287
|
+
"stop",
|
|
6288
|
+
"switch",
|
|
6289
|
+
"symbol",
|
|
6290
|
+
"svg",
|
|
6291
|
+
"text",
|
|
6292
|
+
"tspan",
|
|
6293
|
+
"use",
|
|
6294
|
+
"view",
|
|
6295
|
+
];
|
|
6296
|
+
|
|
6297
|
+
function isSVGComponent(Component) {
|
|
6298
|
+
if (
|
|
6299
|
+
/**
|
|
6300
|
+
* If it's not a string, it's a custom React component. Currently we only support
|
|
6301
|
+
* HTML custom React components.
|
|
6302
|
+
*/
|
|
6303
|
+
typeof Component !== "string" ||
|
|
6304
|
+
/**
|
|
6305
|
+
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
6306
|
+
*/
|
|
6307
|
+
Component.includes("-")) {
|
|
6308
|
+
return false;
|
|
6309
|
+
}
|
|
6310
|
+
else if (
|
|
6311
|
+
/**
|
|
6312
|
+
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
6313
|
+
*/
|
|
6314
|
+
lowercaseSVGElements.indexOf(Component) > -1 ||
|
|
6315
|
+
/**
|
|
6316
|
+
* If it contains a capital letter, it's an SVG component
|
|
6317
|
+
*/
|
|
6318
|
+
/[A-Z]/u.test(Component)) {
|
|
6319
|
+
return true;
|
|
6320
|
+
}
|
|
6321
|
+
return false;
|
|
6322
|
+
}
|
|
6323
|
+
|
|
5168
6324
|
function createUseRender(forwardMotionProps = false) {
|
|
5169
6325
|
const useRender = (Component, props, ref, { latestValues }, isStatic) => {
|
|
5170
6326
|
const useVisualProps = isSVGComponent(Component)
|
|
@@ -5476,11 +6632,6 @@ class MotionValue {
|
|
|
5476
6632
|
* - `transformer`: A function to transform incoming values with.
|
|
5477
6633
|
*/
|
|
5478
6634
|
constructor(init, options = {}) {
|
|
5479
|
-
/**
|
|
5480
|
-
* This will be replaced by the build step with the latest version number.
|
|
5481
|
-
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
5482
|
-
*/
|
|
5483
|
-
this.version = "12.9.1";
|
|
5484
6635
|
/**
|
|
5485
6636
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
5486
6637
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -5508,6 +6659,11 @@ class MotionValue {
|
|
|
5508
6659
|
// Update update subscribers
|
|
5509
6660
|
if (this.current !== this.prev) {
|
|
5510
6661
|
this.events.change?.notify(this.current);
|
|
6662
|
+
if (this.dependents) {
|
|
6663
|
+
for (const dependent of this.dependents) {
|
|
6664
|
+
dependent.dirty();
|
|
6665
|
+
}
|
|
6666
|
+
}
|
|
5511
6667
|
}
|
|
5512
6668
|
// Update render subscribers
|
|
5513
6669
|
if (render) {
|
|
@@ -5649,6 +6805,20 @@ class MotionValue {
|
|
|
5649
6805
|
if (this.stopPassiveEffect)
|
|
5650
6806
|
this.stopPassiveEffect();
|
|
5651
6807
|
}
|
|
6808
|
+
dirty() {
|
|
6809
|
+
this.events.change?.notify(this.current);
|
|
6810
|
+
}
|
|
6811
|
+
addDependent(dependent) {
|
|
6812
|
+
if (!this.dependents) {
|
|
6813
|
+
this.dependents = new Set();
|
|
6814
|
+
}
|
|
6815
|
+
this.dependents.add(dependent);
|
|
6816
|
+
}
|
|
6817
|
+
removeDependent(dependent) {
|
|
6818
|
+
if (this.dependents) {
|
|
6819
|
+
this.dependents.delete(dependent);
|
|
6820
|
+
}
|
|
6821
|
+
}
|
|
5652
6822
|
/**
|
|
5653
6823
|
* Returns the latest state of `MotionValue`
|
|
5654
6824
|
*
|
|
@@ -5744,6 +6914,7 @@ class MotionValue {
|
|
|
5744
6914
|
* @public
|
|
5745
6915
|
*/
|
|
5746
6916
|
destroy() {
|
|
6917
|
+
this.dependents?.clear();
|
|
5747
6918
|
this.events.destroy?.notify();
|
|
5748
6919
|
this.clearListeners();
|
|
5749
6920
|
this.stop();
|
|
@@ -6323,7 +7494,7 @@ function mix(from, to, p) {
|
|
|
6323
7494
|
const frameloopDriver = (update) => {
|
|
6324
7495
|
const passTimestamp = ({ timestamp }) => update(timestamp);
|
|
6325
7496
|
return {
|
|
6326
|
-
start: () => frame.update(passTimestamp,
|
|
7497
|
+
start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),
|
|
6327
7498
|
stop: () => cancelFrame(passTimestamp),
|
|
6328
7499
|
/**
|
|
6329
7500
|
* If we're processing this frame we can use the
|
|
@@ -6782,7 +7953,7 @@ function createMixers(output, ease, customMixer) {
|
|
|
6782
7953
|
* mixColor(0.5) // 'rgba(128, 128, 128, 1)'
|
|
6783
7954
|
* ```
|
|
6784
7955
|
*
|
|
6785
|
-
* TODO
|
|
7956
|
+
* TODO Revisit this approach once we've moved to data models for values,
|
|
6786
7957
|
* probably not needed to pregenerate mixer functions.
|
|
6787
7958
|
*
|
|
6788
7959
|
* @public
|
|
@@ -7017,14 +8188,12 @@ function replaceTransitionType(transition) {
|
|
|
7017
8188
|
|
|
7018
8189
|
class WithPromise {
|
|
7019
8190
|
constructor() {
|
|
7020
|
-
this.count = 0;
|
|
7021
8191
|
this.updateFinished();
|
|
7022
8192
|
}
|
|
7023
8193
|
get finished() {
|
|
7024
8194
|
return this._finished;
|
|
7025
8195
|
}
|
|
7026
8196
|
updateFinished() {
|
|
7027
|
-
this.count++;
|
|
7028
8197
|
this._finished = new Promise((resolve) => {
|
|
7029
8198
|
this.resolve = resolve;
|
|
7030
8199
|
});
|
|
@@ -7065,17 +8234,18 @@ class JSAnimation extends WithPromise {
|
|
|
7065
8234
|
* This method is bound to the instance to fix a pattern where
|
|
7066
8235
|
* animation.stop is returned as a reference from a useEffect.
|
|
7067
8236
|
*/
|
|
7068
|
-
this.stop = () => {
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
8237
|
+
this.stop = (sync = true) => {
|
|
8238
|
+
if (sync) {
|
|
8239
|
+
const { motionValue } = this.options;
|
|
8240
|
+
if (motionValue && motionValue.updatedAt !== time.now()) {
|
|
8241
|
+
this.tick(time.now());
|
|
8242
|
+
}
|
|
7072
8243
|
}
|
|
7073
8244
|
this.isStopped = true;
|
|
7074
8245
|
if (this.state === "idle")
|
|
7075
8246
|
return;
|
|
7076
8247
|
this.teardown();
|
|
7077
|
-
|
|
7078
|
-
onStop && onStop();
|
|
8248
|
+
this.options.onStop?.();
|
|
7079
8249
|
};
|
|
7080
8250
|
this.options = options;
|
|
7081
8251
|
this.initAnimation();
|
|
@@ -7275,6 +8445,7 @@ class JSAnimation extends WithPromise {
|
|
|
7275
8445
|
else if (this.driver) {
|
|
7276
8446
|
this.startTime = this.driver.now() - newTime / this.playbackSpeed;
|
|
7277
8447
|
}
|
|
8448
|
+
this.driver?.start(false);
|
|
7278
8449
|
}
|
|
7279
8450
|
get speed() {
|
|
7280
8451
|
return this.playbackSpeed;
|
|
@@ -7290,11 +8461,11 @@ class JSAnimation extends WithPromise {
|
|
|
7290
8461
|
play() {
|
|
7291
8462
|
if (this.isStopped)
|
|
7292
8463
|
return;
|
|
7293
|
-
const { driver = frameloopDriver,
|
|
8464
|
+
const { driver = frameloopDriver, startTime } = this.options;
|
|
7294
8465
|
if (!this.driver) {
|
|
7295
8466
|
this.driver = driver((timestamp) => this.tick(timestamp));
|
|
7296
8467
|
}
|
|
7297
|
-
onPlay
|
|
8468
|
+
this.options.onPlay?.();
|
|
7298
8469
|
const now = this.driver.now();
|
|
7299
8470
|
if (this.state === "finished") {
|
|
7300
8471
|
this.updateFinished();
|
|
@@ -7330,19 +8501,19 @@ class JSAnimation extends WithPromise {
|
|
|
7330
8501
|
this.holdTime = null;
|
|
7331
8502
|
}
|
|
7332
8503
|
finish() {
|
|
8504
|
+
this.notifyFinished();
|
|
7333
8505
|
this.teardown();
|
|
7334
8506
|
this.state = "finished";
|
|
7335
|
-
|
|
7336
|
-
onComplete && onComplete();
|
|
8507
|
+
this.options.onComplete?.();
|
|
7337
8508
|
}
|
|
7338
8509
|
cancel() {
|
|
7339
8510
|
this.holdTime = null;
|
|
7340
8511
|
this.startTime = 0;
|
|
7341
8512
|
this.tick(0);
|
|
7342
8513
|
this.teardown();
|
|
8514
|
+
this.options.onCancel?.();
|
|
7343
8515
|
}
|
|
7344
8516
|
teardown() {
|
|
7345
|
-
this.notifyFinished();
|
|
7346
8517
|
this.state = "idle";
|
|
7347
8518
|
this.stopDriver();
|
|
7348
8519
|
this.startTime = this.holdTime = null;
|
|
@@ -7363,6 +8534,7 @@ class JSAnimation extends WithPromise {
|
|
|
7363
8534
|
this.options.ease = "linear";
|
|
7364
8535
|
this.initAnimation();
|
|
7365
8536
|
}
|
|
8537
|
+
this.driver?.stop();
|
|
7366
8538
|
return timeline.observe(this);
|
|
7367
8539
|
}
|
|
7368
8540
|
}
|
|
@@ -7547,11 +8719,7 @@ function flushKeyframeResolvers() {
|
|
|
7547
8719
|
}
|
|
7548
8720
|
class KeyframeResolver {
|
|
7549
8721
|
constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {
|
|
7550
|
-
|
|
7551
|
-
* Track whether this resolver has completed. Once complete, it never
|
|
7552
|
-
* needs to attempt keyframe resolution again.
|
|
7553
|
-
*/
|
|
7554
|
-
this.isComplete = false;
|
|
8722
|
+
this.state = "pending";
|
|
7555
8723
|
/**
|
|
7556
8724
|
* Track whether this resolver is async. If it is, it'll be added to the
|
|
7557
8725
|
* resolver queue and flushed in the next frame. Resolvers that aren't going
|
|
@@ -7563,11 +8731,6 @@ class KeyframeResolver {
|
|
|
7563
8731
|
* to resolve its keyframes.
|
|
7564
8732
|
*/
|
|
7565
8733
|
this.needsMeasurement = false;
|
|
7566
|
-
/**
|
|
7567
|
-
* Track whether this resolver is currently scheduled to resolve
|
|
7568
|
-
* to allow it to be cancelled and resumed externally.
|
|
7569
|
-
*/
|
|
7570
|
-
this.isScheduled = false;
|
|
7571
8734
|
this.unresolvedKeyframes = [...unresolvedKeyframes];
|
|
7572
8735
|
this.onComplete = onComplete;
|
|
7573
8736
|
this.name = name;
|
|
@@ -7576,7 +8739,7 @@ class KeyframeResolver {
|
|
|
7576
8739
|
this.isAsync = isAsync;
|
|
7577
8740
|
}
|
|
7578
8741
|
scheduleResolve() {
|
|
7579
|
-
this.
|
|
8742
|
+
this.state = "scheduled";
|
|
7580
8743
|
if (this.isAsync) {
|
|
7581
8744
|
toResolve.add(this);
|
|
7582
8745
|
if (!isScheduled) {
|
|
@@ -7619,19 +8782,19 @@ class KeyframeResolver {
|
|
|
7619
8782
|
measureInitialState() { }
|
|
7620
8783
|
renderEndStyles() { }
|
|
7621
8784
|
measureEndState() { }
|
|
7622
|
-
complete(
|
|
7623
|
-
this.
|
|
7624
|
-
this.onComplete(this.unresolvedKeyframes, this.finalKeyframe,
|
|
8785
|
+
complete(isForcedComplete = false) {
|
|
8786
|
+
this.state = "complete";
|
|
8787
|
+
this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);
|
|
7625
8788
|
toResolve.delete(this);
|
|
7626
8789
|
}
|
|
7627
8790
|
cancel() {
|
|
7628
|
-
if (
|
|
7629
|
-
this.isScheduled = false;
|
|
8791
|
+
if (this.state === "scheduled") {
|
|
7630
8792
|
toResolve.delete(this);
|
|
8793
|
+
this.state = "pending";
|
|
7631
8794
|
}
|
|
7632
8795
|
}
|
|
7633
8796
|
resume() {
|
|
7634
|
-
if (
|
|
8797
|
+
if (this.state === "pending")
|
|
7635
8798
|
this.scheduleResolve();
|
|
7636
8799
|
}
|
|
7637
8800
|
}
|
|
@@ -7794,10 +8957,6 @@ class NativeAnimation extends WithPromise {
|
|
|
7794
8957
|
onComplete?.();
|
|
7795
8958
|
this.notifyFinished();
|
|
7796
8959
|
};
|
|
7797
|
-
/**
|
|
7798
|
-
* TODO: In a breaking change, we should replace this with `.notifyCancel()`
|
|
7799
|
-
*/
|
|
7800
|
-
this.animation.oncancel = () => this.notifyFinished();
|
|
7801
8960
|
}
|
|
7802
8961
|
play() {
|
|
7803
8962
|
if (this.isStopped)
|
|
@@ -8051,16 +9210,13 @@ const acceleratedValues = new Set([
|
|
|
8051
9210
|
"clipPath",
|
|
8052
9211
|
"filter",
|
|
8053
9212
|
"transform",
|
|
8054
|
-
// TODO:
|
|
8055
|
-
// or until we implement support for linear() easing.
|
|
9213
|
+
// TODO: Could be re-enabled now we have support for linear() easing
|
|
8056
9214
|
// "background-color"
|
|
8057
9215
|
]);
|
|
8058
9216
|
const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
8059
9217
|
function supportsBrowserAnimation(options) {
|
|
8060
9218
|
const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
|
|
8061
|
-
if (!motionValue
|
|
8062
|
-
!motionValue.owner ||
|
|
8063
|
-
!(motionValue.owner.current instanceof HTMLElement)) {
|
|
9219
|
+
if (!isHTMLElement$1(motionValue?.owner?.current)) {
|
|
8064
9220
|
return false;
|
|
8065
9221
|
}
|
|
8066
9222
|
const { onUpdate, transformTemplate } = motionValue.owner.getProps();
|
|
@@ -8099,9 +9255,7 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
8099
9255
|
this._animation.stop();
|
|
8100
9256
|
this.stopTimeline?.();
|
|
8101
9257
|
}
|
|
8102
|
-
|
|
8103
|
-
this.keyframeResolver?.cancel();
|
|
8104
|
-
}
|
|
9258
|
+
this.keyframeResolver?.cancel();
|
|
8105
9259
|
};
|
|
8106
9260
|
this.createdAt = time.now();
|
|
8107
9261
|
const optionsWithDefaults = {
|
|
@@ -8192,6 +9346,7 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
8192
9346
|
}
|
|
8193
9347
|
get animation() {
|
|
8194
9348
|
if (!this._animation) {
|
|
9349
|
+
this.keyframeResolver?.resume();
|
|
8195
9350
|
flushKeyframeResolvers();
|
|
8196
9351
|
}
|
|
8197
9352
|
return this._animation;
|
|
@@ -8236,7 +9391,10 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
8236
9391
|
this.animation.complete();
|
|
8237
9392
|
}
|
|
8238
9393
|
cancel() {
|
|
8239
|
-
this.
|
|
9394
|
+
if (this._animation) {
|
|
9395
|
+
this.animation.cancel();
|
|
9396
|
+
}
|
|
9397
|
+
this.keyframeResolver?.cancel();
|
|
8240
9398
|
}
|
|
8241
9399
|
}
|
|
8242
9400
|
|
|
@@ -8326,7 +9484,9 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
|
|
|
8326
9484
|
return;
|
|
8327
9485
|
}
|
|
8328
9486
|
}
|
|
8329
|
-
return
|
|
9487
|
+
return valueTransition.isSync
|
|
9488
|
+
? new JSAnimation(options)
|
|
9489
|
+
: new AsyncMotionValueAnimation(options);
|
|
8330
9490
|
};
|
|
8331
9491
|
|
|
8332
9492
|
const positionalKeys = new Set([
|
|
@@ -10197,7 +11357,7 @@ class MeasureLayoutWithContext extends React.Component {
|
|
|
10197
11357
|
}
|
|
10198
11358
|
getSnapshotBeforeUpdate(prevProps) {
|
|
10199
11359
|
const { layoutDependency, visualElement, drag, isPresent } = this.props;
|
|
10200
|
-
const projection = visualElement
|
|
11360
|
+
const { projection } = visualElement;
|
|
10201
11361
|
if (!projection)
|
|
10202
11362
|
return null;
|
|
10203
11363
|
/**
|
|
@@ -10295,10 +11455,6 @@ function animateSingleValue(value, keyframes, options) {
|
|
|
10295
11455
|
return motionValue$1.animation;
|
|
10296
11456
|
}
|
|
10297
11457
|
|
|
10298
|
-
function isSVGElement(element) {
|
|
10299
|
-
return element instanceof SVGElement && element.tagName !== "svg";
|
|
10300
|
-
}
|
|
10301
|
-
|
|
10302
11458
|
const compareByDepth = (a, b) => a.depth - b.depth;
|
|
10303
11459
|
|
|
10304
11460
|
class FlatTree {
|
|
@@ -10685,6 +11841,22 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
|
|
|
10685
11841
|
return transform || "none";
|
|
10686
11842
|
}
|
|
10687
11843
|
|
|
11844
|
+
/**
|
|
11845
|
+
* Checks if an element is an SVG element in a way
|
|
11846
|
+
* that works across iframes
|
|
11847
|
+
*/
|
|
11848
|
+
function isSVGElement(element) {
|
|
11849
|
+
return isObject$1(element) && "ownerSVGElement" in element;
|
|
11850
|
+
}
|
|
11851
|
+
|
|
11852
|
+
/**
|
|
11853
|
+
* Checks if an element is specifically an SVGSVGElement (the root SVG element)
|
|
11854
|
+
* in a way that works across iframes
|
|
11855
|
+
*/
|
|
11856
|
+
function isSVGSVGElement(element) {
|
|
11857
|
+
return isSVGElement(element) && element.tagName === "svg";
|
|
11858
|
+
}
|
|
11859
|
+
|
|
10688
11860
|
const transformAxes = ["", "X", "Y", "Z"];
|
|
10689
11861
|
const hiddenVisibility = { visibility: "hidden" };
|
|
10690
11862
|
/**
|
|
@@ -10878,10 +12050,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
10878
12050
|
/**
|
|
10879
12051
|
* Lifecycles
|
|
10880
12052
|
*/
|
|
10881
|
-
mount(instance
|
|
12053
|
+
mount(instance) {
|
|
10882
12054
|
if (this.instance)
|
|
10883
12055
|
return;
|
|
10884
|
-
this.isSVG = isSVGElement(instance);
|
|
12056
|
+
this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);
|
|
10885
12057
|
this.instance = instance;
|
|
10886
12058
|
const { layoutId, layout, visualElement } = this.options;
|
|
10887
12059
|
if (visualElement && !visualElement.current) {
|
|
@@ -10889,7 +12061,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
10889
12061
|
}
|
|
10890
12062
|
this.root.nodes.add(this);
|
|
10891
12063
|
this.parent && this.parent.children.add(this);
|
|
10892
|
-
if (
|
|
12064
|
+
if (this.root.hasTreeAnimated && (layout || layoutId)) {
|
|
10893
12065
|
this.isLayoutDirty = true;
|
|
10894
12066
|
}
|
|
10895
12067
|
if (attachResizeListener) {
|
|
@@ -10987,6 +12159,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
10987
12159
|
stack && stack.remove(this);
|
|
10988
12160
|
this.parent && this.parent.children.delete(this);
|
|
10989
12161
|
this.instance = undefined;
|
|
12162
|
+
this.eventHandlers.clear();
|
|
10990
12163
|
cancelFrame(this.updateProjection);
|
|
10991
12164
|
}
|
|
10992
12165
|
// only on the root
|
|
@@ -11188,7 +12361,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11188
12361
|
this.scroll.phase === phase) {
|
|
11189
12362
|
needsMeasurement = false;
|
|
11190
12363
|
}
|
|
11191
|
-
if (needsMeasurement) {
|
|
12364
|
+
if (needsMeasurement && this.instance) {
|
|
11192
12365
|
const isRoot = checkIsScrollRoot(this.instance);
|
|
11193
12366
|
this.scroll = {
|
|
11194
12367
|
animationId: this.root.animationId,
|
|
@@ -11212,6 +12385,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11212
12385
|
: undefined;
|
|
11213
12386
|
const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;
|
|
11214
12387
|
if (isResetRequested &&
|
|
12388
|
+
this.instance &&
|
|
11215
12389
|
(hasProjection ||
|
|
11216
12390
|
hasTransform(this.latestValues) ||
|
|
11217
12391
|
transformTemplateHasChanged)) {
|
|
@@ -11683,10 +12857,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11683
12857
|
}
|
|
11684
12858
|
startAnimation(options) {
|
|
11685
12859
|
this.notifyListeners("animationStart");
|
|
11686
|
-
this.currentAnimation
|
|
11687
|
-
|
|
11688
|
-
this.resumingFrom.currentAnimation.stop();
|
|
11689
|
-
}
|
|
12860
|
+
this.currentAnimation?.stop(false);
|
|
12861
|
+
this.resumingFrom?.currentAnimation?.stop(false);
|
|
11690
12862
|
if (this.pendingAnimation) {
|
|
11691
12863
|
cancelFrame(this.pendingAnimation);
|
|
11692
12864
|
this.pendingAnimation = undefined;
|
|
@@ -11698,8 +12870,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11698
12870
|
*/
|
|
11699
12871
|
this.pendingAnimation = frame.update(() => {
|
|
11700
12872
|
globalProjectionState.hasAnimatedSinceResize = true;
|
|
11701
|
-
this.
|
|
12873
|
+
this.motionValue || (this.motionValue = motionValue(0));
|
|
12874
|
+
this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], {
|
|
11702
12875
|
...options,
|
|
12876
|
+
isSync: true,
|
|
11703
12877
|
onUpdate: (latest) => {
|
|
11704
12878
|
this.mixTargetDelta(latest);
|
|
11705
12879
|
options.onUpdate && options.onUpdate(latest);
|
|
@@ -11733,7 +12907,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11733
12907
|
finishAnimation() {
|
|
11734
12908
|
if (this.currentAnimation) {
|
|
11735
12909
|
this.mixTargetDelta && this.mixTargetDelta(animationTarget);
|
|
11736
|
-
this.currentAnimation.stop();
|
|
12910
|
+
this.currentAnimation.stop(false);
|
|
11737
12911
|
}
|
|
11738
12912
|
this.completeAnimation();
|
|
11739
12913
|
}
|
|
@@ -11998,7 +13172,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11998
13172
|
}
|
|
11999
13173
|
// Only run on root
|
|
12000
13174
|
resetTree() {
|
|
12001
|
-
this.root.nodes.forEach((node) => node.currentAnimation?.stop());
|
|
13175
|
+
this.root.nodes.forEach((node) => node.currentAnimation?.stop(false));
|
|
12002
13176
|
this.root.nodes.forEach(clearMeasurements);
|
|
12003
13177
|
this.root.sharedNodes.clear();
|
|
12004
13178
|
}
|
|
@@ -12470,17 +13644,19 @@ function press(targetOrSelector, onPressStart, options = {}) {
|
|
|
12470
13644
|
const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);
|
|
12471
13645
|
const startPress = (startEvent) => {
|
|
12472
13646
|
const target = startEvent.currentTarget;
|
|
12473
|
-
if (!isValidPressEvent(startEvent)
|
|
13647
|
+
if (!isValidPressEvent(startEvent))
|
|
12474
13648
|
return;
|
|
12475
13649
|
isPressing.add(target);
|
|
12476
13650
|
const onPressEnd = onPressStart(target, startEvent);
|
|
12477
13651
|
const onPointerEnd = (endEvent, success) => {
|
|
12478
13652
|
window.removeEventListener("pointerup", onPointerUp);
|
|
12479
13653
|
window.removeEventListener("pointercancel", onPointerCancel);
|
|
12480
|
-
if (
|
|
13654
|
+
if (isPressing.has(target)) {
|
|
13655
|
+
isPressing.delete(target);
|
|
13656
|
+
}
|
|
13657
|
+
if (!isValidPressEvent(endEvent)) {
|
|
12481
13658
|
return;
|
|
12482
13659
|
}
|
|
12483
|
-
isPressing.delete(target);
|
|
12484
13660
|
if (typeof onPressEnd === "function") {
|
|
12485
13661
|
onPressEnd(endEvent, { success });
|
|
12486
13662
|
}
|
|
@@ -12500,7 +13676,7 @@ function press(targetOrSelector, onPressStart, options = {}) {
|
|
|
12500
13676
|
targets.forEach((target) => {
|
|
12501
13677
|
const pointerDownTarget = options.useGlobalTarget ? window : target;
|
|
12502
13678
|
pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions);
|
|
12503
|
-
if (target
|
|
13679
|
+
if (isHTMLElement$1(target)) {
|
|
12504
13680
|
target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions));
|
|
12505
13681
|
if (!isElementKeyboardAccessible(target) &&
|
|
12506
13682
|
!target.hasAttribute("tabindex")) {
|
|
@@ -12707,13 +13883,6 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
12707
13883
|
* to our visual element's motion value map.
|
|
12708
13884
|
*/
|
|
12709
13885
|
element.addValue(key, nextValue);
|
|
12710
|
-
/**
|
|
12711
|
-
* Check the version of the incoming motion value with this version
|
|
12712
|
-
* and warn against mismatches.
|
|
12713
|
-
*/
|
|
12714
|
-
if (process.env.NODE_ENV === "development") {
|
|
12715
|
-
warnOnce(nextValue.version === "12.9.2", `Attempting to mix Motion versions ${nextValue.version} with 12.9.2 may not work as expected.`);
|
|
12716
|
-
}
|
|
12717
13886
|
}
|
|
12718
13887
|
else if (isMotionValue(prevValue)) {
|
|
12719
13888
|
/**
|
|
@@ -13445,7 +14614,7 @@ class DOMKeyframesResolver extends KeyframeResolver {
|
|
|
13445
14614
|
}
|
|
13446
14615
|
}
|
|
13447
14616
|
}
|
|
13448
|
-
else {
|
|
14617
|
+
else if (positionalValues[name]) {
|
|
13449
14618
|
/**
|
|
13450
14619
|
* Else, the only way to resolve this is by measuring the element.
|
|
13451
14620
|
*/
|
|
@@ -13561,7 +14730,9 @@ class HTMLVisualElement extends DOMVisualElement {
|
|
|
13561
14730
|
}
|
|
13562
14731
|
readValueFromInstance(instance, key) {
|
|
13563
14732
|
if (transformProps.has(key)) {
|
|
13564
|
-
return
|
|
14733
|
+
return this.projection?.isProjecting
|
|
14734
|
+
? defaultTransformValue(key)
|
|
14735
|
+
: readTransformValue(instance, key);
|
|
13565
14736
|
}
|
|
13566
14737
|
else {
|
|
13567
14738
|
const computedStyle = getComputedStyle$1(instance);
|
|
@@ -13640,7 +14811,7 @@ class SVGVisualElement extends DOMVisualElement {
|
|
|
13640
14811
|
return scrapeMotionValuesFromProps(props, prevProps, visualElement);
|
|
13641
14812
|
}
|
|
13642
14813
|
build(renderState, latestValues, props) {
|
|
13643
|
-
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate);
|
|
14814
|
+
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);
|
|
13644
14815
|
}
|
|
13645
14816
|
renderInstance(instance, renderState, styleProp, projection) {
|
|
13646
14817
|
renderSVG(instance, renderState, styleProp, projection);
|
|
@@ -14628,15 +15799,15 @@ const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z
|
|
|
14628
15799
|
const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
14629
15800
|
const dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
14630
15801
|
function timeRegexSource(args) {
|
|
14631
|
-
|
|
14632
|
-
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
15802
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
14633
15803
|
if (args.precision) {
|
|
14634
|
-
|
|
15804
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
14635
15805
|
}
|
|
14636
15806
|
else if (args.precision == null) {
|
|
14637
|
-
|
|
15807
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
14638
15808
|
}
|
|
14639
|
-
|
|
15809
|
+
const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
|
|
15810
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
14640
15811
|
}
|
|
14641
15812
|
function timeRegex(args) {
|
|
14642
15813
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -18333,47 +19504,7 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
18333
19504
|
return result;
|
|
18334
19505
|
};
|
|
18335
19506
|
|
|
18336
|
-
|
|
18337
|
-
|
|
18338
|
-
function deepEqual(object1, object2) {
|
|
18339
|
-
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
18340
|
-
return object1 === object2;
|
|
18341
|
-
}
|
|
18342
|
-
if (isDateObject(object1) && isDateObject(object2)) {
|
|
18343
|
-
return object1.getTime() === object2.getTime();
|
|
18344
|
-
}
|
|
18345
|
-
const keys1 = Object.keys(object1);
|
|
18346
|
-
const keys2 = Object.keys(object2);
|
|
18347
|
-
if (keys1.length !== keys2.length) {
|
|
18348
|
-
return false;
|
|
18349
|
-
}
|
|
18350
|
-
for (const key of keys1) {
|
|
18351
|
-
const val1 = object1[key];
|
|
18352
|
-
if (!keys2.includes(key)) {
|
|
18353
|
-
return false;
|
|
18354
|
-
}
|
|
18355
|
-
if (key !== 'ref') {
|
|
18356
|
-
const val2 = object2[key];
|
|
18357
|
-
if ((isDateObject(val1) && isDateObject(val2)) ||
|
|
18358
|
-
(isObject(val1) && isObject(val2)) ||
|
|
18359
|
-
(Array.isArray(val1) && Array.isArray(val2))
|
|
18360
|
-
? !deepEqual(val1, val2)
|
|
18361
|
-
: val1 !== val2) {
|
|
18362
|
-
return false;
|
|
18363
|
-
}
|
|
18364
|
-
}
|
|
18365
|
-
}
|
|
18366
|
-
return true;
|
|
18367
|
-
}
|
|
18368
|
-
|
|
18369
|
-
const useDeepEqualEffect = (effect, deps) => {
|
|
18370
|
-
const ref = React__namespace.useRef(deps);
|
|
18371
|
-
if (!deepEqual(deps, ref.current)) {
|
|
18372
|
-
ref.current = deps;
|
|
18373
|
-
}
|
|
18374
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18375
|
-
React__namespace.useEffect(effect, ref.current);
|
|
18376
|
-
};
|
|
19507
|
+
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
18377
19508
|
|
|
18378
19509
|
/**
|
|
18379
19510
|
* This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
|
|
@@ -18419,7 +19550,7 @@ function useFormState(props) {
|
|
|
18419
19550
|
isValid: false,
|
|
18420
19551
|
errors: false,
|
|
18421
19552
|
});
|
|
18422
|
-
|
|
19553
|
+
useIsomorphicLayoutEffect(() => control._subscribe({
|
|
18423
19554
|
name: name,
|
|
18424
19555
|
formState: _localProxyFormState.current,
|
|
18425
19556
|
exact,
|
|
@@ -18470,16 +19601,17 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) =>
|
|
|
18470
19601
|
function useWatch(props) {
|
|
18471
19602
|
const methods = useFormContext();
|
|
18472
19603
|
const { control = methods.control, name, defaultValue, disabled, exact, } = props || {};
|
|
18473
|
-
const
|
|
18474
|
-
|
|
19604
|
+
const _defaultValue = React.useRef(defaultValue);
|
|
19605
|
+
const [value, updateValue] = React.useState(control._getWatch(name, _defaultValue.current));
|
|
19606
|
+
useIsomorphicLayoutEffect(() => control._subscribe({
|
|
18475
19607
|
name: name,
|
|
18476
19608
|
formState: {
|
|
18477
19609
|
values: true,
|
|
18478
19610
|
},
|
|
18479
19611
|
exact,
|
|
18480
19612
|
callback: (formState) => !disabled &&
|
|
18481
|
-
updateValue(generateWatchOutput(name, control._names, formState.values || control._formValues, false,
|
|
18482
|
-
}), [name,
|
|
19613
|
+
updateValue(generateWatchOutput(name, control._names, formState.values || control._formValues, false, _defaultValue.current)),
|
|
19614
|
+
}), [name, control, disabled, exact]);
|
|
18483
19615
|
React.useEffect(() => control._removeUnmounted());
|
|
18484
19616
|
return value;
|
|
18485
19617
|
}
|
|
@@ -18714,6 +19846,39 @@ var createSubject = () => {
|
|
|
18714
19846
|
};
|
|
18715
19847
|
};
|
|
18716
19848
|
|
|
19849
|
+
var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
|
|
19850
|
+
|
|
19851
|
+
function deepEqual(object1, object2) {
|
|
19852
|
+
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
19853
|
+
return object1 === object2;
|
|
19854
|
+
}
|
|
19855
|
+
if (isDateObject(object1) && isDateObject(object2)) {
|
|
19856
|
+
return object1.getTime() === object2.getTime();
|
|
19857
|
+
}
|
|
19858
|
+
const keys1 = Object.keys(object1);
|
|
19859
|
+
const keys2 = Object.keys(object2);
|
|
19860
|
+
if (keys1.length !== keys2.length) {
|
|
19861
|
+
return false;
|
|
19862
|
+
}
|
|
19863
|
+
for (const key of keys1) {
|
|
19864
|
+
const val1 = object1[key];
|
|
19865
|
+
if (!keys2.includes(key)) {
|
|
19866
|
+
return false;
|
|
19867
|
+
}
|
|
19868
|
+
if (key !== 'ref') {
|
|
19869
|
+
const val2 = object2[key];
|
|
19870
|
+
if ((isDateObject(val1) && isDateObject(val2)) ||
|
|
19871
|
+
(isObject(val1) && isObject(val2)) ||
|
|
19872
|
+
(Array.isArray(val1) && Array.isArray(val2))
|
|
19873
|
+
? !deepEqual(val1, val2)
|
|
19874
|
+
: val1 !== val2) {
|
|
19875
|
+
return false;
|
|
19876
|
+
}
|
|
19877
|
+
}
|
|
19878
|
+
}
|
|
19879
|
+
return true;
|
|
19880
|
+
}
|
|
19881
|
+
|
|
18717
19882
|
var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
|
|
18718
19883
|
|
|
18719
19884
|
var isFileInput = (element) => element.type === 'file';
|
|
@@ -19277,7 +20442,7 @@ function createFormControl(props = {}) {
|
|
|
19277
20442
|
};
|
|
19278
20443
|
const _fields = {};
|
|
19279
20444
|
let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)
|
|
19280
|
-
? cloneObject(_options.
|
|
20445
|
+
? cloneObject(_options.defaultValues || _options.values) || {}
|
|
19281
20446
|
: {};
|
|
19282
20447
|
let _formValues = _options.shouldUnregister
|
|
19283
20448
|
? {}
|
|
@@ -20282,7 +21447,6 @@ function createFormControl(props = {}) {
|
|
|
20282
21447
|
};
|
|
20283
21448
|
}
|
|
20284
21449
|
|
|
20285
|
-
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
20286
21450
|
/**
|
|
20287
21451
|
* Custom hook to manage the entire form.
|
|
20288
21452
|
*
|
|
@@ -21629,21 +22793,21 @@ const getDefaultConfig = () => {
|
|
|
21629
22793
|
* @see https://tailwindcss.com/docs/height
|
|
21630
22794
|
*/
|
|
21631
22795
|
h: [{
|
|
21632
|
-
h: ['screen', ...scaleSizing()]
|
|
22796
|
+
h: ['screen', 'lh', ...scaleSizing()]
|
|
21633
22797
|
}],
|
|
21634
22798
|
/**
|
|
21635
22799
|
* Min-Height
|
|
21636
22800
|
* @see https://tailwindcss.com/docs/min-height
|
|
21637
22801
|
*/
|
|
21638
22802
|
'min-h': [{
|
|
21639
|
-
'min-h': ['screen', 'none', ...scaleSizing()]
|
|
22803
|
+
'min-h': ['screen', 'lh', 'none', ...scaleSizing()]
|
|
21640
22804
|
}],
|
|
21641
22805
|
/**
|
|
21642
22806
|
* Max-Height
|
|
21643
22807
|
* @see https://tailwindcss.com/docs/max-height
|
|
21644
22808
|
*/
|
|
21645
22809
|
'max-h': [{
|
|
21646
|
-
'max-h': ['screen', ...scaleSizing()]
|
|
22810
|
+
'max-h': ['screen', 'lh', ...scaleSizing()]
|
|
21647
22811
|
}],
|
|
21648
22812
|
// ------------------
|
|
21649
22813
|
// --- Typography ---
|
|
@@ -23442,7 +24606,7 @@ function FormMessage(_a) {
|
|
|
23442
24606
|
|
|
23443
24607
|
function Input(_a) {
|
|
23444
24608
|
var { className, type } = _a, props = __rest(_a, ["className", "type"]);
|
|
23445
|
-
return (React__namespace.createElement("input", Object.assign({ type: type, "data-slot": "input", className: cn("border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-
|
|
24609
|
+
return (React__namespace.createElement("input", Object.assign({ type: type, "data-slot": "input", className: cn("border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-10 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className) }, props)));
|
|
23446
24610
|
}
|
|
23447
24611
|
|
|
23448
24612
|
function InputGroup(_a) {
|
|
@@ -23508,9 +24672,9 @@ const buttonVariants = cva("inline-flex cursor-pointer items-center justify-cent
|
|
|
23508
24672
|
},
|
|
23509
24673
|
size: {
|
|
23510
24674
|
link: "p-0 h-auto",
|
|
23511
|
-
default: "h-
|
|
24675
|
+
default: "h-10 px-4 py-2 has-[>svg]:px-3",
|
|
23512
24676
|
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
23513
|
-
lg: "h-
|
|
24677
|
+
lg: "h-12 rounded-md px-6 has-[>svg]:px-4",
|
|
23514
24678
|
icon: "size-9",
|
|
23515
24679
|
},
|
|
23516
24680
|
},
|
|
@@ -28874,7 +30038,7 @@ function requireCurrencies () {
|
|
|
28874
30038
|
name: 'Lesotho loti',
|
|
28875
30039
|
number: '426'
|
|
28876
30040
|
}, {
|
|
28877
|
-
code: '
|
|
30041
|
+
code: 'LTL',
|
|
28878
30042
|
decimals: 2,
|
|
28879
30043
|
name: 'Lithuanian litas',
|
|
28880
30044
|
number: '440'
|
|
@@ -32974,12 +34138,12 @@ function requireReactStripe_umd () {
|
|
|
32974
34138
|
|
|
32975
34139
|
stripe._registerWrapper({
|
|
32976
34140
|
name: 'react-stripe-js',
|
|
32977
|
-
version: "3.
|
|
34141
|
+
version: "3.7.0"
|
|
32978
34142
|
});
|
|
32979
34143
|
|
|
32980
34144
|
stripe.registerAppInfo({
|
|
32981
34145
|
name: 'react-stripe-js',
|
|
32982
|
-
version: "3.
|
|
34146
|
+
version: "3.7.0",
|
|
32983
34147
|
url: 'https://stripe.com/docs/stripe-js/react'
|
|
32984
34148
|
});
|
|
32985
34149
|
};
|
|
@@ -33222,20 +34386,24 @@ function requireReactStripe_umd () {
|
|
|
33222
34386
|
}, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes
|
|
33223
34387
|
|
|
33224
34388
|
var prevOptions = usePrevious(options);
|
|
34389
|
+
var prevCheckoutSdk = usePrevious(ctx.checkoutSdk);
|
|
33225
34390
|
React.useEffect(function () {
|
|
33226
34391
|
var _prevOptions$elements, _options$elementsOpti;
|
|
33227
34392
|
|
|
34393
|
+
// Ignore changes while checkout sdk is not initialized.
|
|
33228
34394
|
if (!ctx.checkoutSdk) {
|
|
33229
34395
|
return;
|
|
33230
34396
|
}
|
|
33231
34397
|
|
|
33232
34398
|
var previousAppearance = prevOptions === null || prevOptions === void 0 ? void 0 : (_prevOptions$elements = prevOptions.elementsOptions) === null || _prevOptions$elements === void 0 ? void 0 : _prevOptions$elements.appearance;
|
|
33233
34399
|
var currentAppearance = options === null || options === void 0 ? void 0 : (_options$elementsOpti = options.elementsOptions) === null || _options$elementsOpti === void 0 ? void 0 : _options$elementsOpti.appearance;
|
|
34400
|
+
var hasAppearanceChanged = !isEqual(currentAppearance, previousAppearance);
|
|
34401
|
+
var hasSdkLoaded = !prevCheckoutSdk && ctx.checkoutSdk;
|
|
33234
34402
|
|
|
33235
|
-
if (currentAppearance &&
|
|
34403
|
+
if (currentAppearance && (hasAppearanceChanged || hasSdkLoaded)) {
|
|
33236
34404
|
ctx.checkoutSdk.changeAppearance(currentAppearance);
|
|
33237
34405
|
}
|
|
33238
|
-
}, [options, prevOptions, ctx.checkoutSdk]); // Attach react-stripe-js version to stripe.js instance
|
|
34406
|
+
}, [options, prevOptions, ctx.checkoutSdk, prevCheckoutSdk]); // Attach react-stripe-js version to stripe.js instance
|
|
33239
34407
|
|
|
33240
34408
|
React.useEffect(function () {
|
|
33241
34409
|
registerWithStripeJs(ctx.stripe);
|
|
@@ -34269,7 +35437,7 @@ const motionSettings = {
|
|
|
34269
35437
|
exit: { opacity: 0 },
|
|
34270
35438
|
transition: { duration: 0.2 },
|
|
34271
35439
|
};
|
|
34272
|
-
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, }) {
|
|
35440
|
+
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, setCheckout, }) {
|
|
34273
35441
|
const { formData, setFormData, step, setStep, checkoutId: storedCheckoutId, setCheckoutId, } = useFormStore();
|
|
34274
35442
|
const [paymentSecret, setPaymentSecret] = React.useState(null);
|
|
34275
35443
|
const [publicKey, setPublicKey] = React.useState(null);
|
|
@@ -34405,10 +35573,11 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
34405
35573
|
name: data.name,
|
|
34406
35574
|
},
|
|
34407
35575
|
});
|
|
34408
|
-
const { paymentSecret, publicKey } = yield storeClient.
|
|
35576
|
+
const { paymentSecret, publicKey, checkoutSession: newCheckout, } = yield storeClient.generateCheckoutPaymentSecret(clientSecret, checkoutId);
|
|
34409
35577
|
setPaymentSecret(paymentSecret);
|
|
34410
35578
|
setPublicKey(publicKey);
|
|
34411
35579
|
setShippingCost(data.price);
|
|
35580
|
+
setCheckout(newCheckout);
|
|
34412
35581
|
setStep("payment");
|
|
34413
35582
|
});
|
|
34414
35583
|
// Navigate back to previous step
|
|
@@ -34426,9 +35595,10 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
34426
35595
|
};
|
|
34427
35596
|
React.useEffect(() => {
|
|
34428
35597
|
const asyncFunc = () => __awaiter(this, void 0, void 0, function* () {
|
|
34429
|
-
const { paymentSecret, publicKey } = yield storeClient.
|
|
35598
|
+
const { paymentSecret, publicKey, checkoutSession: newCheckout, } = yield storeClient.generateCheckoutPaymentSecret(clientSecret, checkoutId);
|
|
34430
35599
|
setPaymentSecret(paymentSecret);
|
|
34431
35600
|
setPublicKey(publicKey);
|
|
35601
|
+
setCheckout(newCheckout);
|
|
34432
35602
|
});
|
|
34433
35603
|
if (!paymentSecret && step === "payment") {
|
|
34434
35604
|
asyncFunc();
|
|
@@ -34455,26 +35625,68 @@ function CheckoutFormLoading() {
|
|
|
34455
35625
|
React.createElement(InputGroupLoading, { className: "md:col-span-2" }),
|
|
34456
35626
|
React.createElement(InputGroupLoading, null),
|
|
34457
35627
|
React.createElement("div", { className: "flex md:col-span-2 justify-end pt-2" },
|
|
34458
|
-
React.createElement(Skeleton, { className: "w-32 h-
|
|
35628
|
+
React.createElement(Skeleton, { className: "w-32 h-10" }))));
|
|
34459
35629
|
}
|
|
34460
35630
|
function InputGroupLoading({ className }) {
|
|
34461
35631
|
return (React.createElement("div", { className: clsx("flex flex-col gap-2", className) },
|
|
34462
35632
|
React.createElement(Skeleton, { className: "w-10 h-3" }),
|
|
34463
|
-
React.createElement(Skeleton, { className: "w-full h-
|
|
35633
|
+
React.createElement(Skeleton, { className: "w-full h-10" })));
|
|
34464
35634
|
}
|
|
34465
35635
|
|
|
34466
|
-
function
|
|
34467
|
-
|
|
35636
|
+
function DiscountCode({ applyDiscountCode, revalidateDiscounts, }) {
|
|
35637
|
+
const { t } = useTranslation();
|
|
35638
|
+
const [discountCode, setDiscountCode] = React.useState("");
|
|
35639
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
35640
|
+
const [error, setError] = React.useState(null);
|
|
35641
|
+
const isValid = discountCode.length > 0;
|
|
35642
|
+
const handleSubmit = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
35643
|
+
e.preventDefault();
|
|
35644
|
+
setIsLoading(true);
|
|
35645
|
+
try {
|
|
35646
|
+
yield applyDiscountCode(discountCode);
|
|
35647
|
+
yield revalidateDiscounts();
|
|
35648
|
+
setDiscountCode("");
|
|
35649
|
+
toast.success(t("CheckoutEmbed.Summary.discountCodeSuccess"));
|
|
35650
|
+
}
|
|
35651
|
+
catch (error) {
|
|
35652
|
+
console.error(error);
|
|
35653
|
+
setError(t("CheckoutEmbed.Summary.discountCodeError"));
|
|
35654
|
+
}
|
|
35655
|
+
finally {
|
|
35656
|
+
setIsLoading(false);
|
|
35657
|
+
}
|
|
35658
|
+
});
|
|
35659
|
+
return (React.createElement("form", { className: "pb-1", onSubmit: handleSubmit },
|
|
35660
|
+
React.createElement(Label, { className: "text-sm font-medium mb-2" }, "Discount Code"),
|
|
35661
|
+
React.createElement("div", { className: "flex items-center gap-2" },
|
|
35662
|
+
React.createElement(Input, { "aria-invalid": !!error, value: discountCode, onChange: (e) => {
|
|
35663
|
+
setError("");
|
|
35664
|
+
setDiscountCode(e.target.value);
|
|
35665
|
+
}, name: "discountCode", placeholder: t("CheckoutEmbed.Summary.discountCodePlaceholder") }),
|
|
35666
|
+
React.createElement(SubmitButton, { isSubmitting: isLoading, isValid: isValid, type: "submit" }, t("CheckoutEmbed.Summary.discountCodeApply"))),
|
|
35667
|
+
error && React.createElement("p", { className: "text-red-500 mt-2 text-sm" }, error)));
|
|
35668
|
+
}
|
|
35669
|
+
|
|
35670
|
+
function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency, onCancel, exchangeRate, applyDiscountCode, revalidateDiscounts, removeDiscount, }) {
|
|
35671
|
+
var _a, _b;
|
|
34468
35672
|
const { formData } = useFormStore();
|
|
34469
35673
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
34470
35674
|
const { t } = useTranslation();
|
|
34471
35675
|
const subtotal = lineItems.reduce((acc, item) => {
|
|
34472
|
-
var _a;
|
|
34473
|
-
const productItem = item.
|
|
34474
|
-
return acc + ((
|
|
35676
|
+
var _a, _b;
|
|
35677
|
+
const productItem = ((_a = item.productData) === null || _a === void 0 ? void 0 : _a.selectedVariant) || item.productData;
|
|
35678
|
+
return acc + ((_b = productItem === null || productItem === void 0 ? void 0 : productItem.priceInCents) !== null && _b !== void 0 ? _b : 0) * item.quantity;
|
|
34475
35679
|
}, 0);
|
|
34476
35680
|
const shippingPrice = shipping !== null && shipping !== void 0 ? shipping : (_a = formData.shipping) === null || _a === void 0 ? void 0 : _a.price;
|
|
34477
35681
|
const total = subtotal + (tax !== null && tax !== void 0 ? tax : 0) + (shippingPrice !== null && shippingPrice !== void 0 ? shippingPrice : 0);
|
|
35682
|
+
const isShippingFree = total > (shippingPrice !== null && shippingPrice !== void 0 ? shippingPrice : 0) &&
|
|
35683
|
+
appliedDiscounts.some((discount) => discount.discount.type === "FREE_SHIPPING");
|
|
35684
|
+
const filteredDiscounts = appliedDiscounts.filter((discount) => discount.discount.type !== "FREE_SHIPPING");
|
|
35685
|
+
const totalWithDiscounts = total -
|
|
35686
|
+
((_b = filteredDiscounts.reduce((acc, { amount }) => acc + amount, 0)) !== null && _b !== void 0 ? _b : 0);
|
|
35687
|
+
React.useEffect(() => {
|
|
35688
|
+
console.log(appliedDiscounts);
|
|
35689
|
+
}, [appliedDiscounts]);
|
|
34478
35690
|
return (React.createElement("div", { className: "grid gap-5" },
|
|
34479
35691
|
React.createElement("div", { className: "flex justify-between items-center" },
|
|
34480
35692
|
React.createElement("div", { onClick: () => setIsOpen(!isOpen), className: "flex items-center gap-2 cursor-pointer" },
|
|
@@ -34485,7 +35697,7 @@ function CheckoutSummary({ lineItems, shipping, tax, currency, onCancel, exchang
|
|
|
34485
35697
|
React.createElement("p", { className: "font-bold text-lg tracking-tight md:hidden" }, storeHelpers.formatPrice(total, currency, exchangeRate)),
|
|
34486
35698
|
React.createElement(Button, { className: "max-sm:hidden", variant: "link", size: "link", onClick: onCancel }, t("CheckoutEmbed.Summary.edit"))),
|
|
34487
35699
|
React.createElement("hr", null),
|
|
34488
|
-
React.createElement("div", { className: clsx("gap-
|
|
35700
|
+
React.createElement("div", { className: clsx("gap-2 order-4 md:order-none", {
|
|
34489
35701
|
"hidden md:grid": !isOpen,
|
|
34490
35702
|
grid: isOpen,
|
|
34491
35703
|
}) },
|
|
@@ -34494,41 +35706,91 @@ function CheckoutSummary({ lineItems, shipping, tax, currency, onCancel, exchang
|
|
|
34494
35706
|
React.createElement("p", null, storeHelpers.formatPrice(subtotal, currency, exchangeRate))),
|
|
34495
35707
|
React.createElement("div", { className: "flex justify-between" },
|
|
34496
35708
|
React.createElement("p", null, t("CheckoutEmbed.Summary.shipping")),
|
|
34497
|
-
React.createElement("p", null,
|
|
34498
|
-
?
|
|
34499
|
-
:
|
|
35709
|
+
React.createElement("p", null, isShippingFree
|
|
35710
|
+
? t("CheckoutEmbed.Summary.free")
|
|
35711
|
+
: !!shippingPrice
|
|
35712
|
+
? storeHelpers.formatPrice(shippingPrice, currency, exchangeRate)
|
|
35713
|
+
: t("CheckoutEmbed.Summary.calculatedAtNextStep"))),
|
|
34500
35714
|
!!tax && (React.createElement("div", { className: "flex justify-between" },
|
|
34501
35715
|
React.createElement("p", null, t("CheckoutEmbed.Summary.tax")),
|
|
34502
35716
|
React.createElement("p", null, storeHelpers.formatPrice(tax, currency, exchangeRate)))),
|
|
34503
|
-
|
|
35717
|
+
filteredDiscounts.map(({ discount, amount, id }) => {
|
|
35718
|
+
var _a;
|
|
35719
|
+
return (React.createElement("div", { key: discount.id, className: "flex not-last:-mb-0.5 justify-between text-muted-foreground" },
|
|
35720
|
+
React.createElement(DiscountItem, { id: id, removeDiscount: removeDiscount, label: (_a = ((discount === null || discount === void 0 ? void 0 : discount.code) || (discount === null || discount === void 0 ? void 0 : discount.title))) !== null && _a !== void 0 ? _a : "", canRemove: discount.method === "CODE" }),
|
|
35721
|
+
React.createElement("p", null,
|
|
35722
|
+
"- ",
|
|
35723
|
+
storeHelpers.formatPrice(amount, currency, exchangeRate))));
|
|
35724
|
+
}),
|
|
35725
|
+
React.createElement("div", { className: "flex font-bold justify-between items-center" },
|
|
34504
35726
|
React.createElement("p", null, t("CheckoutEmbed.Summary.total")),
|
|
34505
|
-
React.createElement("p", null, storeHelpers.formatPrice(
|
|
35727
|
+
React.createElement("p", null, storeHelpers.formatPrice(totalWithDiscounts, currency, exchangeRate)))),
|
|
35728
|
+
React.createElement("hr", { className: clsx("order-7 md:order-none", {
|
|
35729
|
+
"hidden md:block": !isOpen,
|
|
35730
|
+
block: isOpen,
|
|
35731
|
+
}) }),
|
|
35732
|
+
React.createElement("div", { className: clsx("gap-0 order-6 md:order-none", {
|
|
35733
|
+
"hidden md:grid": !isOpen,
|
|
35734
|
+
grid: isOpen,
|
|
35735
|
+
}) },
|
|
35736
|
+
React.createElement(DiscountCode, { applyDiscountCode: applyDiscountCode, revalidateDiscounts: revalidateDiscounts })),
|
|
34506
35737
|
React.createElement("hr", { className: clsx("order-5 md:order-none", {
|
|
34507
35738
|
"hidden md:block": !isOpen,
|
|
34508
35739
|
block: isOpen,
|
|
34509
35740
|
}) }),
|
|
34510
|
-
React.createElement("div", { className: clsx("gap-
|
|
35741
|
+
React.createElement("div", { className: clsx("gap-0 order-3 md:order-none", {
|
|
34511
35742
|
"hidden md:grid": !isOpen,
|
|
34512
35743
|
grid: isOpen,
|
|
34513
35744
|
}) }, lineItems.map((item, index) => {
|
|
34514
|
-
var _a, _b, _c, _d, _e;
|
|
34515
|
-
const
|
|
35745
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
35746
|
+
const productAppliedDiscounts = appliedDiscounts.filter(({ discount }) => discount.allowedProductIDs.includes(item.productData.productId));
|
|
35747
|
+
const discount = productAppliedDiscounts.length > 0
|
|
35748
|
+
? productAppliedDiscounts.reduce((acc, curr) => {
|
|
35749
|
+
return curr.amount > acc.amount ? curr : acc;
|
|
35750
|
+
}, productAppliedDiscounts[0])
|
|
35751
|
+
: null;
|
|
35752
|
+
const isDiscounted = !!discount;
|
|
35753
|
+
const productItem = ((_a = item.productData) === null || _a === void 0 ? void 0 : _a.selectedVariant) || item.productData;
|
|
35754
|
+
const discountedPrice = productItem.priceInCents - ((_b = discount === null || discount === void 0 ? void 0 : discount.amount) !== null && _b !== void 0 ? _b : 0);
|
|
34516
35755
|
return (React.createElement("div", { key: index, className: "flex items-center" },
|
|
34517
35756
|
React.createElement("div", { className: "relative" },
|
|
34518
35757
|
React.createElement("div", { className: "w-16 h-16 bg-secondary rounded-lg overflow-hidden relative" }, (productItem === null || productItem === void 0 ? void 0 : productItem.images[0]) && (React.createElement("img", { src: productItem.images[0] ||
|
|
34519
|
-
((
|
|
34520
|
-
"/placeholder.svg", alt: ((
|
|
35758
|
+
((_c = item === null || item === void 0 ? void 0 : item.productData) === null || _c === void 0 ? void 0 : _c.images[0]) ||
|
|
35759
|
+
"/placeholder.svg", alt: ((_d = item.productData) === null || _d === void 0 ? void 0 : _d.title) || "", className: "object-cover w-full h-full", sizes: "64px" }))),
|
|
34521
35760
|
React.createElement("div", { className: "absolute -top-2 -right-2 w-6 h-6 bg-primary rounded-full flex items-center text-background justify-center text-sm" }, item.quantity)),
|
|
34522
35761
|
React.createElement("div", { className: "ml-4 flex-1" },
|
|
34523
|
-
React.createElement("h3", { className: "text-lg font-medium" }, (
|
|
35762
|
+
React.createElement("h3", { className: "text-lg font-medium" }, (_e = item.productData) === null || _e === void 0 ? void 0 : _e.title),
|
|
34524
35763
|
React.createElement("p", { className: "text-muted-foreground text-sm" }, item.variantOptions.map((option) => (React.createElement("span", { key: option.name },
|
|
34525
35764
|
option.name,
|
|
34526
35765
|
": ",
|
|
34527
35766
|
option.value))))),
|
|
34528
|
-
React.createElement("div", { className: "text-right" },
|
|
34529
|
-
React.createElement("p", { className: "text-
|
|
35767
|
+
React.createElement("div", { className: "text-right" }, isDiscounted ? (React.createElement("div", { className: "flex flex-col" },
|
|
35768
|
+
React.createElement("p", { className: "text-sm font-medium -mb-0.5 line-through text-muted-foreground" }, storeHelpers.formatPrice((_f = productItem === null || productItem === void 0 ? void 0 : productItem.priceInCents) !== null && _f !== void 0 ? _f : 0, currency, exchangeRate)),
|
|
35769
|
+
React.createElement("p", { className: "text-lg font-medium" }, discountedPrice <= 0
|
|
35770
|
+
? t("CheckoutEmbed.Summary.free")
|
|
35771
|
+
: storeHelpers.formatPrice(discountedPrice, currency, exchangeRate)))) : (React.createElement("p", { className: "text-lg font-medium" }, storeHelpers.formatPrice((_g = productItem === null || productItem === void 0 ? void 0 : productItem.priceInCents) !== null && _g !== void 0 ? _g : 0, currency, exchangeRate))))));
|
|
34530
35772
|
}))));
|
|
34531
35773
|
}
|
|
35774
|
+
function DiscountItem({ id, removeDiscount, label, canRemove, }) {
|
|
35775
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
35776
|
+
const handleRemove = () => __awaiter(this, void 0, void 0, function* () {
|
|
35777
|
+
setIsLoading(true);
|
|
35778
|
+
try {
|
|
35779
|
+
yield removeDiscount(id);
|
|
35780
|
+
}
|
|
35781
|
+
catch (error) {
|
|
35782
|
+
console.error(error);
|
|
35783
|
+
}
|
|
35784
|
+
finally {
|
|
35785
|
+
setIsLoading(false);
|
|
35786
|
+
}
|
|
35787
|
+
});
|
|
35788
|
+
return (React.createElement("div", { className: "flex items-center gap-0.5" },
|
|
35789
|
+
React.createElement("p", null, isLoading ? "Removing..." : label),
|
|
35790
|
+
!isLoading && canRemove && (React.createElement("div", { onClick: handleRemove, className: "flex items-center z-10 relative -m-0.5 hover:bg-muted p-1 rounded-full justify-center hover:text-foreground cursor-pointer" },
|
|
35791
|
+
React.createElement(X$2, { className: "size-3" }),
|
|
35792
|
+
React.createElement("p", { className: "sr-only" }, "Remove")))));
|
|
35793
|
+
}
|
|
34532
35794
|
|
|
34533
35795
|
function CheckoutSummaryLoading() {
|
|
34534
35796
|
const { t } = useTranslation();
|
|
@@ -34552,7 +35814,11 @@ function CheckoutSummaryLoading() {
|
|
|
34552
35814
|
React.createElement("p", null, t("CheckoutEmbed.Summary.total")),
|
|
34553
35815
|
React.createElement(Skeleton, { className: "w-24 h-[18px]" }))),
|
|
34554
35816
|
React.createElement("hr", { className: "hidden md:block" }),
|
|
34555
|
-
|
|
35817
|
+
React.createElement("div", null,
|
|
35818
|
+
React.createElement(Skeleton, { className: "w-24 h-5 mb-2" }),
|
|
35819
|
+
React.createElement(Skeleton, { className: "h-10 w-full mb-1" })),
|
|
35820
|
+
React.createElement("hr", { className: "hidden md:block" }),
|
|
35821
|
+
Array.from({ length: 2 }).map((_, index) => (React.createElement("div", { key: index, className: "hidden md:flex items-center" },
|
|
34556
35822
|
React.createElement(Skeleton, { className: "rounded-lg size-16" }),
|
|
34557
35823
|
React.createElement("div", { className: "ml-4 grid gap-2 flex-1" },
|
|
34558
35824
|
React.createElement(Skeleton, { className: "w-28 h-5" }),
|
|
@@ -34562,11 +35828,11 @@ function CheckoutSummaryLoading() {
|
|
|
34562
35828
|
}
|
|
34563
35829
|
|
|
34564
35830
|
function CheckoutEmbed({ checkoutId, config }) {
|
|
34565
|
-
var _a, _b, _c, _d, _e;
|
|
35831
|
+
var _a, _b, _c, _d, _e, _f;
|
|
34566
35832
|
const { cancelUrl, successUrl, appearance, locale, clientSecret, clientProxy, } = config;
|
|
34567
|
-
const storeClient = sdk.createStoreClient({ proxy: clientProxy });
|
|
35833
|
+
const storeClient = React.useMemo(() => sdk.createStoreClient({ proxy: clientProxy }), [clientProxy]);
|
|
34568
35834
|
React.useMemo(() => createI18nInstance(locale), []);
|
|
34569
|
-
const { formData, setFormData,
|
|
35835
|
+
const { formData, setFormData, setStep } = useFormStore();
|
|
34570
35836
|
const [checkout, setCheckout] = React.useState(null);
|
|
34571
35837
|
const [loading, setLoading] = React.useState(true);
|
|
34572
35838
|
React.useEffect(() => {
|
|
@@ -34617,10 +35883,31 @@ function CheckoutEmbed({ checkoutId, config }) {
|
|
|
34617
35883
|
return;
|
|
34618
35884
|
setCheckout(Object.assign(Object.assign({}, checkout), { shipping: cost }));
|
|
34619
35885
|
};
|
|
35886
|
+
const applyDiscountCode = (code) => __awaiter(this, void 0, void 0, function* () {
|
|
35887
|
+
const newCheckout = yield storeClient.applyDiscountCode(clientSecret, checkoutId, code);
|
|
35888
|
+
setCheckout(newCheckout);
|
|
35889
|
+
});
|
|
35890
|
+
const revalidateDiscounts = () => __awaiter(this, void 0, void 0, function* () {
|
|
35891
|
+
const newCheckout = yield storeClient.revalidateDiscounts(clientSecret, checkoutId);
|
|
35892
|
+
setCheckout(newCheckout);
|
|
35893
|
+
});
|
|
35894
|
+
const removeDiscount = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
35895
|
+
console.log("storeclient method", storeClient);
|
|
35896
|
+
const newCheckout = yield storeClient.removeDiscount(clientSecret, checkoutId, id);
|
|
35897
|
+
setCheckout(newCheckout);
|
|
35898
|
+
});
|
|
35899
|
+
React.useEffect(() => {
|
|
35900
|
+
const interval = setTimeout(() => {
|
|
35901
|
+
revalidateDiscounts();
|
|
35902
|
+
}, 1000 * 5);
|
|
35903
|
+
return () => clearInterval(interval);
|
|
35904
|
+
}, []);
|
|
34620
35905
|
return (React.createElement("div", { className: "checkout-embed scrollbar-hidden mx-auto max-w-[1200px] min-h-screen overflow-x-hidden gap-6 md:gap-0 py-4 md:py-12 flex flex-col md:grid md:grid-cols-7 " },
|
|
34621
35906
|
React.createElement(Appearance, { appearance: appearance }),
|
|
34622
|
-
React.createElement("div", { className: "md:col-span-4 px-4 md:px-8" }, loading ? (React.createElement(CheckoutFormLoading, null)) : (React.createElement(CheckoutForm, { locale: locale, setShippingCost: setShippingCost, storeClient: storeClient, fonts: config.fonts, checkoutAppearance: appearance, currency: (_a = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _a !== void 0 ? _a : "", customer: checkout === null || checkout === void 0 ? void 0 : checkout.customer, cancelUrl: cancelUrl, checkoutId: checkoutId, clientSecret: clientSecret, onSuccess: onSuccess, onError: onError, exchangeRate: (_b = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _b !== void 0 ? _b : 1 }))),
|
|
34623
|
-
React.createElement("div", { className: "md:col-span-3 px-4 md:px-8 order-first md:order-last" },
|
|
35907
|
+
React.createElement("div", { className: "md:col-span-4 px-4 md:px-8" }, loading ? (React.createElement(CheckoutFormLoading, null)) : (React.createElement(CheckoutForm, { locale: locale, setShippingCost: setShippingCost, storeClient: storeClient, fonts: config.fonts, checkoutAppearance: appearance, currency: (_a = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _a !== void 0 ? _a : "", customer: checkout === null || checkout === void 0 ? void 0 : checkout.customer, cancelUrl: cancelUrl, checkoutId: checkoutId, clientSecret: clientSecret, onSuccess: onSuccess, onError: onError, exchangeRate: (_b = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _b !== void 0 ? _b : 1, setCheckout: setCheckout }))),
|
|
35908
|
+
React.createElement("div", { className: "md:col-span-3 px-4 md:px-8 order-first md:order-last" },
|
|
35909
|
+
React.createElement(Toaster, null),
|
|
35910
|
+
loading ? (React.createElement(CheckoutSummaryLoading, null)) : (React.createElement(CheckoutSummary, { currency: (_c = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _c !== void 0 ? _c : "", lineItems: (_d = checkout === null || checkout === void 0 ? void 0 : checkout.lineItems) !== null && _d !== void 0 ? _d : [], shipping: checkout === null || checkout === void 0 ? void 0 : checkout.shipping, tax: checkout === null || checkout === void 0 ? void 0 : checkout.tax, onCancel: onCancel, exchangeRate: (_e = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _e !== void 0 ? _e : 1, applyDiscountCode: applyDiscountCode, appliedDiscounts: (_f = checkout === null || checkout === void 0 ? void 0 : checkout.appliedDiscounts) !== null && _f !== void 0 ? _f : [], revalidateDiscounts: revalidateDiscounts, removeDiscount: removeDiscount })))));
|
|
34624
35911
|
}
|
|
34625
35912
|
var index = React.memo(CheckoutEmbed);
|
|
34626
35913
|
|
|
@@ -34651,7 +35938,7 @@ function styleInject(css, ref) {
|
|
|
34651
35938
|
}
|
|
34652
35939
|
}
|
|
34653
35940
|
|
|
34654
|
-
var css_248z = "/*! tailwindcss v4.1.4 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-red-500: oklch(63.7% 0.237 25.331);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --container-lg: 32rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --tracking-tight: -0.025em;\n --tracking-widest: 0.1em;\n --radius-xs: 0.125rem;\n --animate-spin: spin 1s linear infinite;\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--bs-font-sans), Helvetica, Arial, apple-system, sans-serif;\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b, strong {\n font-weight: bolder;\n }\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::-moz-placeholder {\n opacity: 1;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::-moz-placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n -webkit-appearance: button;\n -moz-appearance: button;\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none !important;\n }\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border-width: 0 !important;\n }\n .absolute {\n position: absolute !important;\n }\n .fixed {\n position: fixed !important;\n }\n .relative {\n position: relative !important;\n }\n .sticky {\n position: sticky !important;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0) !important;\n }\n .-top-2 {\n top: calc(var(--spacing) * -2) !important;\n }\n .top-0 {\n top: calc(var(--spacing) * 0) !important;\n }\n .top-0\\.5 {\n top: calc(var(--spacing) * 0.5) !important;\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%) !important;\n }\n .top-4 {\n top: calc(var(--spacing) * 4) !important;\n }\n .top-\\[50\\%\\] {\n top: 50% !important;\n }\n .-right-2 {\n right: calc(var(--spacing) * -2) !important;\n }\n .right-2 {\n right: calc(var(--spacing) * 2) !important;\n }\n .right-4 {\n right: calc(var(--spacing) * 4) !important;\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%) !important;\n }\n .left-2 {\n left: calc(var(--spacing) * 2) !important;\n }\n .left-\\[50\\%\\] {\n left: 50% !important;\n }\n .z-10 {\n z-index: 10 !important;\n }\n .z-50 {\n z-index: 50 !important;\n }\n .order-3 {\n order: 3 !important;\n }\n .order-4 {\n order: 4 !important;\n }\n .order-5 {\n order: 5 !important;\n }\n .order-first {\n order: -9999 !important;\n }\n .col-span-2 {\n grid-column: span 2 / span 2 !important;\n }\n .-mx-1 {\n margin-inline: calc(var(--spacing) * -1) !important;\n }\n .mx-auto {\n margin-inline: auto !important;\n }\n .my-1 {\n margin-block: calc(var(--spacing) * 1) !important;\n }\n .my-2 {\n margin-block: calc(var(--spacing) * 2) !important;\n }\n .mt-8 {\n margin-top: calc(var(--spacing) * 8) !important;\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2) !important;\n }\n .mb-6 {\n margin-bottom: calc(var(--spacing) * 6) !important;\n }\n .ml-4 {\n margin-left: calc(var(--spacing) * 4) !important;\n }\n .ml-auto {\n margin-left: auto !important;\n }\n .block {\n display: block !important;\n }\n .flex {\n display: flex !important;\n }\n .grid {\n display: grid !important;\n }\n .hidden {\n display: none !important;\n }\n .inline-flex {\n display: inline-flex !important;\n }\n .aspect-square {\n aspect-ratio: 1 / 1 !important;\n }\n .size-2 {\n width: calc(var(--spacing) * 2) !important;\n height: calc(var(--spacing) * 2) !important;\n }\n .size-3\\.5 {\n width: calc(var(--spacing) * 3.5) !important;\n height: calc(var(--spacing) * 3.5) !important;\n }\n .size-4 {\n width: calc(var(--spacing) * 4) !important;\n height: calc(var(--spacing) * 4) !important;\n }\n .size-5 {\n width: calc(var(--spacing) * 5) !important;\n height: calc(var(--spacing) * 5) !important;\n }\n .size-9 {\n width: calc(var(--spacing) * 9) !important;\n height: calc(var(--spacing) * 9) !important;\n }\n .size-16 {\n width: calc(var(--spacing) * 16) !important;\n height: calc(var(--spacing) * 16) !important;\n }\n .h-3 {\n height: calc(var(--spacing) * 3) !important;\n }\n .h-3\\.5 {\n height: calc(var(--spacing) * 3.5) !important;\n }\n .h-4 {\n height: calc(var(--spacing) * 4) !important;\n }\n .h-5 {\n height: calc(var(--spacing) * 5) !important;\n }\n .h-6 {\n height: calc(var(--spacing) * 6) !important;\n }\n .h-8 {\n height: calc(var(--spacing) * 8) !important;\n }\n .h-9 {\n height: calc(var(--spacing) * 9) !important;\n }\n .h-10 {\n height: calc(var(--spacing) * 10) !important;\n }\n .h-16 {\n height: calc(var(--spacing) * 16) !important;\n }\n .h-\\[18px\\] {\n height: 18px !important;\n }\n .h-\\[20px\\] {\n height: 20px !important;\n }\n .h-\\[var\\(--radix-select-trigger-height\\)\\] {\n height: var(--radix-select-trigger-height) !important;\n }\n .h-auto {\n height: auto !important;\n }\n .h-auto\\! {\n height: auto !important;\n }\n .h-full {\n height: 100% !important;\n }\n .h-px {\n height: 1px !important;\n }\n .max-h-\\(--radix-dropdown-menu-content-available-height\\) {\n max-height: var(--radix-dropdown-menu-content-available-height) !important;\n }\n .max-h-96 {\n max-height: calc(var(--spacing) * 96) !important;\n }\n .max-h-\\[200px\\] {\n max-height: 200px !important;\n }\n .max-h-\\[300px\\] {\n max-height: 300px !important;\n }\n .min-h-full {\n min-height: 100% !important;\n }\n .min-h-screen {\n min-height: 100vh !important;\n }\n .w-0 {\n width: calc(var(--spacing) * 0) !important;\n }\n .w-4 {\n width: calc(var(--spacing) * 4) !important;\n }\n .w-5 {\n width: calc(var(--spacing) * 5) !important;\n }\n .w-6 {\n width: calc(var(--spacing) * 6) !important;\n }\n .w-10 {\n width: calc(var(--spacing) * 10) !important;\n }\n .w-12 {\n width: calc(var(--spacing) * 12) !important;\n }\n .w-16 {\n width: calc(var(--spacing) * 16) !important;\n }\n .w-20 {\n width: calc(var(--spacing) * 20) !important;\n }\n .w-24 {\n width: calc(var(--spacing) * 24) !important;\n }\n .w-28 {\n width: calc(var(--spacing) * 28) !important;\n }\n .w-32 {\n width: calc(var(--spacing) * 32) !important;\n }\n .w-40 {\n width: calc(var(--spacing) * 40) !important;\n }\n .w-72 {\n width: calc(var(--spacing) * 72) !important;\n }\n .w-fit {\n width: -moz-fit-content !important;\n width: fit-content !important;\n }\n .w-full {\n width: 100% !important;\n }\n .max-w-\\[1200px\\] {\n max-width: 1200px !important;\n }\n .max-w-\\[calc\\(100\\%-2rem\\)\\] {\n max-width: calc(100% - 2rem) !important;\n }\n .min-w-0 {\n min-width: calc(var(--spacing) * 0) !important;\n }\n .min-w-\\[--radix-popper-anchor-width\\] {\n min-width: --radix-popper-anchor-width !important;\n }\n .min-w-\\[8rem\\] {\n min-width: 8rem !important;\n }\n .min-w-\\[var\\(--radix-select-trigger-width\\)\\] {\n min-width: var(--radix-select-trigger-width) !important;\n }\n .flex-1 {\n flex: 1 !important;\n }\n .shrink-0 {\n flex-shrink: 0 !important;\n }\n .flex-grow {\n flex-grow: 1 !important;\n }\n .origin-\\(--radix-dropdown-menu-content-transform-origin\\) {\n transform-origin: var(--radix-dropdown-menu-content-transform-origin) !important;\n }\n .origin-\\(--radix-popover-content-transform-origin\\) {\n transform-origin: var(--radix-popover-content-transform-origin) !important;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .translate-x-\\[-50\\%\\] {\n --tw-translate-x: -50% !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .translate-y-\\[-50\\%\\] {\n --tw-translate-y: -50% !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .rotate-180 {\n rotate: 180deg !important;\n }\n .transform-none\\! {\n transform: none !important;\n }\n .animate-pulse {\n animation: var(--animate-pulse) !important;\n }\n .animate-spin {\n animation: var(--animate-spin) !important;\n }\n .cursor-default {\n cursor: default !important;\n }\n .cursor-pointer {\n cursor: pointer !important;\n }\n .scroll-my-1 {\n scroll-margin-block: calc(var(--spacing) * 1) !important;\n }\n .scroll-py-1 {\n scroll-padding-block: calc(var(--spacing) * 1) !important;\n }\n .grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n .flex-col {\n flex-direction: column !important;\n }\n .flex-col-reverse {\n flex-direction: column-reverse !important;\n }\n .items-center {\n align-items: center !important;\n }\n .justify-between {\n justify-content: space-between !important;\n }\n .justify-center {\n justify-content: center !important;\n }\n .justify-end {\n justify-content: flex-end !important;\n }\n .gap-1\\.5 {\n gap: calc(var(--spacing) * 1.5) !important;\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2) !important;\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3) !important;\n }\n .gap-4 {\n gap: calc(var(--spacing) * 4) !important;\n }\n .gap-5 {\n gap: calc(var(--spacing) * 5) !important;\n }\n .gap-6 {\n gap: calc(var(--spacing) * 6) !important;\n }\n .gap-\\[10px\\] {\n gap: 10px !important;\n }\n .space-y-2 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-y-4 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-y-6 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-x-2 {\n :where(& > :not(:last-child)) {\n --tw-space-x-reverse: 0 !important;\n margin-inline-start: calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse)) !important;\n margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse))) !important;\n }\n }\n .overflow-hidden {\n overflow: hidden !important;\n }\n .overflow-x-hidden {\n overflow-x: hidden !important;\n }\n .overflow-y-auto {\n overflow-y: auto !important;\n }\n .rounded-\\[4px\\] {\n border-radius: 4px !important;\n }\n .rounded-full {\n border-radius: calc(infinity * 1px) !important;\n }\n .rounded-lg {\n border-radius: var(--bs-radius) !important;\n }\n .rounded-md {\n border-radius: calc(var(--bs-radius) - 2px) !important;\n }\n .rounded-sm {\n border-radius: calc(var(--bs-radius) - 4px) !important;\n }\n .rounded-xs {\n border-radius: var(--radius-xs) !important;\n }\n .border {\n border-style: var(--tw-border-style) !important;\n border-width: 1px !important;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style) !important;\n border-bottom-width: 1px !important;\n }\n .border-input {\n border-color: var(--bs-input) !important;\n }\n .border-primary {\n border-color: var(--bs-primary) !important;\n }\n .bg-accent {\n background-color: var(--bs-accent) !important;\n }\n .bg-background {\n background-color: var(--bs-background) !important;\n }\n .bg-black\\/50 {\n background-color: color-mix(in srgb, #000 50%, transparent) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 50%, transparent) !important;\n }\n }\n .bg-border {\n background-color: var(--bs-border) !important;\n }\n .bg-destructive {\n background-color: var(--bs-destructive) !important;\n }\n .bg-muted {\n background-color: var(--bs-muted) !important;\n }\n .bg-popover {\n background-color: var(--bs-popover) !important;\n }\n .bg-primary {\n background-color: var(--bs-primary) !important;\n }\n .bg-secondary {\n background-color: var(--bs-secondary) !important;\n }\n .bg-transparent {\n background-color: transparent !important;\n }\n .fill-current {\n fill: currentcolor !important;\n }\n .fill-primary {\n fill: var(--bs-primary) !important;\n }\n .object-cover {\n -o-object-fit: cover !important;\n object-fit: cover !important;\n }\n .p-0 {\n padding: calc(var(--spacing) * 0) !important;\n }\n .p-1 {\n padding: calc(var(--spacing) * 1) !important;\n }\n .p-4 {\n padding: calc(var(--spacing) * 4) !important;\n }\n .p-6 {\n padding: calc(var(--spacing) * 6) !important;\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3) !important;\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4) !important;\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6) !important;\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1) !important;\n }\n .py-1\\.5 {\n padding-block: calc(var(--spacing) * 1.5) !important;\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2) !important;\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3) !important;\n }\n .py-4 {\n padding-block: calc(var(--spacing) * 4) !important;\n }\n .py-6 {\n padding-block: calc(var(--spacing) * 6) !important;\n }\n .pt-2 {\n padding-top: calc(var(--spacing) * 2) !important;\n }\n .pt-4 {\n padding-top: calc(var(--spacing) * 4) !important;\n }\n .pt-8 {\n padding-top: calc(var(--spacing) * 8) !important;\n }\n .pr-2 {\n padding-right: calc(var(--spacing) * 2) !important;\n }\n .pr-8 {\n padding-right: calc(var(--spacing) * 8) !important;\n }\n .pb-2 {\n padding-bottom: calc(var(--spacing) * 2) !important;\n }\n .pl-2 {\n padding-left: calc(var(--spacing) * 2) !important;\n }\n .pl-8 {\n padding-left: calc(var(--spacing) * 8) !important;\n }\n .text-center {\n text-align: center !important;\n }\n .text-right {\n text-align: right !important;\n }\n .text-base {\n font-size: var(--text-base) !important;\n line-height: var(--tw-leading, var(--text-base--line-height)) !important;\n }\n .text-lg {\n font-size: var(--text-lg) !important;\n line-height: var(--tw-leading, var(--text-lg--line-height)) !important;\n }\n .text-sm {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n .text-xs {\n font-size: var(--text-xs) !important;\n line-height: var(--tw-leading, var(--text-xs--line-height)) !important;\n }\n .leading-none {\n --tw-leading: 1 !important;\n line-height: 1 !important;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold) !important;\n font-weight: var(--font-weight-bold) !important;\n }\n .font-medium {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold) !important;\n font-weight: var(--font-weight-semibold) !important;\n }\n .tracking-tight {\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n .tracking-widest {\n --tw-tracking: var(--tracking-widest) !important;\n letter-spacing: var(--tracking-widest) !important;\n }\n .text-ellipsis {\n text-overflow: ellipsis !important;\n }\n .whitespace-nowrap {\n white-space: nowrap !important;\n }\n .text-background {\n color: var(--bs-background) !important;\n }\n .text-current {\n color: currentcolor !important;\n }\n .text-destructive {\n color: var(--bs-destructive) !important;\n }\n .text-destructive-foreground {\n color: var(--bs-destructive-foreground) !important;\n }\n .text-foreground {\n color: var(--bs-foreground) !important;\n }\n .text-muted-foreground {\n color: var(--bs-muted-foreground) !important;\n }\n .text-popover-foreground {\n color: var(--bs-popover-foreground) !important;\n }\n .text-primary {\n color: var(--bs-primary) !important;\n }\n .text-primary-foreground {\n color: var(--bs-primary-foreground) !important;\n }\n .text-red-500 {\n color: var(--color-red-500) !important;\n }\n .text-secondary-foreground {\n color: var(--bs-secondary-foreground) !important;\n }\n .text-white {\n color: var(--color-white) !important;\n }\n .underline-offset-4 {\n text-underline-offset: 4px !important;\n }\n .opacity-0 {\n opacity: 0% !important;\n }\n .opacity-50 {\n opacity: 50% !important;\n }\n .opacity-70 {\n opacity: 70% !important;\n }\n .opacity-100 {\n opacity: 100% !important;\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-sm {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-xs {\n --tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .ring {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .ring-offset-background {\n --tw-ring-offset-color: var(--bs-background) !important;\n }\n .outline-hidden {\n --tw-outline-style: none !important;\n outline-style: none !important;\n @media (forced-colors: active) {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n }\n }\n .outline {\n outline-style: var(--tw-outline-style) !important;\n outline-width: 1px !important;\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-\\[color\\,box-shadow\\] {\n transition-property: color,box-shadow !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-opacity {\n transition-property: opacity !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-shadow {\n transition-property: box-shadow !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-transform {\n transition-property: transform, translate, scale, rotate !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-none {\n transition-property: none !important;\n }\n .duration-200 {\n --tw-duration: 200ms !important;\n transition-duration: 200ms !important;\n }\n .outline-none {\n --tw-outline-style: none !important;\n outline-style: none !important;\n }\n .select-none {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n user-select: none !important;\n }\n .duration-200 {\n animation-duration: 200ms !important;\n }\n .group-data-\\[disabled\\=true\\]\\:pointer-events-none {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n pointer-events: none !important;\n }\n }\n .group-data-\\[disabled\\=true\\]\\:opacity-50 {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n opacity: 50% !important;\n }\n }\n .peer-disabled\\:cursor-not-allowed {\n &:is(:where(.peer):disabled ~ *) {\n cursor: not-allowed !important;\n }\n }\n .peer-disabled\\:opacity-50 {\n &:is(:where(.peer):disabled ~ *) {\n opacity: 50% !important;\n }\n }\n .selection\\:bg-primary {\n & *::-moz-selection {\n background-color: var(--bs-primary) !important;\n }\n & *::selection {\n background-color: var(--bs-primary) !important;\n }\n &::-moz-selection {\n background-color: var(--bs-primary) !important;\n }\n &::selection {\n background-color: var(--bs-primary) !important;\n }\n }\n .selection\\:text-primary-foreground {\n & *::-moz-selection {\n color: var(--bs-primary-foreground) !important;\n }\n & *::selection {\n color: var(--bs-primary-foreground) !important;\n }\n &::-moz-selection {\n color: var(--bs-primary-foreground) !important;\n }\n &::selection {\n color: var(--bs-primary-foreground) !important;\n }\n }\n .file\\:inline-flex {\n &::file-selector-button {\n display: inline-flex !important;\n }\n }\n .file\\:h-7 {\n &::file-selector-button {\n height: calc(var(--spacing) * 7) !important;\n }\n }\n .file\\:border-0 {\n &::file-selector-button {\n border-style: var(--tw-border-style) !important;\n border-width: 0px !important;\n }\n }\n .file\\:bg-transparent {\n &::file-selector-button {\n background-color: transparent !important;\n }\n }\n .file\\:text-sm {\n &::file-selector-button {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n }\n .file\\:font-medium {\n &::file-selector-button {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n }\n .file\\:text-foreground {\n &::file-selector-button {\n color: var(--bs-foreground) !important;\n }\n }\n .placeholder\\:text-muted-foreground {\n &::-moz-placeholder {\n color: var(--bs-muted-foreground) !important;\n }\n &::placeholder {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .hover\\:bg-accent {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-accent) !important;\n }\n }\n }\n .hover\\:bg-destructive\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 90%, transparent) !important;\n }\n }\n }\n }\n .hover\\:bg-primary\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-primary) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-primary) 90%, transparent) !important;\n }\n }\n }\n }\n .hover\\:bg-secondary\\/80 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-secondary) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-secondary) 80%, transparent) !important;\n }\n }\n }\n }\n .hover\\:text-accent-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--bs-accent-foreground) !important;\n }\n }\n }\n .hover\\:underline {\n &:hover {\n @media (hover: hover) {\n text-decoration-line: underline !important;\n }\n }\n }\n .hover\\:opacity-100 {\n &:hover {\n @media (hover: hover) {\n opacity: 100% !important;\n }\n }\n }\n .focus\\:bg-accent {\n &:focus {\n background-color: var(--bs-accent) !important;\n }\n }\n .focus\\:text-accent-foreground {\n &:focus {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .focus\\:ring-1 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus\\:ring-ring {\n &:focus {\n --tw-ring-color: var(--bs-ring) !important;\n }\n }\n .focus\\:ring-offset-2 {\n &:focus {\n --tw-ring-offset-width: 2px !important;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;\n }\n }\n .focus\\:outline-hidden {\n &:focus {\n --tw-outline-style: none !important;\n outline-style: none !important;\n @media (forced-colors: active) {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n }\n }\n }\n .focus\\:outline-none {\n &:focus {\n --tw-outline-style: none !important;\n outline-style: none !important;\n }\n }\n .focus-visible\\:border-ring {\n &:focus-visible {\n border-color: var(--bs-ring) !important;\n }\n }\n .focus-visible\\:ring-\\[3px\\] {\n &:focus-visible {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus-visible\\:ring-destructive\\/20 {\n &:focus-visible {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n .focus-visible\\:ring-ring\\/50 {\n &:focus-visible {\n --tw-ring-color: var(--bs-ring) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-ring) 50%, transparent) !important;\n }\n }\n }\n .disabled\\:pointer-events-none {\n &:disabled {\n pointer-events: none !important;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed !important;\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50% !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-2\\.5 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 2.5) !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-3 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 3) !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-4 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 4) !important;\n }\n }\n .aria-invalid\\:border-destructive {\n &[aria-invalid=\"true\"] {\n border-color: var(--bs-destructive) !important;\n }\n }\n .aria-invalid\\:ring-destructive\\/20 {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n .data-\\[disabled\\]\\:pointer-events-none {\n &[data-disabled] {\n pointer-events: none !important;\n }\n }\n .data-\\[disabled\\]\\:opacity-50 {\n &[data-disabled] {\n opacity: 50% !important;\n }\n }\n .data-\\[disabled\\=true\\]\\:pointer-events-none {\n &[data-disabled=\"true\"] {\n pointer-events: none !important;\n }\n }\n .data-\\[disabled\\=true\\]\\:opacity-50 {\n &[data-disabled=\"true\"] {\n opacity: 50% !important;\n }\n }\n .data-\\[error\\=true\\]\\:text-destructive-foreground {\n &[data-error=\"true\"] {\n color: var(--bs-destructive-foreground) !important;\n }\n }\n .data-\\[inset\\]\\:pl-8 {\n &[data-inset] {\n padding-left: calc(var(--spacing) * 8) !important;\n }\n }\n .data-\\[placeholder\\]\\:text-muted-foreground {\n &[data-placeholder] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .data-\\[selected\\=true\\]\\:bg-accent {\n &[data-selected=\"true\"] {\n background-color: var(--bs-accent) !important;\n }\n }\n .data-\\[selected\\=true\\]\\:text-accent-foreground {\n &[data-selected=\"true\"] {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .data-\\[side\\=bottom\\]\\:translate-y-1 {\n &[data-side=\"bottom\"] {\n --tw-translate-y: calc(var(--spacing) * 1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=bottom\\]\\:slide-in-from-top-2 {\n &[data-side=\"bottom\"] {\n --tw-enter-translate-y: -0.5rem !important;\n }\n }\n .data-\\[side\\=left\\]\\:-translate-x-1 {\n &[data-side=\"left\"] {\n --tw-translate-x: calc(var(--spacing) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=left\\]\\:slide-in-from-right-2 {\n &[data-side=\"left\"] {\n --tw-enter-translate-x: 0.5rem !important;\n }\n }\n .data-\\[side\\=right\\]\\:translate-x-1 {\n &[data-side=\"right\"] {\n --tw-translate-x: calc(var(--spacing) * 1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=right\\]\\:slide-in-from-left-2 {\n &[data-side=\"right\"] {\n --tw-enter-translate-x: -0.5rem !important;\n }\n }\n .data-\\[side\\=top\\]\\:-translate-y-1 {\n &[data-side=\"top\"] {\n --tw-translate-y: calc(var(--spacing) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=top\\]\\:slide-in-from-bottom-2 {\n &[data-side=\"top\"] {\n --tw-enter-translate-y: 0.5rem !important;\n }\n }\n .\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 {\n :is(& *) {\n &[data-slot=\"command-input-wrapper\"] {\n height: calc(var(--spacing) * 12) !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1 {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n overflow: hidden !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 1 !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:flex {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n display: flex !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:items-center {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n align-items: center !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:gap-2 {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n gap: calc(var(--spacing) * 2) !important;\n }\n }\n }\n .data-\\[state\\=checked\\]\\:border-primary {\n &[data-state=\"checked\"] {\n border-color: var(--bs-primary) !important;\n }\n }\n .data-\\[state\\=checked\\]\\:bg-primary {\n &[data-state=\"checked\"] {\n background-color: var(--bs-primary) !important;\n }\n }\n .data-\\[state\\=checked\\]\\:text-primary-foreground {\n &[data-state=\"checked\"] {\n color: var(--bs-primary-foreground) !important;\n }\n }\n .data-\\[state\\=closed\\]\\:animate-out {\n &[data-state=\"closed\"] {\n animation-name: exit !important;\n animation-duration: 150ms !important;\n --tw-exit-opacity: initial !important;\n --tw-exit-scale: initial !important;\n --tw-exit-rotate: initial !important;\n --tw-exit-translate-x: initial !important;\n --tw-exit-translate-y: initial !important;\n }\n }\n .data-\\[state\\=closed\\]\\:fade-out-0 {\n &[data-state=\"closed\"] {\n --tw-exit-opacity: 0 !important;\n }\n }\n .data-\\[state\\=closed\\]\\:zoom-out-95 {\n &[data-state=\"closed\"] {\n --tw-exit-scale: .95 !important;\n }\n }\n .data-\\[state\\=open\\]\\:bg-accent {\n &[data-state=\"open\"] {\n background-color: var(--bs-accent) !important;\n }\n }\n .data-\\[state\\=open\\]\\:text-accent-foreground {\n &[data-state=\"open\"] {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .data-\\[state\\=open\\]\\:text-muted-foreground {\n &[data-state=\"open\"] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .data-\\[state\\=open\\]\\:animate-in {\n &[data-state=\"open\"] {\n animation-name: enter !important;\n animation-duration: 150ms !important;\n --tw-enter-opacity: initial !important;\n --tw-enter-scale: initial !important;\n --tw-enter-rotate: initial !important;\n --tw-enter-translate-x: initial !important;\n --tw-enter-translate-y: initial !important;\n }\n }\n .data-\\[state\\=open\\]\\:fade-in-0 {\n &[data-state=\"open\"] {\n --tw-enter-opacity: 0 !important;\n }\n }\n .data-\\[state\\=open\\]\\:zoom-in-95 {\n &[data-state=\"open\"] {\n --tw-enter-scale: .95 !important;\n }\n }\n .data-\\[variant\\=destructive\\]\\:text-destructive {\n &[data-variant=\"destructive\"] {\n color: var(--bs-destructive) !important;\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10 {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 10%, transparent) !important;\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:text-destructive {\n &[data-variant=\"destructive\"] {\n &:focus {\n color: var(--bs-destructive) !important;\n }\n }\n }\n .max-sm\\:hidden {\n @media (width < 40rem) {\n display: none !important;\n }\n }\n .sm\\:max-h-\\[270px\\] {\n @media (width >= 40rem) {\n max-height: 270px !important;\n }\n }\n .sm\\:max-w-\\[500px\\] {\n @media (width >= 40rem) {\n max-width: 500px !important;\n }\n }\n .sm\\:max-w-lg {\n @media (width >= 40rem) {\n max-width: var(--container-lg) !important;\n }\n }\n .sm\\:flex-row {\n @media (width >= 40rem) {\n flex-direction: row !important;\n }\n }\n .sm\\:justify-end {\n @media (width >= 40rem) {\n justify-content: flex-end !important;\n }\n }\n .sm\\:text-left {\n @media (width >= 40rem) {\n text-align: left !important;\n }\n }\n .md\\:order-last {\n @media (width >= 48rem) {\n order: 9999 !important;\n }\n }\n .md\\:order-none {\n @media (width >= 48rem) {\n order: 0 !important;\n }\n }\n .md\\:col-span-2 {\n @media (width >= 48rem) {\n grid-column: span 2 / span 2 !important;\n }\n }\n .md\\:col-span-3 {\n @media (width >= 48rem) {\n grid-column: span 3 / span 3 !important;\n }\n }\n .md\\:col-span-4 {\n @media (width >= 48rem) {\n grid-column: span 4 / span 4 !important;\n }\n }\n .md\\:block {\n @media (width >= 48rem) {\n display: block !important;\n }\n }\n .md\\:flex {\n @media (width >= 48rem) {\n display: flex !important;\n }\n }\n .md\\:grid {\n @media (width >= 48rem) {\n display: grid !important;\n }\n }\n .md\\:hidden {\n @media (width >= 48rem) {\n display: none !important;\n }\n }\n .md\\:grid-cols-2 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n }\n .md\\:grid-cols-7 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(7, minmax(0, 1fr)) !important;\n }\n }\n .md\\:gap-0 {\n @media (width >= 48rem) {\n gap: calc(var(--spacing) * 0) !important;\n }\n }\n .md\\:px-8 {\n @media (width >= 48rem) {\n padding-inline: calc(var(--spacing) * 8) !important;\n }\n }\n .md\\:py-12 {\n @media (width >= 48rem) {\n padding-block: calc(var(--spacing) * 12) !important;\n }\n }\n .md\\:text-sm {\n @media (width >= 48rem) {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n }\n .dark\\:focus-visible\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &:focus-visible {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 40%, transparent) !important;\n }\n }\n }\n }\n .dark\\:aria-invalid\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 40%, transparent) !important;\n }\n }\n }\n }\n .dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20 {\n @media (prefers-color-scheme: dark) {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 {\n & [cmdk-group-heading] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 {\n & [cmdk-group-heading] {\n padding-block: calc(var(--spacing) * 1.5) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs {\n & [cmdk-group-heading] {\n font-size: var(--text-xs) !important;\n line-height: var(--tw-leading, var(--text-xs--line-height)) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium {\n & [cmdk-group-heading] {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground {\n & [cmdk-group-heading] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\]\\:px-2 {\n & [cmdk-group] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 {\n & [cmdk-group]:not([hidden]) ~[cmdk-group] {\n padding-top: calc(var(--spacing) * 0) !important;\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 {\n & [cmdk-input-wrapper] svg {\n height: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 {\n & [cmdk-input-wrapper] svg {\n width: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-input\\]\\]\\:h-12 {\n & [cmdk-input] {\n height: calc(var(--spacing) * 12) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:px-2 {\n & [cmdk-item] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:py-3 {\n & [cmdk-item] {\n padding-block: calc(var(--spacing) * 3) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 {\n & [cmdk-item] svg {\n height: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 {\n & [cmdk-item] svg {\n width: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_svg\\]\\:pointer-events-none {\n & svg {\n pointer-events: none !important;\n }\n }\n .\\[\\&_svg\\]\\:shrink-0 {\n & svg {\n flex-shrink: 0 !important;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 {\n & svg:not([class*='size-']) {\n width: calc(var(--spacing) * 4) !important;\n height: calc(var(--spacing) * 4) !important;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground {\n & svg:not([class*='text-']) {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .\\*\\:\\[span\\]\\:last\\:flex {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n display: flex !important;\n }\n }\n }\n }\n .\\*\\:\\[span\\]\\:last\\:items-center {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n align-items: center !important;\n }\n }\n }\n }\n .\\*\\:\\[span\\]\\:last\\:gap-2 {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n gap: calc(var(--spacing) * 2) !important;\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:\\*\\:\\[svg\\]\\:\\!text-destructive {\n &[data-variant=\"destructive\"] {\n :is(& > *) {\n &:is(svg) {\n color: var(--bs-destructive) !important;\n }\n }\n }\n }\n .\\[\\&\\>span\\]\\:line-clamp-1 {\n &>span {\n overflow: hidden !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 1 !important;\n }\n }\n}\n.checkout-embed {\n :root {\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(0.205 0 0);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --destructive-foreground: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --radius: 0.625rem;\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.145 0 0);\n --sidebar-primary: oklch(0.205 0 0);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.97 0 0);\n --sidebar-accent-foreground: oklch(0.205 0 0);\n --sidebar-border: oklch(0.922 0 0);\n --sidebar-ring: oklch(0.708 0 0);\n }\n @layer base {\n * {\n border-color: var(--bs-border) !important;\n outline-color: var(--bs-ring) !important;\n @supports (color: color-mix(in lab, red, red)) {\n outline-color: color-mix(in oklab, var(--bs-ring) 50%, transparent) !important;\n }\n }\n .checkout-embed {\n background-color: var(--bs-background) !important;\n font-family: var(--bs-font-sans), Helvetica, Arial, apple-system, sans-serif !important;\n color: var(--bs-foreground) !important;\n }\n h2 {\n font-size: var(--text-2xl) !important;\n line-height: var(--tw-leading, var(--text-2xl--line-height)) !important;\n --tw-font-weight: var(--font-weight-bold) !important;\n font-weight: var(--font-weight-bold) !important;\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n p {\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n }\n @layer utilities {\n .scrollbar-hidden {\n scrollbar-width: none;\n }\n .scrollbar-hidden::-webkit-scrollbar {\n display: none;\n }\n }\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-y-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-x-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-leading {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-tracking {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-outline-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-space-y-reverse: 0;\n --tw-space-x-reverse: 0;\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-font-weight: initial;\n --tw-tracking: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-outline-style: solid;\n --tw-duration: initial;\n }\n }\n}\n";
|
|
35941
|
+
var css_248z = "/*! tailwindcss v4.1.7 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-red-500: oklch(63.7% 0.237 25.331);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --container-lg: 32rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --tracking-tight: -0.025em;\n --tracking-widest: 0.1em;\n --radius-xs: 0.125rem;\n --animate-spin: spin 1s linear infinite;\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--bs-font-sans), Helvetica, Arial, apple-system, sans-serif;\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b, strong {\n font-weight: bolder;\n }\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::-moz-placeholder {\n opacity: 1;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::-moz-placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n -webkit-appearance: button;\n -moz-appearance: button;\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none !important;\n }\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border-width: 0 !important;\n }\n .absolute {\n position: absolute !important;\n }\n .fixed {\n position: fixed !important;\n }\n .relative {\n position: relative !important;\n }\n .sticky {\n position: sticky !important;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0) !important;\n }\n .-top-2 {\n top: calc(var(--spacing) * -2) !important;\n }\n .top-0 {\n top: calc(var(--spacing) * 0) !important;\n }\n .top-0\\.5 {\n top: calc(var(--spacing) * 0.5) !important;\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%) !important;\n }\n .top-4 {\n top: calc(var(--spacing) * 4) !important;\n }\n .top-\\[50\\%\\] {\n top: 50% !important;\n }\n .-right-2 {\n right: calc(var(--spacing) * -2) !important;\n }\n .right-2 {\n right: calc(var(--spacing) * 2) !important;\n }\n .right-4 {\n right: calc(var(--spacing) * 4) !important;\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%) !important;\n }\n .left-2 {\n left: calc(var(--spacing) * 2) !important;\n }\n .left-\\[50\\%\\] {\n left: 50% !important;\n }\n .z-10 {\n z-index: 10 !important;\n }\n .z-50 {\n z-index: 50 !important;\n }\n .order-3 {\n order: 3 !important;\n }\n .order-4 {\n order: 4 !important;\n }\n .order-5 {\n order: 5 !important;\n }\n .order-6 {\n order: 6 !important;\n }\n .order-7 {\n order: 7 !important;\n }\n .order-first {\n order: -9999 !important;\n }\n .col-span-2 {\n grid-column: span 2 / span 2 !important;\n }\n .-m-0\\.5 {\n margin: calc(var(--spacing) * -0.5) !important;\n }\n .-mx-1 {\n margin-inline: calc(var(--spacing) * -1) !important;\n }\n .mx-auto {\n margin-inline: auto !important;\n }\n .my-1 {\n margin-block: calc(var(--spacing) * 1) !important;\n }\n .my-2 {\n margin-block: calc(var(--spacing) * 2) !important;\n }\n .mt-2 {\n margin-top: calc(var(--spacing) * 2) !important;\n }\n .mt-8 {\n margin-top: calc(var(--spacing) * 8) !important;\n }\n .-mb-0\\.5 {\n margin-bottom: calc(var(--spacing) * -0.5) !important;\n }\n .mb-1 {\n margin-bottom: calc(var(--spacing) * 1) !important;\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2) !important;\n }\n .ml-4 {\n margin-left: calc(var(--spacing) * 4) !important;\n }\n .ml-auto {\n margin-left: auto !important;\n }\n .block {\n display: block !important;\n }\n .flex {\n display: flex !important;\n }\n .grid {\n display: grid !important;\n }\n .hidden {\n display: none !important;\n }\n .inline-flex {\n display: inline-flex !important;\n }\n .aspect-square {\n aspect-ratio: 1 / 1 !important;\n }\n .size-2 {\n width: calc(var(--spacing) * 2) !important;\n height: calc(var(--spacing) * 2) !important;\n }\n .size-3 {\n width: calc(var(--spacing) * 3) !important;\n height: calc(var(--spacing) * 3) !important;\n }\n .size-3\\.5 {\n width: calc(var(--spacing) * 3.5) !important;\n height: calc(var(--spacing) * 3.5) !important;\n }\n .size-4 {\n width: calc(var(--spacing) * 4) !important;\n height: calc(var(--spacing) * 4) !important;\n }\n .size-5 {\n width: calc(var(--spacing) * 5) !important;\n height: calc(var(--spacing) * 5) !important;\n }\n .size-9 {\n width: calc(var(--spacing) * 9) !important;\n height: calc(var(--spacing) * 9) !important;\n }\n .size-16 {\n width: calc(var(--spacing) * 16) !important;\n height: calc(var(--spacing) * 16) !important;\n }\n .h-3 {\n height: calc(var(--spacing) * 3) !important;\n }\n .h-3\\.5 {\n height: calc(var(--spacing) * 3.5) !important;\n }\n .h-4 {\n height: calc(var(--spacing) * 4) !important;\n }\n .h-5 {\n height: calc(var(--spacing) * 5) !important;\n }\n .h-6 {\n height: calc(var(--spacing) * 6) !important;\n }\n .h-8 {\n height: calc(var(--spacing) * 8) !important;\n }\n .h-9 {\n height: calc(var(--spacing) * 9) !important;\n }\n .h-10 {\n height: calc(var(--spacing) * 10) !important;\n }\n .h-12 {\n height: calc(var(--spacing) * 12) !important;\n }\n .h-16 {\n height: calc(var(--spacing) * 16) !important;\n }\n .h-\\[18px\\] {\n height: 18px !important;\n }\n .h-\\[20px\\] {\n height: 20px !important;\n }\n .h-\\[var\\(--radix-select-trigger-height\\)\\] {\n height: var(--radix-select-trigger-height) !important;\n }\n .h-auto {\n height: auto !important;\n }\n .h-auto\\! {\n height: auto !important;\n }\n .h-full {\n height: 100% !important;\n }\n .h-px {\n height: 1px !important;\n }\n .max-h-\\(--radix-dropdown-menu-content-available-height\\) {\n max-height: var(--radix-dropdown-menu-content-available-height) !important;\n }\n .max-h-96 {\n max-height: calc(var(--spacing) * 96) !important;\n }\n .max-h-\\[200px\\] {\n max-height: 200px !important;\n }\n .max-h-\\[300px\\] {\n max-height: 300px !important;\n }\n .min-h-full {\n min-height: 100% !important;\n }\n .min-h-screen {\n min-height: 100vh !important;\n }\n .w-0 {\n width: calc(var(--spacing) * 0) !important;\n }\n .w-4 {\n width: calc(var(--spacing) * 4) !important;\n }\n .w-5 {\n width: calc(var(--spacing) * 5) !important;\n }\n .w-6 {\n width: calc(var(--spacing) * 6) !important;\n }\n .w-10 {\n width: calc(var(--spacing) * 10) !important;\n }\n .w-12 {\n width: calc(var(--spacing) * 12) !important;\n }\n .w-16 {\n width: calc(var(--spacing) * 16) !important;\n }\n .w-20 {\n width: calc(var(--spacing) * 20) !important;\n }\n .w-24 {\n width: calc(var(--spacing) * 24) !important;\n }\n .w-28 {\n width: calc(var(--spacing) * 28) !important;\n }\n .w-32 {\n width: calc(var(--spacing) * 32) !important;\n }\n .w-40 {\n width: calc(var(--spacing) * 40) !important;\n }\n .w-72 {\n width: calc(var(--spacing) * 72) !important;\n }\n .w-fit {\n width: -moz-fit-content !important;\n width: fit-content !important;\n }\n .w-full {\n width: 100% !important;\n }\n .max-w-\\[1200px\\] {\n max-width: 1200px !important;\n }\n .max-w-\\[calc\\(100\\%-2rem\\)\\] {\n max-width: calc(100% - 2rem) !important;\n }\n .min-w-0 {\n min-width: calc(var(--spacing) * 0) !important;\n }\n .min-w-\\[--radix-popper-anchor-width\\] {\n min-width: --radix-popper-anchor-width !important;\n }\n .min-w-\\[8rem\\] {\n min-width: 8rem !important;\n }\n .min-w-\\[var\\(--radix-select-trigger-width\\)\\] {\n min-width: var(--radix-select-trigger-width) !important;\n }\n .flex-1 {\n flex: 1 !important;\n }\n .shrink-0 {\n flex-shrink: 0 !important;\n }\n .flex-grow {\n flex-grow: 1 !important;\n }\n .origin-\\(--radix-dropdown-menu-content-transform-origin\\) {\n transform-origin: var(--radix-dropdown-menu-content-transform-origin) !important;\n }\n .origin-\\(--radix-popover-content-transform-origin\\) {\n transform-origin: var(--radix-popover-content-transform-origin) !important;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .translate-x-\\[-50\\%\\] {\n --tw-translate-x: -50% !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .translate-y-\\[-50\\%\\] {\n --tw-translate-y: -50% !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .rotate-180 {\n rotate: 180deg !important;\n }\n .transform-none\\! {\n transform: none !important;\n }\n .animate-pulse {\n animation: var(--animate-pulse) !important;\n }\n .animate-spin {\n animation: var(--animate-spin) !important;\n }\n .cursor-default {\n cursor: default !important;\n }\n .cursor-pointer {\n cursor: pointer !important;\n }\n .scroll-my-1 {\n scroll-margin-block: calc(var(--spacing) * 1) !important;\n }\n .scroll-py-1 {\n scroll-padding-block: calc(var(--spacing) * 1) !important;\n }\n .grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n .flex-col {\n flex-direction: column !important;\n }\n .flex-col-reverse {\n flex-direction: column-reverse !important;\n }\n .items-center {\n align-items: center !important;\n }\n .justify-between {\n justify-content: space-between !important;\n }\n .justify-center {\n justify-content: center !important;\n }\n .justify-end {\n justify-content: flex-end !important;\n }\n .gap-0 {\n gap: calc(var(--spacing) * 0) !important;\n }\n .gap-0\\.5 {\n gap: calc(var(--spacing) * 0.5) !important;\n }\n .gap-1\\.5 {\n gap: calc(var(--spacing) * 1.5) !important;\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2) !important;\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3) !important;\n }\n .gap-4 {\n gap: calc(var(--spacing) * 4) !important;\n }\n .gap-5 {\n gap: calc(var(--spacing) * 5) !important;\n }\n .gap-6 {\n gap: calc(var(--spacing) * 6) !important;\n }\n .gap-\\[10px\\] {\n gap: 10px !important;\n }\n .space-y-2 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-y-4 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-y-6 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-x-2 {\n :where(& > :not(:last-child)) {\n --tw-space-x-reverse: 0 !important;\n margin-inline-start: calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse)) !important;\n margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse))) !important;\n }\n }\n .overflow-hidden {\n overflow: hidden !important;\n }\n .overflow-x-hidden {\n overflow-x: hidden !important;\n }\n .overflow-y-auto {\n overflow-y: auto !important;\n }\n .rounded-\\[4px\\] {\n border-radius: 4px !important;\n }\n .rounded-full {\n border-radius: calc(infinity * 1px) !important;\n }\n .rounded-lg {\n border-radius: var(--bs-radius) !important;\n }\n .rounded-md {\n border-radius: calc(var(--bs-radius) - 2px) !important;\n }\n .rounded-sm {\n border-radius: calc(var(--bs-radius) - 4px) !important;\n }\n .rounded-xs {\n border-radius: var(--radius-xs) !important;\n }\n .border {\n border-style: var(--tw-border-style) !important;\n border-width: 1px !important;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style) !important;\n border-bottom-width: 1px !important;\n }\n .border-input {\n border-color: var(--bs-input) !important;\n }\n .border-primary {\n border-color: var(--bs-primary) !important;\n }\n .bg-accent {\n background-color: var(--bs-accent) !important;\n }\n .bg-background {\n background-color: var(--bs-background) !important;\n }\n .bg-black\\/50 {\n background-color: color-mix(in srgb, #000 50%, transparent) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 50%, transparent) !important;\n }\n }\n .bg-border {\n background-color: var(--bs-border) !important;\n }\n .bg-destructive {\n background-color: var(--bs-destructive) !important;\n }\n .bg-muted {\n background-color: var(--bs-muted) !important;\n }\n .bg-popover {\n background-color: var(--bs-popover) !important;\n }\n .bg-primary {\n background-color: var(--bs-primary) !important;\n }\n .bg-secondary {\n background-color: var(--bs-secondary) !important;\n }\n .bg-transparent {\n background-color: transparent !important;\n }\n .fill-current {\n fill: currentcolor !important;\n }\n .fill-primary {\n fill: var(--bs-primary) !important;\n }\n .object-cover {\n -o-object-fit: cover !important;\n object-fit: cover !important;\n }\n .p-0 {\n padding: calc(var(--spacing) * 0) !important;\n }\n .p-1 {\n padding: calc(var(--spacing) * 1) !important;\n }\n .p-4 {\n padding: calc(var(--spacing) * 4) !important;\n }\n .p-6 {\n padding: calc(var(--spacing) * 6) !important;\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3) !important;\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4) !important;\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6) !important;\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1) !important;\n }\n .py-1\\.5 {\n padding-block: calc(var(--spacing) * 1.5) !important;\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2) !important;\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3) !important;\n }\n .py-4 {\n padding-block: calc(var(--spacing) * 4) !important;\n }\n .py-6 {\n padding-block: calc(var(--spacing) * 6) !important;\n }\n .pt-2 {\n padding-top: calc(var(--spacing) * 2) !important;\n }\n .pt-4 {\n padding-top: calc(var(--spacing) * 4) !important;\n }\n .pt-8 {\n padding-top: calc(var(--spacing) * 8) !important;\n }\n .pr-2 {\n padding-right: calc(var(--spacing) * 2) !important;\n }\n .pr-8 {\n padding-right: calc(var(--spacing) * 8) !important;\n }\n .pb-1 {\n padding-bottom: calc(var(--spacing) * 1) !important;\n }\n .pb-2 {\n padding-bottom: calc(var(--spacing) * 2) !important;\n }\n .pl-2 {\n padding-left: calc(var(--spacing) * 2) !important;\n }\n .pl-8 {\n padding-left: calc(var(--spacing) * 8) !important;\n }\n .text-center {\n text-align: center !important;\n }\n .text-right {\n text-align: right !important;\n }\n .text-base {\n font-size: var(--text-base) !important;\n line-height: var(--tw-leading, var(--text-base--line-height)) !important;\n }\n .text-lg {\n font-size: var(--text-lg) !important;\n line-height: var(--tw-leading, var(--text-lg--line-height)) !important;\n }\n .text-sm {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n .text-xs {\n font-size: var(--text-xs) !important;\n line-height: var(--tw-leading, var(--text-xs--line-height)) !important;\n }\n .leading-none {\n --tw-leading: 1 !important;\n line-height: 1 !important;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold) !important;\n font-weight: var(--font-weight-bold) !important;\n }\n .font-medium {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold) !important;\n font-weight: var(--font-weight-semibold) !important;\n }\n .tracking-tight {\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n .tracking-widest {\n --tw-tracking: var(--tracking-widest) !important;\n letter-spacing: var(--tracking-widest) !important;\n }\n .text-ellipsis {\n text-overflow: ellipsis !important;\n }\n .whitespace-nowrap {\n white-space: nowrap !important;\n }\n .text-background {\n color: var(--bs-background) !important;\n }\n .text-current {\n color: currentcolor !important;\n }\n .text-destructive {\n color: var(--bs-destructive) !important;\n }\n .text-destructive-foreground {\n color: var(--bs-destructive-foreground) !important;\n }\n .text-foreground {\n color: var(--bs-foreground) !important;\n }\n .text-muted-foreground {\n color: var(--bs-muted-foreground) !important;\n }\n .text-popover-foreground {\n color: var(--bs-popover-foreground) !important;\n }\n .text-primary {\n color: var(--bs-primary) !important;\n }\n .text-primary-foreground {\n color: var(--bs-primary-foreground) !important;\n }\n .text-red-500 {\n color: var(--color-red-500) !important;\n }\n .text-secondary-foreground {\n color: var(--bs-secondary-foreground) !important;\n }\n .text-white {\n color: var(--color-white) !important;\n }\n .line-through {\n text-decoration-line: line-through !important;\n }\n .underline-offset-4 {\n text-underline-offset: 4px !important;\n }\n .opacity-0 {\n opacity: 0% !important;\n }\n .opacity-50 {\n opacity: 50% !important;\n }\n .opacity-70 {\n opacity: 70% !important;\n }\n .opacity-100 {\n opacity: 100% !important;\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-sm {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-xs {\n --tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .ring {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .ring-offset-background {\n --tw-ring-offset-color: var(--bs-background) !important;\n }\n .outline-hidden {\n --tw-outline-style: none !important;\n outline-style: none !important;\n @media (forced-colors: active) {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n }\n }\n .outline {\n outline-style: var(--tw-outline-style) !important;\n outline-width: 1px !important;\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-\\[color\\,box-shadow\\] {\n transition-property: color,box-shadow !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-opacity {\n transition-property: opacity !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-shadow {\n transition-property: box-shadow !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-transform {\n transition-property: transform, translate, scale, rotate !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-none {\n transition-property: none !important;\n }\n .duration-200 {\n --tw-duration: 200ms !important;\n transition-duration: 200ms !important;\n }\n .outline-none {\n --tw-outline-style: none !important;\n outline-style: none !important;\n }\n .select-none {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n user-select: none !important;\n }\n .duration-200 {\n animation-duration: 200ms !important;\n }\n .not-last\\:-mb-0\\.5 {\n &:not(*:last-child) {\n margin-bottom: calc(var(--spacing) * -0.5) !important;\n }\n }\n .group-data-\\[disabled\\=true\\]\\:pointer-events-none {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n pointer-events: none !important;\n }\n }\n .group-data-\\[disabled\\=true\\]\\:opacity-50 {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n opacity: 50% !important;\n }\n }\n .peer-disabled\\:cursor-not-allowed {\n &:is(:where(.peer):disabled ~ *) {\n cursor: not-allowed !important;\n }\n }\n .peer-disabled\\:opacity-50 {\n &:is(:where(.peer):disabled ~ *) {\n opacity: 50% !important;\n }\n }\n .selection\\:bg-primary {\n & *::-moz-selection {\n background-color: var(--bs-primary) !important;\n }\n & *::selection {\n background-color: var(--bs-primary) !important;\n }\n &::-moz-selection {\n background-color: var(--bs-primary) !important;\n }\n &::selection {\n background-color: var(--bs-primary) !important;\n }\n }\n .selection\\:text-primary-foreground {\n & *::-moz-selection {\n color: var(--bs-primary-foreground) !important;\n }\n & *::selection {\n color: var(--bs-primary-foreground) !important;\n }\n &::-moz-selection {\n color: var(--bs-primary-foreground) !important;\n }\n &::selection {\n color: var(--bs-primary-foreground) !important;\n }\n }\n .file\\:inline-flex {\n &::file-selector-button {\n display: inline-flex !important;\n }\n }\n .file\\:h-7 {\n &::file-selector-button {\n height: calc(var(--spacing) * 7) !important;\n }\n }\n .file\\:border-0 {\n &::file-selector-button {\n border-style: var(--tw-border-style) !important;\n border-width: 0px !important;\n }\n }\n .file\\:bg-transparent {\n &::file-selector-button {\n background-color: transparent !important;\n }\n }\n .file\\:text-sm {\n &::file-selector-button {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n }\n .file\\:font-medium {\n &::file-selector-button {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n }\n .file\\:text-foreground {\n &::file-selector-button {\n color: var(--bs-foreground) !important;\n }\n }\n .placeholder\\:text-muted-foreground {\n &::-moz-placeholder {\n color: var(--bs-muted-foreground) !important;\n }\n &::placeholder {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .hover\\:bg-accent {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-accent) !important;\n }\n }\n }\n .hover\\:bg-destructive\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 90%, transparent) !important;\n }\n }\n }\n }\n .hover\\:bg-muted {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-muted) !important;\n }\n }\n }\n .hover\\:bg-primary\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-primary) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-primary) 90%, transparent) !important;\n }\n }\n }\n }\n .hover\\:bg-secondary\\/80 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-secondary) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-secondary) 80%, transparent) !important;\n }\n }\n }\n }\n .hover\\:text-accent-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--bs-accent-foreground) !important;\n }\n }\n }\n .hover\\:text-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--bs-foreground) !important;\n }\n }\n }\n .hover\\:underline {\n &:hover {\n @media (hover: hover) {\n text-decoration-line: underline !important;\n }\n }\n }\n .hover\\:opacity-100 {\n &:hover {\n @media (hover: hover) {\n opacity: 100% !important;\n }\n }\n }\n .focus\\:bg-accent {\n &:focus {\n background-color: var(--bs-accent) !important;\n }\n }\n .focus\\:text-accent-foreground {\n &:focus {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .focus\\:ring-1 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus\\:ring-ring {\n &:focus {\n --tw-ring-color: var(--bs-ring) !important;\n }\n }\n .focus\\:ring-offset-2 {\n &:focus {\n --tw-ring-offset-width: 2px !important;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;\n }\n }\n .focus\\:outline-hidden {\n &:focus {\n --tw-outline-style: none !important;\n outline-style: none !important;\n @media (forced-colors: active) {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n }\n }\n }\n .focus\\:outline-none {\n &:focus {\n --tw-outline-style: none !important;\n outline-style: none !important;\n }\n }\n .focus-visible\\:border-ring {\n &:focus-visible {\n border-color: var(--bs-ring) !important;\n }\n }\n .focus-visible\\:ring-\\[3px\\] {\n &:focus-visible {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus-visible\\:ring-destructive\\/20 {\n &:focus-visible {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n .focus-visible\\:ring-ring\\/50 {\n &:focus-visible {\n --tw-ring-color: var(--bs-ring) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-ring) 50%, transparent) !important;\n }\n }\n }\n .disabled\\:pointer-events-none {\n &:disabled {\n pointer-events: none !important;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed !important;\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50% !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-2\\.5 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 2.5) !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-3 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 3) !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-4 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 4) !important;\n }\n }\n .aria-invalid\\:border-destructive {\n &[aria-invalid=\"true\"] {\n border-color: var(--bs-destructive) !important;\n }\n }\n .aria-invalid\\:ring-destructive\\/20 {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n .data-\\[disabled\\]\\:pointer-events-none {\n &[data-disabled] {\n pointer-events: none !important;\n }\n }\n .data-\\[disabled\\]\\:opacity-50 {\n &[data-disabled] {\n opacity: 50% !important;\n }\n }\n .data-\\[disabled\\=true\\]\\:pointer-events-none {\n &[data-disabled=\"true\"] {\n pointer-events: none !important;\n }\n }\n .data-\\[disabled\\=true\\]\\:opacity-50 {\n &[data-disabled=\"true\"] {\n opacity: 50% !important;\n }\n }\n .data-\\[error\\=true\\]\\:text-destructive-foreground {\n &[data-error=\"true\"] {\n color: var(--bs-destructive-foreground) !important;\n }\n }\n .data-\\[inset\\]\\:pl-8 {\n &[data-inset] {\n padding-left: calc(var(--spacing) * 8) !important;\n }\n }\n .data-\\[placeholder\\]\\:text-muted-foreground {\n &[data-placeholder] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .data-\\[selected\\=true\\]\\:bg-accent {\n &[data-selected=\"true\"] {\n background-color: var(--bs-accent) !important;\n }\n }\n .data-\\[selected\\=true\\]\\:text-accent-foreground {\n &[data-selected=\"true\"] {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .data-\\[side\\=bottom\\]\\:translate-y-1 {\n &[data-side=\"bottom\"] {\n --tw-translate-y: calc(var(--spacing) * 1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=bottom\\]\\:slide-in-from-top-2 {\n &[data-side=\"bottom\"] {\n --tw-enter-translate-y: -0.5rem !important;\n }\n }\n .data-\\[side\\=left\\]\\:-translate-x-1 {\n &[data-side=\"left\"] {\n --tw-translate-x: calc(var(--spacing) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=left\\]\\:slide-in-from-right-2 {\n &[data-side=\"left\"] {\n --tw-enter-translate-x: 0.5rem !important;\n }\n }\n .data-\\[side\\=right\\]\\:translate-x-1 {\n &[data-side=\"right\"] {\n --tw-translate-x: calc(var(--spacing) * 1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=right\\]\\:slide-in-from-left-2 {\n &[data-side=\"right\"] {\n --tw-enter-translate-x: -0.5rem !important;\n }\n }\n .data-\\[side\\=top\\]\\:-translate-y-1 {\n &[data-side=\"top\"] {\n --tw-translate-y: calc(var(--spacing) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=top\\]\\:slide-in-from-bottom-2 {\n &[data-side=\"top\"] {\n --tw-enter-translate-y: 0.5rem !important;\n }\n }\n .\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 {\n :is(& *) {\n &[data-slot=\"command-input-wrapper\"] {\n height: calc(var(--spacing) * 12) !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1 {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n overflow: hidden !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 1 !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:flex {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n display: flex !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:items-center {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n align-items: center !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:gap-2 {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n gap: calc(var(--spacing) * 2) !important;\n }\n }\n }\n .data-\\[state\\=checked\\]\\:border-primary {\n &[data-state=\"checked\"] {\n border-color: var(--bs-primary) !important;\n }\n }\n .data-\\[state\\=checked\\]\\:bg-primary {\n &[data-state=\"checked\"] {\n background-color: var(--bs-primary) !important;\n }\n }\n .data-\\[state\\=checked\\]\\:text-primary-foreground {\n &[data-state=\"checked\"] {\n color: var(--bs-primary-foreground) !important;\n }\n }\n .data-\\[state\\=closed\\]\\:animate-out {\n &[data-state=\"closed\"] {\n animation-name: exit !important;\n animation-duration: 150ms !important;\n --tw-exit-opacity: initial !important;\n --tw-exit-scale: initial !important;\n --tw-exit-rotate: initial !important;\n --tw-exit-translate-x: initial !important;\n --tw-exit-translate-y: initial !important;\n }\n }\n .data-\\[state\\=closed\\]\\:fade-out-0 {\n &[data-state=\"closed\"] {\n --tw-exit-opacity: 0 !important;\n }\n }\n .data-\\[state\\=closed\\]\\:zoom-out-95 {\n &[data-state=\"closed\"] {\n --tw-exit-scale: .95 !important;\n }\n }\n .data-\\[state\\=open\\]\\:bg-accent {\n &[data-state=\"open\"] {\n background-color: var(--bs-accent) !important;\n }\n }\n .data-\\[state\\=open\\]\\:text-accent-foreground {\n &[data-state=\"open\"] {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .data-\\[state\\=open\\]\\:text-muted-foreground {\n &[data-state=\"open\"] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .data-\\[state\\=open\\]\\:animate-in {\n &[data-state=\"open\"] {\n animation-name: enter !important;\n animation-duration: 150ms !important;\n --tw-enter-opacity: initial !important;\n --tw-enter-scale: initial !important;\n --tw-enter-rotate: initial !important;\n --tw-enter-translate-x: initial !important;\n --tw-enter-translate-y: initial !important;\n }\n }\n .data-\\[state\\=open\\]\\:fade-in-0 {\n &[data-state=\"open\"] {\n --tw-enter-opacity: 0 !important;\n }\n }\n .data-\\[state\\=open\\]\\:zoom-in-95 {\n &[data-state=\"open\"] {\n --tw-enter-scale: .95 !important;\n }\n }\n .data-\\[variant\\=destructive\\]\\:text-destructive {\n &[data-variant=\"destructive\"] {\n color: var(--bs-destructive) !important;\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10 {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 10%, transparent) !important;\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:text-destructive {\n &[data-variant=\"destructive\"] {\n &:focus {\n color: var(--bs-destructive) !important;\n }\n }\n }\n .max-sm\\:hidden {\n @media (width < 40rem) {\n display: none !important;\n }\n }\n .sm\\:max-h-\\[270px\\] {\n @media (width >= 40rem) {\n max-height: 270px !important;\n }\n }\n .sm\\:max-w-\\[500px\\] {\n @media (width >= 40rem) {\n max-width: 500px !important;\n }\n }\n .sm\\:max-w-lg {\n @media (width >= 40rem) {\n max-width: var(--container-lg) !important;\n }\n }\n .sm\\:flex-row {\n @media (width >= 40rem) {\n flex-direction: row !important;\n }\n }\n .sm\\:justify-end {\n @media (width >= 40rem) {\n justify-content: flex-end !important;\n }\n }\n .sm\\:text-left {\n @media (width >= 40rem) {\n text-align: left !important;\n }\n }\n .md\\:order-last {\n @media (width >= 48rem) {\n order: 9999 !important;\n }\n }\n .md\\:order-none {\n @media (width >= 48rem) {\n order: 0 !important;\n }\n }\n .md\\:col-span-2 {\n @media (width >= 48rem) {\n grid-column: span 2 / span 2 !important;\n }\n }\n .md\\:col-span-3 {\n @media (width >= 48rem) {\n grid-column: span 3 / span 3 !important;\n }\n }\n .md\\:col-span-4 {\n @media (width >= 48rem) {\n grid-column: span 4 / span 4 !important;\n }\n }\n .md\\:block {\n @media (width >= 48rem) {\n display: block !important;\n }\n }\n .md\\:flex {\n @media (width >= 48rem) {\n display: flex !important;\n }\n }\n .md\\:grid {\n @media (width >= 48rem) {\n display: grid !important;\n }\n }\n .md\\:hidden {\n @media (width >= 48rem) {\n display: none !important;\n }\n }\n .md\\:grid-cols-2 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n }\n .md\\:grid-cols-7 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(7, minmax(0, 1fr)) !important;\n }\n }\n .md\\:gap-0 {\n @media (width >= 48rem) {\n gap: calc(var(--spacing) * 0) !important;\n }\n }\n .md\\:px-8 {\n @media (width >= 48rem) {\n padding-inline: calc(var(--spacing) * 8) !important;\n }\n }\n .md\\:py-12 {\n @media (width >= 48rem) {\n padding-block: calc(var(--spacing) * 12) !important;\n }\n }\n .md\\:text-sm {\n @media (width >= 48rem) {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n }\n .dark\\:focus-visible\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &:focus-visible {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 40%, transparent) !important;\n }\n }\n }\n }\n .dark\\:aria-invalid\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 40%, transparent) !important;\n }\n }\n }\n }\n .dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20 {\n @media (prefers-color-scheme: dark) {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 {\n & [cmdk-group-heading] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 {\n & [cmdk-group-heading] {\n padding-block: calc(var(--spacing) * 1.5) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs {\n & [cmdk-group-heading] {\n font-size: var(--text-xs) !important;\n line-height: var(--tw-leading, var(--text-xs--line-height)) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium {\n & [cmdk-group-heading] {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground {\n & [cmdk-group-heading] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\]\\:px-2 {\n & [cmdk-group] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 {\n & [cmdk-group]:not([hidden]) ~[cmdk-group] {\n padding-top: calc(var(--spacing) * 0) !important;\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 {\n & [cmdk-input-wrapper] svg {\n height: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 {\n & [cmdk-input-wrapper] svg {\n width: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-input\\]\\]\\:h-12 {\n & [cmdk-input] {\n height: calc(var(--spacing) * 12) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:px-2 {\n & [cmdk-item] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:py-3 {\n & [cmdk-item] {\n padding-block: calc(var(--spacing) * 3) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 {\n & [cmdk-item] svg {\n height: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 {\n & [cmdk-item] svg {\n width: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_svg\\]\\:pointer-events-none {\n & svg {\n pointer-events: none !important;\n }\n }\n .\\[\\&_svg\\]\\:shrink-0 {\n & svg {\n flex-shrink: 0 !important;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 {\n & svg:not([class*='size-']) {\n width: calc(var(--spacing) * 4) !important;\n height: calc(var(--spacing) * 4) !important;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground {\n & svg:not([class*='text-']) {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .\\*\\:\\[span\\]\\:last\\:flex {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n display: flex !important;\n }\n }\n }\n }\n .\\*\\:\\[span\\]\\:last\\:items-center {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n align-items: center !important;\n }\n }\n }\n }\n .\\*\\:\\[span\\]\\:last\\:gap-2 {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n gap: calc(var(--spacing) * 2) !important;\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:\\*\\:\\[svg\\]\\:\\!text-destructive {\n &[data-variant=\"destructive\"] {\n :is(& > *) {\n &:is(svg) {\n color: var(--bs-destructive) !important;\n }\n }\n }\n }\n .\\[\\&\\>span\\]\\:line-clamp-1 {\n &>span {\n overflow: hidden !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 1 !important;\n }\n }\n}\n.checkout-embed {\n :root {\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(0.205 0 0);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --destructive-foreground: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --radius: 0.625rem;\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.145 0 0);\n --sidebar-primary: oklch(0.205 0 0);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.97 0 0);\n --sidebar-accent-foreground: oklch(0.205 0 0);\n --sidebar-border: oklch(0.922 0 0);\n --sidebar-ring: oklch(0.708 0 0);\n }\n @layer base {\n * {\n border-color: var(--bs-border) !important;\n outline-color: var(--bs-ring) !important;\n @supports (color: color-mix(in lab, red, red)) {\n outline-color: color-mix(in oklab, var(--bs-ring) 50%, transparent) !important;\n }\n }\n .checkout-embed {\n background-color: var(--bs-background) !important;\n font-family: var(--bs-font-sans), Helvetica, Arial, apple-system, sans-serif !important;\n color: var(--bs-foreground) !important;\n }\n h2 {\n font-size: var(--text-2xl) !important;\n line-height: var(--tw-leading, var(--text-2xl--line-height)) !important;\n --tw-font-weight: var(--font-weight-bold) !important;\n font-weight: var(--font-weight-bold) !important;\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n p {\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n }\n @layer utilities {\n .scrollbar-hidden {\n scrollbar-width: none;\n }\n .scrollbar-hidden::-webkit-scrollbar {\n display: none;\n }\n }\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-y-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-x-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-leading {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-tracking {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-outline-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-space-y-reverse: 0;\n --tw-space-x-reverse: 0;\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-font-weight: initial;\n --tw-tracking: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-outline-style: solid;\n --tw-duration: initial;\n }\n }\n}\n";
|
|
34655
35942
|
styleInject(css_248z);
|
|
34656
35943
|
|
|
34657
35944
|
exports.CheckoutEmbed = index;
|