@omnikit-js/ui 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -13
- package/dist/client.esm.js +28 -0
- package/dist/client.esm.js.map +1 -0
- package/dist/client.js +28 -0
- package/dist/client.js.map +1 -0
- package/dist/index.esm.js +28 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +553 -0
- package/package.json +10 -8
- package/styles.css +196 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";var e=require("react"),t=require("next/navigation"),n=require("react/jsx-runtime"),r=require("react-dom");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var a,i=o(e),s=o(r),l="basil",c="https://js.stripe.com",u="".concat(c,"/").concat(l,"/stripe.js"),d=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,f=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,m=function(e){return d.test(e)||f.test(e)},p=function(e){var t=document.createElement("script");t.src="".concat(u).concat("");var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(t),t},h=null,g=null,v=null,y=function(e){return null!==h?h:(h=new Promise(function(t,n){if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe)t(window.Stripe);else try{var r=function(){for(var e=document.querySelectorAll('script[src^="'.concat(c,'"]')),t=0;t<e.length;t++){var n=e[t];if(m(n.src))return n}return null}();if(r&&e);else if(r){if(r&&null!==v&&null!==g){var o;r.removeEventListener("load",v),r.removeEventListener("error",g),null===(o=r.parentNode)||void 0===o||o.removeChild(r),r=p()}}else r=p();v=function(e,t){return function(){window.Stripe?e(window.Stripe):t(new Error("Stripe.js not available"))}}(t,n),g=function(e){return function(t){e(new Error("Failed to load Stripe.js",{cause:t}))}}(n),r.addEventListener("load",v),r.addEventListener("error",g)}catch(e){return void n(e)}else t(null)})).catch(function(e){return h=null,Promise.reject(e)})},b=!1,w=function(){return a||(a=y(null).catch(function(e){return a=null,Promise.reject(e)}))};Promise.resolve().then(function(){return w()}).catch(function(e){b||console.warn(e)});function x(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E={exports:{}};function R(){}function k(){}k.resetWarningCache=R;E.exports=function(){function e(e,t,n,r,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:k,resetWarningCache:R};return n.PropTypes=n,n}();var N=x(E.exports);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach(function(t){j(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return T(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var A=function(t,n,r){var o=!!r,a=e.useRef(r);e.useEffect(function(){a.current=r},[r]),e.useEffect(function(){if(!o||!t)return function(){};var e=function(){a.current&&a.current.apply(a,arguments)};return t.on(n,e),function(){t.off(n,e)}},[o,n,t,a])},L=function(t){var n=e.useRef(t);return e.useEffect(function(){n.current=t},[t]),n.current},M=function(e){return null!==e&&"object"===_(e)},D="[object Object]",I=function e(t,n){if(!M(t)||!M(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o=Object.prototype.toString.call(t)===D;if(o!==(Object.prototype.toString.call(n)===D))return!1;if(!o&&!r)return t===n;var a=Object.keys(t),i=Object.keys(n);if(a.length!==i.length)return!1;for(var s={},l=0;l<a.length;l+=1)s[a[l]]=!0;for(var c=0;c<i.length;c+=1)s[i[c]]=!0;var u=Object.keys(s);if(u.length!==a.length)return!1;var d=t,f=n;return u.every(function(t){return e(d[t],f[t])})},F=function(e,t,n){return M(e)?Object.keys(e).reduce(function(r,o){var a=!M(t)||!I(e[o],t[o]);return n.includes(o)?(a&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),r):a?S(S({},r||{}),{},j({},o,e[o])):r},null):null},z="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",$=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;if(null===e||M(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;throw new Error(n)},B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;if(function(e){return M(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return $(e,t)})};var n=$(e,t);return null===n?{tag:"empty"}:{tag:"sync",stripe:n}},H=e.createContext(null);H.displayName="ElementsContext";var W=function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},U=function(t){var n=t.stripe,r=t.options,o=t.children,a=e.useMemo(function(){return B(n)},[n]),i=O(e.useState(function(){return{stripe:"sync"===a.tag?a.stripe:null,elements:"sync"===a.tag?a.stripe.elements(r):null}}),2),s=i[0],l=i[1];e.useEffect(function(){var e=!0,t=function(e){l(function(t){return t.stripe?t:{stripe:e,elements:e.elements(r)}})};return"async"!==a.tag||s.stripe?"sync"!==a.tag||s.stripe||t(a.stripe):a.stripePromise.then(function(n){n&&e&&t(n)}),function(){e=!1}},[a,s,r]);var c=L(n);e.useEffect(function(){null!==c&&c!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[c,n]);var u=L(r);return e.useEffect(function(){if(s.elements){var e=F(r,u,["clientSecret","fonts"]);e&&s.elements.update(e)}},[r,u,s.elements]),e.useEffect(function(){var e;(e=s.stripe)&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"3.7.0"}),e.registerAppInfo({name:"react-stripe-js",version:"3.7.0",url:"https://stripe.com/docs/stripe-js/react"}))},[s.stripe]),e.createElement(H.Provider,{value:s},o)};U.propTypes={stripe:N.any,options:N.object};var V=function(){var t,n;return(t="calls useElements()",n=e.useContext(H),W(n,t)).elements};N.func.isRequired;var q=e.createContext(null);q.displayName="CheckoutSdkContext";e.createContext(null).displayName="CheckoutContext",N.any,N.shape({fetchClientSecret:N.func.isRequired,elementsOptions:N.object}).isRequired;var Y=function(t){var n=e.useContext(q),r=e.useContext(H);if(n&&r)throw new Error("You cannot wrap the part of your app that ".concat(t," in both <CheckoutProvider> and <Elements> providers."));return n?function(e,t){if(!e)throw new Error("Could not find CheckoutProvider context; You need to wrap the part of your app that ".concat(t," in an <CheckoutProvider> provider."));return e}(n,t):W(r,t)},G=["mode"],K=function(t,n){var r,o="".concat((r=t).charAt(0).toUpperCase()+r.slice(1),"Element"),a=n?function(t){Y("mounts <".concat(o,">"));var n=t.id,r=t.className;return e.createElement("div",{id:n,className:r})}:function(n){var r,a=n.id,i=n.className,s=n.options,l=void 0===s?{}:s,c=n.onBlur,u=n.onFocus,d=n.onReady,f=n.onChange,m=n.onEscape,p=n.onClick,h=n.onLoadError,g=n.onLoaderStart,v=n.onNetworksChange,y=n.onConfirm,b=n.onCancel,w=n.onShippingAddressChange,x=n.onShippingRateChange,E=Y("mounts <".concat(o,">")),R="elements"in E?E.elements:null,k="checkoutSdk"in E?E.checkoutSdk:null,N=O(e.useState(null),2),C=N[0],S=N[1],_=e.useRef(null),j=e.useRef(null);A(C,"blur",c),A(C,"focus",u),A(C,"escape",m),A(C,"click",p),A(C,"loaderror",h),A(C,"loaderstart",g),A(C,"networkschange",v),A(C,"confirm",y),A(C,"cancel",b),A(C,"shippingaddresschange",w),A(C,"shippingratechange",x),A(C,"change",f),d&&(r="expressCheckout"===t?d:function(){d(C)}),A(C,"ready",r),e.useLayoutEffect(function(){if(null===_.current&&null!==j.current&&(R||k)){var e=null;if(k)switch(t){case"payment":e=k.createPaymentElement(l);break;case"address":if(!("mode"in l))throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");var n=l.mode,r=P(l,G);if("shipping"===n)e=k.createShippingAddressElement(r);else{if("billing"!==n)throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");e=k.createBillingAddressElement(r)}break;case"expressCheckout":e=k.createExpressCheckoutElement(l);break;case"currencySelector":e=k.createCurrencySelectorElement();break;default:throw new Error("Invalid Element type ".concat(o,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else R&&(e=R.create(t,l));_.current=e,S(e),e&&e.mount(j.current)}},[R,k,l]);var T=L(l);return e.useEffect(function(){if(_.current){var e=F(l,T,["paymentRequest"]);e&&"update"in _.current&&_.current.update(e)}},[l,T]),e.useLayoutEffect(function(){return function(){if(_.current&&"function"==typeof _.current.destroy)try{_.current.destroy(),_.current=null}catch(e){}}},[]),e.createElement("div",{id:a,className:i,ref:j})};return a.propTypes={id:N.string,className:N.string,onChange:N.func,onBlur:N.func,onFocus:N.func,onReady:N.func,onEscape:N.func,onClick:N.func,onLoadError:N.func,onLoaderStart:N.func,onNetworksChange:N.func,onConfirm:N.func,onCancel:N.func,onShippingAddressChange:N.func,onShippingRateChange:N.func,options:N.object},a.displayName=o,a.__elementType=t,a},X="undefined"==typeof window;e.createContext(null).displayName="EmbeddedCheckoutProviderContext";K("auBankAccount",X);var Z=K("card",X);function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(null,arguments)}function Q(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ee(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Q(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Q(e[t],null)}}}}function te(...e){return i.useCallback(ee(...e),e)}function ne(e){const t=oe(e),r=i.forwardRef((e,r)=>{const{children:o,...a}=e,s=i.Children.toArray(o),l=s.find(ie);if(l){const e=l.props.children,o=s.map(t=>t===l?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t);return n.jsx(t,{...a,ref:r,children:i.isValidElement(e)?i.cloneElement(e,void 0,o):null})}return n.jsx(t,{...a,ref:r,children:o})});return r.displayName=`${e}.Slot`,r}K("cardNumber",X),K("cardExpiry",X),K("cardCvc",X),K("fpxBank",X),K("iban",X),K("idealBank",X),K("p24Bank",X),K("epsBank",X),K("payment",X),K("expressCheckout",X),K("currencySelector",X),K("paymentRequestButton",X),K("linkAuthentication",X),K("address",X),K("shippingAddress",X),K("paymentMethodMessaging",X),K("affirmMessage",X),K("afterpayClearpayMessage",X);var re=ne("Slot");function oe(e){const t=i.forwardRef((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?ee(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ae=Symbol("radix.slottable");function ie(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ae}function se(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=se(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function le(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=se(e))&&(r&&(r+=" "),r+=t);return r}const ce=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ue=le,de=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return ue(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const i=ce(t)||ce(r);return o[e][i]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return ue(e,i,l,null==n?void 0:n.class,null==n?void 0:n.className)},fe=e=>{const t=ge(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),me(n,t)||he(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},me=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?me(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},pe=/^\[(.+)\]$/,he=e=>{if(pe.test(e)){const t=pe.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ge=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const e in n)ve(n[e],r,e,t);return r},ve=(e,t,n,r)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:ye(t,e)).classGroupId=n)}if("function"==typeof e)return be(e)?void ve(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,o])=>{ve(o,ye(t,e),n,r)})})},ye=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},be=e=>e.isThemeGetter,we=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},xe=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,o=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===r&&0===o){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){n=i;continue}}"["===s?r++:"]"===s?r--:"("===s?o++:")"===s&&o--}const i=0===t.length?e:e.substring(a),s=Ee(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:n&&n>a?n-a:void 0}};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Ee=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,Re=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const n=[];let r=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...r.sort(),e),r=[]):r.push(e)}),n.push(...r.sort()),n}},ke=/\s+/;function Ne(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Ce(e))&&(r&&(r+=" "),r+=t);return r}const Ce=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ce(e[r]))&&(n&&(n+=" "),n+=t);return n};function Se(e,...t){let n,r,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:we(e.cacheSize),parseClassName:xe(e),sortModifiers:Re(e),...fe(e)}))(l),r=n.cache.get,o=n.cache.set,a=i,i(s)};function i(e){const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],s=e.trim().split(ke);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=n(t);if(c){l=t+(l.length>0?" "+l:l);continue}let p=!!m,h=r(p?f.substring(0,m):f);if(!h){if(!p){l=t+(l.length>0?" "+l:l);continue}if(h=r(f),!h){l=t+(l.length>0?" "+l:l);continue}p=!1}const g=a(u).join(":"),v=d?g+"!":g,y=v+h;if(i.includes(y))continue;i.push(y);const b=o(h,p);for(let e=0;e<b.length;++e){const t=b[e];i.push(v+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return o(e,a),a}return function(){return a(Ne.apply(null,arguments))}}const _e=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},je=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Oe=/^\d+\/\d+$/,Te=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ae=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Le=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Me=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,De=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ie=e=>Oe.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),ze=e=>!!e&&Number.isInteger(Number(e)),$e=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),Be=e=>Te.test(e),He=()=>!0,We=e=>Ae.test(e)&&!Le.test(e),Ue=()=>!1,Ve=e=>Me.test(e),qe=e=>De.test(e),Ye=e=>!Ke(e)&&!tt(e),Ge=e=>lt(e,ft,Ue),Ke=e=>je.test(e),Xe=e=>lt(e,mt,We),Ze=e=>lt(e,pt,Fe),Je=e=>lt(e,ut,Ue),Qe=e=>lt(e,dt,qe),et=e=>lt(e,gt,Ve),tt=e=>Pe.test(e),nt=e=>ct(e,mt),rt=e=>ct(e,ht),ot=e=>ct(e,ut),at=e=>ct(e,ft),it=e=>ct(e,dt),st=e=>ct(e,gt,!0),lt=(e,t,n)=>{const r=je.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ct=(e,t,n=!1)=>{const r=Pe.exec(e);return!!r&&(r[1]?t(r[1]):n)},ut=e=>"position"===e||"percentage"===e,dt=e=>"image"===e||"url"===e,ft=e=>"length"===e||"size"===e||"bg-size"===e,mt=e=>"length"===e,pt=e=>"number"===e,ht=e=>"family-name"===e,gt=e=>"shadow"===e,vt=Se(()=>{const e=_e("color"),t=_e("font"),n=_e("text"),r=_e("font-weight"),o=_e("tracking"),a=_e("leading"),i=_e("breakpoint"),s=_e("container"),l=_e("spacing"),c=_e("radius"),u=_e("shadow"),d=_e("inset-shadow"),f=_e("text-shadow"),m=_e("drop-shadow"),p=_e("blur"),h=_e("perspective"),g=_e("aspect"),v=_e("ease"),y=_e("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",tt,Ke],w=()=>[tt,Ke,l],x=()=>[Ie,"full","auto",...w()],E=()=>[ze,"none","subgrid",tt,Ke],R=()=>["auto",{span:["full",ze,tt,Ke]},ze,tt,Ke],k=()=>[ze,"auto",tt,Ke],N=()=>["auto","min","max","fr",tt,Ke],C=()=>["auto",...w()],S=()=>[Ie,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],_=()=>[e,tt,Ke],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ot,Je,{position:[tt,Ke]}],P=()=>["auto","cover","contain",at,Ge,{size:[tt,Ke]}],O=()=>[$e,nt,Xe],T=()=>["","none","full",c,tt,Ke],A=()=>["",Fe,nt,Xe],L=()=>[Fe,$e,ot,Je],M=()=>["","none",p,tt,Ke],D=()=>["none",Fe,tt,Ke],I=()=>["none",Fe,tt,Ke],F=()=>[Fe,tt,Ke],z=()=>[Ie,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Be],breakpoint:[Be],color:[He],container:[Be],"drop-shadow":[Be],ease:["in","out","in-out"],font:[Ye],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Be],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Be],shadow:[Be],spacing:["px",Fe],text:[Be],"text-shadow":[Be],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ie,Ke,tt,g]}],container:["container"],columns:[{columns:[Fe,Ke,tt,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[ze,"auto",tt,Ke]}],basis:[{basis:[Ie,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,Ie,"auto","initial","none",Ke]}],grow:[{grow:["",Fe,tt,Ke]}],shrink:[{shrink:["",Fe,tt,Ke]}],order:[{order:[ze,"first","last","none",tt,Ke]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[s,"screen",...S()]}],"min-w":[{"min-w":[s,"screen","none",...S()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",n,nt,Xe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tt,Ze]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$e,Ke]}],"font-family":[{font:[rt,Ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,tt,Ke]}],"line-clamp":[{"line-clamp":[Fe,"none",tt,Ze]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",tt,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tt,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",tt,Xe]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Fe,"auto",tt,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tt,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tt,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ze,tt,Ke],radial:["",tt,Ke],conic:[ze,tt,Ke]},it,Qe]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":A()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,tt,Ke]}],"outline-w":[{outline:["",Fe,nt,Xe]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",u,st,et]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",d,st,et]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Fe,Xe]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",f,st,et]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Fe,tt,Ke]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[tt,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tt,Ke]}],filter:[{filter:["","none",tt,Ke]}],blur:[{blur:M()}],brightness:[{brightness:[Fe,tt,Ke]}],contrast:[{contrast:[Fe,tt,Ke]}],"drop-shadow":[{"drop-shadow":["","none",m,st,et]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Fe,tt,Ke]}],"hue-rotate":[{"hue-rotate":[Fe,tt,Ke]}],invert:[{invert:["",Fe,tt,Ke]}],saturate:[{saturate:[Fe,tt,Ke]}],sepia:[{sepia:["",Fe,tt,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",tt,Ke]}],"backdrop-blur":[{"backdrop-blur":M()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,tt,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,tt,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,tt,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,tt,Ke]}],"backdrop-invert":[{"backdrop-invert":["",Fe,tt,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,tt,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,tt,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,tt,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tt,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",tt,Ke]}],ease:[{ease:["linear","initial",v,tt,Ke]}],delay:[{delay:[Fe,tt,Ke]}],animate:[{animate:["none",y,tt,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,tt,Ke]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:D()}],"rotate-x":[{"rotate-x":D()}],"rotate-y":[{"rotate-y":D()}],"rotate-z":[{"rotate-z":D()}],scale:[{scale:I()}],"scale-x":[{"scale-x":I()}],"scale-y":[{"scale-y":I()}],"scale-z":[{"scale-z":I()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[tt,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:z()}],"translate-x":[{"translate-x":z()}],"translate-y":[{"translate-y":z()}],"translate-z":[{"translate-z":z()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tt,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tt,Ke]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Fe,nt,Xe,Ze]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function yt(...e){return vt(le(e))}const bt=de("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none 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",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function wt({className:e,variant:t,size:n,asChild:r=!1,...o}){const a=r?re:"button";return i.createElement(a,J({"data-slot":"button",className:yt(bt({variant:t,size:n,className:e}))},o))}function xt({className:e,...t}){return i.createElement("div",J({"data-slot":"card",className:yt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e)},t))}function Et({className:e,...t}){return i.createElement("div",J({"data-slot":"card-header",className:yt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e)},t))}function Rt({className:e,...t}){return i.createElement("div",J({"data-slot":"card-title",className:yt("leading-none font-semibold",e)},t))}function kt({className:e,...t}){return i.createElement("div",J({"data-slot":"card-description",className:yt("text-muted-foreground text-sm",e)},t))}function Nt({className:e,...t}){return i.createElement("div",J({"data-slot":"card-content",className:yt("px-6",e)},t))}function Ct({className:e,...t}){return i.createElement("div",J({"data-slot":"card-footer",className:yt("flex items-center px-6 [.border-t]:pt-6",e)},t))}const St=de("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none 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 transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function _t({className:e,variant:t,asChild:n=!1,...r}){const o=n?re:"span";return i.createElement(o,J({"data-slot":"badge",className:yt(St({variant:t}),e)},r))}function jt(e,t=[]){let r=[];const o=()=>{const t=r.map(e=>i.createContext(e));return function(n){const r=n?.[e]||t;return i.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return o.scopeName=e,[function(t,o){const a=i.createContext(o),s=r.length;r=[...r,o];const l=t=>{const{scope:r,children:o,...l}=t,c=r?.[e]?.[s]||a,u=i.useMemo(()=>l,Object.values(l));return n.jsx(c.Provider,{value:u,children:o})};return l.displayName=t+"Provider",[l,function(n,r){const l=r?.[e]?.[s]||a,c=i.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Pt(o,...t)]}function Pt(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Ot=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const r=ne(`Primitive.${t}`),o=i.forwardRef((e,o)=>{const{asChild:a,...i}=e,s=a?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),n.jsx(s,{...i,ref:o})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});var Tt="Progress",At=100,[Lt,Mt]=jt(Tt),[Dt,It]=Lt(Tt),Ft=i.forwardRef((e,t)=>{const{__scopeProgress:r,value:o=null,max:a,getValueLabel:i=Bt,...s}=e;!a&&0!==a||Ut(a)||console.error(`Invalid prop \`max\` of value \`${`${a}`}\` supplied to \`${"Progress"}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`);const l=Ut(a)?a:At;null===o||Vt(o,l)||console.error(function(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:\n - a positive number\n - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)\n - \`null\` or \`undefined\` if the progress is indeterminate.\n\nDefaulting to \`null\`.`}(`${o}`,"Progress"));const c=Vt(o,l)?o:null,u=Wt(c)?i(c,l):void 0;return n.jsx(Dt,{scope:r,value:c,max:l,children:n.jsx(Ot.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Wt(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":Ht(c,l),"data-value":c??void 0,"data-max":l,...s,ref:t})})});Ft.displayName=Tt;var zt="ProgressIndicator",$t=i.forwardRef((e,t)=>{const{__scopeProgress:r,...o}=e,a=It(zt,r);return n.jsx(Ot.div,{"data-state":Ht(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...o,ref:t})});function Bt(e,t){return`${Math.round(e/t*100)}%`}function Ht(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function Wt(e){return"number"==typeof e}function Ut(e){return Wt(e)&&!isNaN(e)&&e>0}function Vt(e,t){return Wt(e)&&!isNaN(e)&&e<=t&&e>=0}$t.displayName=zt;var qt=Ft,Yt=$t;function Gt({className:e,value:t,...n}){return i.createElement(qt,J({"data-slot":"progress",className:yt("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e)},n),i.createElement(Yt,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}}))}function Kt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var Xt=globalThis?.document?i.useLayoutEffect:()=>{},Zt=i[" useId ".trim().toString()]||(()=>{}),Jt=0;function Qt(e){const[t,n]=i.useState(Zt());return Xt(()=>{n(e=>e??String(Jt++))},[e]),t?`radix-${t}`:""}function en(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...e)=>t.current?.(...e),[])}var tn=i[" useInsertionEffect ".trim().toString()]||Xt;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,s]=function({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return tn(()=>{a.current=t},[t]),i.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:o;{const t=i.useRef(void 0!==e);i.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,r])}const u=i.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[l,e,a,s]);return[c,u]}var rn=i.createContext(void 0);function on(e){const t=i.useContext(rn);return e||t||"ltr"}var an="rovingFocusGroup.onEntryFocus",sn={bubbles:!1,cancelable:!0},ln="RovingFocusGroup",[cn,un,dn]=function(t){const r=t+"CollectionProvider",[o,a]=jt(r),[i,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:r,children:o}=t,a=e.useRef(null),s=e.useRef(new Map).current;return n.jsx(i,{scope:r,itemMap:s,collectionRef:a,children:o})};l.displayName=r;const c=t+"CollectionSlot",u=ne(c),d=e.forwardRef((e,t)=>{const{scope:r,children:o}=e,a=te(t,s(c,r).collectionRef);return n.jsx(u,{ref:a,children:o})});d.displayName=c;const f=t+"CollectionItemSlot",m="data-radix-collection-item",p=ne(f),h=e.forwardRef((t,r)=>{const{scope:o,children:a,...i}=t,l=e.useRef(null),c=te(r,l),u=s(f,o);return e.useEffect(()=>(u.itemMap.set(l,{ref:l,...i}),()=>{u.itemMap.delete(l)})),n.jsx(p,{[m]:"",ref:c,children:a})});return h.displayName=f,[{Provider:l,Slot:d,ItemSlot:h},function(n){const r=s(t+"CollectionConsumer",n);return e.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},a]}(ln),[fn,mn]=jt(ln,[dn]),[pn,hn]=fn(ln),gn=i.forwardRef((e,t)=>n.jsx(cn.Provider,{scope:e.__scopeRovingFocusGroup,children:n.jsx(cn.Slot,{scope:e.__scopeRovingFocusGroup,children:n.jsx(vn,{...e,ref:t})})}));gn.displayName=ln;var vn=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:a=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...m}=e,p=i.useRef(null),h=te(t,p),g=on(s),[v,y]=nn({prop:l,defaultProp:c??null,onChange:u,caller:ln}),[b,w]=i.useState(!1),x=en(d),E=un(r),R=i.useRef(!1),[k,N]=i.useState(0);return i.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(an,x),()=>e.removeEventListener(an,x)},[x]),n.jsx(pn,{scope:r,orientation:o,dir:g,loop:a,currentTabStopId:v,onItemFocus:i.useCallback(e=>y(e),[y]),onItemShiftTab:i.useCallback(()=>w(!0),[]),onFocusableItemAdd:i.useCallback(()=>N(e=>e+1),[]),onFocusableItemRemove:i.useCallback(()=>N(e=>e-1),[]),children:n.jsx(Ot.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:Kt(e.onMouseDown,()=>{R.current=!0}),onFocus:Kt(e.onFocus,e=>{const t=!R.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(an,sn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=E().filter(e=>e.focusable);xn([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),f)}}R.current=!1}),onBlur:Kt(e.onBlur,()=>w(!1))})})}),yn="RovingFocusGroupItem",bn=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:a=!1,tabStopId:s,children:l,...c}=e,u=Qt(),d=s||u,f=hn(yn,r),m=f.currentTabStopId===d,p=un(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=f;return i.useEffect(()=>{if(o)return h(),()=>g()},[o,h,g]),n.jsx(cn.ItemSlot,{scope:r,id:d,focusable:o,active:a,children:n.jsx(Ot.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:Kt(e.onMouseDown,e=>{o?f.onItemFocus(d):e.preventDefault()}),onFocus:Kt(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:Kt(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:wn[r]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const a=o.indexOf(e.currentTarget);o=f.loop?(r=a+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(a+1)}setTimeout(()=>xn(o))}var n,r}),children:"function"==typeof l?l({isCurrentTabStop:m,hasTabStop:null!=v}):l})})});bn.displayName=yn;var wn={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xn(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var En=gn,Rn=bn;var kn=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const e=Nn(r.current);a.current="mounted"===l?e:"none"},[l]),Xt(()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,i=Nn(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,c]),Xt(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=a=>{const i=Nn(r.current).includes(a.animationName);if(a.target===t&&i&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=Nn(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),o="function"==typeof n?n({present:r.isPresent}):i.Children.only(n),a=te(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?i.cloneElement(o,{ref:a}):null};function Nn(e){return e?.animationName||"none"}kn.displayName="Presence";var Cn="Tabs",[Sn,_n]=jt(Cn,[mn]),jn=mn(),[Pn,On]=Sn(Cn),Tn=i.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=on(l),[f,m]=nn({prop:o,onChange:a,defaultProp:i??"",caller:Cn});return n.jsx(Pn,{scope:r,baseId:Qt(),value:f,onValueChange:m,orientation:s,dir:d,activationMode:c,children:n.jsx(Ot.div,{dir:d,"data-orientation":s,...u,ref:t})})});Tn.displayName=Cn;var An="TabsList",Ln=i.forwardRef((e,t)=>{const{__scopeTabs:r,loop:o=!0,...a}=e,i=On(An,r),s=jn(r);return n.jsx(En,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:o,children:n.jsx(Ot.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});Ln.displayName=An;var Mn="TabsTrigger",Dn=i.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,disabled:a=!1,...i}=e,s=On(Mn,r),l=jn(r),c=zn(s.baseId,o),u=$n(s.baseId,o),d=o===s.value;return n.jsx(Rn,{asChild:!0,...l,focusable:!a,active:d,children:n.jsx(Ot.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:Kt(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(o)}),onKeyDown:Kt(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(o)}),onFocus:Kt(e.onFocus,()=>{const e="manual"!==s.activationMode;d||a||!e||s.onValueChange(o)})})})});Dn.displayName=Mn;var In="TabsContent",Fn=i.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,forceMount:a,children:s,...l}=e,c=On(In,r),u=zn(c.baseId,o),d=$n(c.baseId,o),f=o===c.value,m=i.useRef(f);return i.useEffect(()=>{const e=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(e)},[]),n.jsx(kn,{present:a||f,children:({present:r})=>n.jsx(Ot.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:r&&s})})});function zn(e,t){return`${e}-trigger-${t}`}function $n(e,t){return`${e}-content-${t}`}Fn.displayName=In;var Bn=Tn,Hn=Ln,Wn=Dn,Un=Fn;function Vn({className:e,...t}){return i.createElement(Bn,J({"data-slot":"tabs",className:yt("flex flex-col gap-2",e)},t))}function qn({className:e,...t}){return i.createElement(Hn,J({"data-slot":"tabs-list",className:yt("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e)},t))}function Yn({className:e,...t}){return i.createElement(Wn,J({"data-slot":"tabs-trigger",className:yt("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e)},t))}function Gn({className:e,...t}){return i.createElement(Un,J({"data-slot":"tabs-content",className:yt("flex-1 outline-none",e)},t))}var Kn,Xn="dismissableLayer.update",Zn="dismissableLayer.pointerDownOutside",Jn="dismissableLayer.focusOutside",Qn=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),er=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(Qn),[f,m]=i.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=i.useState({}),g=te(t,e=>m(e)),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),w=f?v.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,E=w>=b,R=function(e,t=globalThis?.document){const n=en(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){nr(Zn,n,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));E&&!n&&(a?.(e),l?.(e),e.defaultPrevented||c?.())},p),k=function(e,t=globalThis?.document){const n=en(e),r=i.useRef(!1);return i.useEffect(()=>{const e=e=>{if(e.target&&!r.current){nr(Jn,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},p);return function(e,t=globalThis?.document){const n=en(e);i.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},p),i.useEffect(()=>{if(f)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Kn=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),tr(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Kn)}},[f,p,r,d]),i.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),tr())},[f,d]),i.useEffect(()=>{const e=()=>h({});return document.addEventListener(Xn,e),()=>document.removeEventListener(Xn,e)},[]),n.jsx(Ot.div,{...u,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:Kt(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Kt(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Kt(e.onPointerDownCapture,R.onPointerDownCapture)})});er.displayName="DismissableLayer";function tr(){const e=new CustomEvent(Xn);document.dispatchEvent(e)}function nr(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}i.forwardRef((e,t)=>{const r=i.useContext(Qn),o=i.useRef(null),a=te(t,o);return i.useEffect(()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),n.jsx(Ot.div,{...e,ref:a})}).displayName="DismissableLayerBranch";var rr="focusScope.autoFocusOnMount",or="focusScope.autoFocusOnUnmount",ar={bubbles:!1,cancelable:!0},ir=i.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=e,[c,u]=i.useState(null),d=en(a),f=en(s),m=i.useRef(null),p=te(t,e=>u(e)),h=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(o){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?m.current=t:ur(m.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||ur(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ur(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[o,c,h.paused]),i.useEffect(()=>{if(c){dr.add(h);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(rr,ar);c.addEventListener(rr,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ur(r,{select:t}),document.activeElement!==n)return}((e=sr(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ur(c))}return()=>{c.removeEventListener(rr,d),setTimeout(()=>{const e=new CustomEvent(or,ar);c.addEventListener(or,f),c.dispatchEvent(e),e.defaultPrevented||ur(t??document.body,{select:!0}),c.removeEventListener(or,f),dr.remove(h)},0)}}var e},[c,d,f,h]);const g=i.useCallback(e=>{if(!r&&!o)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=sr(e),n=lr(t,e),r=lr(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&ur(a,{select:!0})):(e.preventDefault(),r&&ur(o,{select:!0})):n===t&&e.preventDefault()}},[r,o,h.paused]);return n.jsx(Ot.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})});function sr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function lr(e,t){for(const n of e)if(!cr(n,{upTo:t}))return n}function cr(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ur(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}ir.displayName="FocusScope";var dr=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=fr(e,t),e.unshift(t)},remove(t){e=fr(e,t),e[0]?.resume()}}}();function fr(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var mr=i.forwardRef((e,t)=>{const{container:o,...a}=e,[s,l]=i.useState(!1);Xt(()=>l(!0),[]);const c=o||s&&globalThis?.document?.body;return c?r.createPortal(n.jsx(Ot.div,{...a,ref:t}),c):null});mr.displayName="Portal";var pr=0;function hr(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gr=function(){return gr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},gr.apply(this,arguments)};function vr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var yr="right-scroll-bar-position",br="width-before-scroll-bar";function wr(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var xr="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,Er=new WeakMap;function Rr(t,n){var r,o,a,i=(r=null,o=function(e){return t.forEach(function(t){return wr(t,e)})},(a=e.useState(function(){return{value:r,callback:o,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=o,a.facade);return xr(function(){var e=Er.get(i);if(e){var n=new Set(e),r=new Set(t),o=i.current;n.forEach(function(e){r.has(e)||wr(e,null)}),r.forEach(function(e){n.has(e)||wr(e,o)})}Er.set(i,t)},[t]),i}function kr(e){return e}var Nr=function(e){var t=e.sideCar,n=vr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,gr({},n))};Nr.isSideCarExport=!0;var Cr=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=kr);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=gr({async:!0,ssr:!1},e),t}(),Sr=function(){},_r=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:Sr,onWheelCapture:Sr,onTouchMoveCapture:Sr}),o=r[0],a=r[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,v=e.allowPinchZoom,y=e.as,b=void 0===y?"div":y,w=e.gapMode,x=vr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,R=Rr([n,t]),k=gr(gr({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(E,{sideCar:Cr,removeScrollBar:u,shards:f,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:w}),s?i.cloneElement(i.Children.only(l),gr(gr({},k),{ref:R})):i.createElement(b,gr({},k,{className:c,ref:R}),l))});_r.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_r.classNames={fullWidth:br,zeroRight:yr};function jr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Pr=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=jr())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Or=function(){var e,t=(e=Pr(),function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},Tr={left:0,top:0,right:0,gap:0},Ar=function(e){return parseInt(e||"",10)||0},Lr=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Tr;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Ar(n),Ar(r),Ar(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Mr=Or(),Dr="data-scroll-locked",Ir=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(Dr,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(yr," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(br," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(yr," .").concat(yr," {\n right: 0 ").concat(r,";\n }\n \n .").concat(br," .").concat(br," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Dr,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Fr=function(){var e=parseInt(document.body.getAttribute(Dr)||"0",10);return isFinite(e)?e:0},zr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;i.useEffect(function(){return document.body.setAttribute(Dr,(Fr()+1).toString()),function(){var e=Fr()-1;e<=0?document.body.removeAttribute(Dr):document.body.setAttribute(Dr,e.toString())}},[]);var a=i.useMemo(function(){return Lr(o)},[o]);return i.createElement(Mr,{styles:Ir(a,!t,o,n?"":"!important")})},$r=!1;if("undefined"!=typeof window)try{var Br=Object.defineProperty({},"passive",{get:function(){return $r=!0,!0}});window.addEventListener("test",Br,Br),window.removeEventListener("test",Br,Br)}catch(e){$r=!1}var Hr=!!$r&&{passive:!1},Wr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Ur=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Vr(e,r)){var o=qr(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vr=function(e,t){return"v"===e?function(e){return Wr(e,"overflowY")}(t):function(e){return Wr(e,"overflowX")}(t)},qr=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Yr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gr=function(e){return[e.deltaX,e.deltaY]},Kr=function(e){return e&&"current"in e?e.current:e},Xr=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Zr=0,Jr=[];function Qr(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var eo,to=(eo=function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(Zr++)[0],a=i.useState(Or)[0],s=i.useRef(e);i.useEffect(function(){s.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Kr),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,a=Yr(e),i=n.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Ur(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Ur(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var m=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,s=t.contains(i),l=!1,c=a>0,u=0,d=0;do{if(!i)break;var f=qr(e,i),m=f[0],p=f[1]-f[2]-o*m;(m||p)&&Vr(e,i)&&(u+=p,d+=m);var h=i.parentNode;i=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(m,t,e,"h"===m?l:c)},[]),c=i.useCallback(function(e){var n=e;if(Jr.length&&Jr[Jr.length-1]===a){var r="deltaY"in n?Gr(n):Yr(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(s.current.shards||[]).map(Kr).filter(Boolean).filter(function(e){return e.contains(n.target)});(i.length>0?l(n,i[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=i.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:Qr(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=i.useCallback(function(e){n.current=Yr(e),r.current=void 0},[]),f=i.useCallback(function(t){u(t.type,Gr(t),t.target,l(t,e.lockRef.current))},[]),m=i.useCallback(function(t){u(t.type,Yr(t),t.target,l(t,e.lockRef.current))},[]);i.useEffect(function(){return Jr.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Hr),document.addEventListener("touchmove",c,Hr),document.addEventListener("touchstart",d,Hr),function(){Jr=Jr.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,Hr),document.removeEventListener("touchmove",c,Hr),document.removeEventListener("touchstart",d,Hr)}},[]);var p=e.removeScrollBar,h=e.inert;return i.createElement(i.Fragment,null,h?i.createElement(a,{styles:Xr(o)}):null,p?i.createElement(zr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Cr.useMedium(eo),Nr),no=i.forwardRef(function(e,t){return i.createElement(_r,gr({},e,{ref:t,sideCar:to}))});no.classNames=_r.classNames;var ro=new WeakMap,oo=new WeakMap,ao={},io=0,so=function(e){return e&&(e.host||so(e.parentNode))},lo=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=so(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);ao[n]||(ao[n]=new WeakMap);var a=ao[n],i=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(ro.get(e)||0)+1,c=(a.get(e)||0)+1;ro.set(e,l),a.set(e,c),i.push(e),1===l&&o&&oo.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),io++,function(){i.forEach(function(e){var t=ro.get(e)-1,o=a.get(e)-1;ro.set(e,t),a.set(e,o),t||(oo.has(e)||e.removeAttribute(r),oo.delete(e)),o||e.removeAttribute(n)}),--io||(ro=new WeakMap,ro=new WeakMap,oo=new WeakMap,ao={})}},co=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),lo(r,o,n,"aria-hidden")):function(){return null}},uo="Dialog",[fo,mo]=jt(uo),[po,ho]=fo(uo),go=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:s,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[d,f]=nn({prop:o,defaultProp:a??!1,onChange:s,caller:uo});return n.jsx(po,{scope:t,triggerRef:c,contentRef:u,contentId:Qt(),titleId:Qt(),descriptionId:Qt(),open:d,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(e=>!e),[f]),modal:l,children:r})};go.displayName=uo;var vo="DialogTrigger";i.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=ho(vo,r),i=te(t,a.triggerRef);return n.jsx(Ot.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Io(a.open),...o,ref:i,onClick:Kt(e.onClick,a.onOpenToggle)})}).displayName=vo;var yo="DialogPortal",[bo,wo]=fo(yo,{forceMount:void 0}),xo=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:a}=e,s=ho(yo,t);return n.jsx(bo,{scope:t,forceMount:r,children:i.Children.map(o,e=>n.jsx(kn,{present:r||s.open,children:n.jsx(mr,{asChild:!0,container:a,children:e})}))})};xo.displayName=yo;var Eo="DialogOverlay",Ro=i.forwardRef((e,t)=>{const r=wo(Eo,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,i=ho(Eo,e.__scopeDialog);return i.modal?n.jsx(kn,{present:o||i.open,children:n.jsx(No,{...a,ref:t})}):null});Ro.displayName=Eo;var ko=ne("DialogOverlay.RemoveScroll"),No=i.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=ho(Eo,r);return n.jsx(no,{as:ko,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(Ot.div,{"data-state":Io(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Co="DialogContent",So=i.forwardRef((e,t)=>{const r=wo(Co,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,i=ho(Co,e.__scopeDialog);return n.jsx(kn,{present:o||i.open,children:i.modal?n.jsx(_o,{...a,ref:t}):n.jsx(jo,{...a,ref:t})})});So.displayName=Co;var _o=i.forwardRef((e,t)=>{const r=ho(Co,e.__scopeDialog),o=i.useRef(null),a=te(t,r.contentRef,o);return i.useEffect(()=>{const e=o.current;if(e)return co(e)},[]),n.jsx(Po,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Kt(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Kt(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Kt(e.onFocusOutside,e=>e.preventDefault())})}),jo=i.forwardRef((e,t)=>{const r=ho(Co,e.__scopeDialog),o=i.useRef(!1),a=i.useRef(!1);return n.jsx(Po,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),Po=i.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:s,...l}=e,c=ho(Co,r),u=i.useRef(null),d=te(t,u);return i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hr()),document.body.insertAdjacentElement("beforeend",e[1]??hr()),pr++,()=>{1===pr&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),pr--}},[]),n.jsxs(n.Fragment,{children:[n.jsx(ir,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:s,children:n.jsx(er,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Io(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(Bo,{titleId:c.titleId}),n.jsx(Ho,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Oo="DialogTitle",To=i.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=ho(Oo,r);return n.jsx(Ot.h2,{id:a.titleId,...o,ref:t})});To.displayName=Oo;var Ao="DialogDescription",Lo=i.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=ho(Ao,r);return n.jsx(Ot.p,{id:a.descriptionId,...o,ref:t})});Lo.displayName=Ao;var Mo="DialogClose",Do=i.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=ho(Mo,r);return n.jsx(Ot.button,{type:"button",...o,ref:t,onClick:Kt(e.onClick,()=>a.onOpenChange(!1))})});function Io(e){return e?"open":"closed"}Do.displayName=Mo;var Fo="DialogTitleWarning",[zo,$o]=function(e,t){const r=i.createContext(t),o=e=>{const{children:t,...o}=e,a=i.useMemo(()=>o,Object.values(o));return n.jsx(r.Provider,{value:a,children:t})};return o.displayName=e+"Provider",[o,function(n){const o=i.useContext(r);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(Fo,{contentName:Co,titleName:Oo,docsSlug:"dialog"}),Bo=({titleId:e})=>{const t=$o(Fo),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},Ho=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$o("DialogDescriptionWarning").contentName}}.`;return i.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},Wo=go,Uo=xo,Vo=Ro,qo=So,Yo=To,Go=Lo,Ko=Do;
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.525.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
const Xo=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Zo=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Jo=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v0.525.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
var Qo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
|
|
16
|
+
/**
|
|
17
|
+
* @license lucide-react v0.525.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const ea=e.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:i,iconNode:s,...l},c)=>e.createElement("svg",{ref:c,...Qo,width:n,height:n,stroke:t,strokeWidth:o?24*Number(r)/Number(n):r,className:Zo("lucide",a),...!i&&!Jo(l)&&{"aria-hidden":"true"},...l},[...s.map(([t,n])=>e.createElement(t,n)),...Array.isArray(i)?i:[i]])),ta=(t,n)=>{const r=e.forwardRef(({className:r,...o},a)=>{return e.createElement(ea,{ref:a,iconNode:n,className:Zo(`lucide-${i=Xo(t),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,r),...o});var i});return r.displayName=Xo(t),r},na=ta("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),ra=ta("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),oa=ta("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),aa=ta("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),ia=ta("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),sa=ta("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),la=ta("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),ca=ta("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ua=ta("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),da=ta("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),fa=Wo,ma=Uo,pa=i.forwardRef(({className:e,...t},n)=>i.createElement(Vo,J({ref:n,className:yt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e)},t)));
|
|
22
|
+
/**
|
|
23
|
+
* @license lucide-react v0.525.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/pa.displayName=Vo.displayName;const ha=i.forwardRef(({className:e,children:t,...n},r)=>i.createElement(ma,null,i.createElement(pa,null),i.createElement(qo,J({ref:r,className:yt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",e)},n),t,i.createElement(Ko,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},i.createElement(da,{className:"h-4 w-4"}),i.createElement("span",{className:"sr-only"},"Close")))));ha.displayName=qo.displayName;const ga=({className:e,...t})=>i.createElement("div",J({className:yt("flex flex-col space-y-1.5 text-center sm:text-left",e)},t));ga.displayName="DialogHeader";const va=({className:e,...t})=>i.createElement("div",J({className:yt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e)},t));va.displayName="DialogFooter";const ya=i.forwardRef(({className:e,...t},n)=>i.createElement(Yo,J({ref:n,className:yt("text-lg font-semibold leading-none tracking-tight",e)},t)));ya.displayName=Yo.displayName;const ba=i.forwardRef(({className:e,...t},n)=>i.createElement(Go,J({ref:n,className:yt("text-sm text-muted-foreground",e)},t)));ba.displayName=Go.displayName;const wa=["top","right","bottom","left"],xa=Math.min,Ea=Math.max,Ra=Math.round,ka=Math.floor,Na=e=>({x:e,y:e}),Ca={left:"right",right:"left",bottom:"top",top:"bottom"},Sa={start:"end",end:"start"};function _a(e,t,n){return Ea(e,xa(t,n))}function ja(e,t){return"function"==typeof e?e(t):e}function Pa(e){return e.split("-")[0]}function Oa(e){return e.split("-")[1]}function Ta(e){return"x"===e?"y":"x"}function Aa(e){return"y"===e?"height":"width"}const La=new Set(["top","bottom"]);function Ma(e){return La.has(Pa(e))?"y":"x"}function Da(e){return Ta(Ma(e))}function Ia(e){return e.replace(/start|end/g,e=>Sa[e])}const Fa=["left","right"],za=["right","left"],$a=["top","bottom"],Ba=["bottom","top"];function Ha(e,t,n,r){const o=Oa(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?za:Fa:t?Fa:za;case"left":case"right":return t?$a:Ba;default:return[]}}(Pa(e),"start"===n,r);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(Ia)))),a}function Wa(e){return e.replace(/left|right|bottom|top/g,e=>Ca[e])}function Ua(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Va(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function qa(e,t,n){let{reference:r,floating:o}=e;const a=Ma(t),i=Da(t),s=Aa(i),l=Pa(t),c="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let m;switch(l){case"top":m={x:u,y:r.y-o.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Oa(t)){case"start":m[i]-=f*(n&&c?-1:1);break;case"end":m[i]+=f*(n&&c?-1:1)}return m}async function Ya(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=ja(t,e),p=Ua(m),h=s[f?"floating"===d?"reference":"floating":d],g=Va(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(h)))||n?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(y))&&await(null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},w=Va(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-w.top+p.top)/b.y,bottom:(w.bottom-g.bottom+p.bottom)/b.y,left:(g.left-w.left+p.left)/b.x,right:(w.right-g.right+p.right)/b.x}}function Ga(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ka(e){return wa.some(t=>e[t]>=0)}const Xa=new Set(["left","top"]);function Za(){return"undefined"!=typeof window}function Ja(e){return ti(e)?(e.nodeName||"").toLowerCase():"#document"}function Qa(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ei(e){var t;return null==(t=(ti(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ti(e){return!!Za()&&(e instanceof Node||e instanceof Qa(e).Node)}function ni(e){return!!Za()&&(e instanceof Element||e instanceof Qa(e).Element)}function ri(e){return!!Za()&&(e instanceof HTMLElement||e instanceof Qa(e).HTMLElement)}function oi(e){return!(!Za()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Qa(e).ShadowRoot)}const ai=new Set(["inline","contents"]);function ii(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=yi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ai.has(o)}const si=new Set(["table","td","th"]);function li(e){return si.has(Ja(e))}const ci=[":popover-open",":modal"];function ui(e){return ci.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const di=["transform","translate","scale","rotate","perspective"],fi=["transform","translate","scale","rotate","perspective","filter"],mi=["paint","layout","strict","content"];function pi(e){const t=hi(),n=ni(e)?yi(e):e;return di.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||fi.some(e=>(n.willChange||"").includes(e))||mi.some(e=>(n.contain||"").includes(e))}function hi(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const gi=new Set(["html","body","#document"]);function vi(e){return gi.has(Ja(e))}function yi(e){return Qa(e).getComputedStyle(e)}function bi(e){return ni(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wi(e){if("html"===Ja(e))return e;const t=e.assignedSlot||e.parentNode||oi(e)&&e.host||ei(e);return oi(t)?t.host:t}function xi(e){const t=wi(e);return vi(t)?e.ownerDocument?e.ownerDocument.body:e.body:ri(t)&&ii(t)?t:xi(t)}function Ei(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=xi(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=Qa(o);if(a){const e=Ri(i);return t.concat(i,i.visualViewport||[],ii(o)?o:[],e&&n?Ei(e):[])}return t.concat(o,Ei(o,[],n))}function Ri(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ki(e){const t=yi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ri(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=Ra(n)!==a||Ra(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function Ni(e){return ni(e)?e:e.contextElement}function Ci(e){const t=Ni(e);if(!ri(t))return Na(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=ki(t);let i=(a?Ra(n.width):n.width)/r,s=(a?Ra(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Si=Na(0);function _i(e){const t=Qa(e);return hi()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Si}function ji(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=Ni(e);let i=Na(1);t&&(r?ni(r)&&(i=Ci(r)):i=Ci(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Qa(e))&&t}(a,n,r)?_i(a):Na(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=Qa(a),t=r&&ni(r)?Qa(r):r;let n=e,o=Ri(n);for(;o&&r&&t!==n;){const e=Ci(o),t=o.getBoundingClientRect(),r=yi(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=Qa(o),o=Ri(n)}}return Va({width:u,height:d,x:l,y:c})}function Pi(e,t){const n=bi(e).scrollLeft;return t?t.left+n:ji(ei(e)).left+n}function Oi(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Pi(e,r)),y:r.top+t.scrollTop}}const Ti=new Set(["absolute","fixed"]);function Ai(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Qa(e),r=ei(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=hi();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=ei(e),n=bi(e),r=e.ownerDocument.body,o=Ea(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ea(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Pi(e);const s=-n.scrollTop;return"rtl"===yi(r).direction&&(i+=Ea(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(ei(e));else if(ni(t))r=function(e,t){const n=ji(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=ri(e)?Ci(e):Na(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=_i(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Va(r)}function Li(e,t){const n=wi(e);return!(n===t||!ni(n)||vi(n))&&("fixed"===yi(n).position||Li(n,t))}function Mi(e,t,n){const r=ri(t),o=ei(t),a="fixed"===n,i=ji(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Na(0);function c(){l.x=Pi(o)}if(r||!r&&!a)if(("body"!==Ja(t)||ii(o))&&(s=bi(t)),r){const e=ji(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!r&&o&&c();const u=!o||r||a?Na(0):Oi(o,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Di(e){return"static"===yi(e).position}function Ii(e,t){if(!ri(e)||"fixed"===yi(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ei(e)===n&&(n=n.ownerDocument.body),n}function Fi(e,t){const n=Qa(e);if(ui(e))return n;if(!ri(e)){let t=wi(e);for(;t&&!vi(t);){if(ni(t)&&!Di(t))return t;t=wi(t)}return n}let r=Ii(e,t);for(;r&&li(r)&&Di(r);)r=Ii(r,t);return r&&vi(r)&&Di(r)&&!pi(r)?n:r||function(e){let t=wi(e);for(;ri(t)&&!vi(t);){if(pi(t))return t;if(ui(t))return null;t=wi(t)}return null}(e)||n}const zi={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=ei(r),s=!!t&&ui(t.floating);if(r===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Na(1);const u=Na(0),d=ri(r);if((d||!d&&!a)&&(("body"!==Ja(r)||ii(i))&&(l=bi(r)),ri(r))){const e=ji(r);c=Ci(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||a?Na(0):Oi(i,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:ei,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?ui(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ei(e,[],!1).filter(e=>ni(e)&&"body"!==Ja(e)),o=null;const a="fixed"===yi(e).position;let i=a?wi(e):e;for(;ni(i)&&!vi(i);){const t=yi(i),n=pi(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&Ti.has(o.position)||ii(i)&&!n&&Li(e,i))?r=r.filter(e=>e!==i):o=t,i=wi(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=a[0],s=a.reduce((e,n)=>{const r=Ai(t,n,o);return e.top=Ea(r.top,e.top),e.right=xa(r.right,e.right),e.bottom=xa(r.bottom,e.bottom),e.left=Ea(r.left,e.left),e},Ai(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Fi,getElementRects:async function(e){const t=this.getOffsetParent||Fi,n=this.getDimensions,r=await n(e.floating);return{reference:Mi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ki(e);return{width:t,height:n}},getScale:Ci,isElement:ni,isRTL:function(e){return"rtl"===yi(e).direction}};function $i(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bi(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Ni(e),u=o||a?[...c?Ei(c):[],...Ei(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=ei(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=c;if(s||t(),!f||!m)return;const p={rootMargin:-ka(d)+"px "+-ka(o.clientWidth-(u+f))+"px "+-ka(o.clientHeight-(d+m))+"px "+-ka(u)+"px",threshold:Ea(0,xa(1,l))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||$i(c,e.getBoundingClientRect())||i(),h=!1}try{r=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),a}(c,n):null;let f,m=-1,p=null;i&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let h=l?ji(e):null;return l&&function t(){const r=ji(e);h&&!$i(h,r)&&n();h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Hi=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=Pa(n),s=Oa(n),l="y"===Ma(n),c=Xa.has(i)?-1:1,u=a&&l?-1:1,d=ja(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof p&&(m="end"===s?-1*p:p),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Wi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ja(e,t),c={x:n,y:r},u=await Ya(t,l),d=Ma(Pa(o)),f=Ta(d);let m=c[f],p=c[d];if(a){const e="y"===f?"bottom":"right";m=_a(m+u["y"===f?"top":"left"],m,m-u[e])}if(i){const e="y"===d?"bottom":"right";p=_a(p+u["y"===d?"top":"left"],p,p-u[e])}const h=s.fn({...t,[f]:m,[d]:p});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:i}}}}}},Ui=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...g}=ja(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const v=Pa(o),y=Ma(s),b=Pa(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!h?[Wa(s)]:function(e){const t=Wa(e);return[Ia(e),t,Ia(t)]}(s)),E="none"!==p;!f&&E&&x.push(...Ha(s,h,p,w));const R=[s,...x],k=await Ya(t,g),N=[];let C=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&N.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Oa(e),o=Da(e),a=Aa(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Wa(i)),[i,Wa(i)]}(o,i,w);N.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:N}],!N.every(e=>e<=0)){var S,_;const e=((null==(S=a.flip)?void 0:S.index)||0)+1,t=R[e];if(t){if(!("alignment"===d&&y!==Ma(t))||C.every(e=>e.overflows[0]>0&&Ma(e.placement)===y))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(_=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:_.placement;if(!n)switch(m){case"bestFit":{var j;const e=null==(j=C.filter(e=>{if(E){const t=Ma(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:j[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Vi=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=ja(e,t),u=await Ya(t,c),d=Pa(o),f=Oa(o),m="y"===Ma(o),{width:p,height:h}=a.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===f?"top":"bottom");const y=h-u.top-u.bottom,b=p-u.left-u.right,w=xa(h-u[g],y),x=xa(p-u[v],b),E=!t.middlewareData.shift;let R=w,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(R=y),E&&!f){const e=Ea(u.left,0),t=Ea(u.right,0),n=Ea(u.top,0),r=Ea(u.bottom,0);m?k=p-2*(0!==e||0!==t?e+t:Ea(u.left,u.right)):R=h-2*(0!==n||0!==r?n+r:Ea(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:R});const N=await i.getDimensions(s.floating);return p!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}},qi=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ja(e,t);switch(r){case"referenceHidden":{const e=Ga(await Ya(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ka(e)}}}case"escaped":{const e=Ga(await Ya(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ka(e)}}}default:return{}}}}},Yi=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=ja(e,t)||{};if(null==c)return{};const d=Ua(u),f={x:n,y:r},m=Da(o),p=Aa(m),h=await i.getDimensions(c),g="y"===m,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[p]+a.reference[m]-f[m]-a.floating[p],x=f[m]-a.reference[m],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let R=E?E[b]:0;R&&await(null==i.isElement?void 0:i.isElement(E))||(R=s.floating[b]||a.floating[p]);const k=w/2-x/2,N=R/2-h[p]/2-1,C=xa(d[v],N),S=xa(d[y],N),_=C,j=R-h[p]-S,P=R/2-h[p]/2+k,O=_a(_,P,j),T=!l.arrow&&null!=Oa(o)&&P!==O&&a.reference[p]/2-(P<_?C:S)-h[p]/2<0,A=T?P<_?P-_:P-j:0;return{[m]:f[m]+A,data:{[m]:O,centerOffset:P-O-A,...T&&{alignmentOffset:A}},reset:T}}}),Gi=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=ja(e,t),u={x:n,y:r},d=Ma(o),f=Ta(d);let m=u[f],p=u[d];const h=ja(s,t),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;m<t?m=t:m>n&&(m=n)}if(c){var v,y;const e="y"===f?"width":"height",t=Xa.has(Pa(o)),n=a.reference[d]-a.floating[e]+(t&&(null==(v=i.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:(null==(y=i.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[f]:m,[d]:p}}}},Ki=(e,t,n)=>{const r=new Map,o={platform:zi,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=qa(c,r,l),f=r,m={},p=0;for(let n=0;n<s.length;n++){const{name:a,fn:h}=s[n],{x:g,y:v,data:y,reset:b}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,m={...m,[a]:{...m[a],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=qa(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:m}})(e,t,{...o,platform:a})};var Xi="undefined"!=typeof document?e.useLayoutEffect:function(){};function Zi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Zi(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Zi(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ji(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qi(e,t){const n=Ji(e);return Math.round(t*n)/n}function es(e){const t=i.useRef(e);return Xi(()=>{t.current=e}),t}const ts=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Yi({element:n.current,padding:r}).fn(t):{}:n?Yi({element:n,padding:r}).fn(t):{};var o}}),ns=(e,t)=>({...Hi(e),options:[e,t]}),rs=(e,t)=>({...Wi(e),options:[e,t]}),os=(e,t)=>({...Gi(e),options:[e,t]}),as=(e,t)=>({...Ui(e),options:[e,t]}),is=(e,t)=>({...Vi(e),options:[e,t]}),ss=(e,t)=>({...qi(e),options:[e,t]}),ls=(e,t)=>({...ts(e),options:[e,t]});var cs=i.forwardRef((e,t)=>{const{children:r,width:o=10,height:a=5,...i}=e;return n.jsx(Ot.svg,{...i,ref:t,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});cs.displayName="Arrow";var us=cs;function ds(e){const[t,n]=i.useState(void 0);return Xt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,a;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var fs="Popper",[ms,ps]=jt(fs),[hs,gs]=ms(fs),vs=e=>{const{__scopePopper:t,children:r}=e,[o,a]=i.useState(null);return n.jsx(hs,{scope:t,anchor:o,onAnchorChange:a,children:r})};vs.displayName=fs;var ys="PopperAnchor",bs=i.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...a}=e,s=gs(ys,r),l=i.useRef(null),c=te(t,l);return i.useEffect(()=>{s.onAnchorChange(o?.current||l.current)}),o?null:n.jsx(Ot.div,{...a,ref:c})});bs.displayName=ys;var ws="PopperContent",[xs,Es]=ms(ws),Rs=i.forwardRef((e,t)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:v,...y}=e,b=gs(ws,r),[w,x]=i.useState(null),E=te(t,e=>x(e)),[R,k]=i.useState(null),N=ds(R),C=N?.width??0,S=N?.height??0,_=o+("center"!==l?"-"+l:""),j="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(f)?f:[f],O=P.length>0,T={padding:j,boundary:P.filter(Ss),altBoundary:O},{refs:A,floatingStyles:L,placement:M,isPositioned:D,middlewareData:I}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,m]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=i.useState(r);Zi(p,r)||h(r);const[g,v]=i.useState(null),[y,b]=i.useState(null),w=i.useCallback(e=>{e!==k.current&&(k.current=e,v(e))},[]),x=i.useCallback(e=>{e!==N.current&&(N.current=e,b(e))},[]),E=a||g,R=l||y,k=i.useRef(null),N=i.useRef(null),C=i.useRef(f),S=null!=u,_=es(u),j=es(o),P=es(d),O=i.useCallback(()=>{if(!k.current||!N.current)return;const e={placement:t,strategy:n,middleware:p};j.current&&(e.platform=j.current),Ki(k.current,N.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};T.current&&!Zi(C.current,t)&&(C.current=t,s.flushSync(()=>{m(t)}))})},[p,t,n,j,P]);Xi(()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const T=i.useRef(!1);Xi(()=>(T.current=!0,()=>{T.current=!1}),[]),Xi(()=>{if(E&&(k.current=E),R&&(N.current=R),E&&R){if(_.current)return _.current(E,R,O);O()}},[E,R,O,_,S]);const A=i.useMemo(()=>({reference:k,floating:N,setReference:w,setFloating:x}),[w,x]),L=i.useMemo(()=>({reference:E,floating:R}),[E,R]),M=i.useMemo(()=>{const e={position:n,left:0,top:0};if(!L.floating)return e;const t=Qi(L.floating,f.x),r=Qi(L.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Ji(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,L.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:O,refs:A,elements:L,floatingStyles:M}),[f,O,A,L,M])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>Bi(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[ns({mainAxis:a+S,alignmentAxis:c}),d&&rs({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?os():void 0,...T}),d&&as({...T}),is({...T,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),R&&ls({element:R,padding:u}),_s({arrowWidth:C,arrowHeight:S}),h&&ss({strategy:"referenceHidden",...T})]}),[F,z]=js(M),$=en(v);Xt(()=>{D&&$?.()},[D,$]);const B=I.arrow?.x,H=I.arrow?.y,W=0!==I.arrow?.centerOffset,[U,V]=i.useState();return Xt(()=>{w&&V(window.getComputedStyle(w).zIndex)},[w]),n.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:D?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(xs,{scope:r,placedSide:F,onArrowChange:k,arrowX:B,arrowY:H,shouldHideArrow:W,children:n.jsx(Ot.div,{"data-side":F,"data-align":z,...y,ref:E,style:{...y.style,animation:D?void 0:"none"}})})})});Rs.displayName=ws;var ks="PopperArrow",Ns={top:"bottom",right:"left",bottom:"top",left:"right"},Cs=i.forwardRef(function(e,t){const{__scopePopper:r,...o}=e,a=Es(ks,r),i=Ns[a.placedSide];return n.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:n.jsx(us,{...o,ref:t,style:{...o.style,display:"block"}})})});function Ss(e){return null!==e}Cs.displayName=ks;var _s=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=js(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+s/2;let m="",p="";return"bottom"===l?(m=a?u:`${d}px`,p=-s+"px"):"top"===l?(m=a?u:`${d}px`,p=`${r.floating.height+s}px`):"right"===l?(m=-s+"px",p=a?u:`${f}px`):"left"===l&&(m=`${r.floating.width+s}px`,p=a?u:`${f}px`),{data:{x:m,y:p}}}});function js(e){const[t,n="center"]=e.split("-");return[t,n]}var Ps=vs,Os=bs,Ts=Rs,As=Cs,Ls=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Ms=i.forwardRef((e,t)=>n.jsx(Ot.span,{...e,ref:t,style:{...Ls,...e.style}}));Ms.displayName="VisuallyHidden";var Ds=Ms,[Is,Fs]=jt("Tooltip",[ps]),zs=ps(),$s="TooltipProvider",Bs=700,Hs="tooltip.open",[Ws,Us]=Is($s),Vs=e=>{const{__scopeTooltip:t,delayDuration:r=Bs,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:s}=e,l=i.useRef(!0),c=i.useRef(!1),u=i.useRef(0);return i.useEffect(()=>{const e=u.current;return()=>window.clearTimeout(e)},[]),n.jsx(Ws,{scope:t,isOpenDelayedRef:l,delayDuration:r,onOpen:i.useCallback(()=>{window.clearTimeout(u.current),l.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:i.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:s})};Vs.displayName=$s;var qs="Tooltip",[Ys,Gs]=Is(qs),Ks=e=>{const{__scopeTooltip:t,children:r,open:o,defaultOpen:a,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=e,u=Us(qs,e.__scopeTooltip),d=zs(t),[f,m]=i.useState(null),p=Qt(),h=i.useRef(0),g=l??u.disableHoverableContent,v=c??u.delayDuration,y=i.useRef(!1),[b,w]=nn({prop:o,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(Hs))):u.onClose(),s?.(e)},caller:qs}),x=i.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),E=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,w(!0)},[w]),R=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),k=i.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,w(!0),h.current=0},v)},[v,w]);return i.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),n.jsx(Ps,{...d,children:n.jsx(Ys,{scope:t,contentId:p,open:b,stateAttribute:x,trigger:f,onTriggerChange:m,onTriggerEnter:i.useCallback(()=>{u.isOpenDelayedRef.current?k():E()},[u.isOpenDelayedRef,k,E]),onTriggerLeave:i.useCallback(()=>{g?R():(window.clearTimeout(h.current),h.current=0)},[R,g]),onOpen:E,onClose:R,disableHoverableContent:g,children:r})})};Ks.displayName=qs;var Xs="TooltipTrigger",Zs=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,a=Gs(Xs,r),s=Us(Xs,r),l=zs(r),c=te(t,i.useRef(null),a.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),f=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),n.jsx(Os,{asChild:!0,...l,children:n.jsx(Ot.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:c,onPointerMove:Kt(e.onPointerMove,e=>{"touch"!==e.pointerType&&(d.current||s.isPointerInTransitRef.current||(a.onTriggerEnter(),d.current=!0))}),onPointerLeave:Kt(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:Kt(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Kt(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:Kt(e.onBlur,a.onClose),onClick:Kt(e.onClick,a.onClose)})})});Zs.displayName=Xs;var[Js,Qs]=Is("TooltipPortal",{forceMount:void 0}),el="TooltipContent",tl=i.forwardRef((e,t)=>{const r=Qs(el,e.__scopeTooltip),{forceMount:o=r.forceMount,side:a="top",...i}=e,s=Gs(el,e.__scopeTooltip);return n.jsx(kn,{present:o||s.open,children:s.disableHoverableContent?n.jsx(il,{side:a,...i,ref:t}):n.jsx(nl,{side:a,...i,ref:t})})}),nl=i.forwardRef((e,t)=>{const r=Gs(el,e.__scopeTooltip),o=Us(el,e.__scopeTooltip),a=i.useRef(null),s=te(t,a),[l,c]=i.useState(null),{trigger:u,onClose:d}=r,f=a.current,{onPointerInTransitChange:m}=o,p=i.useCallback(()=>{c(null),m(!1)},[m]),h=i.useCallback((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),a=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...o,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);c(a),m(!0)},[m]);return i.useEffect(()=>()=>p(),[p]),i.useEffect(()=>{if(u&&f){const e=e=>h(e,f),t=e=>h(e,u);return u.addEventListener("pointerleave",e),f.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),f.removeEventListener("pointerleave",t)}}},[u,f,h,p]),i.useEffect(()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,u=s.x,d=s.y;c>r!=d>r&&n<(u-l)*(r-c)/(d-c)+l&&(o=!o)}return o}(n,l);r?p():o&&(p(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,f,l,d,p]),n.jsx(il,{...e,ref:s})}),[rl,ol]=Is(qs,{isInside:!1}),al=function(e){const t=({children:e})=>n.jsx(n.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=ae,t}("TooltipContent"),il=i.forwardRef((e,t)=>{const{__scopeTooltip:r,children:o,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=e,u=Gs(el,r),d=zs(r),{onClose:f}=u;return i.useEffect(()=>(document.addEventListener(Hs,f),()=>document.removeEventListener(Hs,f)),[f]),i.useEffect(()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&f()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,f]),n.jsx(er,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:n.jsxs(Ts,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[n.jsx(al,{children:o}),n.jsx(rl,{scope:r,isInside:!0,children:n.jsx(Ds,{id:u.contentId,role:"tooltip",children:a||o})})]})})});tl.displayName=el;var sl="TooltipArrow";i.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,a=zs(r);return ol(sl,r).isInside?null:n.jsx(As,{...a,...o,ref:t})}).displayName=sl;var ll=tl;const cl=Vs,ul=Ks,dl=Zs,fl=i.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.createElement(ll,J({ref:r,sideOffset:t,className:yt("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e)},n)));fl.displayName=ll.displayName;const ml=de("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),pl=i.forwardRef(({className:e,variant:t,...n},r)=>i.createElement("div",J({ref:r,role:"alert",className:yt(ml({variant:t}),e)},n)));pl.displayName="Alert";i.forwardRef(({className:e,...t},n)=>i.createElement("h5",J({ref:n,className:yt("mb-1 font-medium leading-none tracking-tight",e)},t))).displayName="AlertTitle";const hl=i.forwardRef(({className:e,...t},n)=>i.createElement("div",J({ref:n,className:yt("text-sm [&_p]:leading-relaxed",e)},t)));function gl({userId:t,onSuccess:n,onCancel:r,createSetupIntent:o}){const a=Y("calls useStripe()").stripe,i=V(),[s,l]=e.useState(!1),[c,u]=e.useState(null),[d,f]=e.useState(!1);return d?React.createElement("div",{className:"text-center py-8"},React.createElement(oa,{className:"h-12 w-12 text-green-500 mx-auto mb-4"}),React.createElement("p",{className:"text-lg font-medium"},"Payment method added successfully!"),React.createElement("p",{className:"text-sm text-muted-foreground mt-2"},"Redirecting...")):React.createElement("form",{onSubmit:async e=>{if(e.preventDefault(),a&&i){l(!0),u(null);try{const{client_secret:e}=await o(t);if(!e)throw new Error("Failed to create setup intent");const r=await a.confirmCardSetup(e,{payment_method:{card:i.getElement(Z)}});r.error?u(r.error.message||"An error occurred"):(f(!0),setTimeout(()=>{n&&n()},2e3))}catch(e){u(e instanceof Error?e.message:"An error occurred")}finally{l(!1)}}},className:"space-y-6"},React.createElement("div",null,React.createElement("label",{className:"block text-sm font-medium mb-2"},"Card Details"),React.createElement("div",{className:"border rounded-md p-3 bg-background"},React.createElement(Z,{options:{style:{base:{fontSize:"16px",color:"#fff","::placeholder":{color:"#999"}}}}}))),c&&React.createElement(pl,{variant:"destructive"},React.createElement(hl,null,c)),React.createElement("div",{className:"flex gap-2"},React.createElement(wt,{type:"button",variant:"outline",onClick:r,disabled:s,className:"flex-1"},"Cancel"),React.createElement(wt,{type:"submit",disabled:!a||s,className:"flex-1"},s&&React.createElement(ca,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Processing...":"Add Payment Method")))}hl.displayName="AlertDescription";var vl="Radio",[yl,bl]=jt(vl),[wl,xl]=yl(vl),El=i.forwardRef((e,t)=>{const{__scopeRadio:r,name:o,checked:a=!1,required:s,disabled:l,value:c="on",onCheck:u,form:d,...f}=e,[m,p]=i.useState(null),h=te(t,e=>p(e)),g=i.useRef(!1),v=!m||(d||!!m.closest("form"));return n.jsxs(wl,{scope:r,checked:a,disabled:l,children:[n.jsx(Ot.button,{type:"button",role:"radio","aria-checked":a,"data-state":Cl(a),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:h,onClick:Kt(e.onClick,e=>{a||u?.(),v&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),v&&n.jsx(Nl,{control:m,bubbles:!g.current,name:o,value:c,checked:a,required:s,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});El.displayName=vl;var Rl="RadioIndicator",kl=i.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:o,...a}=e,i=xl(Rl,r);return n.jsx(kn,{present:o||i.checked,children:n.jsx(Ot.span,{"data-state":Cl(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t})})});kl.displayName=Rl;var Nl=i.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:o=!0,...a},s)=>{const l=i.useRef(null),c=te(l,s),u=function(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(r),d=ds(t);return i.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}},[u,r,o]),n.jsx(Ot.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Cl(e){return e?"checked":"unchecked"}Nl.displayName="RadioBubbleInput";var Sl=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_l="RadioGroup",[jl,Pl]=jt(_l,[mn,bl]),Ol=mn(),Tl=bl(),[Al,Ll]=jl(_l),Ml=i.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:o,defaultValue:a,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=e,p=Ol(r),h=on(u),[g,v]=nn({prop:i,defaultProp:a??null,onChange:f,caller:_l});return n.jsx(Al,{scope:r,name:o,required:s,disabled:l,value:g,onValueChange:v,children:n.jsx(En,{asChild:!0,...p,orientation:c,dir:h,loop:d,children:n.jsx(Ot.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:h,...m,ref:t})})})});Ml.displayName=_l;var Dl="RadioGroupItem",Il=i.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:o,...a}=e,s=Ll(Dl,r),l=s.disabled||o,c=Ol(r),u=Tl(r),d=i.useRef(null),f=te(t,d),m=s.value===a.value,p=i.useRef(!1);return i.useEffect(()=>{const e=e=>{Sl.includes(e.key)&&(p.current=!0)},t=()=>p.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),n.jsx(Rn,{asChild:!0,...c,focusable:!l,active:m,children:n.jsx(El,{disabled:l,required:s.required,checked:m,...u,...a,name:s.name,ref:f,onCheck:()=>s.onValueChange(a.value),onKeyDown:Kt(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Kt(a.onFocus,()=>{p.current&&d.current?.click()})})})});Il.displayName=Dl;var Fl=i.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...o}=e,a=Tl(r);return n.jsx(kl,{...a,...o,ref:t})});Fl.displayName="RadioGroupIndicator";var zl=Ml,$l=Il,Bl=Fl;const Hl=i.forwardRef(({className:e,...t},n)=>i.createElement(zl,J({className:yt("grid gap-2",e)},t,{ref:n})));Hl.displayName=zl.displayName;const Wl=i.forwardRef(({className:e,...t},n)=>i.createElement($l,J({ref:n,className:yt("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e)},t),i.createElement(Bl,{className:"flex items-center justify-center"},i.createElement(aa,{className:"h-2.5 w-2.5 fill-current text-current"}))));Wl.displayName=$l.displayName;var Ul=i.forwardRef((e,t)=>n.jsx(Ot.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Ul.displayName="Label";var Vl=Ul;function ql({className:e,...t}){return i.createElement(Vl,J({"data-slot":"label",className:yt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e)},t))}function Yl({brand:t,className:n="w-8 h-5"}){const r=t?.toLowerCase();switch(r){case"visa":return e.createElement("svg",{className:n,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#1A1F71"}),e.createElement("path",{d:"M20.5 22H17.5L19.5 10H22.5L20.5 22Z",fill:"white"}),e.createElement("path",{d:"M31.5 10.5L29 17.5L28.5 15.5L27.5 11C27.5 11 27.5 10 26.5 10H22L22 10.5C22 10.5 23.5 11 25 12L28 22H31L36 10H33L31.5 10.5Z",fill:"white"}),e.createElement("path",{d:"M37 10C36 10 35.5 10.5 35.5 10.5L31.5 19.5L32 22H35L35.5 20.5H39L39.5 22H42L40 10H37ZM36 18L37.5 13.5L38.5 18H36Z",fill:"white"}),e.createElement("path",{d:"M16 11L16.5 10H11.5C10.5 10 10 10.5 10 11L8 20C8 20 8.5 21.5 9.5 22C10.5 22.5 12 22.5 13 22C14 21.5 15 21 15.5 20C16 19 16 18.5 16 18C16 17.5 15.5 17 15 17C14.5 16.5 13.5 16.5 12.5 16.5H11.5L12 14H15L14.5 12H11.5L12 11H16Z",fill:"white"}));case"mastercard":return e.createElement("svg",{className:n,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#1E293B"}),e.createElement("circle",{cx:"19",cy:"16",r:"7",fill:"#EB001B"}),e.createElement("circle",{cx:"29",cy:"16",r:"7",fill:"#F79E1B"}),e.createElement("path",{d:"M24 10.5C25.5 12 26.5 14 26.5 16C26.5 18 25.5 20 24 21.5C22.5 20 21.5 18 21.5 16C21.5 14 22.5 12 24 10.5Z",fill:"#FF5F00"}));case"amex":case"american express":return e.createElement("svg",{className:n,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#2E7BC4"}),e.createElement("path",{d:"M12 12H15L16 14L17 12H20V18H18V14L16 18H16L14 14V18H12V12Z",fill:"white"}),e.createElement("path",{d:"M21 12H27V14H23V15H27V16H23V17H27V18H21V12Z",fill:"white"}),e.createElement("path",{d:"M28 12H31L33 14L35 12H38L35 15L38 18H35L33 16L31 18H28L31 15L28 12Z",fill:"white"}));case"discover":return e.createElement("svg",{className:n,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#F47216"}),e.createElement("circle",{cx:"29",cy:"16",r:"7",fill:"#FCFCFC"}));case"diners":case"diners club":return e.createElement("svg",{className:n,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#0079BE"}),e.createElement("circle",{cx:"24",cy:"16",r:"8",fill:"white"}),e.createElement("circle",{cx:"20",cy:"16",r:"5",fill:"#0079BE"}),e.createElement("circle",{cx:"28",cy:"16",r:"5",fill:"#0079BE"}));case"jcb":return e.createElement("svg",{className:n,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{width:"48",height:"32",rx:"4",fill:"white"}),e.createElement("rect",{x:"8",y:"8",width:"8",height:"16",rx:"2",fill:"#0E4C96"}),e.createElement("rect",{x:"20",y:"8",width:"8",height:"16",rx:"2",fill:"#EE0005"}),e.createElement("rect",{x:"32",y:"8",width:"8",height:"16",rx:"2",fill:"#00A650"}));case"unionpay":return e.createElement("svg",{className:n,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#005BAC"}),e.createElement("rect",{x:"16",y:"8",width:"16",height:"16",fill:"#E60012"}));default:return e.createElement("div",{className:`${n} bg-slate-200 dark:bg-slate-800 rounded flex items-center justify-center`},e.createElement("span",{className:"text-xs font-bold uppercase"},r||"card"))}}function Gl({isOpen:t,onClose:n,plan:r,currentPlan:o,paymentMethods:a,userId:i,onSuccess:s,createSubscription:l}){const[c,u]=e.useState(a?.find(e=>e.is_default)?.stripe_payment_method_id||a?.[0]?.stripe_payment_method_id||""),[d,f]=e.useState(!1),[m,p]=e.useState(null),[h,g]=e.useState(!1),v=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"usd"}).format(e/100);if(!r)return null;const y=r?.prices?.[0],b=y&&0===parseFloat(y.unit_amount),w=o&&y&&parseFloat(y.unit_amount)<parseFloat(o.prices[0].unit_amount);return h?React.createElement(fa,{open:t,onOpenChange:n},React.createElement(ha,null,React.createElement("div",{className:"text-center py-8"},React.createElement(oa,{className:"h-12 w-12 text-green-500 mx-auto mb-4"}),React.createElement("h3",{className:"text-lg font-medium"},"Subscription Successful!"),React.createElement("p",{className:"text-sm text-muted-foreground mt-2"},"You have been successfully subscribed to ",r.name)))):React.createElement(fa,{open:t,onOpenChange:n},React.createElement(ha,{className:"sm:max-w-md"},React.createElement(ga,null,React.createElement(ya,null,"Confirm Subscription"),React.createElement(ba,null,o?"You are about to change your subscription plan":"You are about to subscribe to a new plan")),React.createElement("div",{className:"space-y-4"},React.createElement(xt,{className:"p-4"},React.createElement("h4",{className:"font-medium mb-2"},r.name),React.createElement("p",{className:"text-2xl font-bold mb-2"},b?"Free":v(100*parseFloat(y.unit_amount)),!b&&React.createElement("span",{className:"text-sm font-normal text-muted-foreground"},"/month")),React.createElement("ul",{className:"space-y-1"},r.features?.map(e=>React.createElement("li",{key:e.id,className:"flex items-start text-sm"},React.createElement(na,{className:"h-4 w-4 mr-2 text-primary mt-0.5 flex-shrink-0"}),React.createElement(cl,null,React.createElement(ul,null,React.createElement(dl,{asChild:!0},React.createElement("span",{className:"cursor-help"},(e=>{if("true"===e||!0===e)return"✓";if("false"===e||!1===e)return"✗";const t="string"==typeof e?parseFloat(e):e;return!isNaN(t)&&t>=1e3?new Intl.NumberFormat("en-US").format(t):e})(e.value)," ",React.createElement("span",{className:"text-sm text-muted-foreground font-normal"},e.units)," - ",e.name||e.description)),React.createElement(fl,null,React.createElement("p",null,e.description)))))))),!b&&a?.length>0&&React.createElement("div",{className:"space-y-3"},React.createElement(ql,null,"Payment Method"),React.createElement(Hl,{value:c,onValueChange:u},a.map(e=>React.createElement("div",{key:e.id,className:"flex items-center space-x-3"},React.createElement(Wl,{value:e.stripe_payment_method_id,id:e.id.toString()}),React.createElement(ql,{htmlFor:e.id.toString(),className:"flex items-center gap-3 cursor-pointer flex-1"},React.createElement(Yl,{brand:e.brand,className:"w-12 h-8"}),React.createElement("span",{className:"font-medium"},"•••• ",e.last4),e.is_default&&React.createElement("span",{className:"text-xs text-muted-foreground"},"(Default)")))))),!b&&React.createElement(pl,null,React.createElement(ra,{className:"h-4 w-4"}),React.createElement(hl,null,"You will be charged ",v(100*parseFloat(y.unit_amount))," immediately upon confirmation.",w&&" Refunds for downgrades will be prorated and applied to your next invoice.")),m&&React.createElement(pl,{variant:"destructive"},React.createElement(hl,null,m))),React.createElement(va,{className:"gap-2"},React.createElement(wt,{variant:"outline",onClick:n,disabled:d},"Cancel"),React.createElement(wt,{onClick:async()=>{f(!0),p(null);try{const e=r.prices[0].stripe_price_id,t=0===parseFloat(r.prices[0].unit_amount),o=await l(i,e,t?"":c);o.success?(g(!0),setTimeout(()=>{s(),n()},2e3)):p(o.error||"Failed to create subscription")}catch(e){p(e instanceof Error?e.message:"An error occurred")}finally{f(!1)}},disabled:d||!b&&!c},d&&React.createElement(ca,{className:"mr-2 h-4 w-4 animate-spin"}),d?"Processing...":"Confirm Subscription"))))}const Kl=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b=!0;var r=Date.now();return w().then(function(e){return function(e,t,n){if(null===e)return null;var r=t[0].match(/^pk_test/),o=function(e){return 3===e?"v3":e}(e.version),a=l;r&&o!==a&&console.warn("Stripe.js@".concat(o," was loaded on the page, but @stripe/stripe-js@").concat("7.4.0"," expected Stripe.js@").concat(a,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var i=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"7.4.0",startTime:t})}(i,n),i}(e,t,r)})}(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY||"");function Xl({customerData:n,pricingData:r,paymentMethods:o,apiUrl:a,apiKey:i}){const[s,l]=e.useState(!1),[c,u]=e.useState(!1),[d,f]=e.useState(!1),[m,p]=e.useState(!1),[h,g]=e.useState(null),[v,y]=e.useState(null),[b,w]=e.useState("overview"),x=t.useRouter(),E=n?.subscriptions?.[0],R=E?.items?.[0],k=n?.usage,N=n?.invoices||[],C=r?.products?.find(e=>e.prices?.some(e=>e.id===R?.price_id)),S=C?.prices?.find(e=>e.id===R?.price_id),_=e=>("string"==typeof e?new Date(e):new Date(1e3*e)).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),j=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"usd"}).format(e/100),P=async e=>{l(!0);try{await async function(e,t,n){const r=await fetch(`${t}/billing/payment-methods/${e}/default`,{method:"POST",headers:{"x-api-key":n,"Content-Type":"application/json"},body:JSON.stringify({})});if(!r.ok)throw new Error("Failed to set default payment method");return await r.json()}(e,a,i),x.refresh()}catch(e){console.error("Failed to set default payment method:",e)}finally{l(!1)}};return React.createElement(React.Fragment,null,React.createElement("div",{className:"space-y-6"},React.createElement("div",null,React.createElement("h3",{className:"text-lg font-medium"},"Billing"),React.createElement("p",{className:"text-sm text-muted-foreground"},"Manage your subscription and billing information.")),React.createElement(Vn,{value:b,onValueChange:w,className:"space-y-4"},React.createElement(qn,null,React.createElement(Yn,{value:"overview"},"Overview"),React.createElement(Yn,{value:"usage"},"Usage"),React.createElement(Yn,{value:"plans"},"Plans"),React.createElement(Yn,{value:"billing-history"},"Billing History")),React.createElement(Gn,{value:"overview",className:"space-y-4"},React.createElement(xt,null,React.createElement(Et,null,React.createElement(Rt,null,"Current Plan"),React.createElement(kt,null,C?`You are currently on the ${C.name}`:"No active subscription")),React.createElement(Nt,null,E?React.createElement("div",{className:"flex items-center justify-between"},React.createElement("div",null,React.createElement("p",{className:"text-2xl font-bold"},S?j(100*parseFloat(S.unit_amount)):"Active","/month"),React.createElement("p",{className:"text-sm text-muted-foreground"},"Next billing date: ",_(E.current_period_end)),E.cancel_at_period_end&&React.createElement("p",{className:"text-sm text-destructive mt-2"},React.createElement(ra,{className:"inline h-4 w-4 mr-1"}),"Subscription will cancel at the end of the billing period")),React.createElement("div",{className:"space-x-2"},React.createElement(wt,{variant:"outline",onClick:()=>w("plans")},"Change Plan"),!E.cancel_at_period_end&&React.createElement(wt,{variant:"outline",onClick:async()=>{if(E?.id&&confirm("Are you sure you want to cancel your subscription? You will continue to have access until the end of your billing period.")){l(!0);try{await async function(e,t,n){const r=await fetch(`${t}/billing/subscriptions/${e}`,{method:"DELETE",headers:{"x-api-key":n,"Content-Type":"application/json"}});if(!r.ok)throw new Error("Failed to cancel subscription");return await r.json()}(E.id,a,i),x.refresh()}catch(e){console.error("Failed to cancel subscription:",e)}finally{l(!1)}}},disabled:s},s&&React.createElement(ca,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancel Subscription"))):React.createElement("div",{className:"text-center py-6"},React.createElement("p",{className:"text-muted-foreground mb-4"},"You don't have an active subscription"),React.createElement(wt,{onClick:()=>w("plans")},"Choose a Plan")))),React.createElement(xt,null,React.createElement(Et,null,React.createElement(Rt,null,"Payment Methods"),React.createElement(kt,null,"Manage your payment information")),React.createElement(Nt,{className:"space-y-4"},o?.paymentMethods?.length>0?React.createElement("div",{className:"space-y-3"},o.paymentMethods.map(e=>React.createElement("div",{key:e.id,className:"flex items-center justify-between p-4 border rounded-lg"},React.createElement("div",{className:"flex items-center gap-4"},React.createElement(Yl,{brand:e.brand,className:"w-16 h-10"}),React.createElement("div",{className:"flex-1"},React.createElement("p",{className:"font-medium"},"•••• •••• •••• ",e.last4),React.createElement("p",{className:"text-sm text-muted-foreground"},"Expires ",e.exp_month,"/",e.exp_year)),e.is_default&&React.createElement(_t,{variant:"secondary"},"Default")),React.createElement("div",{className:"flex items-center gap-2 ml-4"},!e.is_default&&React.createElement(wt,{variant:"outline",size:"sm",onClick:()=>P(e.stripe_payment_method_id),disabled:s},"Set as Default"),React.createElement(wt,{variant:"outline",size:"sm",onClick:()=>{return t=e.stripe_payment_method_id,y(t),void p(!0);var t},disabled:s},"Remove"))))):React.createElement("div",{className:"text-center py-6"},React.createElement("p",{className:"text-muted-foreground mb-4"},"No payment methods on file"))),React.createElement(Ct,null,React.createElement(wt,{className:"w-full",onClick:()=>u(!0)},React.createElement(ia,{className:"mr-2 h-4 w-4"}),"Add Payment Method")))),React.createElement(Gn,{value:"usage",className:"space-y-4"},React.createElement(xt,null,React.createElement(Et,null,React.createElement(Rt,null,"Current Usage"),React.createElement(kt,null,"Your resource usage for the current billing period")),React.createElement(Nt,{className:"space-y-6"},k?.data?.filter(e=>"number"==typeof e.limit&&e.limit>0).map(e=>{const t="number"==typeof e.limit?Math.min(e.current_usage/e.limit*100,100):0;return React.createElement("div",{key:e.feature_key,className:"space-y-3"},React.createElement("div",{className:"flex items-center justify-between text-sm"},React.createElement("div",{className:"flex items-center gap-2"},"number"==typeof e.limit&&(n=t,!e.within_limit||n>=90?React.createElement(ra,{className:"h-4 w-4 text-red-600 dark:text-red-400"}):n>=75?React.createElement(ua,{className:"h-4 w-4 text-orange-600 dark:text-orange-400"}):n>=50?React.createElement(la,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400"}):React.createElement(oa,{className:"h-4 w-4 text-green-600 dark:text-green-400"})),React.createElement("span",null,e.feature_details.description)),React.createElement("span",{className:`font-medium ${"number"==typeof e.limit?(e=>e>=90?"text-red-600 dark:text-red-400":e>=75?"text-orange-600 dark:text-orange-400":e>=50?"text-yellow-600 dark:text-yellow-400":"text-green-600 dark:text-green-400")(t):""}`},"number"==typeof e.limit?`${e.current_usage.toLocaleString()} / ${e.limit.toLocaleString()}`:e.current_usage,e.feature_details.units&&` ${e.feature_details.units}`)),"number"==typeof e.limit&&React.createElement(React.Fragment,null,React.createElement(Gt,{value:t,className:`h-2 ${(e=>e>=90?"bg-red-100 dark:bg-red-950":e>=75?"bg-orange-100 dark:bg-orange-950":e>=50?"bg-yellow-100 dark:bg-yellow-950":"bg-green-100 dark:bg-green-950")(t)} ${e.within_limit?t>=90?"[&>div]:bg-red-500":t>=75?"[&>div]:bg-orange-500":t>=50?"[&>div]:bg-yellow-500":"[&>div]:bg-green-500":"[&>div]:bg-red-500"}`}),React.createElement("p",{className:"text-xs "+(e.within_limit?t>=90?"text-red-600 dark:text-red-400":t>=75?"text-orange-600 dark:text-orange-400":"text-muted-foreground":"text-red-600 dark:text-red-400 font-medium")},e.within_limit?`${Math.max(0,e.limit-e.current_usage).toLocaleString()} ${e.feature_details.units||""} remaining`:`${(e.current_usage-e.limit).toLocaleString()} ${e.feature_details.units||""} over limit`)));var n})),React.createElement(Ct,null,React.createElement("p",{className:"text-sm text-muted-foreground"},"Usage resets on ",E?_(E.current_period_end):"N/A",". Need more resources? Consider upgrading your plan.")))),React.createElement(Gn,{value:"plans",className:"space-y-4"},React.createElement("div",{className:"grid gap-4 "+(3===r?.products?.length?"md:grid-cols-3":"md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4")},r?.products?.map(e=>{const t=e.prices?.[0],n=e.features||[],r=R?.price_id===t?.id;return React.createElement(xt,{key:e.id,className:`relative overflow-hidden h-full flex flex-col ${r?"border-primary shadow-md":"border-muted"} ${"true"!==e.metadata?.popular||r?"":"border-primary/50"}`},"true"===e.metadata?.popular&&!r&&React.createElement("div",{className:"absolute top-0 right-0 bg-primary text-primary-foreground text-xs font-medium px-3 py-1 rounded-bl-lg"},"POPULAR"),React.createElement(Et,{className:"text-center pb-4 pt-4"},React.createElement(Rt,{className:"text-lg font-semibold"},e.name),React.createElement(kt,{className:"mt-1 text-sm"},e.description)),React.createElement(Nt,{className:"text-center pb-4 flex-1"},React.createElement("div",{className:"mb-4"},React.createElement("div",{className:"flex items-baseline justify-center"},React.createElement("span",{className:"text-3xl font-bold tracking-tight"},0===parseFloat(t?.unit_amount)?"Free":`$${parseFloat(t?.unit_amount).toFixed(2).replace(/\.00$/,"")}`),parseFloat(t?.unit_amount)>0&&React.createElement("span",{className:"ml-1 text-sm text-muted-foreground"},"/month")),r?React.createElement(_t,{variant:"secondary",className:"mt-2"},"Current Plan"):React.createElement("div",{className:"mt-2 h-6"})),React.createElement("div",{className:"space-y-3 flex-1 flex flex-col justify-between min-h-[300px]"},n.map(e=>React.createElement("div",{key:e.id,className:"border-t pt-3 first:border-t-0 first:pt-0 flex-1 flex flex-col justify-center"},React.createElement("div",{className:"text-lg font-semibold text-foreground"},(e=>{if("true"===e||!0===e)return"✓";if("false"===e||!1===e)return"✗";const t="string"==typeof e?parseFloat(e):e;return!isNaN(t)&&t>=1e3?new Intl.NumberFormat("en-US").format(t):e})(e.value)," ",React.createElement("span",{className:"text-sm text-gray-500 font-normal"},e.units)),React.createElement(cl,null,React.createElement(ul,null,React.createElement(dl,{asChild:!0},React.createElement("div",{className:"text-xs text-gray-500 mt-1 cursor-help"},e.name||e.description)),React.createElement(fl,null,React.createElement("p",null,e.description)))))))),React.createElement(Ct,{className:"pt-3"},React.createElement(wt,{className:"w-full",variant:r?"outline":"true"===e.metadata?.popular?"default":"secondary",size:"lg",disabled:r,onClick:()=>!r&&(e=>{const t=e.prices?.[0];if(!(t&&0===parseFloat(t.unit_amount)||o?.paymentMethods&&0!==o.paymentMethods.length))return w("overview"),void u(!0);g(e),f(!0)})(e)},(()=>{if(r)return"Current Plan";const e=parseFloat(t?.unit_amount||0),n=parseFloat(S?.unit_amount||0);return 0===e?n>0?"Switch to Free":"Get Started":0===n||e>n?"Upgrade":"Downgrade"})())))}))),React.createElement(Gn,{value:"billing-history",className:"space-y-4"},React.createElement(xt,null,React.createElement(Et,null,React.createElement(Rt,null,"Billing History"),React.createElement(kt,null,"Download your past invoices")),React.createElement(Nt,null,React.createElement("div",{className:"space-y-4"},N.length>0?N.map(e=>React.createElement("div",{key:e.id,className:"flex items-center justify-between p-4 border rounded-lg"},React.createElement("div",{className:"flex items-center space-x-4"},React.createElement(sa,{className:"h-8 w-8 text-muted-foreground"}),React.createElement("div",null,React.createElement("p",{className:"font-medium"},"Invoice #",e.id.slice(-8).toUpperCase()),React.createElement("p",{className:"text-sm text-muted-foreground"},_(e.created)))),React.createElement("div",{className:"flex items-center space-x-4"},React.createElement("div",{className:"text-right"},React.createElement("p",{className:"font-medium"},j(e.amount_paid)),React.createElement("p",{className:"text-sm text-muted-foreground capitalize"},e.status)),React.createElement(wt,{variant:"outline",size:"sm",onClick:()=>window.open(e.invoice_pdf||e.hosted_invoice_url,"_blank")},React.createElement(sa,{className:"h-4 w-4 mr-2"}),"Download")))):React.createElement("div",{className:"text-center py-12"},React.createElement(sa,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),React.createElement("p",{className:"text-muted-foreground"},"No invoices yet")))))))),React.createElement(fa,{open:c,onOpenChange:u},React.createElement(ha,null,React.createElement(ga,null,React.createElement(ya,null,"Add Payment Method"),React.createElement(ba,null,"Add a new payment method to your account. Your card information is securely processed by Stripe.")),React.createElement(U,{stripe:Kl},React.createElement(gl,{userId:String(n?.id||""),onSuccess:()=>{u(!1),x.refresh()},onCancel:()=>u(!1),createSetupIntent:async e=>await async function(e,t,n){const r=await fetch(`${t}/billing/setup-intent`,{method:"POST",headers:{"x-api-key":n,"Content-Type":"application/json"},body:JSON.stringify({user_id:e})});if(!r.ok)throw new Error("Failed to create setup intent");return await r.json()}(e,a,i)})))),React.createElement(Gl,{isOpen:d,onClose:()=>f(!1),plan:h,currentPlan:C,paymentMethods:o?.paymentMethods||[],userId:String(n?.id||""),onSuccess:()=>{f(!1),g(null),x.refresh(),w("overview")},createSubscription:async(e,t,n)=>await async function(e,t,n,r,o){try{const a=await fetch(`${r}/billing/subscriptions`,{method:"POST",headers:{"x-api-key":o,"Content-Type":"application/json"},body:JSON.stringify({user_id:e,priceId:t,paymentMethodId:n})}),i=await a.json();if(!a.ok||!1===i.success){let e="Failed to create subscription";return"MISSING_PARAMETERS"===i.error?e=i.message||"Missing required parameters. Please check your information and try again.":i.message?e=i.message:i.error&&(e=i.error),{success:!1,error:e,errorType:i.error}}return{success:!0,data:i}}catch(e){return{success:!1,error:e instanceof Error?e.message:"An error occurred while creating subscription",errorType:"NETWORK_ERROR"}}}(e,t,n,a,i)}),React.createElement(fa,{open:m,onOpenChange:p},React.createElement(ha,null,React.createElement(ga,null,React.createElement(ya,null,"Delete Payment Method"),React.createElement(ba,null,"Are you sure you want to delete this payment method? This action cannot be undone.")),React.createElement("div",{className:"flex justify-end space-x-2 pt-4"},React.createElement(wt,{variant:"outline",onClick:()=>p(!1)},"Cancel"),React.createElement(wt,{variant:"destructive",onClick:async()=>{if(v)try{l(!0),await async function(e,t,n){const r=await fetch(`${t}/billing/payment-methods/${e}`,{method:"DELETE",headers:{"x-api-key":n,"Content-Type":"application/json"},body:JSON.stringify({})});if(!r.ok)throw new Error("Failed to delete payment method");return await r.json()}(v,a,i),x.refresh()}catch(e){console.error("Error deleting payment method:",e)}finally{l(!1),p(!1),y(null)}},disabled:s},s&&React.createElement(ca,{className:"mr-2 h-4 w-4 animate-spin"}),"Delete")))))}async function Zl(e,t,n){try{const r=await fetch(`${t}/billing/customers/${e}`,{headers:{"x-api-key":n,"Content-Type":"application/json"},cache:"no-store"});if(!r.ok)throw new Error("Failed to fetch customer data");return(await r.json()).customer}catch(e){return console.error("Error fetching customer data:",e),null}}async function Jl(e,t,n){try{const r=await fetch(`${t}/billing/prices?project_id=${e}`,{headers:{"x-api-key":n,"Content-Type":"application/json"},cache:"no-store"});if(!r.ok)throw new Error("Failed to fetch pricing data");return await r.json()}catch(e){return console.error("Error fetching pricing data:",e),null}}async function Ql(e,t,n){try{const r=await fetch(`${t}/billing/payment-methods?user_id=${e}`,{headers:{"x-api-key":n,"Content-Type":"application/json"},cache:"no-store"});if(!r.ok)throw new Error("Failed to fetch payment methods");return await r.json()}catch(e){return console.error("Error fetching payment methods:",e),null}}exports.Billing=async function({userId:e,apiUrl:t=process.env.NEXT_PUBLIC_API_URL||"http://localhost:3001",apiKey:n=process.env.API_KEY||"",projectId:r=process.env.NEXT_PUBLIC_API_PROJECT||""}){if(!e)return console.error("Billing component: userId is required"),React.createElement("div",null,"Error: User ID is required");let o=null,a=null,i=null;try{const[s,l,c]=await Promise.all([Zl(e,t,n),Jl(r,t,n),Ql(e,t,n)]);o=s,a=l,i=s?.payment_methods?{paymentMethods:s.payment_methods}:c}catch(e){return console.error("Error fetching billing data:",e),React.createElement("div",{className:"p-6 text-center"},React.createElement("p",{className:"text-red-600"},"Failed to load billing information. Please try again later."))}return React.createElement(Xl,{customerData:o,pricingData:a,paymentMethods:i,apiUrl:t,apiKey:n})},exports.BillingClient=Xl;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|