your-ai-workflow-firebase-os 1.14.38 → 1.14.39

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.
@@ -0,0 +1,12 @@
1
+ const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./verifiedAccount-BqmmFNkc.cjs`),n=require(`./lucide-react-NE2zYbRL.cjs`),r=require(`./address-COc6hg_p.cjs`);let i=require(`react`);i=e.a(i,1);let a=require(`react/jsx-runtime`),o=require(`firebase/app`),s=require(`firebase/auth`),c=require(`firebase/firestore`),l=require(`firebase/storage`),u=require(`react-router-dom`),d=require(`react-dom`);var f=e.r({contactFormConfig:()=>p}),p={systemName:`contact`,formType:`public`,redirectTo:`/`,title:`Get in Touch`,buttonName:`Contact Us`,submitText:`Send Message`,fields:[{name:`name`,type:`text`,label:`Full Name`,placeholder:`John Doe`,required:!0},{name:`email`,type:`email`,label:`Email Address`,placeholder:`john@example.com`,required:!0},{name:`phone`,type:`tel`,label:`Phone Number`,placeholder:`+1 (555) 000-0000`,required:!1},{name:`questions`,type:`textarea`,label:`Your Questions`,placeholder:`How can we help you?`,required:!0}]},m=e.r({supportFormConfig:()=>h}),h={systemName:`support`,formType:`private`,redirectTo:`/dashboard`,title:`Request Assistance`,buttonName:`Get Assistance`,submitText:`Submit Request`,fields:[{name:`topic`,type:`text`,label:`Topic`,placeholder:`E.g. Password reset issue`,required:!0},{name:`contactEmail`,type:`email`,label:`Contact Email`,placeholder:`your@email.com`,required:!0},{name:`description`,type:`textarea`,label:`Description`,placeholder:`Please describe your issue in detail...`,required:!0}]},g={appName:`Your AI Firebase`,defaultTheme:`light`,showThemeToggle:!0,logoUrl:`https://firebasestorage.googleapis.com/v0/b/fir-os-47863.firebasestorage.app/o/pub_files%2F1776321238933_favicon_smaller.png?alt=media&token=efecb55c-2456-4cbe-a20a-b86db54a1e55`,faviconUrl:`https://firebasestorage.googleapis.com/v0/b/fir-os-47863.firebasestorage.app/o/pub_files%2F1776321238933_favicon_smaller.png?alt=media&token=efecb55c-2456-4cbe-a20a-b86db54a1e55`,colors:{dark:{background:`#07070f`,backgroundSecondary:`#0a0a18`,foreground:`#f0eeff`,accent:`#a78bfa`,buttonText:`#ffffff`},light:{background:`#fcfaff`,backgroundSecondary:`#f7f3ff`,foreground:`#1e1b4b`,accent:`#7c3aed`,buttonText:`#ffffff`}},cornerRounding:`default`,cornerRadii:{buttonRadius:.75,inputRadius:.75,cardRadius:1.5,modalRadius:2.5}},_=(0,i.createContext)({});function v({config:e,children:t}){return(0,a.jsx)(_.Provider,{value:e,children:t})}var y=()=>(0,i.useContext)(_),b=`1.14.39`,x=typeof window<`u`?i.useLayoutEffect:i.useEffect,S=(0,i.createContext)(void 0),C=e=>{let t=e?.defaultTheme;return t!==`light`&&t!==`dark`||e?.showThemeToggle?null:t};function w({children:e,scopeSelector:t}){let n=y(),r=(0,i.useMemo)(()=>n?.themeConfig||g,[n?.themeConfig]),o=C(r),s=!!r.showThemeToggle;(0,i.useEffect)(()=>{try{localStorage.removeItem(`theme_config_cache`),localStorage.removeItem(`theme_saved_cache`)}catch{}console.info(`Your AI Firebase ${b} · colours from theme.config.ts`)},[]);let[c,l]=(0,i.useState)(()=>{if(o)return o;if(typeof window>`u`)return r.defaultTheme||`system`;let e=localStorage.getItem(`theme-mode`),t=localStorage.getItem(`last-seen-default-theme`);return r.defaultTheme&&r.defaultTheme!==t?(localStorage.setItem(`last-seen-default-theme`,r.defaultTheme),localStorage.removeItem(`theme-mode`),r.defaultTheme):e||r.defaultTheme||`system`}),[u,d]=(0,i.useState)(()=>{if(o)return o;if(typeof window>`u`)return r.defaultTheme===`light`?`light`:`dark`;let e=localStorage.getItem(`theme-mode`),t=localStorage.getItem(`last-seen-default-theme`),n=e||r.defaultTheme||`system`;return r.defaultTheme&&r.defaultTheme!==t&&(n=r.defaultTheme),n===`system`?window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`:n});return(0,i.useEffect)(()=>{let e=r.defaultTheme;e&&(o&&l(o),e!==localStorage.getItem(`last-seen-default-theme`)&&(localStorage.setItem(`last-seen-default-theme`,e),localStorage.removeItem(`theme-mode`),l(e)))},[r.defaultTheme,o]),(0,i.useEffect)(()=>{let e=e=>{c===`system`&&d(e.matches?`light`:`dark`)},t=window.matchMedia(`(prefers-color-scheme: light)`);return c===`system`?(d(t.matches?`light`:`dark`),t.addEventListener(`change`,e)):d(c),()=>t.removeEventListener(`change`,e)},[c]),x(()=>{let e=(t?document.querySelector(t):document.documentElement)||document.documentElement,n=u===`dark`?r.colors.dark:r.colors.light;e.style.setProperty(`--bg-color`,n.background),e.style.setProperty(`--bg-secondary-color`,n.backgroundSecondary||n.background),e.style.setProperty(`--fg-color`,n.foreground),e.style.setProperty(`--accent-color`,n.accent);let i=u===`dark`;e.style.setProperty(`--panel-bg`,n.panelBg||`color-mix(in srgb, ${n.accent} ${i?`5%`:`4%`}, transparent)`),e.style.setProperty(`--panel-border`,n.panelBorder||`color-mix(in srgb, ${n.accent} 15%, transparent)`);let a=(e,t,n)=>{if(!e||e.length===0)return t||`transparent`;if(e.length===1)return e[0];let r=e.map((t,n)=>`${t} ${Math.round(n/(e.length-1)*100)}%`).join(`, `);return n===`conic`?`conic-gradient(from 180deg at 50% 100%, ${r})`:`linear-gradient(135deg, ${r})`},o=`linear-gradient(135deg, color-mix(in oklab, ${n.accent} ${i?`70%`:`78%`}, black) 0%, ${n.accent} 100%)`,s=`linear-gradient(135deg, color-mix(in oklab, ${n.accent} ${i?`80%`:`85%`}, black) 0%, color-mix(in oklab, ${n.accent} 72%, white) 100%)`;e.style.setProperty(`--button-bg`,a(n.buttonGradient,o,n.buttonGradientShape)),e.style.setProperty(`--button-fg`,n.buttonText||`#ffffff`),e.style.setProperty(`--button-hover-bg`,a(n.buttonHoverGradient||n.buttonGradient,s,n.buttonGradientShape)),e.style.setProperty(`--text-gradient`,a(n.textGradient,`linear-gradient(135deg, ${n.foreground} 0%, ${n.accent} 100%)`)),e.style.setProperty(`--glow-color`,n.glowColor||`color-mix(in srgb, ${n.accent} ${i?`40%`:`30%`}, transparent)`),e.style.setProperty(`--notification-icon-color`,n.notificationIconColor||n.accent);let l=n.secondaryButton?.bg||(u===`dark`?`rgba(255, 255, 255, 0.05)`:`rgba(0, 0, 0, 0.03)`),d=n.secondaryButton?.border||(u===`dark`?`rgba(255, 255, 255, 0.1)`:`rgba(0, 0, 0, 0.06)`),f=n.secondaryButton?.text||n.foreground;if(e.style.setProperty(`--btn-sec-bg`,l),e.style.setProperty(`--btn-sec-border`,d),e.style.setProperty(`--btn-sec-text`,f),e.style.setProperty(`--selection-bg`,n.selectionBg||`color-mix(in srgb, var(--accent-color) 40%, transparent)`),e.style.setProperty(`--selection-text`,n.selectionText||`#ffffff`),e.setAttribute(`data-theme`,u),localStorage.setItem(`theme-mode`,c),r.cornerRounding===`custom`&&r.cornerRadii?(e.style.setProperty(`--btn-radius`,`${parseFloat(String(r.cornerRadii.buttonRadius))||0}rem`),e.style.setProperty(`--card-radius`,`${parseFloat(String(r.cornerRadii.cardRadius))||0}rem`),e.style.setProperty(`--input-radius`,`${parseFloat(String(r.cornerRadii.inputRadius))||0}rem`),e.style.setProperty(`--modal-radius`,`${parseFloat(String(r.cornerRadii.modalRadius))||0}rem`)):(e.style.setProperty(`--btn-radius`,`0.75rem`),e.style.setProperty(`--card-radius`,`1.5rem`),e.style.setProperty(`--input-radius`,`0.75rem`),e.style.setProperty(`--modal-radius`,`1.5rem`)),!document.getElementById(`inter-font`)){let e=document.createElement(`link`);e.id=`inter-font`,e.rel=`stylesheet`,e.href=`https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap`,document.head.appendChild(e)}e.style.fontSize=`16px`,e.style.setProperty(`--weight-h1`,`800`),e.style.setProperty(`--weight-h2`,`700`),e.style.setProperty(`--weight-h3`,`700`),e.style.setProperty(`--leading-normal`,`1.5`);let p=document.querySelector(`link[rel*='icon']`);p||(p=document.createElement(`link`),p.rel=`icon`,document.head.appendChild(p)),r.faviconUrl&&(p.href=r.faviconUrl),r.appName&&(document.title=r.appName)},[u,c,r]),(0,a.jsx)(S.Provider,{value:{theme:u,setTheme:e=>{o||l(e)},toggleTheme:()=>{o||l(u===`light`?`dark`:`light`)},isSystem:c===`system`,setIsSystem:e=>{o||l(e?`system`:u)},config:r,activeConfig:r,canSwitchTheme:s},children:e})}var T=()=>{let e=(0,i.useContext)(S);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e},E=null,D=null,O=null,k=null,ee=null;function te(e){let t=e.projectId||``;if((0,o.getApps)().length&&ee===t){E=(0,o.getApp)(),D=(0,s.getAuth)(E);try{O=(0,c.initializeFirestore)(E,{localCache:(0,c.persistentLocalCache)({tabManager:(0,c.persistentMultipleTabManager)()})})}catch{O=(0,c.getFirestore)(E)}k=(0,l.getStorage)(E);return}if((0,o.getApps)().length&&ee!==t)try{(0,o.deleteApp)((0,o.getApp)())}catch{}E=(0,o.initializeApp)(e),ee=t,D=(0,s.getAuth)(E);try{O=(0,c.initializeFirestore)(E,{localCache:(0,c.persistentLocalCache)({tabManager:(0,c.persistentMultipleTabManager)()})})}catch{O=(0,c.getFirestore)(E)}k=(0,l.getStorage)(E)}function A(e){try{return{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_ADMIN_EMAILS:void 0,VITE_FIREBASE_API_KEY:void 0,VITE_FIREBASE_APP_ID:void 0,VITE_FIREBASE_AUTH_DOMAIN:void 0,VITE_FIREBASE_MESSAGING_SENDER_ID:void 0,VITE_FIREBASE_PROJECT_ID:void 0,VITE_FIREBASE_STORAGE_BUCKET:void 0}?.[e]||``}catch{return``}}var j=[`VITE_FIREBASE_API_KEY`,`VITE_FIREBASE_AUTH_DOMAIN`,`VITE_FIREBASE_PROJECT_ID`,`VITE_FIREBASE_STORAGE_BUCKET`,`VITE_FIREBASE_MESSAGING_SENDER_ID`,`VITE_FIREBASE_APP_ID`],ne={VITE_FIREBASE_API_KEY:`apiKey`,VITE_FIREBASE_AUTH_DOMAIN:`authDomain`,VITE_FIREBASE_PROJECT_ID:`projectId`,VITE_FIREBASE_STORAGE_BUCKET:`storageBucket`,VITE_FIREBASE_MESSAGING_SENDER_ID:`messagingSenderId`,VITE_FIREBASE_APP_ID:`appId`};function re(){let e={};for(let t of j){let n=A(t);if(!n)return null;e[ne[t]]=n}return e}var M=re();M&&!(0,o.getApps)().length&&te(M);var N=new Map;function P(e,t,n,r){let i=N.get(e);if(!i){let n={subscribers:new Set,stop:()=>{},last:null,refused:void 0};N.set(e,n),n.stop=(0,c.onSnapshot)(t(),e=>{n.last=e,n.refused=void 0,n.subscribers.forEach(t=>F(()=>t.next(e)))},e=>{n.refused=e,n.subscribers.forEach(t=>F(()=>t.fail(e)))}),i=n}let a={next:n,fail:r};return i.subscribers.add(a),i.last?F(()=>n(i.last)):i.refused!==void 0&&F(()=>r(i.refused)),()=>{let t=N.get(e);!t||!t.subscribers.delete(a)||t.subscribers.size===0&&(t.stop(),N.delete(e))}}function F(e){try{e()}catch(e){console.error(`A screen could not take a shared Firestore answer`,e)}}var ie=[`user`,`internal`,`admin`],I=e=>ie.includes(e),L={user:`Members`,internal:`Your team`,admin:`Admins`},ae={user:`user-round`,internal:`users`,admin:`shield`},oe=`id-card`,R=[],z={},se={},ce=e=>{R=e},le=()=>R,ue=e=>{z=e},de=e=>{se=e},fe=e=>I(e)&&String(se[e]||``).trim()||``,pe=e=>I(e)&&String(z[e]||``).trim()||``,me=(e,t=le())=>t.find(t=>t.id===e)?.name||pe(e)||(I(e)?L[e]:``)||e,he=(e=le())=>[...ie.map(t=>({id:t,name:me(t,e)})),...e.map(e=>({id:e.id,name:e.name}))],ge=`sys_payments`,_e=`_settings`,ve=()=>({on:!1,amount:``,priceId:``,livePriceId:``}),ye=()=>({name:``,description:``,monthly:{...ve(),on:!0},yearly:ve(),roleId:``}),be=()=>({name:``,amount:``}),xe=e=>({id:e,name:``,description:``,kind:``,amount:``,items:[],plans:[],how:``,emailReceipt:!0,notifyOwner:!0,pageIds:[],customNote:``,customPath:``,createdAt:Date.now()}),Se=e=>e.kind===`once`?e.items.length?e.items:e.name.trim()||e.amount.trim()?[{name:e.name,amount:e.amount}]:[]:[],Ce=e=>{let t=Number(String(e||``).trim().replace(/[^0-9.]/g,``));return Number.isFinite(t)&&t>0?t:null},we=e=>({on:!!e?.on,amount:String(e?.amount||``),priceId:String(e?.priceId||``),livePriceId:String(e?.livePriceId||``)}),Te=e=>/^(no|none|nothing|n\/?a|nothing needed|nothing else|-)[.!]*$/i.test(e.trim()),Ee=e=>/[.!?]$/.test(e)?e:`${e}.`,De=e=>{let t=[],n=String(e?.how||``),r=String(e?.collect||``).trim();r&&!Te(r)&&t.push(`Before paying, the buyer tells me: ${Ee(r)}`);let i=String(e?.after||``).trim();if(i&&t.push(`After they pay: ${Ee(i)}`),Array.isArray(e?.plans))for(let n of e.plans){let e=String(n?.name||``).trim()||`The plan`,r=String(n?.features||``).trim(),i=String(n?.sees||``).trim();r&&t.push(`${e} unlocks: ${Ee(r)}`),i&&t.push(`Someone on ${e} sees: ${Ee(i)}`)}return t.length?[...n.trim()?[Ee(n.trim())]:[],...t].join(` `):n},Oe=(e,n)=>{let r=n?.kind===`once`||n?.kind===`subscription`?n.kind:``,i=Array.isArray(n?.items)?n.items.map(e=>({name:String(e?.name||``),amount:String(e?.amount||``)})):[],a=String(n?.name||``),o=String(n?.amount||``);return r===`once`&&!i.length&&(a.trim()||o.trim())&&(i=[{name:a,amount:o}],a=``,o=``),{id:e,name:a,description:String(n?.description||``),kind:r,amount:o,items:i,plans:Array.isArray(n?.plans)?n.plans.map(e=>({name:String(e?.name||``),description:String(e?.description||``),monthly:we(e?.monthly),yearly:we(e?.yearly),roleId:t.h(e?.roleId)?String(e.roleId):``})):[],how:De(n),emailReceipt:n?.emailReceipt!==!1,notifyOwner:n?.notifyOwner!==!1,pageIds:Array.isArray(n?.pageIds)?n.pageIds.map(e=>String(e||``)).filter(Boolean):[],customNote:String(n?.customNote||``),customPath:String(n?.customPath||``),createdAt:typeof n?.createdAt==`number`?n.createdAt:void 0}},ke=e=>/^price_[A-Za-z0-9]+$/.test(e.trim()),Ae=(e,t=ct())=>t?e.livePriceId:e.priceId;function je(e,t=ct()){if(!e.kind)return`Say how it is paid — once, or a subscription.`;if(e.kind===`once`){let t=Se(e);if(!t.length)return`Add something to sell — a name and a price.`;for(let e of t){let t=e.name.trim();if(Ce(e.amount)===null)return`Give ${t||`it`} a price — just a number, like 25.`;if(!t)return`Give it a name, the way a buyer should read it.`}return``}if(!e.plans.length)return`Add at least one plan.`;for(let n of e.plans){let e=n.name.trim()||`each plan`;if(!n.name.trim())return`Give each plan a name.`;if(!n.monthly.on&&!n.yearly.on)return`Turn on monthly or yearly for ${e}.`;for(let[r,i]of[[`monthly`,n.monthly],[`yearly`,n.yearly]])if(i.on){if(Ce(i.amount)===null)return`Give ${e} its ${r} price — just a number.`;if(!ke(Ae(i,t)))return t?`Paste the live ${r} price id for ${e} — live mode is a fresh Stripe catalogue, so the price is made again there. Your test id is kept.`:`Paste the ${r} price id for ${e} — the steps above say where it comes from in Stripe.`}}return``}var Me=(e,t=ct())=>je(e,t)===``,Ne=e=>e.kind===`subscription`&&e.plans.length>0&&e.plans.every(e=>e.name.trim()!==``&&(e.monthly.on||e.yearly.on)&&(!e.monthly.on||Ce(e.monthly.amount)!==null)&&(!e.yearly.on||Ce(e.yearly.amount)!==null));function Pe(e){let t=e.name.trim();if(t)return t;let n=Se(e).map(e=>e.name.trim()).filter(Boolean);if(n.length===1)return n[0];if(n.length>1){let e=n.slice(0,3),t=n.length>3?`more`:e.pop();return`${e.join(`, `)} and ${t}`}return`this product`}function Fe(e){let t=e.name.trim();if(!e.kind)return t?`${t} — say how it is paid`:`A new product — say how it is paid`;if(e.kind===`once`){let n=Se(e);if(n.length<=1){let e=n[0],r=e?.name.trim()||t,i=e?.amount.trim();return`${r||`A new product`}${i?` — ${i}, paid once`:` — paid once`}`}return`${t||n.map(e=>e.name.trim()).filter(Boolean).slice(0,3).join(`, `)||`A new product`} — ${n.length} things, paid once`}let n=e.plans.length;return`${t||`A new subscription`} — a subscription${n?`, ${n} plan${n===1?``:`s`}`:``}`}function Ie(e,t,n=ct()){let r=e.name.trim(),i=`${t.name.trim()||`this plan`}${r?` — ${r}`:``}`,a=t.description.trim(),o=t.monthly.on&&t.yearly.on,s=t.monthly.on?t.monthly:t.yearly,c=t.monthly.on?`Monthly`:`Yearly`,l=[n?`In your Stripe dashboard, switch Test mode OFF — live mode is its own catalogue, so the plan is made once more there. Then open Product catalogue and click Add product.`:`In your Stripe dashboard, open Product catalogue and click Add product.`,`Name it "${i}"${a?` and paste your one-liner into the Description box: "${a}"`:``}.`,`On the same form, choose Recurring, type ${s.amount.trim()||`…`} as the amount, set the billing period to ${c}, and click Add product to save.`,o?`Click the product you just made, then click its ${c.toLowerCase()} price. The price id — it starts with price_ — sits in the top right corner: copy it and paste it into the ${c.toLowerCase()} box below.`:`Click the product you just made, then click the price inside it. The price id — it starts with price_ — sits in the top right corner: copy it and paste it into the box below.`];return o&&l.push(`Go back to the product. In its Pricing section click + to add a second price: Recurring, ${t.yearly.amount.trim()||`…`} as the amount, billing period Yearly — save it.`,`Click that yearly price, copy its id from the top right corner, and paste it into the yearly box below.`),l}var Le=e=>e.includes(`'`)?`"${e}"`:`'${e}'`,Re=`Every payment goes through the app's own <PayButton> — never build a checkout, a card form or Stripe code of your own. The button's words, colour and place on the page are yours to design.`,ze=(e,t=ct())=>{let n=e.name.trim()||`this product`,r=e.description.trim();if(e.kind===`once`){let t=Se(e),r=e=>`<PayButton amount={${Ce(e.amount)??0}} productName=${Le(e.name.trim())}>`;if(t.length<=1){let i=t[0]||{name:e.name,amount:e.amount};return[`It sells ${i.name.trim()||n} for ${i.amount.trim()}, paid once: ${r(i)}.`]}let i=e.name.trim();return[`It sells ${t.length} things${i?` under ${i}`:``}, each paid once with its own button:`,...t.map(e=>`${e.name.trim()||`Something`} for ${e.amount.trim()}: ${r(e)}.`)]}let i=[`It sells ${n}${r?` (${r})`:``} as a subscription. Lay its plans out as one pricing section — each plan is bought with its own button, and where a plan has monthly and yearly, offer a monthly/yearly switch:`];for(let n of e.plans){let e=n.name.trim()||`Plan`,r=n.description.trim(),a=[];n.monthly.on&&a.push(`${n.monthly.amount.trim()} per month: <PayButton priceId='${Ae(n.monthly,t).trim()}' mode='subscription'>`),n.yearly.on&&a.push(`${n.yearly.amount.trim()} per year: <PayButton priceId='${Ae(n.yearly,t).trim()}' mode='subscription'>`);let o=n.roleId?` Buying it makes the buyer my ${me(n.roleId)} role — userRole '${n.roleId}'.`:``;i.push(`${e}${r?` (${r})`:``} — ${a.join(`; `)}.${o}`)}return i},Be=`If my words ask the buyer for anything before paying — a phone number, a note, what they need — ask it with a form made the app's way: a *Form.config.ts whose fields are properly typed (tel for a phone number, email, date), shown with <ContactPopup formId='…' isInline onSubmitted={…} /> — never inputs you build by hand. onSubmitted hands you the answers as strings: put each one into the button's metadata as a plain string, and they read beside the order on my Payments screen. If my words ask for nothing, put no form in front of the button. Never ask for their email (Stripe collects it at checkout) and never build a backend of your own for this.`,Ve=`Show and hide what a plan unlocks with the app's own useMyPayments() — it returns { loading, active, subscriptions, payments } — and that is presentation, not protection: anything genuinely paid, like a file or a secret, must come from the server.`,He=`A plan's role is given the moment the buyer pays and taken back when the subscription ends — the app does both itself, so build neither. What that plan unlocks is what its role opens: a page kept for the role, and anything a page shows to it — read const { userRole } = useAuth() from 'your-ai-workflow-firebase-os' and compare it with the role's word above. Gate that by the role, never with useMyPayments().`;function Ue(e,t=``,n=ct()){let r=[...ze(e,n)],i=e.how.trim();return i&&r.push(`Here is how this payment should work, start to finish: ${i}`),r.push(Be),e.kind===`subscription`&&(e.plans.some(e=>e.roleId)&&r.push(He),e.plans.some(e=>!e.roleId)&&r.push(Ve)),r.push(...We(t,e)),r}function We(e,t){let n=[`Set each button's successPath to ${e||`the page the button is on`} so the buyer lands back where they paid and finds what my words say happens after.`],r=[];return t.emailReceipt&&r.push(`emailReceipt: 'yes'`),t.notifyOwner&&r.push(`notifyOwner: 'yes'`),r.length&&n.push(`Put ${r.join(` and `)} in the button's metadata — the app then sends ${r.length===2?`those emails`:`that email`} on its own.`),n}var Ge=e=>e===`internal`||e===`admin`,Ke=e=>Array.isArray(e?.links)?e.links.map(e=>({pageId:String(e?.pageId||``),how:String(e?.how||``)})):[],qe=(e,t)=>t.find(t=>t.id===e)||t.find(t=>String(t.config?.contentKey||``).trim()===e),Je=(e,t)=>e===t.id||e===String(t.config?.contentKey||``).trim();function Ye(e){return e.how.trim()?``:`Describe how this payment will work.`}var Xe=(e,t)=>e.pageIds.some(e=>Je(e,t)),Ze=(e,t)=>Xe(e,t)?e.pageIds.filter(e=>!Je(e,t)):[...e.pageIds,t.id],Qe=`What people paid is mine and my admins' alone: the app refuses everybody else the sales outright, so never call useSales() on this page and never put an amount on it. Show what an admin's own page has recorded about a sale — the name, what they bought, when — and if what I asked for cannot be built without the amounts, say so plainly in your reply: the page has to be kept for Admins for that. This page never sells — no <PayButton> on it.`,$e="Read the sales on it with the app's own useSales() from 'your-ai-workflow-firebase-os' — it returns { loading, charges, subscriptions, error } live from my Stripe account: who paid, for what, when, and each subscription's current status. Show `error` when it is set. Design the list however fits; never write Stripe code, a backend or an export of your own for it. This page never sells — no <PayButton> on it.",et=e=>`/payments?new=subscription&page=${encodeURIComponent(e)}`,tt=(e,t)=>`/payments?open=${encodeURIComponent(e)}&page=${encodeURIComponent(t)}`,nt=(e,t)=>`/pages/${encodeURIComponent(e)}?addPayment=${encodeURIComponent(t)}`,rt=[],it=!1,at=e=>{rt=e},ot=()=>rt,st=e=>{it=e},ct=()=>it;function lt(e){let t=[];for(let n of e)if(n.kind===`subscription`)for(let e of n.plans)for(let[r,i]of[[`monthly`,e.monthly],[`yearly`,e.yearly]]){if(!i.on)continue;let a=i.priceId.trim(),o=i.livePriceId.trim();ke(o)&&ke(a)&&a!==o&&t.push({product:n.name.trim()||`a subscription`,plan:e.name.trim()||`its plan`,word:r,from:a,to:o})}return t}function ut(e=ot()){let t=lt(e),n=[`My Stripe account has switched from test mode to live mode. I have already replaced the keys in Secrets — do not touch any keys or write any Stripe code of your own.`];return t.length?n.push(`In my pages, every <PayButton> with a priceId still carries a test price id. Swap each one for its live id and change nothing else about the button:`,...t.map(e=>`For ${e.product}, ${e.plan} (${e.word}): replace '${e.from}' with '${e.to}'.`),`Buttons that use amount={…} instead of a priceId need no change.`):n.push(`No price id in my pages needs to change — buttons that use amount={…} never had one.`),n.push(`Then rebuild the app so it runs with the live keys and ids.`),n.join(`
2
+ `)}var dt=`admin_keys`,ft=`plans`,pt=()=>({planUntil:(0,c.deleteField)(),planPass:(0,c.deleteField)()}),mt=e=>typeof e?.planUntil==`number`&&e.planUntil>0?e.planUntil:0,ht=e=>mt(e)>0,gt=e=>mt(e);function _t(e){if(!e)return!1;if(ht(e))return!0;let t=e.role;return t==null||t===`user`||t===`free`}function vt(e,t=Date.now()){let n=e?.role?String(e.role):`user`,r=mt(e);return r&&t>=r?`user`:n}function yt(e,n){if(!_t(e))return null;let r=String(n?.role||``);return r?!t.h(r)||typeof n?.until!=`number`||typeof n?.pass!=`string`||e.role===r&&e.planUntil===n.until?null:{role:r,planUntil:n.until,planPass:n.pass}:ht(e)?{role:`user`,...pt()}:null}async function bt(e,n){try{let r=D?.currentUser;if(!r||r.uid!==e||!t.t(r)||typeof fetch!=`function`)return;let i=(0,c.doc)(O,`user_profiles`,e),a=n??(await(0,c.getDoc)(i)).data();if(!_t(a))return;let o=await r.getIdToken(),s=await fetch(`/api/payments/plan-role`,{headers:{Authorization:`Bearer ${o}`}});if(!s.ok)return;let l=yt(a,await s.json());l&&await(0,c.updateDoc)(i,l)}catch{}}function xt(e){(0,i.useEffect)(()=>{let e=!1;return(async()=>{let t=D?.currentUser;if(!t||typeof fetch!=`function`)return;let n=await fetch(`/api/payments/plan-key`,{headers:{Authorization:`Bearer ${await t.getIdToken()}`}});if(!n.ok||e)return;let r=String((await n.json())?.key||``);if(!r)return;let i=(0,c.doc)(O,dt,ft),a=await(0,c.getDoc)(i);!e&&a.data()?.key!==r&&await(0,c.setDoc)(i,{key:r})})().catch(()=>{}),()=>{e=!0}},[e])}function St(e){let t={};for(let n of e)if(n.kind===`subscription`)for(let e of n.plans){if(!e.roleId)continue;let r=e.name.trim()||n.name.trim()||`A plan`,i=t[e.roleId]||=[];i.includes(r)||i.push(r)}return t}function Ct(){let[e,t]=(0,i.useState)({});return(0,i.useEffect)(()=>P(ge,()=>(0,c.collection)(O,ge),e=>{let n=[];e.forEach(e=>{e.id!==`_settings`&&n.push(Oe(e.id,e.data()))}),t(St(n))},()=>{}),[]),e}var wt=e=>`fbos_verify_sent_${e}`,Tt=e=>{if(!e)return!1;try{return localStorage.getItem(wt(e))===`1`}catch{return!1}},Et=e=>{if(e)try{localStorage.setItem(wt(e),`1`)}catch{}},Dt=e=>{if(e)try{localStorage.removeItem(wt(e))}catch{}};async function Ot(e){if(!e?.uid||!e.email)return`failed`;if(Tt(e.uid))return`already`;try{return await(0,s.sendEmailVerification)(e),Et(e.uid),`sent`}catch{return`failed`}}var kt={collection:`sys_configs`,doc:`auth_methods`},At=[`Open console.firebase.google.com and pick your project.`,`In the menu on the left open Authentication, then the Sign-in method tab.`],jt=`https://console.firebase.google.com/`;function Mt(){try{let e=D;return String(e?.app?.options?.authDomain||e?.config?.authDomain||``)}catch{return``}}var Nt=e=>e?`https://${e}/__/auth/handler`:``,Pt=()=>{try{let e=typeof window<`u`?String(window.location?.origin||``):``;return/^https?:\/\//.test(e)?e:``}catch{return``}},Ft=`This is where your app is running right now. When you publish it to your own domain, come back and change this to that address.`,It=`Open the Settings tab, find SMS region policy, and allow every country your people might be signing in from — not only your own. A country left off gets no text at all, and the person waiting for the code is told nothing.`,Lt=[{id:`password`,label:`Email and password`,description:`A password they choose when they register.`,inSentence:`a password`,kind:`signIn`,defaultOn:!0,needsSetup:!1,providerId:`password`,steps:[`Click Email/Password and switch it on.`]},{id:`emailLink`,label:`Email link, no password`,description:`You email them a link. Nothing to remember, nothing to reset.`,inSentence:`an emailed link`,kind:`signIn`,defaultOn:!1,needsSetup:!0,button:`Email me a link`,providerId:`emailLink`,setupTitle:`Set up passwordless sign-in`,steps:[`Click Email/Password, switch on Email link (passwordless sign-in), and save.`]},{id:`google`,label:`Google`,description:`One tap with a Google account.`,inSentence:`Google`,kind:`signIn`,defaultOn:!0,needsSetup:!1,button:`Continue with Google`,providerId:`google.com`,steps:[`Click Add new provider, choose Google, and follow the steps.`]},{id:`phone`,label:`Phone number`,description:`A code by text, and no email at all.`,inSentence:`a phone number`,kind:`signIn`,defaultOn:!1,needsSetup:!0,button:`Continue with a phone number`,providerId:`phone`,steps:[`Click Add new provider, choose Phone, and enable it.`,It,`While you are on the Phone provider, open "Phone numbers for testing" and add one: a number and a six-digit code you make up. Signing in with that pair never sends a text, so you can try the whole thing on your own, as often as you like, for nothing.`]},{id:`github`,label:`GitHub`,description:`A GitHub account — for an app your developers use.`,inSentence:`GitHub`,kind:`signIn`,defaultOn:!1,needsSetup:!0,button:`Continue with GitHub`,providerId:`github.com`,steps:[`Click Add new provider, choose GitHub, and paste in the two things below.`],setup:{where:`GitHub`,url:`https://github.com/settings/developers`,asksFor:[`Client ID`,`Client secret`],steps:[{text:`Sign in at github.com and open Settings → Developer settings → OAuth Apps, then click New OAuth App.`},{text:`Give it a name your people will recognise — it is what they see when GitHub asks them to allow it — and put your own app's address in Homepage URL.`,copy:{label:`Homepage URL`,address:`home`,note:Ft}},{text:`Paste the address below into Redirect URI, then click Register application.`,copy:{label:`Redirect URI`,address:`callback`,note:`Some GitHub screens call this same box Authorization callback URL.`}},{text:`Copy the Client ID off the page that comes back, then click Generate a new client secret and copy that too. GitHub shows a secret once.`},{text:`Back in Firebase, paste the Client ID and the Client secret into the GitHub panel and click Save.`}]}},{id:`twitter`,label:`X`,description:`An X account, the one that used to be called Twitter.`,inSentence:`X`,kind:`signIn`,defaultOn:!1,needsSetup:!0,button:`Continue with X`,providerId:`twitter.com`,steps:[`Click Add new provider and choose Twitter. Firebase still lists X under its old name, with the old blue bird beside it — that is the right one.`,`Paste in the two things below. Firebase calls them API key and API secret; X calls the same pair the Consumer Key and Consumer Secret, and the steps say where to find them.`],setup:{where:`the X developer portal`,url:`https://developer.x.com/en/portal/dashboard`,asksFor:[`API key`,`API secret`],steps:[{text:`Sign in at developer.x.com and open the developer portal.`},{text:`Click Create an app, give it a name, leave the project as the default one X offers, and create it.`},{text:`X throws a window of credentials at you the moment the app exists. Close it. None of what is in it is what Firebase wants, and the right pair is the last step here.`},{text:`Click the app's name and find User authentication settings, then click Set up. Leave every setting on that screen as X has set it, apart from the two addresses and the one tick below.`},{text:`Website URL is your own app's address.`,copy:{label:`Website URL`,address:`home`,note:Ft}},{text:`Callback URI / Redirect URL, on the same screen, is this.`,copy:{label:`Callback URI / Redirect URL`,address:`callback`}},{text:`Tick "Request email from users" before you leave that screen. Leave it off and everybody who signs in with X arrives with no email address at all — no way for you to write to them, and a verification screen that has nothing to send to. X asks for a Terms of service and a Privacy policy address before it will let you tick it.`},{text:`Click Save changes. X answers with a Client ID and a Client Secret. Close that one too — still not the pair Firebase is asking for.`},{text:`Back on the app, open Keys and tokens. Under OAuth 1.0, press Regenerate beside Consumer Key — which X also calls the API Key and API Key Secret. Copy both halves while they are on the screen: X shows them once. Leave the access tokens alone while you are on that page: the Generate button under Access Token is for reading X from your own account, and this app never does that.`},{text:`Back in Firebase, paste the Consumer Key into API key and the Consumer Secret into API secret, then click Save.`}],warning:`X hands you a Client ID and a Client Secret twice before it hands you the right pair — once when the app is made, and again when you save the authentication screen. Both of those are X's newer OAuth 2.0 pair, which Firebase does not use: paste them in and the sign-in fails with "invalid credential" the first time somebody presses the button. The pair Firebase wants is the Consumer Key and Consumer Secret, on Keys and tokens, under OAuth 1.0.`}},{id:`sms2fa`,label:`Two-step sign-in`,description:`After the password, a code by text before they are let in.`,inSentence:`a text code`,kind:`security`,defaultOn:!1,needsSetup:!0,steps:[`In the Advanced section below the providers, find SMS Multi-factor Authentication and click Enable.`,It]}],Rt=e=>Lt.find(t=>t.id===e),zt=Lt.filter(e=>e.kind===`signIn`),Bt=e=>e===`internal`||t.h(e);function Vt(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=String(n??``).trim();Bt(e)&&!t.includes(e)&&t.push(e)}return t}var Ht=()=>{let e={};for(let t of Lt)e[t.id]=t.defaultOn;return{on:e,registerAs:{on:!1,roles:[]},twoStepOptional:!1,finishRegistration:{skippable:!0,perRole:!1}}};function Ut(e){let t=Ht(),n=e?.methods&&typeof e.methods==`object`?e.methods:{};for(let e of Lt)typeof n[e.id]==`boolean`&&(t.on[e.id]=n[e.id]);let r=e?.registerAs&&typeof e.registerAs==`object`?e.registerAs:{};t.registerAs={on:r.on===!0,roles:Vt(r.roles)},t.twoStepOptional=e?.twoStepOptional===!0;let i=e?.finishRegistration&&typeof e.finishRegistration==`object`?e.finishRegistration:{};return t.finishRegistration={skippable:i.required!==!0,perRole:i.perRole===!0},t}function Wt(e,t){if(!e.registerAs.on)return[];let n=e.registerAs.roles.includes(`internal`)?[{id:`internal`,name:me(`internal`,t)}]:[],r=e.registerAs.roles.map(e=>t.find(t=>t.id===e)).filter(e=>!!e).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({id:e.id,name:e.name}));return[...n,...r]}var Gt=(e,t,n)=>Wt(e,n).find(e=>e.id===String(t??``))??null;function Kt(e,t){let n=String(t||e).trim()||e;return e===`internal`?n===L.internal?`one of our team`:`one of ${n}`:`${/^[aeiou]/i.test(n)?`an`:`a`} ${n}`}function qt(e){let t=e.map(e=>Kt(e.id,e.name).replace(`one of our team`,`one of your team`));return t.length?`People can register as ${t.length===1?t[0]:`${t.slice(0,-1).join(`, `)} or ${t[t.length-1]}`}.`:``}function Jt(e){let t=zt.filter(t=>e.on[t.id]);return t.length>0?t:zt.filter(e=>e.id===`password`)}var Yt=e=>Jt(e).some(e=>e.id===`password`);function Xt(e){let t=Jt(e).map(e=>e.inSentence);return t.length===1?t[0]:`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`}function Zt(e,t){let n=Rt(t);return!n||n.kind!==`signIn`||zt.filter(n=>n.id!==t&&e.on[n.id]).length>0?``:`Keep at least one way to sign in — switch another one on first, then this one off.`}var Qt=e=>`${Rt(e)?.label??`This way of signing in`} is not switched on in your Firebase project yet. An admin can switch it on there, on the Sign in screen's own instructions.`,$t=null,en=null,tn=null,nn=null;function rn(e){tn=e,$t?.forEach(t=>t(e))}var an=6e3,on=null;function sn(e){on&&=(clearTimeout(on),null),nn=e,rn(e)}function cn(e){let t=!$t;return $t||=new Set,$t.add(e),t?(nn||(on=setTimeout(()=>{on=null,nn||sn(Ht())},an)),en=(0,c.onSnapshot)((0,c.doc)(O,kt.collection,kt.doc),e=>sn(Ut(e.exists()?e.data():null)),()=>{nn||sn(Ht())})):tn&&e(tn),()=>{$t?.delete(e),!$t?.size&&(on&&=(clearTimeout(on),null),en?.(),$t=null,en=null)}}function ln(){let[e,t]=(0,i.useState)(()=>tn?{loading:!1,settings:tn}:{loading:!0,settings:Ht()});(0,i.useEffect)(()=>cn(e=>t({loading:!1,settings:e})),[]);let n=()=>tn??e.settings,r=e=>(0,c.setDoc)((0,c.doc)(O,kt.collection,kt.doc),e,{merge:!0}),a=`That could not be saved — check you are still signed in as an admin, then try again.`,o=async(e,t)=>{if(!t){let t=Zt(n(),e);if(t)return t}let i=n().on[e];rn({...n(),on:{...n().on,[e]:t}});try{return await r({methods:{[e]:t}}),null}catch{let t=n(),r=nn?nn.on[e]:i;return rn({...t,on:{...t.on,[e]:r}}),a}},s=async e=>{let t=n().registerAs,i={on:e.on??t.on,roles:Vt(e.roles??t.roles)};rn({...n(),registerAs:i});try{return await r({registerAs:i}),null}catch{return rn({...n(),registerAs:nn?nn.registerAs:t}),a}},l=async e=>{let t=n().twoStepOptional;rn({...n(),twoStepOptional:e});try{return await r({twoStepOptional:e}),null}catch{return rn({...n(),twoStepOptional:nn?nn.twoStepOptional:t}),a}},u=async e=>{let t=n().finishRegistration,i={skippable:e.skippable??t.skippable,perRole:e.perRole??t.perRole};rn({...n(),finishRegistration:i});try{return await r({finishRegistration:{required:!i.skippable,perRole:i.perRole}}),null}catch{return rn({...n(),finishRegistration:nn?nn.finishRegistration:t}),a}};return{...e.settings,loading:e.loading,set:o,setRegisterAs:s,setTwoStepOptional:l,setFinishRegistration:u}}var un=`fbos_register_as`,dn=[`/register`,`/login`],fn=()=>{try{return typeof window<`u`?window.sessionStorage:null}catch{return null}};function pn(e,t=Date.now()){if(Bt(e))try{fn()?.setItem(un,JSON.stringify({id:e,at:t}))}catch{}}function mn(){try{fn()?.removeItem(un)}catch{}}function hn(e,t=Date.now()){let n=fn();if(!n)return``;let r=null;try{r=n.getItem(un),r!==null&&n.removeItem(un)}catch{return``}if(!r||!dn.includes(String(e||``).replace(/\/+$/,``)||`/`))return``;try{let{id:e,at:n}=JSON.parse(r);return typeof n!=`number`||t-n>36e5||t<n?``:Bt(e)?String(e):``}catch{return``}}function gn(e,t,n=Date.now()){if(!t||!Bt(t)||e?.removed===!0)return null;let r=e?.role;return r&&r!==`user`&&r!==`free`||e?.requestedRole===t?null:{requestedRole:t,requestedRoleAt:new Date(n).toISOString()}}var _n=()=>({requestedRole:(0,c.deleteField)(),requestedRoleAt:(0,c.deleteField)()});function vn(e){let t=e?.requestedRole;return Bt(t)?{role:String(t),at:typeof e?.requestedRoleAt==`string`?e.requestedRoleAt:``}:null}var yn=(e,t)=>`Register as ${Kt(e,t)}`,bn=(e,t)=>`Asked to be ${Kt(e,t)}`,xn=`Your registration goes to an admin for approval. Until then everything works as usual.`,Sn=`Your registration is pending approval`,Cn=`We'll let you know as soon as it's approved. Everything else works as usual.`,wn=()=>({title:`Your registration has been approved`,body:`Everything that was waiting on it is open to you now.`,link:`/dashboard`}),Tn=()=>({title:`Your registration was not approved`,body:`You still have your account, and everything works as usual.`,link:`/dashboard`}),En=(0,i.createContext)({user:null,userRole:null,accessLevel:`free`,isInternal:!1,isAdmin:!1,loading:!0,signOut:async()=>{},registerUser:async()=>{},refreshUser:async()=>{},userInactive:!1,roleResolved:!1,roleConfirmed:!1,requestedRole:null,profile:null,profileReady:!1,activeOrg:null,activeWorkspace:null,checkOrg:async()=>{},workspaceAccess:{},userWorkspaces:[],switchWorkspace:async()=>{},createWorkspace:async()=>{},createOrg:async()=>{}});async function Dn(e){try{return await(0,s.deleteUser)(e),`deleted`}catch{}try{return await(0,s.signOut)(D),`signed-out`}catch{return`failed`}}var On=e=>`fbos_role2_${e}`,kn=e=>{try{return localStorage.getItem(On(e))}catch{return null}},An=(e,t)=>{try{localStorage.setItem(On(e),t)}catch{}},jn=e=>{try{localStorage.removeItem(On(e))}catch{}},Mn=e=>{try{localStorage.removeItem(`fbos_role_${e}`)}catch{}};function Nn(e,t,n=Date.now()){if(e?.removed===!0)return null;let r=e||{},i=Date.parse(String(r.lastLoginAt||``)),a=Number.isFinite(i)&&n-i<36e5&&i<=n,o=t.email||r.email||null;if(e&&r.uid===t.uid&&r.email===o&&r.createdAt&&(!t.displayName||r.displayName===t.displayName)&&a)return null;let s=new Date(n).toISOString();return{uid:t.uid,email:o,displayName:t.displayName||r.displayName||``,lastLoginAt:s,createdAt:r.createdAt||s}}function Pn({children:e,onSignedOut:n,onRemoved:r}){let[o,l]=(0,i.useState)(null),[u,d]=(0,i.useState)(null),[f,p]=(0,i.useState)(!1),[m,h]=(0,i.useState)(!0),[g,_]=(0,i.useState)(!1),[v,y]=(0,i.useState)(!1),[b,x]=(0,i.useState)(null),[S,C]=(0,i.useState)(null),[w,T]=(0,i.useState)(!1),E=i.default.useRef(null),k=i.default.useRef(null),ee=i.default.useRef(null),te=i.default.useRef(``),A=i.default.useRef(null),j=i.default.useRef(n);j.current=n;let ne=i.default.useRef(r);ne.current=r;let re=i.default.useRef(null),M=i.default.useRef(null),N=i.default.useRef(null),P=i.default.useRef(null),F=i.default.useRef(null),ie=i.default.useRef(new Set),I=e=>(0,c.updateDoc)((0,c.doc)(O,`user_profiles`,e),{role:`admin`}),L=async(e,{again:t=!1}={})=>{if(!(ie.current.has(e)&&!t)){ie.current.add(e);try{await I(e)}catch(t){if(t?.code!==`permission-denied`){console.error(`Error claiming the admin role:`,t);return}try{if(!D.currentUser)return;await D.currentUser.getIdToken(!0),await I(e)}catch(e){e?.code!==`permission-denied`&&console.error(`Error claiming the admin role:`,e)}}}};return(0,i.useEffect)(()=>{let e;if(!D){h(!1),_(!0),T(!0);return}(0,s.getRedirectResult)(D).catch(()=>{});let n=(0,s.onAuthStateChanged)(D,async n=>{if(n?.uid===A.current&&g){l(n);return}let r=A.current;if(A.current=n?.uid||null,n){te.current=hn(typeof window<`u`?window.location.pathname:``),y(!1),n.uid!==r&&(N.current=null),r!==n.uid&&T(!1),Mn(n.uid);let i=kn(n.uid);i?(d(i),_(!0),h(!1)):_(!1),console.log(`[AuthContext] 1. onAuthStateChanged fired for user:`,n.uid),l(n);try{let r=(0,c.doc)(O,`user_profiles`,n.uid);e&&e();let i=e=>{console.error(`[AuthContext] the profile could not be read to the end:`,e),F.current=null,_(!0),y(!0),T(!0),h(!1)};e=(0,c.onSnapshot)(r,{includeMetadataChanges:!0},e=>{try{let i=e.exists()?e.data():null,a=e.metadata?.hasPendingWrites===!0;if(i?.removed===!0){re.current=n.uid,M.current!==n.uid&&(M.current=n.uid,Dn(n).then(e=>{e!==`deleted`&&(M.current=null)})),d(null),N.current=null,jn(n.uid),p(!0),x(null),C(i),_(!0),y(!0),T(!0),h(!1);return}if(ee.current!==n.uid){ee.current=n.uid;let e=Nn(i,{uid:n.uid,email:n.email,displayName:n.displayName}),t=gn(i,te.current);te.current=``,(e||t)&&(i||(F.current=n.uid),(0,c.setDoc)(r,{...e||{},...t||{}},{merge:!0}).catch(e=>{e?.code===`permission-denied`?console.warn(`This account may not update its own profile — it has been deactivated, or its address is not verified yet.`):console.error(`Failed to sync profile:`,e)}).finally(()=>{F.current===n.uid&&(F.current=null,T(!0))}))}if(i){let e=vt(i);a?e=N.current??`user`:N.current=e,!a&&k.current!==n.uid&&_t(i)&&t.t(D.currentUser)&&(k.current=n.uid,bt(n.uid,i)),!a&&!i.role&&!i.removed&&D.currentUser?.emailVerified&&L(n.uid),E.current===null&&(E.current=e),d(e),An(n.uid,e),p(i.inactive===!0),x(vn(i)?.role??null),C(i)}else d(null),a||(N.current=null),jn(n.uid),p(!1),x(null),C(null);_(!0),y(!0),(i||F.current!==n.uid)&&T(!0),h(!1)}catch(e){i(e)}},e=>{console.warn(`[AuthContext] user_profiles snapshot error (safe to ignore during auth transition):`,e),_(!0),F.current=null,T(!0),h(!1)})}catch(e){console.error(`[AuthContext] ERROR in auth resolution:`,e),_(!0),F.current=null,T(!0),h(!1)}}else{if(console.log(`[AuthContext] No user currently signed in.`),r){let e=re.current===r;e&&(re.current=null),(e&&ne.current||j.current)?.()}l(null),d(null),p(!1),x(null),C(null),_(!0),y(!1),T(!1),h(!1),E.current=null,N.current=null,P.current=null,te.current=``,k.current=null,ee.current=null,F.current=null,e&&e()}});return()=>{n(),e&&e()}},[]),(0,i.useEffect)(()=>{let e=o?.uid??null,t=o?.emailVerified===!0,n=P.current,r=!!e&&!!n&&n.uid===e&&!n.verified&&t;if(P.current=e?{uid:e,verified:t}:null,!r||u===`admin`)return;let i=!1;return(0,c.getDoc)((0,c.doc)(O,`user_profiles`,o.uid)).then(e=>{!i&&e.exists()&&!e.data().role&&!e.data().removed&&L(o.uid,{again:!0})}).catch(()=>{}),()=>{i=!0}},[o?.uid,o?.emailVerified,u]),(0,a.jsx)(En.Provider,{value:{user:o,userRole:u,accessLevel:t.g(u),isInternal:t.f(u),isAdmin:t.p(u),loading:m,signOut:async()=>{await(0,s.signOut)(D),l(null)},registerUser:async(e,t,n,r)=>{let{createUserWithEmailAndPassword:i}=await import(`firebase/auth`),{user:a}=await i(D,e,t),o=`${n} ${r}`.trim();await(0,s.updateProfile)(a,{displayName:o});try{await a.getIdToken(!0),await(0,c.setDoc)((0,c.doc)(O,`user_profiles`,a.uid),{uid:a.uid,email:a.email,displayName:o,createdAt:new Date().toISOString()},{merge:!0})}catch(e){console.warn(`Could not write public profile on registration.`,e)}await(0,s.sendEmailVerification)(a),Et(a.uid)},refreshUser:async()=>{D.currentUser&&(await D.currentUser.reload(),l(Object.assign(Object.create(D.currentUser),{photoURL:D.currentUser.photoURL,displayName:D.currentUser.displayName,email:D.currentUser.email,emailVerified:D.currentUser.emailVerified})))},userInactive:f,roleResolved:g,roleConfirmed:v,requestedRole:b,profile:S,profileReady:w},children:e})}var Fn=()=>(0,i.useContext)(En),In=(0,i.createContext)({});function Ln(e){let t=(0,i.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Rn=typeof window<`u`?i.useLayoutEffect:i.useEffect,zn=(0,i.createContext)(null);function Bn(e,t){e.indexOf(t)===-1&&e.push(t)}function Vn(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Hn=(e,t,n)=>n>t?t:n<e?e:n;function Un(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var Wn=()=>{},Gn=()=>{};typeof process<`u`&&process.env.NODE_ENV!==`production`&&(Wn=(e,t,n)=>{!e&&typeof console<`u`&&console.warn(Un(t,n))},Gn=(e,t,n)=>{if(!e)throw Error(Un(t,n))});var Kn={},qn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Jn(e){return typeof e==`object`&&!!e}var Yn=e=>/^0[^.\s]+$/u.test(e);function Xn(e){let t;return()=>(t===void 0&&(t=e()),t)}var Zn=e=>e,Qn=(e,t)=>n=>t(e(n)),$n=(...e)=>e.reduce(Qn),er=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},tr=class{constructor(){this.subscriptions=[]}add(e){return Bn(this.subscriptions,e),()=>Vn(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},nr=e=>e*1e3,rr=e=>e/1e3;function ir(e,t){return t?1e3/t*e:0}var ar=new Set;function or(e,t,n){e||ar.has(t)||(console.warn(Un(t,n)),ar.add(t))}var sr=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,cr=1e-7,lr=12;function ur(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=sr(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>cr&&++s<lr);return o}function dr(e,t,n,r){if(e===t&&n===r)return Zn;let i=t=>ur(t,0,1,e,n);return e=>e===0||e===1?e:sr(i(e),t,r)}var fr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pr=e=>t=>1-e(1-t),mr=dr(.33,1.53,.69,.99),hr=pr(mr),gr=fr(hr),_r=e=>e>=1?1:(e*=2)<1?.5*hr(e):.5*(2-2**(-10*(e-1))),vr=e=>1-Math.sin(Math.acos(e)),yr=pr(vr),br=fr(vr),xr=dr(.42,0,1,1),Sr=dr(0,0,.58,1),Cr=dr(.42,0,.58,1),wr=e=>Array.isArray(e)&&typeof e[0]!=`number`,Tr=e=>Array.isArray(e)&&typeof e[0]==`number`,Er={linear:Zn,easeIn:xr,easeInOut:Cr,easeOut:Sr,circIn:vr,circInOut:br,circOut:yr,backIn:hr,backInOut:gr,backOut:mr,anticipate:_r},Dr=e=>typeof e==`string`,Or=e=>{if(Tr(e)){Gn(e.length===4,`Cubic bezier arrays must contain four numerical values.`,`cubic-bezier-length`);let[t,n,r,i]=e;return dr(t,n,r,i)}else if(Dr(e))return Gn(Er[e]!==void 0,`Invalid easing type '${e}'`,`invalid-easing-type`),Er[e];return e},kr=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Ar={value:null,addProjectionMetrics:null};function jr(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&Ar.value&&Ar.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var Mr=40;function Nr(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=kr.reduce((e,n)=>(e[n]=jr(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Kn.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Mr),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:kr.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<kr.length;t++)o[kr[t]].cancel(e)},state:i,steps:o}}var{schedule:B,cancel:Pr,state:V,steps:Fr}=Nr(typeof requestAnimationFrame<`u`?requestAnimationFrame:Zn,!0),Ir;function Lr(){Ir=void 0}var Rr={now:()=>(Ir===void 0&&Rr.set(V.isProcessing||Kn.useManualTiming?V.timestamp:performance.now()),Ir),set:e=>{Ir=e,queueMicrotask(Lr)}},zr={layout:0,mainThread:0,waapi:0},Br=e=>t=>typeof t==`string`&&t.startsWith(e),Vr=Br(`--`),Hr=Br(`var(--`),Ur=e=>Hr(e)?Wr.test(e.split(`/*`)[0].trim()):!1,Wr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Gr(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var Kr={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},qr={...Kr,transform:e=>Hn(0,1,e)},Jr={...Kr,default:1},Yr=e=>Math.round(e*1e5)/1e5,Xr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Zr(e){return e==null}var Qr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$r=(e,t)=>n=>!!(typeof n==`string`&&Qr.test(n)&&n.startsWith(e)||t&&!Zr(n)&&Object.prototype.hasOwnProperty.call(n,t)),ei=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Xr);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},ti=e=>Hn(0,255,e),ni={...Kr,transform:e=>Math.round(ti(e))},ri={test:$r(`rgb`,`red`),parse:ei(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+ni.transform(e)+`, `+ni.transform(t)+`, `+ni.transform(n)+`, `+Yr(qr.transform(r))+`)`};function ii(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var ai={test:$r(`#`),parse:ii,transform:ri.transform},oi=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),si=oi(`deg`),ci=oi(`%`),H=oi(`px`),li=oi(`vh`),ui=oi(`vw`),di={...ci,parse:e=>ci.parse(e)/100,transform:e=>ci.transform(e*100)},fi={test:$r(`hsl`,`hue`),parse:ei(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+ci.transform(Yr(t))+`, `+ci.transform(Yr(n))+`, `+Yr(qr.transform(r))+`)`},U={test:e=>ri.test(e)||ai.test(e)||fi.test(e),parse:e=>ri.test(e)?ri.parse(e):fi.test(e)?fi.parse(e):ai.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?ri.transform(e):fi.transform(e),getAnimatableNone:e=>{let t=U.parse(e);return t.alpha=0,U.transform(t)}},pi=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mi(e){return isNaN(e)&&typeof e==`string`&&(e.match(Xr)?.length||0)+(e.match(pi)?.length||0)>0}var hi=`number`,gi=`color`,_i=`var`,vi=`var(`,yi="${}",bi=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function xi(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(bi,e=>(U.test(e)?(r.color.push(a),i.push(gi),n.push(U.parse(e))):e.startsWith(vi)?(r.var.push(a),i.push(_i),n.push(e)):(r.number.push(a),i.push(hi),n.push(parseFloat(e))),++a,yi)).split(yi),indexes:r,types:i}}function Si(e){return xi(e).values}function Ci({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===hi?i+=Yr(r[a]):e===gi?i+=U.transform(r[a]):i+=r[a]}return i}}function wi(e){return Ci(xi(e))}var Ti=e=>typeof e==`number`?0:U.test(e)?U.getAnimatableNone(e):e,Ei=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Ti(e);function Di(e){let t=xi(e);return Ci(t)(t.values.map((e,n)=>Ei(e,t.split[n])))}var Oi={test:mi,parse:Si,createTransformer:wi,getAnimatableNone:Di};function ki(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ai({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ki(s,r,e+1/3),a=ki(s,r,e),o=ki(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function ji(e,t){return n=>n>0?t:e}var W=(e,t,n)=>e+(t-e)*n,Mi=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Ni=[ai,ri,fi],Pi=e=>Ni.find(t=>t.test(e));function Fi(e){let t=Pi(e);if(Wn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,`color-not-animatable`),!t)return!1;let n=t.parse(e);return t===fi&&(n=Ai(n)),n}var Ii=(e,t)=>{let n=Fi(e),r=Fi(t);if(!n||!r)return ji(e,t);let i={...n};return e=>(i.red=Mi(n.red,r.red,e),i.green=Mi(n.green,r.green,e),i.blue=Mi(n.blue,r.blue,e),i.alpha=W(n.alpha,r.alpha,e),ri.transform(i))},Li=new Set([`none`,`hidden`]);function Ri(e,t){return Li.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function zi(e,t){return n=>W(e,t,n)}function Bi(e){return typeof e==`number`?zi:typeof e==`string`?Ur(e)?ji:U.test(e)?Ii:Wi:Array.isArray(e)?Vi:typeof e==`object`?U.test(e)?Ii:Hi:ji}function Vi(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Bi(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Hi(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Bi(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Ui(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var Wi=(e,t)=>{let n=Oi.createTransformer(t),r=xi(e),i=xi(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Li.has(e)&&!i.values.length||Li.has(t)&&!r.values.length?Ri(e,t):$n(Vi(Ui(r,i),i.values),n):(Wn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,`complex-values-different`),ji(e,t))};function Gi(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?W(e,t,n):Bi(e)(e,t)}var Ki=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>B.update(t,e),stop:()=>Pr(t),now:()=>V.isProcessing?V.timestamp:Rr.now()}},qi=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Ji=2e4;function Yi(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Xi(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Yi(r),Ji);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:rr(i)}}var G={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Zi(e,t){return e*Math.sqrt(1-t*t)}var Qi=12;function $i(e,t,n){let r=n;for(let n=1;n<Qi;n++)r-=e(r)/t(r);return r}var ea=.001;function ta({duration:e=G.duration,bounce:t=G.bounce,velocity:n=G.velocity,mass:r=G.mass}){let i,a;Wn(e<=nr(G.maxDuration),`Spring duration must be 10 seconds or less`,`spring-duration-limit`);let o=1-t;o=Hn(G.minDamping,G.maxDamping,o),e=Hn(G.minDuration,G.maxDuration,rr(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Zi(t,o),c=Math.exp(-i);return ea-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Zi(t**2,o);return(-i(t)+ea>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-ea+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=$i(i,a,s);if(e=nr(e),isNaN(c))return{stiffness:G.stiffness,damping:G.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var na=[`duration`,`bounce`],ra=[`stiffness`,`damping`,`mass`];function ia(e,t){return t.some(t=>e[t]!==void 0)}function aa(e){let t={velocity:G.velocity,stiffness:G.stiffness,damping:G.damping,mass:G.mass,isResolvedFromDuration:!1,...e};if(!ia(e,ra)&&ia(e,na))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Hn(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:G.mass,stiffness:i,damping:a}}else{let n=ta({...e,velocity:0});t={...t,...n,mass:G.mass},t.isResolvedFromDuration=!0}return t}function oa(e=G.visualDuration,t=G.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=aa({...n,velocity:-rr(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=rr(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?G.restSpeed.granular:G.restSpeed.default,i||=v?G.restDelta.granular:G.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Zi(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>nr(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=nr(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=nr(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Yi(T),Ji),t=qi(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}oa.applyToOptions=e=>{let t=Xi(e,100,oa);return e.ease=t.ease,e.duration=nr(t.duration),e.type=`keyframes`,e};var sa=5;function ca(e,t,n){let r=Math.max(t-sa,0);return ir(n-e(r),t-r)}function la({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=oa({keyframes:[f.value,m(f.value)],velocity:ca(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function ua(e,t,n){let r=[],i=n||Kn.mix||Gi,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=$n(Array.isArray(t)?t[n]||Zn:t,a)),r.push(a)}return r}function da(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(Gn(a===t.length,`Both input and output ranges must be the same length`,`range-length`),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=ua(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=er(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Hn(e[0],e[a-1],t)):l}function fa(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=er(0,t,r);e.push(W(n,1,i))}}function pa(e){let t=[0];return fa(t,e.length-1),t}function ma(e,t){return e.map(e=>e*t)}function ha(e,t){return e.map(()=>t||Cr).splice(0,e.length-1)}function ga({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=wr(r)?r.map(Or):Or(r),a={done:!1,value:t[0]},o=da(ma(n&&n.length===t.length?n:pa(t),e),t,{ease:Array.isArray(i)?i:ha(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var _a=e=>e!==null;function va(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(_a),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var ya={decay:la,inertia:la,tween:ga,keyframes:ga,spring:oa};function ba(e){typeof e.type==`string`&&(e.type=ya[e.type])}var xa=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Sa=e=>e/100,Ca=class extends xa{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Rr.now()&&this.tick(Rr.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},zr.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;ba(e);let{type:t=ga,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||ga;process.env.NODE_ENV!==`production`&&s!==ga&&Gn(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`,`spring-two-frames`),s!==ga&&typeof o[0]!=`number`&&(this.mixKeyframes=$n(Sa,Gi(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Yi(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Hn(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==la&&(b.value=va(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return rr(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+rr(e)}get time(){return rr(this.currentTime)}set time(e){e=nr(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return ca(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Rr.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=rr(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ki,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Rr.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,zr.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function wa(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Ta=e=>e*180/Math.PI,Ea=e=>Oa(Ta(Math.atan2(e[1],e[0]))),Da={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ea,rotateZ:Ea,skewX:e=>Ta(Math.atan(e[1])),skewY:e=>Ta(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Oa=e=>(e%=360,e<0&&(e+=360),e),ka=Ea,Aa=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ja=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ma={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Aa,scaleY:ja,scale:e=>(Aa(e)+ja(e))/2,rotateX:e=>Oa(Ta(Math.atan2(e[6],e[5]))),rotateY:e=>Oa(Ta(Math.atan2(-e[2],e[0]))),rotateZ:ka,rotate:ka,skewX:e=>Ta(Math.atan(e[4])),skewY:e=>Ta(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Na(e){return+!!e.includes(`scale`)}function Pa(e,t){if(!e||e===`none`)return Na(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Ma,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Da,i=t}if(!i)return Na(t);let a=r[t],o=i[1].split(`,`).map(Ia);return typeof a==`function`?a(o):o[a]}var Fa=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Pa(n,t)};function Ia(e){return parseFloat(e.trim())}var La=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Ra=new Set(La),za=e=>e===Kr||e===H,Ba=new Set([`x`,`y`,`z`]),Va=La.filter(e=>!Ba.has(e));function Ha(e){let t=[];return Va.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var Ua={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Pa(t,`x`),y:(e,{transform:t})=>Pa(t,`y`)};Ua.translateX=Ua.x,Ua.translateY=Ua.y;var Wa=new Set,Ga=!1,Ka=!1,qa=!1;function Ja(){if(Ka){let e=Array.from(Wa).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Ha(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Ka=!1,Ga=!1,Wa.forEach(e=>e.complete(qa)),Wa.clear()}function Ya(){Wa.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ka=!0)})}function Xa(){qa=!0,Ya(),Ja(),qa=!1}var Za=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Wa.add(this),Ga||(Ga=!0,B.read(Ya),B.resolveKeyframes(Ja))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}wa(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Wa.delete(this)}cancel(){this.state===`scheduled`&&(Wa.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Qa=e=>e.startsWith(`--`);function $a(e,t,n){Qa(t)?e.style.setProperty(t,n):e.style[t]=n}var eo={};function to(e,t){let n=Xn(e);return()=>eo[t]??n()}var no=to(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),ro=to(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),io=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ao={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:io([0,.65,.55,1]),circOut:io([.55,0,1,.45]),backIn:io([.31,.01,.66,-.59]),backOut:io([.33,1.53,.69,.99])};function oo(e,t){if(e)return typeof e==`function`?ro()?qi(e,t):`ease-out`:Tr(e)?io(e):Array.isArray(e)?e.map(e=>oo(e,t)||ao.easeOut):ao[e]}function so(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=oo(s,i);Array.isArray(d)&&(u.easing=d),Ar.value&&zr.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Ar.value&&p.finished.finally(()=>{zr.waapi--}),p}function co(e){return typeof e==`function`&&`applyToOptions`in e}function lo({type:e,...t}){return co(e)&&ro()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var uo=class extends xa{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,Gn(typeof e.type!=`string`,`Mini animate() doesn't support "type" as a string.`,`mini-spring`);let c=lo(e);this.animation=so(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=va(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),$a(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return rr(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+rr(e)}get time(){return rr(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=nr(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&no()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Zn):r(this)}},fo={anticipate:_r,backInOut:gr,circInOut:br};function po(e){return e in fo}function mo(e){typeof e.ease==`string`&&po(e.ease)&&(e.ease=fo[e.ease])}var ho=10,go=class extends uo{constructor(e){mo(e),ba(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Ca({...a,autoplay:!1}),s=Math.max(ho,Rr.now()-this.startTime),c=Hn(0,ho,s-ho),l=o.sample(s).value,{name:u}=this.options;i&&u&&$a(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},_o=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Oi.test(e)||e===`0`)&&!e.startsWith(`url(`));function vo(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function yo(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=_o(i,t),s=_o(a,t);return Wn(o===s,`You are trying to animate ${t} from "${i}" to "${a}". "${o?a:i}" is not an animatable value.`,`value-not-animatable`),!o||!s?!1:vo(e)||(n===`spring`||co(n))&&r}function bo(e){e.duration=0,e.type=`keyframes`}var xo=new Set([`opacity`,`clipPath`,`filter`,`transform`]),So=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Co(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&So.test(e[t]))return!0;return!1}var wo=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),To=Xn(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Eo(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return To()&&n&&(xo.has(n)||wo.has(n)&&Co(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Do=40,Oo=class extends xa{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Rr.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||Za)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Rr.now();let u=!0;yo(e,i,a,o)||(u=!1,(Kn.instantAnimations||!s)&&l?.(va(e,n,t)),e[0]=e[e.length-1],bo(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Do?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Eo(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new go({...d,element:p})}catch{m=new Ca(d)}else m=new Ca(d);m.finished.then(()=>{this.notifyFinished()}).catch(Zn),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Xa()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function ko(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Ao=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function jo(e){let t=Ao.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}var Mo=4;function No(e,t,n=1){Gn(n<=Mo,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,`max-css-var-depth`);let[r,i]=jo(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return qn(e)?parseFloat(e):e}return Ur(i)?No(i,t,n+1):i}var Po={type:`spring`,stiffness:500,damping:25,restSpeed:10},Fo=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Io={type:`keyframes`,duration:.8},Lo={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Ro=(e,{keyframes:t})=>t.length>2?Io:Ra.has(e)?e.startsWith(`scale`)?Fo(t[1]):Po:Lo;function zo(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Bo(e,t){let n=e?.[t]??e?.default??e;return n===e?n:zo(n,e)}var Vo=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Ho(e){for(let t in e)if(!Vo.has(t))return!0;return!1}var Uo=(e,t,n,r={},i,a)=>o=>{let s=Bo(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=nr(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Ho(s)||Object.assign(u,Ro(e,u)),u.duration&&=nr(u.duration),u.repeatDelay&&=nr(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(bo(u),u.delay===0&&(d=!0)),(Kn.instantAnimations||Kn.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,bo(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=va(u.keyframes,s);if(e!==void 0){B.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ca(u):new Oo(u)};function Wo(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Go(e,t,n,r){if(typeof t==`function`){let[i,a]=Wo(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Wo(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Ko(e,t,n){let r=e.getProps();return Go(r,t,n===void 0?r.custom:n,e)}var qo=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...La]),Jo=30,Yo=e=>!isNaN(parseFloat(e)),Xo={current:void 0},Zo=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Rr.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Rr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Yo(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!==`production`&&or(!1,`value.onChange(callback) is deprecated. Switch to value.on("change", callback).`),this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new tr);let n=this.events[e].add(t);return e===`change`?()=>{n(),B.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Xo.current&&Xo.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Rr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Jo)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Jo);return ir(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Qo(e,t){return new Zo(e,t)}var $o=e=>Array.isArray(e);function es(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qo(n))}function ts(e){return $o(e)?e[e.length-1]||0:e}function ns(e,t){let{transitionEnd:n={},transition:r={},...i}=Ko(e,t)||{};i={...i,...n};for(let t in i)es(e,t,ts(i[t]))}var K=e=>!!(e&&e.getVelocity);function rs(e){return!!(K(e)&&e.add)}function is(e,t){let n=e.getValue(`willChange`);if(rs(n))return n.add(t);if(!n&&Kn.WillChange){let n=new Kn.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function as(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var os=`data-`+as(`framerAppearId`);function ss(e){return e.props[os]}function cs({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ls(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?zo(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&cs(d,t))continue;let o={delay:n,...Bo(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){B.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=ss(e);if(n){let e=window.MotionHandoffAnimation(n,t,B);e!==null&&(o.startTime=e,f=!0)}}is(e,t);let p=l??e.shouldReduceMotion;r.start(Uo(t,r,i,p&&qo.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>B.update(()=>{o&&ns(e,o)});u.length?Promise.all(u).then(t):t()}return u}function us(e,t,n={}){let r=Ko(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(ls(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return ds(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function ds(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(us(c,t,{...o,delay:n+(typeof r==`function`?0:r)+ko(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function fs(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>us(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=us(e,t,n);else{let i=typeof t==`function`?Ko(e,t,n.custom):t;r=Promise.all(ls(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var ps={test:e=>e===`auto`,parse:e=>e},ms=e=>t=>t.test(e),hs=[Kr,H,ci,si,ui,li,ps],gs=e=>hs.find(ms(e));function _s(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||Yn(e)}var vs=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function ys(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Xr)||[];if(!r)return e;let i=n.replace(r,``),a=+!!vs.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var bs=/\b([a-z-]*)\(.*?\)/gu,xs={...Oi,getAnimatableNone:e=>{let t=e.match(bs);return t?t.map(ys).join(` `):e}},Ss={...Oi,getAnimatableNone:e=>{let t=Oi.parse(e);return Oi.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Cs={...Kr,transform:Math.round},ws={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,inset:H,insetBlock:H,insetBlockStart:H,insetBlockEnd:H,insetInline:H,insetInlineStart:H,insetInlineEnd:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,paddingBlock:H,paddingBlockStart:H,paddingBlockEnd:H,paddingInline:H,paddingInlineStart:H,paddingInlineEnd:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,marginBlock:H,marginBlockStart:H,marginBlockEnd:H,marginInline:H,marginInlineStart:H,marginInlineEnd:H,fontSize:H,backgroundPositionX:H,backgroundPositionY:H,rotate:si,rotateX:si,rotateY:si,rotateZ:si,scale:Jr,scaleX:Jr,scaleY:Jr,scaleZ:Jr,skew:si,skewX:si,skewY:si,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:qr,originX:di,originY:di,originZ:H,zIndex:Cs,fillOpacity:qr,strokeOpacity:qr,numOctaves:Cs},Ts={...ws,color:U,backgroundColor:U,outlineColor:U,fill:U,stroke:U,borderColor:U,borderTopColor:U,borderRightColor:U,borderBottomColor:U,borderLeftColor:U,filter:xs,WebkitFilter:xs,mask:Ss,WebkitMask:Ss},Es=e=>Ts[e],Ds=new Set([xs,Ss]);function Os(e,t){let n=Es(e);return Ds.has(n)||(n=Oi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var ks=new Set([`auto`,`none`,`0`]);function As(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ks.has(t)&&xi(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Os(n,i)}var js=class extends Za{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Ur(r))){let i=No(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!qo.has(n)||e.length!==2)return;let[r,i]=e,a=gs(r),o=gs(i);if(Gr(r)!==Gr(i)&&Ua[n]){this.needsMeasurement=!0;return}if(a!==o)if(za(a)&&za(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Ua[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||_s(e[t]))&&n.push(t);n.length&&As(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ua[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Ua[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function Ms(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Ns=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Ps(e){return Jn(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:Fs,cancel:Is}=Nr(queueMicrotask,!1),Ls={x:!1,y:!1};function Rs(){return Ls.x||Ls.y}function zs(e){return e===`x`||e===`y`?Ls[e]?null:(Ls[e]=!0,()=>{Ls[e]=!1}):Ls.x||Ls.y?null:(Ls.x=Ls.y=!0,()=>{Ls.x=Ls.y=!1})}function Bs(e,t){let n=Ms(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Vs(e){return!(e.pointerType===`touch`||Rs())}function Hs(e,t,n={}){let[r,i,a]=Bs(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Vs(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Us=(e,t)=>t?e===t?!0:Us(e,t.parentElement):!1,Ws=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Gs=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Ks(e){return Gs.has(e.tagName)||e.isContentEditable===!0}var qs=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Js(e){return qs.has(e.tagName)||e.isContentEditable===!0}var Ys=new WeakSet;function Xs(e){return t=>{t.key===`Enter`&&e(t)}}function Zs(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Qs=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Xs(()=>{if(Ys.has(n))return;Zs(n,`down`);let e=Xs(()=>{Zs(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Zs(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function $s(e){return Ws(e)&&!Rs()}var ec=new WeakSet;function tc(e,t,n={}){let[r,i,a]=Bs(e,n),o=e=>{let r=e.currentTarget;if(!$s(e)||ec.has(e))return;Ys.add(r),n.stopPropagation&&ec.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),Ys.has(r)&&Ys.delete(r),$s(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Us(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Ps(e)&&(e.addEventListener(`focus`,e=>Qs(e,i)),!Ks(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function nc(e){return Jn(e)&&`ownerSVGElement`in e}var rc=new WeakMap,ic,ac=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:nc(r)&&`getBBox`in r?r.getBBox()[t]:r[n],oc=ac(`inline`,`width`,`offsetWidth`),sc=ac(`block`,`height`,`offsetHeight`);function cc({target:e,borderBoxSize:t}){rc.get(e)?.forEach(n=>{n(e,{get width(){return oc(e,t)},get height(){return sc(e,t)}})})}function lc(e){e.forEach(cc)}function uc(){typeof ResizeObserver>`u`||(ic=new ResizeObserver(lc))}function dc(e,t){ic||uc();let n=Ms(e);return n.forEach(e=>{let n=rc.get(e);n||(n=new Set,rc.set(e,n)),n.add(t),ic?.observe(e)}),()=>{n.forEach(e=>{let n=rc.get(e);n?.delete(t),n?.size||ic?.unobserve(e)})}}var fc=new Set,pc;function mc(){pc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};fc.forEach(t=>t(e))},window.addEventListener(`resize`,pc)}function hc(e){return fc.add(e),pc||mc(),()=>{fc.delete(e),!fc.size&&typeof pc==`function`&&(window.removeEventListener(`resize`,pc),pc=void 0)}}function gc(e,t){return typeof e==`function`?hc(e):dc(e,t)}function _c(e){return nc(e)&&e.tagName===`svg`}var vc=[...hs,U,Oi],yc=e=>vc.find(ms(e)),bc=()=>({translate:0,scale:1,origin:0,originPoint:0}),xc=()=>({x:bc(),y:bc()}),Sc=()=>({min:0,max:0}),q=()=>({x:Sc(),y:Sc()}),Cc=new WeakMap;function wc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Tc(e){return typeof e==`string`||Array.isArray(e)}var Ec=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Dc=[`initial`,...Ec];function Oc(e){return wc(e.animate)||Dc.some(t=>Tc(e[t]))}function kc(e){return!!(Oc(e)||e.variants)}function Ac(e,t,n){for(let r in t){let i=t[r],a=n[r];if(K(i))e.addValue(r,i);else if(K(a))e.addValue(r,Qo(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Qo(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var jc={current:null},Mc={current:!1},Nc=typeof window<`u`;function Pc(){if(Mc.current=!0,Nc)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>jc.current=e.matches;e.addEventListener(`change`,t),t()}else jc.current=!1}var Fc=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Ic={};function Lc(e){Ic=e}function Rc(){return Ic}var zc=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Za,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Rr.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,B.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Oc(t),this.isVariantNode=kc(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&K(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Cc.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Mc.current||Pc(),this.shouldReduceMotion=jc.current),process.env.NODE_ENV!==`production`&&or(this.shouldReduceMotion!==!0,`You have Reduced Motion enabled on your device. Animations may not appear as expected.`,`reduced-motion-disabled`),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Pr(this.notifyUpdate),Pr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&xo.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new uo({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:nr(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Ra.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&B.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Ic){let t=Ic[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):q()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Fc.length;t++){let n=Fc[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Ac(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Qo(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(qn(n)||Yn(n))?n=parseFloat(n):!yc(n)&&Oi.test(t)&&(n=Os(e,t)),this.setBaseTarget(e,K(n)?n.get():n)),K(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Go(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!K(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new tr),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Fs.render(this.render)}},Bc=class extends zc{constructor(){super(...arguments),this.KeyframeResolver=js}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;K(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Vc=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Hc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Uc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Wc(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Gc(e){return e===void 0||e===1}function Kc({scale:e,scaleX:t,scaleY:n}){return!Gc(e)||!Gc(t)||!Gc(n)}function qc(e){return Kc(e)||Jc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Jc(e){return Yc(e.x)||Yc(e.y)}function Yc(e){return e&&e!==`0%`}function Xc(e,t,n){return n+t*(e-n)}function Zc(e,t,n,r,i){return i!==void 0&&(e=Xc(e,i,r)),Xc(e,n,r)+t}function Qc(e,t=0,n=1,r,i){e.min=Zc(e.min,t,n,r,i),e.max=Zc(e.max,t,n,r,i)}function $c(e,{x:t,y:n}){Qc(e.x,t.translate,t.scale,t.originPoint),Qc(e.y,n.translate,n.scale,n.originPoint)}var el=.999999999999,tl=1.0000000000001;function nl(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(rl(e.x,-a.scroll.offset.x),rl(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,$c(e,o)),r&&qc(a.latestValues)&&ol(e,a.latestValues,a.layout?.layoutBox))}t.x<tl&&t.x>el&&(t.x=1),t.y<tl&&t.y>el&&(t.y=1)}function rl(e,t){e.min+=t,e.max+=t}function il(e,t,n,r,i=.5){Qc(e,t,n,W(e.min,e.max,i),r)}function al(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function ol(e,t,n){let r=n??e;il(e.x,al(t.x,r.x),t.scaleX,t.scale,t.originX),il(e.y,al(t.y,r.y),t.scaleY,t.scale,t.originY)}function sl(e,t){return Hc(Wc(e.getBoundingClientRect(),t))}function cl(e,t,n){let r=sl(e,n),{scroll:i}=t;return i&&(rl(r.x,i.offset.x),rl(r.y,i.offset.y)),r}var ll={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ul=La.length;function dl(e,t,n){let r=``,i=!0;for(let a=0;a<ul;a++){let o=La[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Ns(s,ws[o]);if(!c){i=!1;let t=ll[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function fl(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Ra.has(e)){o=!0;continue}else if(Vr(e)){i[e]=n;continue}else{let t=Ns(n,ws[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=dl(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function pl(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function ml(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var hl={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(H.test(e))e=parseFloat(e);else return e;return`${ml(e,t.target.x)}% ${ml(e,t.target.y)}%`}},gl={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Oi.parse(e);if(i.length>5)return r;let a=Oi.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=W(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},_l={borderRadius:{...hl,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:hl,borderTopRightRadius:hl,borderBottomLeftRadius:hl,borderBottomRightRadius:hl,boxShadow:gl};function vl(e,{layout:t,layoutId:n}){return Ra.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!_l[e]||e===`opacity`)}function yl(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(K(r[t])||i&&K(i[t])||vl(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function bl(e){return window.getComputedStyle(e)}var xl=class extends Bc{constructor(){super(...arguments),this.type=`html`,this.renderInstance=pl}readValueFromInstance(e,t){if(Ra.has(t))return this.projection?.isProjecting?Na(t):Fa(e,t);{let n=bl(e),r=(Vr(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return sl(e,t)}build(e,t,n){fl(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return yl(e,t,n)}},Sl={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Cl={offset:`strokeDashoffset`,array:`strokeDasharray`};function wl(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Sl:Cl;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Tl=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function El(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(fl(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Tl)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&wl(d,i,a,o,!1)}var Dl=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Ol=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function kl(e,t,n,r){pl(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Dl.has(n)?n:as(n),t.attrs[n])}function Al(e,t,n){let r=yl(e,t,n);for(let n in e)if(K(e[n])||K(t[n])){let t=La.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var jl=class extends Bc{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=q}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Ra.has(t)){let e=Es(t);return e&&e.default||0}return t=Dl.has(t)?t:as(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Al(e,t,n)}build(e,t,n){El(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){kl(e,t,n,r)}mount(e){this.isSVGTag=Ol(e.tagName),super.mount(e)}},Ml=Dc.length;function Nl(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Nl(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Ml;n++){let r=Dc[n],i=e.props[r];(Tc(i)||i===!1)&&(t[r]=i)}return t}function Pl(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Fl=[...Ec].reverse(),Il=Ec.length;function Ll(e){return t=>Promise.all(t.map(({animation:t,options:n})=>fs(e,t,n)))}function Rl(e){let t=Ll(e),n=Vl(),r=!0,i=!1,a=t=>(n,r)=>{let i=Ko(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=Nl(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Il;t++){let p=Fl[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Tc(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||wc(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=zl(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=$o(t)&&$o(n)?!Pl(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Ko(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=ko(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Ko(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Vl(),i=!0}}}function zl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Pl(t,e):!1}function Bl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vl(){return{animate:Bl(!0),whileInView:Bl(),whileHover:Bl(),whileTap:Bl(),whileDrag:Bl(),whileFocus:Bl(),exit:Bl()}}function Hl(e,t){e.min=t.min,e.max=t.max}function Ul(e,t){Hl(e.x,t.x),Hl(e.y,t.y)}function Wl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Gl=1e-4,Kl=1-Gl,ql=1+Gl,Jl=.01,Yl=0-Jl,Xl=0+Jl;function Zl(e){return e.max-e.min}function Ql(e,t,n){return Math.abs(e-t)<=n}function $l(e,t,n,r=.5){e.origin=r,e.originPoint=W(t.min,t.max,e.origin),e.scale=Zl(n)/Zl(t),e.translate=W(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Kl&&e.scale<=ql||isNaN(e.scale))&&(e.scale=1),(e.translate>=Yl&&e.translate<=Xl||isNaN(e.translate))&&(e.translate=0)}function eu(e,t,n,r){$l(e.x,t.x,n.x,r?r.originX:void 0),$l(e.y,t.y,n.y,r?r.originY:void 0)}function tu(e,t,n,r=0){e.min=(r?W(n.min,n.max,r):n.min)+t.min,e.max=e.min+Zl(t)}function nu(e,t,n,r){tu(e.x,t.x,n.x,r?.x),tu(e.y,t.y,n.y,r?.y)}function ru(e,t,n,r=0){let i=r?W(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Zl(t)}function iu(e,t,n,r){ru(e.x,t.x,n.x,r?.x),ru(e.y,t.y,n.y,r?.y)}function au(e,t,n,r,i){return e-=t,e=Xc(e,1/n,r),i!==void 0&&(e=Xc(e,1/i,r)),e}function ou(e,t=0,n=1,r=.5,i,a=e,o=e){if(ci.test(t)&&(t=parseFloat(t),t=W(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=W(a.min,a.max,r);e===a&&(s-=t),e.min=au(e.min,t,n,s,i),e.max=au(e.max,t,n,s,i)}function su(e,t,[n,r,i],a,o){ou(e,t[n],t[r],t[i],t.scale,a,o)}var cu=[`x`,`scaleX`,`originX`],lu=[`y`,`scaleY`,`originY`];function uu(e,t,n,r){su(e.x,t,cu,n?n.x:void 0,r?r.x:void 0),su(e.y,t,lu,n?n.y:void 0,r?r.y:void 0)}function du(e){return e.translate===0&&e.scale===1}function fu(e){return du(e.x)&&du(e.y)}function pu(e,t){return e.min===t.min&&e.max===t.max}function mu(e,t){return pu(e.x,t.x)&&pu(e.y,t.y)}function hu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function gu(e,t){return hu(e.x,t.x)&&hu(e.y,t.y)}function _u(e){return Zl(e.x)/Zl(e.y)}function vu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function yu(e){return[e(`x`),e(`y`)]}function bu(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var xu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],Su=xu.length,Cu=e=>typeof e==`string`?parseFloat(e):e,wu=e=>typeof e==`number`||H.test(e);function Tu(e,t,n,r,i,a){i?(e.opacity=W(0,n.opacity??1,Du(r)),e.opacityExit=W(t.opacity??1,0,Ou(r))):a&&(e.opacity=W(t.opacity??1,n.opacity??1,r));for(let i=0;i<Su;i++){let a=xu[i],o=Eu(t,a),s=Eu(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||wu(o)===wu(s)?(e[a]=Math.max(W(Cu(o),Cu(s),r),0),(ci.test(s)||ci.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=W(t.rotate||0,n.rotate||0,r))}function Eu(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Du=ku(0,.5,yr),Ou=ku(.5,.95,Zn);function ku(e,t,n){return r=>r<e?0:r>t?1:n(er(e,t,r))}function Au(e,t,n){let r=K(e)?e:Qo(e);return r.start(Uo(``,r,t,n)),r.animation}function ju(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var Mu=(e,t)=>e.depth-t.depth,Nu=class{constructor(){this.children=[],this.isDirty=!1}add(e){Bn(this.children,e),this.isDirty=!0}remove(e){Vn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Mu),this.isDirty=!1,this.children.forEach(e)}};function Pu(e,t){let n=Rr.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Pr(r),e(a-t))};return B.setup(r,!0),()=>Pr(r)}function Fu(e){return K(e)?e.get():e}var Iu=class{constructor(){this.members=[]}add(e){Bn(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Vn(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Vn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Lu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ru={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},zu=[``,`X`,`Y`,`Z`],Bu=1e3,Vu=0;function Hu(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Uu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=ss(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,B,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Uu(r)}function Wu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Vu++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ar.value&&(Ru.nodes=Ru.calculatedTargetDeltas=Ru.calculatedProjections=0),this.nodes.forEach(qu),this.nodes.forEach(nd),this.nodes.forEach(rd),this.nodes.forEach(Ju),Ar.addProjectionMetrics&&Ar.addProjectionMetrics(Ru)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Nu)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new tr),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=nc(t)&&!_c(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;B.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Pu(i,250),Lu.hasAnimatedSinceResize&&(Lu.hasAnimatedSinceResize=!1,this.nodes.forEach(td)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||ud,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!gu(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Bo(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||td(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Pr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(id),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Uu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Zu),this.nodes.forEach(Xu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Qu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach($u),this.nodes.forEach(ed),this.nodes.forEach(Gu),this.nodes.forEach(Ku)):this.nodes.forEach(Qu),this.clearAllSnapshots();let e=Rr.now();V.delta=Hn(0,1e3/60,e-V.timestamp),V.timestamp=e,V.isProcessing=!0,Fr.update.process(V),Fr.preRender.process(V),Fr.render.process(V),V.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Yu),this.sharedNodes.forEach(ad)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,B.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){B.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Zl(this.snapshot.measuredBox.x)&&!Zl(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=q(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!fu(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||qc(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),md(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return q();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(gd))){let{scroll:e}=this.root;e&&(rl(t.x,e.offset.x),rl(t.y,e.offset.y))}return t}removeElementScroll(e){let t=q();if(Ul(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Ul(t,e),rl(t.x,i.offset.x),rl(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||q();Ul(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(rl(r.x,-n.scroll.offset.x),rl(r.y,-n.scroll.offset.y)),qc(n.latestValues)&&ol(r,n.latestValues,n.layout?.layoutBox)}return qc(this.latestValues)&&ol(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=q();Ul(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!qc(n.latestValues))continue;let r;n.instance&&(Kc(n.latestValues)&&n.updateSnapshot(),r=q(),Ul(r,n.measurePageBox())),uu(t,n.latestValues,n.snapshot?.layoutBox,r)}return qc(this.latestValues)&&uu(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==V.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=V.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=q(),this.targetWithTransforms=q()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nu(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ul(this.target,this.layout.layoutBox),$c(this.target,this.targetDelta)):Ul(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Ar.value&&Ru.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Kc(this.parent.latestValues)||Jc(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=q(),this.relativeTargetOrigin=q(),iu(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Ul(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===V.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Ul(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;nl(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=q());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Wl(this.prevProjectionDelta.x,this.projectionDelta.x),Wl(this.prevProjectionDelta.y,this.projectionDelta.y)),eu(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!vu(this.projectionDelta.x,this.prevProjectionDelta.x)||!vu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Ar.value&&Ru.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xc(),this.projectionDelta=xc(),this.projectionDeltaWithTransform=xc()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=xc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=q(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(ld));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;od(a.x,e.x,n),od(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(iu(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),cd(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&mu(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=q(),Ul(d,this.relativeTarget)),s&&(this.animationValues=i,Tu(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Pr(this.pendingAnimation),void 0),this.pendingAnimation=B.update(()=>{Lu.hasAnimatedSinceResize=!0,zr.layout++,this.motionValue||=Qo(0),this.motionValue.jump(0,!1),this.currentAnimation=Au(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{zr.layout--},onComplete:()=>{zr.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Bu),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&hd(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||q();let t=Zl(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Zl(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Ul(t,n),ol(t,i),eu(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Iu),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Hu(`z`,e,r,this.animationValues);for(let t=0;t<zu.length;t++)Hu(`rotate${zu[t]}`,e,r,this.animationValues),Hu(`skew${zu[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Fu(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Fu(t?.pointerEvents)||``),this.hasProjected&&!qc(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=bu(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in _l){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=_l[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Fu(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Xu),this.root.sharedNodes.clear()}}}function Gu(e){e.updateLayout()}function Ku(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)yu(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Zl(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Hl(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else hd(i,t.layoutBox,n)&&yu(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Zl(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=xc();eu(o,n,t.layoutBox);let s=xc();a?eu(s,e.applyTransform(r,!0),t.measuredBox):eu(s,n,t.layoutBox);let c=!fu(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=q();iu(s,t.layoutBox,i.layoutBox,o);let c=q();iu(c,n,a.layoutBox,o),gu(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function qu(e){Ar.value&&Ru.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ju(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Yu(e){e.clearSnapshot()}function Xu(e){e.clearMeasurements()}function Zu(e){e.isLayoutDirty=!0,e.updateLayout()}function Qu(e){e.isLayoutDirty=!1}function $u(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ed(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function td(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function nd(e){e.resolveTargetDelta()}function rd(e){e.calcProjection()}function id(e){e.resetSkewAndRotation()}function ad(e){e.removeLeadSnapshot()}function od(e,t,n){e.translate=W(t.translate,0,n),e.scale=W(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function sd(e,t,n,r){e.min=W(t.min,n.min,r),e.max=W(t.max,n.max,r)}function cd(e,t,n,r){sd(e.x,t.x,n.x,r),sd(e.y,t.y,n.y,r)}function ld(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var ud={duration:.45,ease:[.4,0,.1,1]},dd=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),fd=dd(`applewebkit/`)&&!dd(`chrome/`)?Math.round:Zn;function pd(e){e.min=fd(e.min),e.max=fd(e.max)}function md(e){pd(e.x),pd(e.y)}function hd(e,t,n){return e===`position`||e===`preserve-aspect`&&!Ql(_u(t),_u(n),.2)}function gd(e){return e!==e.root&&e.scroll?.wasRoot}var _d=Wu({attachResizeListener:(e,t)=>ju(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),vd={current:void 0},yd=Wu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vd.current){let e=new _d({});e.mount(window),e.setOptions({layoutScroll:!0}),vd.current=e}return vd.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),bd=(0,i.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function xd(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Sd(...e){return t=>{let n=!1,r=e.map(e=>{let r=xd(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():xd(e[t],null)}}}}function Cd(...e){return i.useCallback(Sd(...e),e)}var wd=class extends i.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Ps(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Ps(e)&&e.offsetWidth||0,r=Ps(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}};function Td({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:s}){let c=(0,i.useId)(),l=(0,i.useRef)(null),u=(0,i.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=(0,i.useContext)(bd),f=Cd(l,e.props?.ref??e?.ref);return(0,i.useInsertionEffect)(()=>{let{width:e,height:i,top:a,left:f,right:p,bottom:m}=u.current;if(t||s===!1||!l.current||!e||!i)return;let h=n===`left`?`left: ${f}`:`right: ${p}`,g=r===`bottom`?`bottom: ${m}`:`top: ${a}`;l.current.dataset.motionPopId=c;let _=document.createElement(`style`);d&&(_.nonce=d);let v=o??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
3
+ [data-motion-pop-id="${c}"] {
4
+ position: absolute !important;
5
+ width: ${e}px !important;
6
+ height: ${i}px !important;
7
+ ${h}px !important;
8
+ ${g}px !important;
9
+ }
10
+ `),()=>{l.current?.removeAttribute(`data-motion-pop-id`),v.contains(_)&&v.removeChild(_)}},[t]),(0,a.jsx)(wd,{isPresent:t,childRef:l,sizeRef:u,pop:s,children:s===!1?e:i.cloneElement(e,{ref:f})})}var Ed=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=Ln(Dd),p=(0,i.useId)(),m=!0,h=(0,i.useMemo)(()=>(m=!1,{id:p,initial:t,isPresent:n,custom:o,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;r&&r()},register:e=>(f.set(e,!1),()=>f.delete(e))}),[n,f,r]);return s&&m&&(h={...h}),(0,i.useMemo)(()=>{f.forEach((e,t)=>f.set(t,!1))},[n]),i.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),e=(0,a.jsx)(Td,{pop:c===`popLayout`,isPresent:n,anchorX:l,anchorY:u,root:d,children:e}),(0,a.jsx)(zn.Provider,{value:h,children:e})};function Dd(){return new Map}function Od(e=!0){let t=(0,i.useContext)(zn);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:a}=t,o=(0,i.useId)();(0,i.useEffect)(()=>{if(e)return a(o)},[e]);let s=(0,i.useCallback)(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}var kd=e=>e.key||``;function Ad(e){let t=[];return i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&t.push(e)}),t}var jd=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s=`sync`,propagate:c=!1,anchorX:l=`left`,anchorY:u=`top`,root:d})=>{let[f,p]=Od(c),m=(0,i.useMemo)(()=>Ad(e),[e]),h=c&&!f?[]:m.map(kd),g=(0,i.useRef)(!0),_=(0,i.useRef)(m),v=Ln(()=>new Map),y=(0,i.useRef)(new Set),[b,x]=(0,i.useState)(m),[S,C]=(0,i.useState)(m);Rn(()=>{g.current=!1,_.current=m;for(let e=0;e<S.length;e++){let t=kd(S[e]);h.includes(t)?(v.delete(t),y.current.delete(t)):v.get(t)!==!0&&v.set(t,!1)}},[S,h.length,h.join(`-`)]);let w=[];if(m!==b){let e=[...m];for(let t=0;t<S.length;t++){let n=S[t],r=kd(n);h.includes(r)||(e.splice(t,0,n),w.push(n))}return s===`wait`&&w.length&&(e=w),C(Ad(e)),x(m),null}process.env.NODE_ENV!==`production`&&s===`wait`&&S.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);let{forceRender:T}=(0,i.useContext)(In);return(0,a.jsx)(a.Fragment,{children:S.map(e=>{let i=kd(e),b=c&&!f?!1:m===S||h.includes(i);return(0,a.jsx)(Ed,{isPresent:b,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:b?void 0:()=>{if(y.current.has(i))return;if(v.has(i))y.current.add(i),v.set(i,!0);else return;let e=!0;v.forEach(t=>{t||(e=!1)}),e&&(T?.(),C(_.current),c&&p?.(),r&&r())},anchorX:l,anchorY:u,children:e},i)})})},Md=(0,i.createContext)({strict:!1}),Nd={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Pd=!1;function Fd(){if(Pd)return;let e={};for(let t in Nd)e[t]={isEnabled:e=>Nd[t].some(t=>!!e[t])};Lc(e),Pd=!0}function Id(){return Fd(),Rc()}function Ld(e){let t=Id();for(let n in e)t[n]={...t[n],...e[n]};Lc(t)}var Rd=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function zd(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Rd.has(e)}var Bd=e.r({default:()=>Vd}),Vd,Hd=e.n((()=>{throw Vd={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),Ud=e=>!zd(e);function Wd(e){typeof e==`function`&&(Ud=t=>t.startsWith(`on`)?!zd(t):e(t))}try{Wd((Hd(),e.i(Bd)).default)}catch{}function Gd(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||K(e[i])||(Ud(i)||n===!0&&zd(i)||!t&&!zd(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var Kd=(0,i.createContext)({});function qd(e,t){if(Oc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Tc(t)?t:void 0,animate:Tc(n)?n:void 0}}return e.inherit===!1?{}:t}function Jd(e){let{initial:t,animate:n}=qd(e,(0,i.useContext)(Kd));return(0,i.useMemo)(()=>({initial:t,animate:n}),[Yd(t),Yd(n)])}function Yd(e){return Array.isArray(e)?e.join(` `):e}var Xd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Zd(e,t,n){for(let r in t)!K(t[r])&&!vl(r,n)&&(e[r]=t[r])}function Qd({transformTemplate:e},t){return(0,i.useMemo)(()=>{let n=Xd();return fl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $d(e,t){let n=e.style||{},r={};return Zd(r,n,e),Object.assign(r,Qd(e,t)),r}function ef(e,t){let n={},r=$d(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var tf=()=>({...Xd(),attrs:{}});function nf(e,t,n,r){let a=(0,i.useMemo)(()=>{let n=tf();return El(n,t,Ol(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Zd(t,e.style,e),a.style={...t,...a.style}}return a}var rf=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function af(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(rf.indexOf(e)>-1||/[A-Z]/u.test(e))}function of(e,t,n,{latestValues:r},a,o=!1,s){let c=(s??af(e)?nf:ef)(t,r,a,e),l=Gd(t,typeof e==`string`,o),u=e===i.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,i.useMemo)(()=>K(d)?d.get():d,[d]);return(0,i.createElement)(e,{...u,children:f})}function sf({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:cf(n,r,i,e),renderState:t()}}function cf(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Fu(a[e]);let{initial:o,animate:s}=e,c=Oc(e),l=kc(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!wc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Go(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var lf=e=>(t,n)=>{let r=(0,i.useContext)(Kd),a=(0,i.useContext)(zn),o=()=>sf(e,t,r,a);return n?o():Ln(o)},uf=lf({scrapeMotionValuesFromProps:yl,createRenderState:Xd}),df=lf({scrapeMotionValuesFromProps:Al,createRenderState:tf}),ff=Symbol.for(`motionComponentSymbol`);function pf(e,t,n){let r=(0,i.useRef)(n);(0,i.useInsertionEffect)(()=>{r.current=n});let a=(0,i.useRef)(null);return(0,i.useCallback)(n=>{n&&e.onMount?.(n);let i=r.current;if(typeof i==`function`)if(n){let e=i(n);typeof e==`function`&&(a.current=e)}else a.current?(a.current(),a.current=null):i(n);else i&&(i.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var mf=(0,i.createContext)({});function hf(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function gf(e,t,n,r,a,o){let{visualElement:s}=(0,i.useContext)(Kd),c=(0,i.useContext)(Md),l=(0,i.useContext)(zn),u=(0,i.useContext)(bd),d=u.reducedMotion,f=u.skipAnimations,p=(0,i.useRef)(null),m=(0,i.useRef)(!1);r||=c.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:s,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:o}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));let h=p.current,g=(0,i.useContext)(mf);h&&!h.projection&&a&&(h.type===`html`||h.type===`svg`)&&_f(p.current,n,a,g);let _=(0,i.useRef)(!1);(0,i.useInsertionEffect)(()=>{h&&_.current&&h.update(n,l)});let v=n[os],y=(0,i.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return Rn(()=>{m.current=!0,h&&(_.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),y.current&&h.animationState&&h.animationState.animateChanges())}),(0,i.useEffect)(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),!1),h.enteringChildren=void 0)}),h}function _f(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:vf(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&hf(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function vf(e){if(e)return e.options.allowProjection===!1?vf(e.parent):e.projection}function yf(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&Ld(r);let s=n?n===`svg`:af(e),c=s?df:uf;function l(n,l){let u,d={...(0,i.useContext)(bd),...n,layoutId:bf(n)},{isStatic:f}=d,p=Jd(n),m=c(n,f);if(!f&&typeof window<`u`){xf(d,r);let t=Sf(d);u=t.MeasureLayout,p.visualElement=gf(e,m,d,o,t.ProjectionNode,s)}return(0,a.jsxs)(Kd.Provider,{value:p,children:[u&&p.visualElement?(0,a.jsx)(u,{visualElement:p.visualElement,...d}):null,of(e,n,pf(m,p.visualElement,l),m,f,t,s)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=(0,i.forwardRef)(l);return u[ff]=e,u}function bf({layoutId:e}){let t=(0,i.useContext)(In).id;return t&&e!==void 0?t+`-`+e:e}function xf(e,t){let n=(0,i.useContext)(Md).strict;if(process.env.NODE_ENV!==`production`&&t&&n){let t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Wn(!1,t,`lazy-strict-mode`):Gn(!1,t,`lazy-strict-mode`)}}function Sf(e){let{drag:t,layout:n}=Id();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Cf(e,t){if(typeof Proxy>`u`)return yf;let n=new Map,r=(n,r)=>yf(n,r,e,t);return new Proxy((e,t)=>(process.env.NODE_ENV!==`production`&&or(!1,`motion() is deprecated. Use motion.create() instead.`),r(e,t)),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,yf(a,void 0,e,t)),n.get(a))})}var wf=(e,t)=>t.isSVG??af(e)?new jl(t):new xl(t,{allowProjection:e!==i.Fragment}),Tf=class extends Vc{constructor(e){super(e),e.animationState||=Rl(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();wc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Ef=0,Df={animation:{Feature:Tf},exit:{Feature:class extends Vc{constructor(){super(...arguments),this.id=Ef++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=Ko(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Of(e){return{point:{x:e.pageX,y:e.pageY}}}var kf=e=>t=>Ws(t)&&e(t,Of(t));function Af(e,t,n,r){return ju(e,t,kf(n),r)}var jf=({current:e})=>e?e.ownerDocument.defaultView:null,Mf=(e,t)=>Math.abs(e-t);function Nf(e,t){let n=Mf(e.x,t.x),r=Mf(e.y,t.y);return Math.sqrt(n**2+r**2)}var Pf=new Set([`auto`,`scroll`]),Ff=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=If(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Rf(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Nf(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=V;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=If(t,this.transformPagePoint),B.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Rf(e.type===`pointercancel`?this.lastMoveEventInfo:If(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Ws(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=If(Of(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=V;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Rf(s,this.history)),this.removeListeners=$n(Af(this.contextWindow,`pointermove`,this.handlePointerMove),Af(this.contextWindow,`pointerup`,this.handlePointerUp),Af(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Pf.has(e.overflowX)||Pf.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),B.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Pr(this.updatePoint)}};function If(e,t){return t?{point:t(e.point)}:e}function Lf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Rf({point:e},t){return{point:e,delta:Lf(e,Bf(t)),offset:Lf(e,zf(t)),velocity:Vf(t,.1)}}function zf(e){return e[0]}function Bf(e){return e[e.length-1]}function Vf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Bf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>nr(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>nr(t)*2&&(r=e[1]);let a=rr(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Hf(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?W(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?W(n,e,r.max):Math.min(e,n)),e}function Uf(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Wf(e,{top:t,left:n,bottom:r,right:i}){return{x:Uf(e.x,n,i),y:Uf(e.y,t,r)}}function Gf(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Kf(e,t){return{x:Gf(e.x,t.x),y:Gf(e.y,t.y)}}function qf(e,t){let n=.5,r=Zl(e),i=Zl(t);return i>r?n=er(t.min,t.max-r,e.min):r>i&&(n=er(e.min,e.max-i,t.min)),Hn(0,1,n)}function Jf(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Yf=.35;function Xf(e=Yf){return e===!1?e=0:e===!0&&(e=Yf),{x:Zf(e,`left`,`right`),y:Zf(e,`top`,`bottom`)}}function Zf(e,t,n){return{min:Qf(e,t),max:Qf(e,n)}}function Qf(e,t){return typeof e==`number`?e:e[t]||0}var $f=new WeakMap,ep=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=q(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Of(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=zs(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yu(e=>{let t=this.getAxisMotionValue(e).get()||0;if(ci.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Zl(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&B.update(()=>i(e,t),!1,!0),is(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=ip(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&B.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Ff(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:jf(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&B.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!rp(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Hf(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&hf(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Wf(n.layoutBox,e):this.constraints=!1,this.elastic=Xf(t),r!==this.constraints&&!hf(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&yu(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Jf(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!hf(e))return!1;let n=e.current;Gn(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.",`drag-constraints-ref`);let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=cl(n,r.root,this.visualElement.getTransformPagePoint()),a=Kf(r.layout.layoutBox,i);if(t){let e=t(Uc(a));this.hasMutatedConstraints=!!e,e&&(a=Hc(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=yu(o=>{if(!rp(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return is(this.visualElement,e),n.start(Uo(e,n,0,t,this.visualElement,!1))}stopAnimation(){yu(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){yu(t=>{let{drag:n}=this.getProps();if(!rp(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-W(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!hf(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};yu(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=qf({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),yu(t=>{if(!rp(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(W(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;$f.set(this.visualElement,this);let e=this.visualElement.current,t=Af(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Js(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();hf(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=np(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),B.read(r);let o=ju(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(yu(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Yf,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function tp(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function np(e,t,n){let r=gc(e,tp(n)),i=gc(t,tp(n));return()=>{r(),i()}}function rp(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ip(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var ap=class extends Vc{constructor(e){super(e),this.removeGroupControls=Zn,this.removeListeners=Zn,this.controls=new ep(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zn}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},op=e=>(t,n)=>{e&&B.update(()=>e(t,n),!1,!0)},sp=class extends Vc{constructor(){super(...arguments),this.removePointerDownListener=Zn}onPointerDown(e){this.session=new Ff(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jf(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:op(e),onStart:op(t),onMove:op(n),onEnd:(e,t)=>{delete this.session,r&&B.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Af(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},cp=!1,lp=class extends i.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),cp&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Lu.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),cp=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||B.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Fs.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;cp=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function up(e){let[t,n]=Od(),r=(0,i.useContext)(In);return(0,a.jsx)(lp,{...e,layoutGroup:r,switchLayoutGroup:(0,i.useContext)(mf),isPresent:t,safeToRemove:n})}var dp={pan:{Feature:sp},drag:{Feature:ap,ProjectionNode:yd,MeasureLayout:up}};function fp(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&B.postRender(()=>i(t,Of(t)))}var pp=class extends Vc{mount(){let{current:e}=this.node;e&&(this.unmount=Hs(e,(e,t)=>(fp(this.node,t,`Start`),e=>fp(this.node,e,`End`))))}unmount(){}},mp=class extends Vc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=$n(ju(this.node.current,`focus`,()=>this.onFocus()),ju(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function hp(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&B.postRender(()=>i(t,Of(t)))}var gp=class extends Vc{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=tc(e,(e,t)=>(hp(this.node,t,`Start`),(e,{success:t})=>hp(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},_p=new WeakMap,vp=new WeakMap,yp=e=>{let t=_p.get(e.target);t&&t(e)},bp=e=>{e.forEach(yp)};function xp({root:e,...t}){let n=e||document;vp.has(n)||vp.set(n,{});let r=vp.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(bp,{root:e,...t})),r[i]}function Sp(e,t,n){let r=xp(t);return _p.set(e,n),r.observe(e),()=>{_p.delete(e),r.unobserve(e)}}var Cp={some:0,all:1},wp=class extends Vc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Cp[r]};this.stopObserver=Sp(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Tp(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Tp({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Ep={inView:{Feature:wp},tap:{Feature:gp},focus:{Feature:mp},hover:{Feature:pp}},Dp={layout:{ProjectionNode:yd,MeasureLayout:up}},Op=Cf({...Df,...Ep,...dp,...Dp},wf),kp=e=>e?.formType===`private`||e?.submitPage===`requests`?`user_requests`:`user_submissions`,Ap={contact:p,support:h};function jp(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=jp(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Mp(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=jp(e))&&(r&&(r+=` `),r+=t);return r}var Np=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Pp=(e,t)=>({classGroupId:e,validator:t}),Fp=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ip=`-`,Lp=[],Rp=`arbitrary..`,zp=e=>{let t=Hp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Vp(e);let n=e.split(Ip);return Bp(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Np(i,t):t:i||Lp}return n[e]||Lp}}},Bp=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Bp(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ip):e.slice(t).join(Ip),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Vp=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Rp+r:void 0})(),Hp=e=>{let{theme:t,classGroups:n}=e;return Up(n,t)},Up=(e,t)=>{let n=Fp();for(let r in e){let i=e[r];Wp(i,n,r,t)}return n},Wp=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Gp(i,t,n,r)}},Gp=(e,t,n,r)=>{if(typeof e==`string`){Kp(e,t,n);return}if(typeof e==`function`){qp(e,t,n,r);return}Jp(e,t,n,r)},Kp=(e,t,n)=>{let r=e===``?t:Yp(t,e);r.classGroupId=n},qp=(e,t,n,r)=>{if(Xp(e)){Wp(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Pp(n,e))},Jp=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Wp(o,Yp(t,a),n,r)}},Yp=(e,t)=>{let n=e,r=t.split(Ip),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Fp(),n.nextPart.set(t,i)),n=i}return n},Xp=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Zp=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Qp=`!`,$p=`:`,em=[],tm=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),nm=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===$p){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Qp)?(c=s.slice(0,-1),l=!0):s.startsWith(Qp)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return tm(t,l,c,u)};if(t){let e=t+$p,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):tm(em,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},rm=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},im=e=>({cache:Zp(e.cacheSize),parseClassName:nm(e),sortModifiers:rm(e),...zp(e)}),am=/\s+/,om=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(am),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+Qp:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},sm=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=cm(n))&&(i&&(i+=` `),i+=r);return i},cm=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=cm(e[r]))&&(n&&(n+=` `),n+=t);return n},lm=(e,...t)=>{let n,r,i,a,o=o=>(n=im(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=om(e,n);return i(e,a),a};return a=o,(...e)=>a(sm(...e))},um=[],J=e=>{let t=t=>t[e]||um;return t.isThemeGetter=!0,t},dm=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fm=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pm=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,mm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hm=/\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$/,gm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_m=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ym=e=>pm.test(e),Y=e=>!!e&&!Number.isNaN(Number(e)),bm=e=>!!e&&Number.isInteger(Number(e)),xm=e=>e.endsWith(`%`)&&Y(e.slice(0,-1)),Sm=e=>mm.test(e),Cm=()=>!0,wm=e=>hm.test(e)&&!gm.test(e),Tm=()=>!1,Em=e=>_m.test(e),Dm=e=>vm.test(e),Om=e=>!X(e)&&!Z(e),km=e=>Wm(e,Jm,Tm),X=e=>dm.test(e),Am=e=>Wm(e,Ym,wm),jm=e=>Wm(e,Xm,Y),Mm=e=>Wm(e,Qm,Cm),Nm=e=>Wm(e,Zm,Tm),Pm=e=>Wm(e,Km,Tm),Fm=e=>Wm(e,qm,Dm),Im=e=>Wm(e,$m,Em),Z=e=>fm.test(e),Lm=e=>Gm(e,Ym),Rm=e=>Gm(e,Zm),zm=e=>Gm(e,Km),Bm=e=>Gm(e,Jm),Vm=e=>Gm(e,qm),Hm=e=>Gm(e,$m,!0),Um=e=>Gm(e,Qm,!0),Wm=(e,t,n)=>{let r=dm.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Gm=(e,t,n=!1)=>{let r=fm.exec(e);return r?r[1]?t(r[1]):n:!1},Km=e=>e===`position`||e===`percentage`,qm=e=>e===`image`||e===`url`,Jm=e=>e===`length`||e===`size`||e===`bg-size`,Ym=e=>e===`length`,Xm=e=>e===`number`,Zm=e=>e===`family-name`,Qm=e=>e===`number`||e===`weight`,$m=e=>e===`shadow`,eh=lm(()=>{let e=J(`color`),t=J(`font`),n=J(`text`),r=J(`font-weight`),i=J(`tracking`),a=J(`leading`),o=J(`breakpoint`),s=J(`container`),c=J(`spacing`),l=J(`radius`),u=J(`shadow`),d=J(`inset-shadow`),f=J(`text-shadow`),p=J(`drop-shadow`),m=J(`blur`),h=J(`perspective`),g=J(`aspect`),_=J(`ease`),v=J(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Z,X],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Z,X,c],T=()=>[ym,`full`,`auto`,...w()],E=()=>[bm,`none`,`subgrid`,Z,X],D=()=>[`auto`,{span:[`full`,bm,Z,X]},bm,Z,X],O=()=>[bm,`auto`,Z,X],k=()=>[`auto`,`min`,`max`,`fr`,Z,X],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],te=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[ym,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[ym,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[ym,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,Z,X],N=()=>[...b(),zm,Pm,{position:[Z,X]}],P=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],F=()=>[`auto`,`cover`,`contain`,Bm,km,{size:[Z,X]}],ie=()=>[xm,Lm,Am],I=()=>[``,`none`,`full`,l,Z,X],L=()=>[``,Y,Lm,Am],ae=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[Y,xm,zm,Pm],z=()=>[``,`none`,m,Z,X],se=()=>[`none`,Y,Z,X],ce=()=>[`none`,Y,Z,X],le=()=>[Y,Z,X],ue=()=>[ym,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Sm],breakpoint:[Sm],color:[Cm],container:[Sm],"drop-shadow":[Sm],ease:[`in`,`out`,`in-out`],font:[Om],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Sm],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Sm],shadow:[Sm],spacing:[`px`,Y],text:[Sm],"text-shadow":[Sm],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ym,X,Z,g]}],container:[`container`],columns:[{columns:[Y,X,Z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[bm,`auto`,Z,X]}],basis:[{basis:[ym,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Y,ym,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,Y,Z,X]}],shrink:[{shrink:[``,Y,Z,X]}],order:[{order:[bm,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...te(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...te()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...te(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...te(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...te(),`baseline`]}],"place-self":[{"place-self":[`auto`,...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,Lm,Am]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Um,Mm]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,xm,X]}],"font-family":[{font:[Rm,Nm,t]}],"font-features":[{"font-features":[X]}],"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:[i,Z,X]}],"line-clamp":[{"line-clamp":[Y,`none`,Z,jm]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[Y,`from-font`,`auto`,Z,Am]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Y,`auto`,Z,X]}],"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`,Z,X]}],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`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:F()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},bm,Z,X],radial:[``,Z,X],conic:[bm,Z,X]},Vm,Fm]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-bs":[{"border-bs":L()}],"border-w-be":[{"border-be":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":L()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Y,Z,X]}],"outline-w":[{outline:[``,Y,Lm,Am]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`none`,u,Hm,Im]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Hm,Im]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:L()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Y,Am]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Hm,Im]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Y,Z,X]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"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":[Y]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":b()}],"mask-image-conic-pos":[{"mask-conic":[Y]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:z()}],brightness:[{brightness:[Y,Z,X]}],contrast:[{contrast:[Y,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Hm,Im]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,Y,Z,X]}],"hue-rotate":[{"hue-rotate":[Y,Z,X]}],invert:[{invert:[``,Y,Z,X]}],saturate:[{saturate:[Y,Z,X]}],sepia:[{sepia:[``,Y,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":z()}],"backdrop-brightness":[{"backdrop-brightness":[Y,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[Y,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Y,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Y,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,Y,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[Y,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[Y,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,Y,Z,X]}],"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`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Y,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,_,Z,X]}],delay:[{delay:[Y,Z,X]}],animate:[{animate:[`none`,v,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":[`translate-none`],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"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`,Z,X]}],"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-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":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-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":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`,Z,X]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[Y,Lm,Am,jm]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`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`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`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-bs`,`border-w-be`,`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-bs`,`border-color-be`,`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-mbs`,`scroll-mbe`,`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-pbs`,`scroll-pbe`,`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 th(...e){return eh(Mp(e))}var nh=i.default.forwardRef(({className:e,label:t,error:n,currencySymbol:r,type:i,...o},s)=>{let c=i===`currency`;return(0,a.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[t&&(0,a.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1`,children:t}),(0,a.jsxs)(`div`,{className:`relative flex items-center lift-focus`,children:[c&&r&&(0,a.jsx)(`span`,{className:`absolute left-4 font-bold text-foreground/70 z-10 pointer-events-none text-[15px]`,children:r}),(0,a.jsx)(`input`,{ref:s,type:c?`number`:i,className:th(`block h-12 w-full text-[15px] text-foreground py-2`,c&&r?`pl-8 pr-4`:`px-4`,`transition-all duration-300 placeholder:text-foreground/40`,`focus:outline-none focus:border-accent glow-focus`,`disabled:cursor-not-allowed disabled:opacity-50 glass-panel`,n&&`border-red-500/50 focus:border-red-500/50`,e),style:{borderRadius:`var(--input-radius, 0.75rem)`},...o})]}),n&&(0,a.jsx)(Op.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:`text-xs text-red-500 font-medium`,children:n})]})});nh.displayName=`Input`;var rh=i.default.forwardRef(({className:e,variant:t=`primary`,isLoading:n,children:r,...i},o)=>(0,a.jsxs)(Op.button,{ref:o,whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},className:th(`relative inline-flex items-center justify-center px-5 py-2 text-sm font-medium transition-all duration-300 overflow-hidden group`,{primary:`btn-primary !border-none`,secondary:`btn-secondary !border-none`,ghost:`bg-transparent hover:bg-black/5 dark:hover:bg-white/5 text-foreground/60 hover:text-foreground transition-all duration-300 !border-none`}[t],e),style:{borderRadius:`var(--btn-radius, 0.75rem)`},disabled:n||i.disabled,...i,children:[n?(0,a.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,a.jsxs)(`svg`,{className:`w-5 h-5 animate-spin text-current`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,a.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,a.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}):null,(0,a.jsx)(`span`,{className:th(`inline-flex items-center justify-center gap-2`,n&&`opacity-0`),children:r})]}));rh.displayName=`Button`;var ih=()=>typeof document>`u`?null:document.querySelector(`.firebase-os`)||document.body;function ah({value:e=``,options:t,onChange:r,label:o,disabled:s,variant:c=`default`,multiple:l=!1,values:u,placeholder:f,footer:p,compact:m=!1,dense:h=!1,direction:g=`up`,portal:_=!1,ariaLabel:v,className:y=``}){let[b,x]=(0,i.useState)(!1),[S,C]=(0,i.useState)(g===`down`?`down`:`up`),[w,T]=(0,i.useState)(null),E=(0,i.useRef)(null),D=(0,i.useRef)(null),O=(0,i.useRef)(null);(0,i.useEffect)(()=>{function e(e){let t=e.target;E.current?.contains(t)||O.current?.contains(t)||x(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,i.useLayoutEffect)(()=>{if(!b)return;let e=()=>{let e=D.current;if(!e)return;let t=e.getBoundingClientRect();if(T({top:t.top,left:t.left,width:t.width,height:t.height}),g===`auto`){let e=(typeof window<`u`?window.innerHeight:0)-t.bottom;C(e<260&&t.top>e?`up`:`down`)}else C(g)};return e(),window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[b,g]);let k=l&&u||[],ee=t=>l?k.includes(t):e===t,te=t.find(t=>t.value===e)||(f==null?t[0]:void 0),A=t.filter(e=>k.includes(e.value)).map(e=>e.label),j=l?A.length?A.map((e,t)=>(0,a.jsxs)(i.default.Fragment,{children:[t>0?`, `:``,e]},t)):f:te?.label??f,ne=!s&&(t.length>1||l),re=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!b)return;let e=re.current,t=e?.querySelector(`[aria-selected="true"]`);!e||!t||(e.scrollTop=t.offsetTop-e.clientHeight/2+t.clientHeight/2)},[b]);let M=(0,a.jsx)(Op.div,{ref:O,role:`listbox`,"aria-label":v||o,"aria-multiselectable":l||void 0,initial:{opacity:0,y:S===`up`?5:-5,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:S===`up`?5:-5,scale:.98},transition:{duration:.15},className:`z-[99999] glass-popover overflow-hidden ${_?`fixed`:`absolute left-0 w-full ${S===`up`?`bottom-[calc(100%+8px)]`:`top-[calc(100%+8px)]`}`}`,style:{borderRadius:`var(--input-radius, 0.75rem)`,..._&&w?(()=>{let e=Math.max(w.width,m?180:0),t=(typeof window<`u`?window.innerWidth:w.left+e)-e-8;return{left:Math.max(8,Math.min(w.left,t)),width:e,...S===`up`?{bottom:(typeof window<`u`?window.innerHeight:0)-w.top+8}:{top:w.top+w.height+8}}})():{}},children:(0,a.jsxs)(`div`,{ref:re,className:`max-h-60 overflow-y-auto no-scrollbar p-1`,children:[t.map(e=>(0,a.jsxs)(`div`,{role:`option`,"aria-selected":ee(e.value),"aria-disabled":e.disabled||void 0,onClick:()=>{e.disabled||(r(e.value),l||x(!1))},className:`flex items-center justify-between gap-3 px-3 py-2.5 transition-colors font-medium ${h?`text-[13.5px]`:`text-[13px]`} ${e.disabled?`text-foreground/30 cursor-default`:ee(e.value)?`bg-accent/10 text-accent font-bold cursor-pointer`:`text-foreground/80 hover:bg-foreground/5 hover:text-foreground cursor-pointer`}`,style:{borderRadius:`calc(var(--input-radius, 0.75rem) - 0.25rem)`},children:[(0,a.jsx)(`span`,{className:`truncate`,children:e.label}),ee(e.value)&&!e.disabled&&(0,a.jsx)(n.rn,{className:`w-3.5 h-3.5 shrink-0 text-accent`})]},e.value)),p]})}),N=_?ih():null,P=(0,a.jsx)(jd,{children:b&&M});return(0,a.jsxs)(`div`,{className:`flex flex-col relative ${m?`w-auto`:`w-full`} ${s?`opacity-50 pointer-events-none`:``} ${y}`,ref:E,children:[o&&(0,a.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1`,children:o}),(0,a.jsxs)(`div`,{className:`relative ${m?`w-auto`:`w-full`}`,children:[(0,a.jsxs)(`div`,{ref:D,role:`button`,tabIndex:s?-1:0,"aria-haspopup":`listbox`,"aria-expanded":b,"aria-label":v||o,"aria-disabled":s||void 0,onClick:()=>{ne&&x(!b)},onKeyDown:e=>{ne&&((e.key===`Enter`||e.key===` `)&&(e.preventDefault(),x(e=>!e)),e.key===`Escape`&&x(!1))},className:`text-foreground transition-all duration-300 flex items-center justify-between outline-none ${m?`h-9 px-3 gap-2 text-[12.5px] font-semibold`:h?`w-full h-11 px-4 text-[14px] font-medium`:`w-full h-12 px-4 text-[15px]`} ${ne?`cursor-pointer`:`cursor-default`} ${c===`ghost`?`hover:bg-foreground/5 bg-transparent`:`border glass-panel ${m?``:`shadow-sm`} ${b?`border-accent select-open`:`border-[var(--panel-border)]`}`}`,style:{borderRadius:`var(--input-radius, 0.75rem)`},children:[(0,a.jsx)(`span`,{className:`truncate`,children:j}),(t.length>1||l)&&(0,a.jsx)(n.nn,{className:`w-4 h-4 text-foreground/50 shrink-0 transition-transform duration-300 ${b?`rotate-180`:``}`})]}),!(_&&N)&&P]}),_&&N?(0,d.createPortal)(P,N):null]})}var oh=45*1024,sh=/^image\/(jpe?g|png|webp)$/i,ch=[.82,.65,.5],lh=()=>{try{let e=document.createElement(`canvas`);return e.width=1,e.height=1,e.toDataURL(`image/webp`).startsWith(`data:image/webp`)}catch{return!1}},uh=async e=>{if(typeof createImageBitmap==`function`){let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,done:()=>t.close?.()}}let t=URL.createObjectURL(e);try{let e=await new Promise((e,n)=>{let r=new Image;r.onload=()=>e(r),r.onerror=()=>n(Error(`That picture could not be read.`)),r.src=t});return{source:e,width:e.naturalWidth,height:e.naturalHeight,done:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}},dh=(e,t,n)=>new Promise(r=>{if(typeof e.toBlob!=`function`){r(null);return}e.toBlob(e=>r(e),t,n)}),fh=`__sm`,ph=e=>`${(e||`image`).replace(/\.[^.]+$/,``)||`image`}${fh}.webp`,mh=e=>{let t=e.lastIndexOf(`/`),n=e.slice(t+1);return hh(n)?``:`${e.slice(0,t+1)}${ph(n)}`},hh=e=>RegExp(`${fh}\\.webp($|[?#])`,`i`).test(String(e||``)),gh=(e,t)=>{let n=t===`image/webp`?`webp`:t===`image/png`?`png`:`jpg`;return`${(e||`image`).replace(/\.[^.]+$/,``)||`image`}.${n}`};async function _h(e,t={}){let n=t.maxSide??1600,r=t.targetBytes??921600;if(!e||!sh.test(e.type||``)||e.size<=(t.floorBytes??153600)||typeof document>`u`)return e;try{let{source:t,width:i,height:a,done:o}=await uh(e);try{if(!i||!a)return e;let o=Math.min(1,n/Math.max(i,a)),s=document.createElement(`canvas`);s.width=Math.max(1,Math.round(i*o)),s.height=Math.max(1,Math.round(a*o));let c=s.getContext(`2d`);if(!c)return e;c.drawImage(t,0,0,s.width,s.height);let l=/png$/i.test(e.type),u=lh()?`image/webp`:l?`image/png`:`image/jpeg`,d=null;for(let e of ch){let t=await dh(s,u,e);if(!t||(d=t,t.size<=r)||u===`image/png`)break}return!d||d.size>=e.size?e:new File([d],gh(e.name,u),{type:u,lastModified:Date.now()})}finally{o()}}catch{return e}}async function vh(e,t){if(!e||!sh.test(e.type||``)||hh(e.name||``)||e.size<=46080)return null;try{let n=await _h(e,{maxSide:400,targetBytes:oh,floorBytes:0});return n===e?null:new File([n],ph(t||e.name),{type:n.type,lastModified:Date.now()})}catch{return null}}var yh=`pub_files`,bh=e=>`${Date.now()}_${(e||`file`).replace(/[^a-zA-Z0-9.-]/g,`_`)}`;async function xh(e,t,n){try{let r=await vh(t);if(!r)return``;let i=e.lastIndexOf(`/`),a=(0,l.ref)(k,`${e.slice(0,i+1)}${ph(e.slice(i+1))}`);return await(0,l.uploadBytes)(a,r,n?{customMetadata:n}:void 0),await(0,l.getDownloadURL)(a)}catch{return``}}async function Sh(e){let t=e?mh(e):``;if(t)try{await(0,l.deleteObject)((0,l.ref)(k,t))}catch{}}async function Ch(e,t){if(!t)throw Error(`Sign in again before uploading.`);let n=await _h(e),r=`${yh}/${bh(n.name)}`,i=(0,l.ref)(k,r);await(0,l.uploadBytes)(i,n,{customMetadata:{ownerId:t.uid}});let a=await(0,l.getDownloadURL)(i),o=await xh(r,n,{ownerId:t.uid});return await(0,c.addDoc)((0,c.collection)(O,yh),{fileName:n.name,fileType:n.type||`unknown`,fileSize:n.size,downloadURL:a,...o?{smallURL:o}:{},storagePath:r,uid:t.uid,uploaderEmail:t.email||``,createdAt:(0,c.serverTimestamp)()}),{url:a,file:n,...o?{small:o}:{}}}var wh=async(e,t)=>(await Ch(e,t)).url,Th=`pub_form_uploads`;async function Eh(e,t){let n=await _h(e);if(n.size>=10485760)throw Error(`That file is over 10 MB. Try a smaller one.`);let r=Math.random().toString(36).slice(2,8),i=(0,l.ref)(k,`${Th}/${Date.now()}_${r}_${(n.name||`file`).replace(/[^a-zA-Z0-9.-]/g,`_`)}`);return await(0,l.uploadBytes)(i,n,t?{customMetadata:{ownerId:t.uid}}:void 0),(0,l.getDownloadURL)(i)}var Dh=e=>typeof e==`string`?e.split(/\s+/).filter(Boolean):[],Oh=e=>e.join(`
11
+ `),kh=e=>/^https?:\/\/\S+$/.test(e)&&RegExp(`(/|%2F)pub_form_uploads(/|%2F)`,`i`).test(e),Ah=e=>{let t=Dh(e);return t.length>0&&t.every(kh)};function jh(e){try{let t=new URL(e);return(decodeURIComponent(t.pathname.split(`/o/`)[1]||t.pathname).split(`/`).pop()||``).replace(/^\d+_[a-z0-9]+_/,``)||t.hostname||`Attached file`}catch{return`Attached file`}}var Mh=e=>e?.code===`storage/unauthorized`?`You do not have permission to upload here.`:e?.message||`That upload did not work. Try again.`,Nh=(e,t)=>{let n=String(t||``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(!n.length)return!0;let r=(e.type||``).toLowerCase(),i=(e.name||``).toLowerCase();return n.some(e=>e.startsWith(`.`)?i.endsWith(e):e.endsWith(`/*`)?r.startsWith(e.slice(0,-1)):r===e)},Ph=e=>Array.from(e.dataTransfer?.types||[]).includes(`Files`);function Fh({onFiles:e,onReject:t,accept:n,multiple:r=!1,disabled:a=!1}){let[o,s]=(0,i.useState)(!1),c=(0,i.useRef)(0);return{over:o&&!a,dropProps:{onDragEnter:e=>{a||!Ph(e)||(e.preventDefault(),c.current+=1,s(!0))},onDragOver:e=>{a||!Ph(e)||e.preventDefault()},onDragLeave:e=>{Ph(e)&&(c.current=Math.max(0,c.current-1),c.current===0&&s(!1))},onDrop:i=>{if(c.current=0,s(!1),a||!Ph(i))return;i.preventDefault();let o=Array.from(i.dataTransfer.files||[]),l=o.filter(e=>Nh(e,n)),u=o.filter(e=>!Nh(e,n));u.length&&t?.(u);let d=r?l:l.slice(0,1);d.length&&e(d)}}}}function Ih({field:e,value:t,error:r,onChange:o}){let[s,c]=(0,i.useState)(0),[l,u]=(0,i.useState)(``),d=(0,i.useRef)(null),f=s>0,p=Dh(t),m=async e=>{let t=Array.from(e||[]);d.current&&(d.current.value=``),t.length&&(u(``),c(e=>e+t.length),await Promise.all(t.map(async e=>{try{let t=await Eh(e,D.currentUser);o(e=>Oh([...Dh(e),t]))}catch(e){u(e?.code===`storage/unauthorized`?`That kind of file is not accepted. Try a PDF, a document or a picture.`:Mh(e))}finally{c(e=>e-1)}})))},h=e=>{u(``),o(t=>Oh(Dh(t).filter(t=>t!==e)))},{over:g,dropProps:_}=Fh({accept:e.accept,multiple:!0,disabled:f,onFiles:m,onReject:()=>u(`That kind of file is not accepted here.`)}),v=r||l;return(0,a.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[(0,a.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1`,children:e.label}),p.length>0&&(0,a.jsx)(`ul`,{className:`flex flex-col gap-1.5 mb-2`,children:p.map(e=>(0,a.jsxs)(`li`,{className:`flex items-center gap-3 w-full rounded-xl px-4 py-2.5 glass-panel`,style:{borderRadius:`var(--input-radius, 0.75rem)`},children:[(0,a.jsx)(n.X,{className:`w-4 h-4 shrink-0 text-accent`}),(0,a.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[15px] text-foreground`,children:jh(e)}),(0,a.jsx)(`button`,{type:`button`,onClick:()=>h(e),"aria-label":`Remove ${jh(e)}`,title:`Remove`,className:`p-1 rounded-lg text-foreground/40 hover:text-red-500 hover:bg-red-500/10 transition-colors cursor-pointer shrink-0`,children:(0,a.jsx)(n.a,{className:`w-3.5 h-3.5`})})]},e))}),(0,a.jsxs)(`label`,{..._,className:`flex items-center gap-3 w-full rounded-xl px-4 py-3 glass-panel transition-all duration-300 cursor-pointer hover:border-accent ${f?`opacity-60 pointer-events-none`:``} ${g?`!border-accent bg-accent/[0.05]`:``}`,style:{borderRadius:`var(--input-radius, 0.75rem)`},children:[f?(0,a.jsx)(n.ft,{className:`w-4 h-4 animate-spin text-accent shrink-0`}):(0,a.jsx)(n.Kt,{className:`w-4 h-4 shrink-0 ${g?`text-accent`:`text-foreground/40`}`}),(0,a.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[15px] ${g?`text-accent`:`text-foreground/40`}`,children:g?`Drop to attach`:f?s>1?`Uploading ${s} files...`:`Uploading...`:p.length?`Add another file`:e.placeholder||`Attach files, or drop them here`}),!f&&(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[12.5px] font-bold text-foreground/60 shrink-0`,children:[(0,a.jsx)(n.Kt,{className:`w-3.5 h-3.5`}),(0,a.jsx)(`span`,{className:`max-sm:hidden`,children:`Upload`})]}),(0,a.jsx)(`input`,{ref:d,type:`file`,multiple:!0,accept:e.accept,"aria-label":e.label,disabled:f,onChange:e=>m(e.target.files),className:`hidden`})]}),v&&(0,a.jsx)(`span`,{className:`text-xs text-red-500 font-medium mt-1.5 ml-1`,children:v})]})}var Lh=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],Rh={mon:`Monday`,tue:`Tuesday`,wed:`Wednesday`,thu:`Thursday`,fri:`Friday`,sat:`Saturday`,sun:`Sunday`},zh={mon:`Mon`,tue:`Tue`,wed:`Wed`,thu:`Thu`,fri:`Fri`,sat:`Sat`,sun:`Sun`},Bh=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`],Vh=[{value:`text`,label:`Short text`},{value:`textarea`,label:`Long text`},{value:`tel`,label:`Phone`},{value:`email`,label:`Email`},{value:`number`,label:`Number`},{value:`date`,label:`Date`},{value:`select`,label:`Choose one`},{value:`checkbox`,label:`Yes-no`},{value:`file`,label:`A file`}],Hh=new Set(Vh.map(e=>e.value)),Uh={text:`Your answer`,textarea:`A sentence or two`,tel:`+1 555 0123`,email:`jane@example.com`,number:`2`,date:``,select:`Choose one…`,checkbox:``,file:`Attach a file, or drop it here`},Wh=new Set(Object.values(Uh).filter(Boolean)),Gh=e=>e!==`date`&&e!==`checkbox`,Kh=(e,t)=>{if(!Gh(t))return``;let n=String(e.placeholder||``).trim();return!n||Wh.has(n)?Uh[t]:e.placeholder},qh=[{name:`name`,type:`text`,label:`Your name`,placeholder:`Jane Doe`},{name:`email`,type:`email`,label:`Your email`,placeholder:`jane@example.com`}],Jh=new Set(qh.map(e=>e.name)),Yh=e=>Jh.has(e),Xh=e=>{let t=qh.find(t=>t.name===e);return{name:t.name,label:t.label,type:t.type,required:!0,placeholder:t.placeholder,options:[]}},Zh=(e,t)=>e.find(e=>e.name===t)||Xh(t),Qh=()=>[Xh(`name`),Xh(`email`),{name:`note`,label:`Anything we should know?`,type:`textarea`,required:!1,placeholder:``,options:[]}],$h=()=>({name:``,label:``,type:`text`,required:!1,placeholder:Uh.text,options:[]}),eg=e=>String(e||``).toLowerCase().trim().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).slice(0,60);function tg(e,t,n){if(e.name&&e.name!==eg(e.label))return e.name;let r=eg(t);if(!r)return``;let i=n.filter(t=>t!==e).map(e=>e.name);if(!i.includes(r))return r;let a=2;for(;i.includes(`${r}_${a}`);)a++;return`${r}_${a}`}var ng=(e,t)=>{let n=String(e?.label||``),r=Hh.has(String(e?.type))?String(e.type):`text`;return{name:String(e?.name||``).trim()||eg(n)||(n.trim()?`answer_${t+1}`:``),label:n,type:r,required:e?.required===!0,placeholder:String(e?.placeholder||``),options:r===`select`&&Array.isArray(e?.options)?e.options.map(e=>String(e||``)):[]}};function rg(e){let t=Array.isArray(e)?e.map(ng).filter(e=>e.name):Qh();return[...qh.map(e=>{let n=t.find(t=>t.name===e.name),r=Xh(e.name);return n?{...r,label:n.label.trim()?n.label:r.label,placeholder:n.placeholder}:r}),...t.filter(e=>!Yh(e.name))]}var ig=e=>e.filter(e=>e.label.trim()&&!Yh(e.name));function ag(e,t){let n={};for(let r of ig(e))r.required&&(String(t[r.name]||``).trim()||(n[r.name]=r.type===`checkbox`?`Please tick this to book.`:r.type===`file`?`Please attach a file to book.`:`Please answer this.`));return n}function og(e,t){let n={};for(let r of ig(e)){let e=String(t[r.name]||``).trim();e&&(n[r.name]=e)}return n}function sg(e,t){let n={};for(let r of ig(e)){let e=String(t[r.name]||``).trim();e&&(n[r.label.trim()]=e)}return n}var cg=`booking`,lg=`sys_schedules`,ug=`pub_bookings`,Q=`mem_bookings`,dg=[{value:`15`,label:`15 minutes`},{value:`30`,label:`30 minutes`},{value:`45`,label:`45 minutes`},{value:`60`,label:`1 hour`},{value:`90`,label:`1½ hours`},{value:`120`,label:`2 hours`}],fg=[{value:`7`,label:`A week ahead`},{value:`14`,label:`Two weeks ahead`},{value:`30`,label:`A month ahead`},{value:`60`,label:`Two months ahead`},{value:`90`,label:`Three months ahead`}],pg=[{value:`0`,label:`No notice needed`},{value:`2`,label:`At least 2 hours`},{value:`12`,label:`At least 12 hours`},{value:`24`,label:`At least a day`},{value:`48`,label:`At least two days`}],mg=Array.from({length:48},(e,t)=>{let n=`${String(Math.floor(t/2)).padStart(2,`0`)}:${t%2?`30`:`00`}`;return{value:n,label:n}}),hg=[...mg.slice(1),{value:`24:00`,label:`Midnight`}],gg={from:`09:00`,to:`17:00`},_g=(e,t=e,n=``,r=kg())=>({id:e,memberId:t,memberName:n,name:``,description:``,questions:Qh(),paymentId:``,notifyOwner:!0,confirmBooker:!0,enabled:!1,timeZone:r,slotMinutes:30,days:{mon:[gg],tue:[gg],wed:[gg],thu:[gg],fri:[gg],sat:[],sun:[]},blocked:[],horizonDays:30,noticeHours:12}),vg=/^([01]\d|2[0-3]):[0-5]\d$/,yg=/^(([01]\d|2[0-3]):[0-5]\d|24:00)$/,bg=e=>{let t=String(e?.from||``),n=String(e?.to||``);return vg.test(t)&&yg.test(n)?{from:t,to:n}:null},$=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},xg=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Sg=e=>{let t=String(e||``);if(!xg.test(t))return!1;let[n,r,i]=t.split(`-`).map(Number),a=new Date(Date.UTC(n,r-1,i));return a.getUTCFullYear()===n&&a.getUTCMonth()===r-1&&a.getUTCDate()===i};function Cg(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e){let e=typeof n==`string`?n:String(n?.date||``);if(!Sg(e))continue;let r=Array.isArray(n?.windows)?n.windows.map(e=>bg(e)).filter(e=>!!e&&$(e.to)>$(e.from)):[],i=t.get(e);i&&i.length&&r.length?t.set(e,[...i,...r]):t.set(e,i&&!i.length?[]:r)}return[...t.entries()].map(([e,t])=>({date:e,windows:t.sort((e,t)=>$(e.from)-$(t.from))})).sort((e,t)=>e.date.localeCompare(t.date))}function wg(e,t){let n=e.blocked.find(e=>e.date===t);return n?n.windows.length?n.windows:[Eg]:[]}var Tg=(e,t)=>e.blocked.some(e=>e.date===t&&e.windows.length===0),Eg={from:`00:00`,to:`24:00`},Dg=(e,t,n)=>{let r=typeof e==`number`?e:Number(e);return!Number.isFinite(r)||r<0||n&&!n.includes(r)?t:r},Og=(e,t)=>{let n=!String(t?.memberId||``).trim(),r=n?e:String(t.memberId),i=String((n?t?.name:t?.memberName)||``),a=_g(e,r,i,`UTC`),o={...a.days};for(let e of Lh){let n=t?.days?.[e];o[e]=Array.isArray(n)?n.map(bg).filter(e=>!!e):[]}let s=t?.days&&typeof t.days==`object`;return{id:e,memberId:r,memberName:i,name:String(t?.name||``),description:String(t?.description||``),questions:rg(t?.questions),paymentId:String(t?.paymentId||``),notifyOwner:t?.notifyOwner!==!1,confirmBooker:t?.confirmBooker!==!1,enabled:t?.enabled===!0,timeZone:jg(t?.timeZone)?String(t.timeZone):a.timeZone,slotMinutes:Dg(t?.slotMinutes,30,dg.map(e=>Number(e.value))),days:s?o:a.days,blocked:Cg(t?.blocked),horizonDays:Dg(t?.horizonDays,30),noticeHours:Dg(t?.noticeHours,12),createdAt:typeof t?.createdAt==`number`?t.createdAt:void 0,updatedAt:typeof t?.updatedAt==`number`?t.updatedAt:void 0}};function kg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}}var Ag=new Map;function jg(e){if(typeof e!=`string`||!e.trim())return!1;let t=Ag.get(e);if(t!==void 0)return t;let n=!1;try{new Intl.DateTimeFormat(`en-US`,{timeZone:e}),n=!0}catch{n=!1}return Ag.set(e,n),n}function Mg(){try{return Intl.supportedValuesOf?Intl.supportedValuesOf(`timeZone`):[`UTC`]}catch{return[`UTC`]}}function Ng(e,t=12){let n=e.trim().toLowerCase().replace(/\s+/g,`_`),r=Mg(),i=kg(),a=n?r.filter(e=>e.toLowerCase().includes(n)):r;return(a.includes(i)?[i,...a.filter(e=>e!==i)]:a).slice(0,t)}var Pg=new Map,Fg=e=>{let t=Pg.get(e);return t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,weekday:`short`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),Pg.set(e,t)),t};function Ig(e,t){let n={};for(let r of Fg(t).formatToParts(e))n[r.type]=r.value;let r=Number(n.year),i=Number(n.month),a=Number(n.day),o=Number(n.hour)%24,s=Number(n.minute);return{year:r,month:i,day:a,hour:o,minute:s,second:Number(n.second),weekday:(n.weekday||`Mon`).slice(0,3).toLowerCase(),dateKey:`${r}-${String(i).padStart(2,`0`)}-${String(a).padStart(2,`0`)}`,time:`${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}`}}function Lg(e,t){let n=Ig(t,e),r=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second);return Math.round((r-t.getTime())/6e4)}function Rg(e,t,n){let[r,i,a]=e.split(`-`).map(Number),[o,s]=t.split(`:`).map(Number),c=Date.UTC(r,i-1,a,o,s),l=Lg(n,new Date(c)),u=c-l*6e4,d=Lg(n,new Date(u));return d!==l&&(u=c-d*6e4,Lg(n,new Date(u))!==d&&(u=c-Math.min(l,d)*6e4)),new Date(u)}function zg(e,t){let[n,r,i]=e.split(`-`).map(Number),a=new Date(Date.UTC(n,r-1,i+t));return`${a.getUTCFullYear()}-${String(a.getUTCMonth()+1).padStart(2,`0`)}-${String(a.getUTCDate()).padStart(2,`0`)}`}function Bg(e){let[t,n,r]=e.split(`-`).map(Number);return Bh[new Date(Date.UTC(t,n-1,r)).getUTCDay()]}function Vg(e,t){let[n,r]=e.split(`-`).map(Number);return new Intl.DateTimeFormat(t,{month:`long`,year:`numeric`,timeZone:`UTC`}).format(new Date(Date.UTC(n,r-1,1)))}function Hg(e,t){let[n,r]=e.split(`-`).map(Number),i=new Date(Date.UTC(n,r-1+t,1));return`${i.getUTCFullYear()}-${String(i.getUTCMonth()+1).padStart(2,`0`)}`}var Ug=(e,t)=>e.start<t.end&&t.start<e.end,Wg=(e,t)=>`${e}__${t.replace(/[-:]/g,``).slice(0,15)}`,Gg=[{value:``,label:`Theme`,hex:`var(--accent-color)`},{value:`rose`,label:`Rose`,hex:`#f43f5e`},{value:`amber`,label:`Amber`,hex:`#f59e0b`},{value:`emerald`,label:`Green`,hex:`#10b981`},{value:`sky`,label:`Blue`,hex:`#0ea5e9`},{value:`fuchsia`,label:`Pink`,hex:`#d946ef`},{value:`slate`,label:`Grey`,hex:`#64748b`}],Kg=e=>(Gg.find(t=>t.value===e)||Gg[0]).hex,qg=(e,t)=>`color-mix(in srgb, ${Kg(e)} ${t}%, transparent)`,Jg=Array.from({length:96},(e,t)=>{let n=`${String(Math.floor(t/4)).padStart(2,`0`)}:${String(t%4*15).padStart(2,`0`)}`;return{value:n,label:n}}),Yg=[...dg,{value:`180`,label:`3 hours`},{value:`240`,label:`4 hours`}],Xg=e=>e.own?(e.title||``).trim()||`Busy`:(e.name||``).trim()||`Someone`;function Zg(e,t){let{hour:n,minute:r}=Ig(e,t),i=Math.ceil((n*60+r)/15);return i>=96?`23:45`:Jg[i].value}function Qg(e,t){if(!k_(e))return[];let{now:n}=t,r=(t.taken||[]).filter(t=>t.memberId===e.memberId),i=e.timeZone,a=e.slotMinutes*6e4,o=n.getTime()+e.noticeHours*36e5,s=Math.max(1,Math.min(t.days??e.horizonDays,e.horizonDays)),c=Ig(n,i).dateKey,l=new Map;for(let t=0;t<s;t++){let n=zg(c,t);if(Tg(e,n))continue;let s=wg(e,n).map(e=>({start:Rg(n,e.from,i).toISOString(),end:Rg(n,e.to,i).toISOString()})),u=(e.days[Bg(n)]||[]).filter(e=>$(e.to)>$(e.from)).sort((e,t)=>$(e.from)-$(t.from));for(let t of u){let c=Rg(n,t.from,i).getTime(),u=Rg(n,t.to,i).getTime();for(let t=c;t+a<=u;t+=a){if(t<o||l.has(t))continue;let n={start:new Date(t).toISOString(),end:new Date(t+a).toISOString(),memberId:e.memberId,scheduleId:e.id};r.some(e=>Ug(e,n))||s.some(e=>Ug(e,n))||l.set(t,n)}}}return[...l.keys()].sort((e,t)=>e-t).map(e=>l.get(e))}function $g(e,t){return e.flatMap(e=>Qg(e,t)).sort((e,t)=>e.start.localeCompare(t.start)||e.memberId.localeCompare(t.memberId)||e.scheduleId.localeCompare(t.scheduleId))}function e_(e){let t=new Set,n=[];for(let r of e)t.has(r.memberId)||(t.add(r.memberId),n.push(r));return n}function t_(e,t,n){let r=e.timeZone,i=Ig(t,r).dateKey,a=[],o=[];for(let t=0;t<n;t++){let n=zg(i,t);if(!Tg(e,n)){for(let t of e.days[Bg(n)]||[])$(t.to)<=$(t.from)||a.push({from:Rg(n,t.from,r).getTime(),to:Rg(n,t.to,r).getTime()});for(let t of wg(e,n))o.push({from:Rg(n,t.from,r).getTime(),to:Rg(n,t.to,r).getTime()})}}return o.reduce((e,t)=>i_(e,t),n_(a))}function n_(e){let t=[...e].sort((e,t)=>e.from-t.from),n=[];for(let e of t){let t=n[n.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):n.push({...e})}return n}function r_(e,t){let n=[],r=0,i=0;for(;r<e.length&&i<t.length;){let a=Math.max(e[r].from,t[i].from),o=Math.min(e[r].to,t[i].to);a<o&&n.push({from:a,to:o}),e[r].to<t[i].to?r++:i++}return n}function i_(e,t){let n=[];for(let r of e){if(t.to<=r.from||t.from>=r.to){n.push(r);continue}t.from>r.from&&n.push({from:r.from,to:t.from}),t.to<r.to&&n.push({from:t.to,to:r.to})}return n}function a_(e,t){let n=e_(e.filter(k_));if(!n.length)return[];if(n.length===1)return Qg(n[0],t);let{now:r}=t,i=Math.max(...n.map(e=>e.slotMinutes))*6e4,a=Math.min(...n.map(e=>e.horizonDays)),o=Math.max(1,Math.min(t.days??a,a)),s=r.getTime()+Math.max(...n.map(e=>e.noticeHours))*36e5,c=t_(n[0],r,o);for(let e of n.slice(1)){if(!c.length)break;c=r_(c,t_(e,r,o))}let l=new Set(n.map(e=>e.memberId));for(let e of t.taken||[]){if(!c.length)break;if(!l.has(e.memberId))continue;let t=Date.parse(e.start),n=Date.parse(e.end);!Number.isFinite(t)||!Number.isFinite(n)||n<=t||(c=i_(c,{from:t,to:n}))}let u=n[0],d=[];for(let e of c)for(let t=e.from;t+i<=e.to;t+=i)t<s||d.push({start:new Date(t).toISOString(),end:new Date(t+i).toISOString(),memberId:u.memberId,scheduleId:u.id});return d.sort((e,t)=>e.start.localeCompare(t.start))}var o_=(e,t,n)=>n?a_(e,t):$g(e,t),s_=(e,t)=>{let n=e_(t);return n.length?n.map(t=>({start:e.start,end:e.end,memberId:t.memberId,scheduleId:t.id})):[e]},c_=e=>new Set(e.map(e=>e.memberId)).size>1,l_=(e,t)=>t.find(t=>t.id===e.scheduleId)||t.find(t=>t.memberId===e.memberId),u_=e=>`/book/${e}`,d_=e=>`/pay/${e}`;function f_(e){let t=typeof window<`u`&&window.location?.origin?window.location.origin:``;return t?`${t}${e}`:e}function p_(e,t,n){let r=new Map;for(let i of e){let e=new Date(i.start),{dateKey:a}=Ig(e,t),o=r.get(a);o||(o={dateKey:a,label:m_(e,t,n),slots:[]},r.set(a,o)),o.slots.push(i)}return[...r.values()].sort((e,t)=>e.dateKey.localeCompare(t.dateKey))}function m_(e,t,n){return new Intl.DateTimeFormat(n,{timeZone:t,weekday:`short`,day:`numeric`,month:`short`,year:`numeric`}).format(e)}function h_(e,t,n){return new Intl.DateTimeFormat(n,{timeZone:t,hour:`numeric`,minute:`2-digit`}).resolvedOptions().hour12===!0?new Intl.DateTimeFormat(n,{timeZone:t,hour:`numeric`,minute:`2-digit`}).format(e):new Intl.DateTimeFormat(n,{timeZone:t,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).format(e)}function g_(e,t,n){let r=new Date(e.start),i=new Date(e.end);return`${m_(r,t,n)}, ${h_(r,t,n)}–${h_(i,t,n)}`}function __(e,t,n){let r=new Date(e.start);return{day:m_(r,t,n),time:`${h_(r,t,n)} – ${h_(new Date(e.end),t,n)}`}}var v_=e=>e.replace(/_/g,` `).replace(/\//g,` / `);function y_(e,t,n,r){let i=t.trim();return`${g_(e,n,r)} (${v_(n)})${i?` with ${i}`:``}`}var b_=(e,t=!1)=>`${e.start}|${e.end}|${e.memberId}|${e.scheduleId}${t?`|t`:``}`;function x_(e){if(typeof e!=`string`)return null;let[t,n,r,i]=e.split(`|`);return!t||!n||!r||Number.isNaN(Date.parse(t))||Number.isNaN(Date.parse(n))?null:{start:t,end:n,memberId:r,scheduleId:i||``}}var S_=e=>typeof e==`string`&&e.split(`|`)[4]===`t`;function C_(e,t,n,r,i){return{[e]:y_(t,n,r,i),[`${e}Start`]:t.start,[`${e}End`]:t.end,[`${e}With`]:n,[`${e}TimeZone`]:r}}function w_(e,t){let n=e[`${t}Start`],r=e[`${t}End`];if(typeof n!=`string`||typeof r!=`string`||Number.isNaN(Date.parse(n))||Number.isNaN(Date.parse(r)))return null;let i=e[`${t}With`],a=e[`${t}TimeZone`];return{start:n,end:r,with:typeof i==`string`?i:``,timeZone:typeof a==`string`?a:``}}var T_=e=>Object.keys(e||{}).some(t=>w_(e,t)!==null);function E_(e){return e.memberName.trim()?e.memberId.trim()?jg(e.timeZone)?dg.some(t=>Number(t.value)===e.slotMinutes)?D_(e,e.slotMinutes):`Say how long a booking lasts.`:`Pick a time zone we know, like Europe/Rome.`:`Say whose time this is.`:`Give the person the name visitors will see.`}function D_(e,t=0){if(!jg(e.timeZone))return`Pick a time zone we know, like Europe/Rome.`;let n=!1;for(let r of Lh){let i=e.days[r]||[];for(let e of i){if(n=!0,$(e.to)<=$(e.from))return`On ${Rh[r]}, the end must come after the start.`;if(t&&$(e.to)-$(e.from)<t)return`On ${Rh[r]}, the hours are shorter than one booking.`}let a=i.slice().sort((e,t)=>$(e.from)-$(t.from));for(let e=1;e<a.length;e++)if($(a[e].from)<$(a[e-1].to))return`On ${Rh[r]}, the two stretches of hours overlap.`}return n?``:`Turn on at least one day.`}var O_=e=>D_(e)===``,k_=e=>e.enabled&&E_(e)===``,A_={15:`A short meeting`,30:`A short meeting`,45:`A 45-minute meeting`,60:`A 1-hour meeting`,90:`A 1½-hour meeting`,120:`A 2-hour meeting`},j_=e=>A_[e.slotMinutes]||`A meeting`,M_=e=>e.name.trim()||j_(e),N_=e=>{let t=M_(e),n=e.memberName.trim();return n?`${t} with ${n}`:t},P_=(e,t=X_())=>!!e&&t.some(t=>t.id===e);function F_(e,t=``,n=X_()){return e&&P_(e.id,n)?M_(e):t.trim()}var I_=e=>{let t=(e.scheduleName||``).trim(),n=(e.memberName||``).trim();return t&&n?`${t} with ${n}`:t||(n?`A meeting with ${n}`:`A meeting`)},L_=e=>dg.find(t=>Number(t.value)===e)?.label||`${e} min`,R_=e=>{let t=e.memberName.trim();return`${L_(e.slotMinutes)}${t?` with ${t}`:``}. Pick a time that suits you.`},z_=e=>{let t=e.description.trim();return t&&t!==R_(e)?t:``},B_=e=>{let[t,...n]=L_(e).split(` `),r=n.join(` `)||`min`;return{value:t,unit:r.startsWith(`minute`)?`min`:r}},V_=(e,t)=>e.length===t.length&&e.every((e,n)=>e.from===t[n].from&&e.to===t[n].to);function H_(e){let t=Lh.filter(t=>(e.days[t]||[]).length);if(!t.length)return``;let n=e.days[t[0]],r=t.every(t=>V_(e.days[t],n)),i=t.map(e=>Lh.indexOf(e)),a=i.every((e,t)=>t===0||e===i[t-1]+1)&&t.length>2?`${zh[t[0]]}–${zh[t[t.length-1]]}`:t.map(e=>zh[e]).join(`, `);return r?`${a} ${n.map(e=>`${e.from}–${e.to}`).join(`, `)}`:`${a}, hours vary`}function U_(e){let t=N_(e),n=H_(e);return n?`${t} — ${n} · ${L_(e.slotMinutes)} · ${v_(e.timeZone)}`:`${t} — no hours yet`}var W_=(e=new Date)=>new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,10),G_=e=>e.name.trim()||`Working hours`,K_=e=>{let t=e.memberName.trim();return t?`${t} · ${G_(e)}`:G_(e)};function q_(e,t=W_()){let n=H_(e),r=G_(e);if(!n)return`${r} — no hours yet`;let i=e.blocked.filter(e=>e.date>=t).length,a=i?` · ${i} day${i===1?``:`s`} blocked`:``;return`${r} — ${n} · ${v_(e.timeZone)}${a}`}var J_=[],Y_=e=>{J_=e},X_=()=>J_,Z_=[],Q_=e=>{Z_=e},$_=()=>Z_,ev=()=>{let e=new Set(J_.map(e=>e.id));return[...J_,...Z_.filter(t=>!e.has(t.id)&&k_(t))]},tv=[{value:`calendar`,label:`A full calendar — the page is about booking`},{value:`compact`,label:`A compact time picker — one question among others`}],nv=[{value:`each`,label:`An individual schedule — they book one of us`},{value:`all`,label:`The united team schedule — one meeting with all of us`},{value:`choose`,label:`Both — the visitor chooses one of us or all of us`}],rv=new Set(nv.map(e=>e.value)),iv=e=>rv.has(String(e?.party))?String(e.party):e?.together===!0?`all`:`each`,av=e=>(Array.isArray(e?.schedules)?e.schedules:Array.isArray(e?.members)?e.members:[]).filter(e=>typeof e==`string`||typeof e==`number`).map(e=>String(e).trim()).filter(Boolean);function ov(e){let t=e?.booking;if(!t||typeof t!=`object`)return null;let n=av(t);return n.length?{schedules:n,party:iv(t),ask:String(t.ask||``),how:String(t.how||``)}:null}var sv=(e,t,n=[])=>{let r=t.find(t=>t.id===e);if(r)return r;let i=n.find(t=>t.id===e);return i?t.find(e=>e.id===(i.scheduleId||i.id)):void 0},cv=(e,t,n=[])=>{let r=[];for(let i of e){let e=sv(i,t,n),a=e?e.id:i;r.includes(a)||r.push(a)}return r},lv=(e,t,n=[])=>{let r=[];for(let i of e.schedules){let e=sv(i,t,n);e&&!r.some(t=>t.id===e.id)&&r.push(e)}return r};function uv(e,t,n){if(e.includes(t))return e.filter(e=>e!==t);let r=n.find(e=>e.id===t)?.memberId;return[...r?e.filter(e=>n.find(t=>t.id===e)?.memberId!==r):e,t]}var dv=e=>{let t=e.map(e=>e.memberName.trim()||`a team member`);return t.length<=1?t.join(``):`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`},fv=e=>{let t=e.map(N_);return t.length<=1?t.join(``):`${t.slice(0,-1).join(`, `)}, and ${t[t.length-1]}`};function pv(e,t,n=t){let r=ov(e);if(!r)return``;let i=lv(r,t,n);if(!i.length)return`The schedules picked for this page no longer exist — pick one on the Schedule screen.`;let a=i.find(e=>!O_(e));return a?`Finish ${K_(a)} on the Schedule screen first.`:r.how.trim()?``:`Say what this page should do with those hours.`}var mv=`calls?|meetings?|times?|slots?|sessions?|appointments?|visits?|consultations?|chats?|demos?`,hv=e=>/\b(book|books|booked|booking|bookings|appointment|appointments|reservation|reservations)\b/i.test(e)||RegExp(`\\bschedul\\w*\\s+(?:a|an|my|our|your|their|the|some)?\\s*(?:${mv})\\b`,`i`).test(e),gv=/\b(calls?|meetings?|sessions?|appointments?|consultations?|chats?|demos?|visits?|interviews?|viewings?|classes|lessons?|slots?|times?|diar(?:y|ies)|calendars?)\b/i,_v=e=>{let t=ov(e);return[e?.brief,e?.pageChange,t?.how,t?.ask].map(e=>String(e||``).trim()).filter(Boolean).join(`
12
+ `)},vv=e=>hv(e)||gv.test(e),yv=(e,t=ov(e))=>!!t&&(!!t.ask.trim()||t.party!==`each`||vv(_v(e))),bv=`Booking goes through the app's own form system: the page's form gets ONE question of type 'schedule', and the built-in form draws the picker — never build a calendar, a time picker, a list of times or a bookings collection of your own. The app shows every visitor the free times in their own time zone, stops two people taking the same time, and lists every booking on my Schedule screen. It also tells the people it was booked with — the booking is in their bell and on their own calendar the moment it is made — so never send a notification of your own about a booking.`,xv=(e,t=`time`,n=`each`)=>{let r=n===`all`?`, together: true`:n===`choose`?`, party: 'choose'`:``;return`{ name: '${t}', type: 'schedule', label: 'Pick a time', required: true, schedules: [${e.map(e=>`'${e}'`).join(`, `)}]${r} }`},Sv=`With together: true the app offers only the times every single one of them is free at the same moment — in the visitor's own time zone — and one booking takes that time in every one of their calendars and tells every one of them. Never work the shared times out yourself, never draw a calendar or a list of anyone's hours, never ask the visitor to pick a person first, and never make more than one booking or more than one time question.`,Cv=`With party: 'choose' the built-in picker shows the visitor a switch above the times — meet one of us, or meet all of us. On 'one of us' it offers each person's own free times with their name under each; on 'all of us' only the times every one of them is free at once, and the booking is then made and announced the right way for whichever they chose. Never build that switch, a calendar or a list of anyone's hours yourself, never ask the visitor to pick a person before the switch, and never make more than one time question.`,wv=()=>`More than one person can be booked here, so decide from my words which kind of booking this is. If my words ask for ONE meeting that all of them attend — a united calendar, a time that suits everyone, all of us in it together — add together: true to that question. ${Sv} If my words ask to let the visitor pick either — one of us or all of us — add party: 'choose' instead. ${Cv} If my words ask only for a time with ONE of them, leave the question as it is: the app then offers each person's own free times, with their name under each, and the visitor picks one of them.`,Tv=e=>`Before the time is picked, this page asks the visitor: ${e}. Put each of those on the same form as one more question, choosing the kind of box each answer needs, and keep a name question and an email question on it as well — a visitor who is already signed in is never asked those two, the app fills them in from their account itself.`,Ev=`Decide how the picker looks from my words and add a look to that question. look: 'calendar' when the page is about booking — the question draws a whole calendar with the free times under it, so show the form inline with <ContactPopup formId='…' isInline /> and give it the full width of the page, the other questions following once a time is picked. look: 'compact' when booking is one question among others — the question draws a compact picker of days and times and sits among the other questions like any of them, and the form shows the way any other form on the page does. If my words do not say, a page that is about nothing but booking gets the calendar and every other page gets the compact picker.`,Dv=`Read them with useBookings() from 'your-ai-workflow-firebase-os' — { loading, bookings, error }, each booking with id, start and end (ISO, UTC), memberId, memberName, name, email, answers and formId — the upcoming ones, soonest first; show error when it is set, format times in the reader's own zone, and cancel one with cancelBooking(id, { reason, side: 'host' }) from the same package — always with a reason, because it is what the other side reads. Never read mem_bookings or pub_bookings by hand, and never write to them. An entry with own:true is an event the owner put on their own calendar rather than a booking: it has no name or email, so title every entry with eventName(booking) from the same package. An entry with cancelled:true was called off — its time is free again, so keep it in the list greyed out and struck through rather than dropping it, and show its cancelReason when it has one. An entry with pending:true is booked but NOT yet agreed to by the person whose hour it is: mark it Pending and never draw it as a settled meeting. They accept their own with acceptBooking(id) — offer that only when booking.memberId is the signed-in person's own uid, because a meeting in somebody else's diary is not theirs to agree to. Turning a booking down is cancelBooking with a reason, never a state of its own.`,Ov=e=>{let t=e_(e).map(e=>`'${e.memberId}'`).join(`, `);return`This page is built on ${dv(e)}'s hours — their week, their own time zone and the days they are away, kept on my Schedule screen. Read them with useTeamHours() from 'your-ai-workflow-firebase-os' and use the ones whose memberId is ${t}; my app's instructions say what is ready to use with them. Never type anybody's hours or times into the page, never invent one, and never read or write sys_schedules yourself.`},kv=(e,t,n)=>{let r=`The free times come from my Schedule screen and follow my hours there, so a change to my week changes this page — never state a length, and never type a day, an hour or a time into the page. ${bv}`;return t===`all`?`People book ONE meeting with ${e} on this page — all of them in it together. ${r}`:t===`choose`?`People book time with ${e} on this page and choose for themselves whether it is with one of them or with all of them at once. ${r}`:`People book time with ${e} on this page${n?` — the visitor picks one of them, then one of that person’s free times`:``}. ${r}`};function Av(e,t,n,r=t){let i=ov(e);if(!i)return[];let a=lv(i,t,r);if(!a.length)return[];let o=i.how.trim(),s=i.ask.trim();if(!yv(e,i))return[Ov(a),...o?[`Here is what this page should do with those hours: ${o}`]:[]];let c=e_(a),l=dv(c),u=[];if(n)u.push(`This page is where my team follows the times people book with ${l}. ${Dv}`);else{let e=c_(c),t=e?i.party:`each`;u.push(kv(l,t,e),`Add exactly this question to the page's form, copied as it is: ${xv(c.map(e=>e.id),`time`,t)}`),t===`all`?u.push(Sv):t===`choose`?u.push(Cv):e&&u.push(wv()),u.push(Ev)}return s&&!n&&u.push(Tv(s)),o&&u.push(`Here is how booking should work on this page: ${o}`),u}function jv(e,t,n,r,i=n){let a=ov(t);if(!a||!yv(t,a))return``;let o=e_(lv(a,n,i));if(!o.length)return``;let s=dv(o);return r?`Times are booked with ${s} on the page at ${e}, which this page is linked to. Show those bookings here. ${Dv}`:`Times are booked with ${s} on the page at ${e}, which this page is linked to — the booking itself happens there. Put no picker on this page unless I ask for one below.`}var Mv=`rounded-2xl border border-[var(--panel-border)] bg-[var(--panel-bg)] transition-colors hover:border-accent/40`,Nv=`inline-flex items-center justify-center gap-1.5 h-8 px-2.5 sm:h-9 sm:px-3 shrink-0 whitespace-nowrap rounded-[var(--btn-radius,0.75rem)] text-[12.5px] font-semibold border border-[var(--panel-border)] bg-transparent text-foreground/60 hover:text-foreground hover:border-accent/40 hover:bg-foreground/[0.04] active:scale-[0.98] transition-all cursor-pointer disabled:opacity-40 disabled:pointer-events-none`,Pv=`w-full h-11 px-4 rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] text-[14px] text-foreground outline-none transition-all duration-300 placeholder:text-foreground/35 hover:border-accent/40 focus:border-accent disabled:opacity-50 disabled:cursor-not-allowed console-field`,Fv=`w-full h-11 flex items-center px-4 rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] transition-all duration-300 hover:border-accent/40 focus-within:border-accent console-field`,Iv=`flex-1 min-w-0 h-full bg-transparent border-none outline-none shadow-none text-[14px] text-foreground placeholder:text-foreground/35 disabled:cursor-not-allowed`,Lv=`text-[12.5px] sm:text-[13px] font-medium text-foreground/50 select-none`,Rv=`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug`;function zv({label:e=`cog`}){return(0,a.jsx)(n.N,{role:`img`,"aria-label":e,className:`inline-block w-[1.1em] h-[1.1em] align-[-0.18em] mx-[0.08em] text-foreground/85`})}function Bv({children:e,tone:t=`quiet`}){return(0,a.jsx)(`p`,{className:`text-[12.5px] font-medium leading-relaxed px-1 ${t===`error`?`text-red-500`:`text-foreground/50`}`,children:e})}function Vv({onClick:e,children:t}){return(0,a.jsx)(`button`,{type:`button`,onClick:e,className:`text-accent font-bold hover:underline cursor-pointer`,children:t})}function Hv({state:e=`saved`,label:t}){return(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11.5px] font-semibold text-foreground/50 whitespace-nowrap shrink-0`,children:[e===`saving`?(0,a.jsx)(n.ft,{className:`w-3 h-3 animate-spin text-foreground/40 shrink-0`}):(0,a.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0 ${e===`saved`?`bg-emerald-500`:e===`error`?`bg-red-500`:`bg-foreground/25`}`}),t]})}function Uv({icon:e,children:t,onClick:r,disabled:i,busy:o,tone:s=`default`,className:c=``,title:l,compact:u}){return(0,a.jsxs)(`button`,{type:`button`,title:l,onClick:r,disabled:i||o,className:`${Nv} ${s===`danger`?`hover:text-red-500 hover:border-red-500/40 hover:bg-red-500/[0.06]`:``} ${u?`max-sm:w-8 max-sm:px-0 max-sm:gap-0 max-sm:border-transparent max-sm:hover:border-transparent max-sm:hover:bg-foreground/[0.06]`:``} ${c}`,children:[o?(0,a.jsx)(n.ft,{className:`w-3.5 h-3.5 animate-spin shrink-0`}):e?(0,a.jsx)(e,{className:`w-3.5 h-3.5 shrink-0`}):null,u?(0,a.jsx)(`span`,{className:`max-sm:hidden sm:inline-flex items-center gap-1.5`,children:t}):t]})}function Wv({to:e,title:t,children:r,className:i=``}){return(0,a.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,title:t,onClick:e=>e.stopPropagation(),className:`${Nv} max-sm:w-8 max-sm:px-0 max-sm:gap-0 max-sm:border-transparent max-sm:hover:border-transparent max-sm:hover:bg-foreground/[0.06] ${i}`,children:[(0,a.jsx)(n.Rt,{className:`w-3.5 h-3.5 shrink-0`}),(0,a.jsx)(`span`,{className:`max-sm:hidden`,children:r})]})}var Gv=`w-6 h-6 rounded-md flex items-center justify-center text-inherit outline-none hover:text-foreground hover:bg-foreground/[0.07] focus-visible:text-foreground focus-visible:ring-2 focus-visible:ring-accent transition-colors cursor-pointer disabled:opacity-25 disabled:pointer-events-none`;function Kv({label:e,canUp:t=!0,canDown:r=!0,onMove:i,hideOnPhone:o,className:s=``}){let c=(t,r)=>(0,a.jsx)(`button`,{type:`button`,title:t===`up`?`Move up`:`Move down`,"aria-label":`Move ${e} ${t}`,disabled:!r,onClick:()=>i(t),className:Gv,children:t===`up`?(0,a.jsx)(n.mn,{className:`w-3 h-3`}):(0,a.jsx)(n.vn,{className:`w-3 h-3`})});return(0,a.jsxs)(`div`,{className:`${o?`max-sm:hidden sm:flex`:`flex`} items-center shrink-0 text-foreground/40 [@media(hover:hover)]:opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 `+s,onClick:e=>e.stopPropagation(),children:[c(`up`,t),c(`down`,r)]})}function qv({icon:e,title:t,description:r,actions:o,children:s,defaultOpen:c=!0,collapsible:l=!0}){let[u,d]=(0,i.useState)(c),f=l?u:!0,p=typeof o==`function`?o({open:()=>d(!0)}):o;return(0,a.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] overflow-hidden transition-all`,children:[(0,a.jsxs)(`div`,{className:`w-full px-4 sm:px-5 py-4 grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-x-3 sm:gap-x-3.5 gap-y-0.5 text-left`,children:[e&&(0,a.jsx)(`div`,{className:`row-start-1 col-start-1 row-span-2 self-center w-10 h-10 rounded-2xl flex items-center justify-center shrink-0 border border-[var(--panel-border)]/50 bg-accent/10 text-accent`,children:(0,a.jsx)(e,{className:`w-5 h-5`})}),(0,a.jsx)(`span`,{className:`row-start-1 col-start-2 min-w-0 text-[15px] font-bold text-foreground tracking-tight leading-tight truncate self-end`,children:t}),p&&(0,a.jsx)(`div`,{className:`row-start-1 row-span-2 col-start-3 self-center justify-self-end flex items-center gap-1 sm:gap-2 shrink-0`,children:p}),l&&(0,a.jsx)(`button`,{type:`button`,onClick:()=>d(e=>!e),"aria-expanded":f,"aria-label":f?`Collapse ${t}`:`Expand ${t}`,className:`row-start-1 col-start-4 row-span-2 self-center w-8 h-8 rounded-xl border border-[var(--panel-border)]/60 hover:border-accent/40 flex items-center justify-center text-foreground/50 hover:text-foreground hover:bg-foreground/5 transition-all cursor-pointer justify-self-end`,children:(0,a.jsx)(n.nn,{className:`w-4 h-4 transition-transform duration-200 ${f?`rotate-180`:``}`})}),r&&(0,a.jsx)(`span`,{className:`row-start-2 col-start-2 min-w-0 text-[12px] text-foreground/50 font-normal leading-snug truncate self-start`,children:r})]}),(0,a.jsx)(jd,{initial:!1,children:f&&(0,a.jsx)(Op.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},className:`overflow-hidden`,children:(0,a.jsx)(`div`,{className:`border-t border-[var(--panel-border)]/40 p-4 sm:p-5 flex flex-col gap-5 bg-background/30`,children:s})})})]})}function Jv({icon:e,title:t,description:n,chip:r,enabled:i,onChange:o,label:s,children:c}){return(0,a.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] overflow-hidden`,children:[(0,a.jsxs)(`div`,{className:`w-full px-4 sm:px-5 py-4 grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 sm:gap-x-3.5 gap-y-0.5`,children:[(0,a.jsx)(`div`,{className:`row-start-1 col-start-1 row-span-2 self-center w-10 h-10 rounded-2xl flex items-center justify-center shrink-0 border border-[var(--panel-border)]/50 bg-accent/10 text-accent`,children:(0,a.jsx)(e,{className:`w-5 h-5`})}),(0,a.jsx)(`span`,{className:`row-start-1 col-start-2 min-w-0 text-[15px] font-bold text-foreground tracking-tight leading-tight truncate self-end`,children:t}),(0,a.jsx)(`span`,{className:`row-start-2 col-start-2 min-w-0 text-[12px] text-foreground/50 font-normal leading-snug truncate self-start`,children:n}),(0,a.jsxs)(`div`,{className:`row-start-1 row-span-2 col-start-3 self-center justify-self-end flex items-center gap-2 sm:gap-3 shrink-0`,children:[r&&(0,a.jsx)(`span`,{className:`max-sm:hidden`,children:(0,a.jsx)(Hv,{state:r.state,label:r.label})}),i!==null&&(0,a.jsx)(ty,{enabled:i,onChange:o,label:s||t})]})]}),c&&(0,a.jsx)(`div`,{className:`border-t border-[var(--panel-border)]/40 p-4 sm:p-5 flex flex-col gap-4 bg-background/30`,children:c})]})}function Yv({label:e,hint:t,action:n,children:r,error:i}){return(0,a.jsxs)(`div`,{className:`flex flex-col w-full`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-1 sm:mb-1.5 ml-1`,children:[(0,a.jsx)(`label`,{className:Lv,children:e}),n]}),r,t&&!i&&(0,a.jsx)(`span`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug mt-1 sm:mt-1.5 px-1`,children:t}),i&&(0,a.jsx)(`span`,{className:`text-[11.5px] font-semibold text-red-500 leading-snug mt-1 sm:mt-1.5 px-1`,children:i})]})}function Xv({label:e,hint:t,value:n,onChange:r,onBlur:i,placeholder:o,prefix:s,error:c,disabled:l,action:u}){return(0,a.jsx)(Yv,{label:e,hint:t,error:c,action:u,children:s?(0,a.jsxs)(`div`,{className:`${Fv} ${c?`is-invalid border-red-500/60`:``} ${l?`opacity-50`:``}`,children:[(0,a.jsx)(`span`,{className:`mr-0.5 text-[14px] font-semibold text-foreground/40 select-none shrink-0`,children:s}),(0,a.jsx)(`input`,{type:`text`,value:n??``,disabled:l,placeholder:o,onChange:e=>r(e.target.value),onBlur:i,"aria-label":e,className:`${Iv} no-glow`})]}):(0,a.jsx)(`input`,{type:`text`,value:n??``,disabled:l,placeholder:o,onChange:e=>r(e.target.value),onBlur:i,"aria-label":e,className:`${Pv} ${c?`is-invalid border-red-500/60`:``}`})})}function Zv({value:e,className:t=``,...n}){let r=(0,i.useRef)(null),{placeholder:o}=n,s=i.default.useCallback(()=>{let e=r.current;if(!e)return;e.style.height=`auto`;let t=e.scrollHeight;!e.value&&e.placeholder&&(e.value=e.placeholder,t=Math.max(t,e.scrollHeight),e.value=``),e.style.height=`${t+(e.offsetHeight-e.clientHeight)}px`},[]);return(0,i.useLayoutEffect)(s,[s,e,o]),(0,i.useEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(s);return e.parentElement&&t.observe(e.parentElement),()=>t.disconnect()},[s]),(0,a.jsx)(`textarea`,{ref:r,value:e??``,onInput:s,className:`${t} resize-none overflow-hidden`,...n,rows:n.rows||1})}function Qv({label:e,hint:t,value:n,onChange:r,onBlur:i,placeholder:o,rows:s,error:c}){return(0,a.jsx)(Yv,{label:e,hint:t,error:c,children:(0,a.jsx)(Zv,{value:n??``,placeholder:o,rows:s,onChange:e=>r(e.target.value),onBlur:i,"aria-label":e,className:`${Pv.replace(`h-11 `,``)} min-h-11 py-2.5 leading-5 ${c?`is-invalid border-red-500/60`:``}`})})}function $v({label:e,hint:t,value:n,onChange:r,options:i,placeholder:o=`None`,allowEmpty:s=!0,disabled:c}){let l=[...s?[{value:``,label:o}]:[],...i.filter(e=>e.value!==``)];return(0,a.jsx)(Yv,{label:e,hint:t,children:(0,a.jsx)(ah,{ariaLabel:e,value:n??``,options:l,onChange:r,disabled:c,className:`console-select`,dense:!0,portal:!0,direction:`auto`})})}function ey({label:e,hint:t,enabled:n,onChange:r,disabled:i,hintWideOnly:o}){return(0,a.jsxs)(`div`,{className:`flex items-center justify-between gap-4 w-full`,children:[(0,a.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0 ml-1`,children:[(0,a.jsx)(`span`,{className:`text-[13px] font-medium text-foreground/80`,children:e}),t&&(0,a.jsx)(`span`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug${o?` max-sm:hidden`:``}`,children:t})]}),(0,a.jsx)(ty,{enabled:n,onChange:r,disabled:i,label:e})]})}function ty({enabled:e,onChange:t,disabled:n,label:r}){return(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":r,disabled:n,onClick:n=>{n.stopPropagation(),t(!e)},className:`relative w-10 h-6 rounded-full transition-colors shrink-0 cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${e?`bg-accent`:`bg-foreground/15`}`,children:(0,a.jsx)(`span`,{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-[var(--button-fg,#fff)] shadow transition-transform ${e?`translate-x-4`:`translate-x-0`}`})})}function ny({saving:e,savedAt:t,error:n}){return n?(0,a.jsx)(Hv,{state:`error`,label:n}):e?(0,a.jsx)(Hv,{state:`saving`,label:`Saving`}):t?(0,a.jsx)(Hv,{state:`saved`,label:`Saved`}):null}function ry({label:e=`Time zone`,hint:t,value:r,onChange:o,compact:s}){let[c,l]=(0,i.useState)(``),u=kg(),d=(r||``).trim(),f=(0,i.useMemo)(()=>Ng(c),[c]),p=c.trim().length>0,m=t??(d===u?`Detected from your browser.`:`Your browser is in ${v_(u)}.`),h=(0,a.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,a.jsxs)(`div`,{className:Fv,children:[d&&!p?(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-2 mr-2.5 shrink-0 min-w-0 text-accent`,children:[(0,a.jsx)(n.Et,{className:`w-4 h-4 shrink-0`}),(0,a.jsx)(`span`,{className:`text-[13px] font-semibold truncate`,children:v_(d)}),(0,a.jsx)(n.rn,{className:`w-3.5 h-3.5 shrink-0`})]}):(0,a.jsx)(n.F,{className:`w-4 h-4 mr-2.5 text-foreground/30 shrink-0`}),(0,a.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:d?`Type a city to change it`:`Type a city, e.g. Rome`,"aria-label":`Search time zones`,className:`${Iv} no-glow`})]}),p&&(0,a.jsx)(`div`,{className:`rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] p-1.5 max-h-56 overflow-y-auto`,children:f.length>0?(0,a.jsx)(`div`,{className:`flex flex-col`,children:f.map(e=>(0,a.jsxs)(`button`,{type:`button`,"aria-pressed":e===d,onClick:()=>{o(e),l(``)},className:`w-full text-left px-2.5 py-1.5 rounded-lg text-[13px] font-medium transition-colors cursor-pointer ${e===d?`bg-accent text-[var(--button-fg,#fff)]`:`text-foreground/70 hover:text-foreground hover:bg-foreground/[0.06]`}`,children:[v_(e),e===u?` · detected`:``]},e))}):(0,a.jsx)(`span`,{className:`block px-2 py-2 text-[12px] font-medium text-foreground/45`,children:`Nothing close to that. Try a big city near you, like London or Chicago.`})})]});return s?h:(0,a.jsx)(Yv,{label:e,hint:m,children:h})}function iy({timeZone:e,onTimeZone:t,action:r}){let[o,s]=(0,i.useState)(!1);return(0,a.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,a.jsxs)(`div`,{className:`flex gap-3 ${r?`max-sm:flex-col max-sm:items-stretch sm:items-center sm:justify-between`:``}`,children:[(0,a.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[12px] font-medium text-foreground/50`,children:[(0,a.jsx)(n.Et,{className:`w-3.5 h-3.5 text-foreground/35 shrink-0`,"aria-hidden":!0}),(0,a.jsxs)(`span`,{children:[`Times in `,v_(e),` · `,(0,a.jsx)(`button`,{type:`button`,onClick:()=>s(e=>!e),className:`text-accent font-semibold hover:underline cursor-pointer`,children:o?`Done`:`Change`})]})]}),r]}),o&&(0,a.jsx)(ry,{compact:!0,value:e,onChange:e=>{t(e),s(!1)}})]})}var ay=(e,t)=>!!e&&e.memberId===t.memberId&&e.start===t.start&&e.scheduleId===t.scheduleId,oy=`relative flex flex-col items-center justify-center w-full min-h-11 px-3 py-2 rounded-[var(--input-radius,0.75rem)] border text-[14px] font-semibold transition-all duration-200 cursor-pointer`;function sy({slots:e,value:t,onChange:r,timeZone:i,members:o,together:s}){let c=!s&&new Set(o.map(e=>e.memberId)).size>1,l=e=>(o.find(t=>t.id===e.scheduleId)||o.find(t=>t.memberId===e.memberId))?.memberName.trim()||``;return e.length?(0,a.jsx)(`div`,{className:`grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(96px,1fr))]`,role:`listbox`,"aria-label":`Free times`,children:e.map(e=>{let o=ay(t,e),s=h_(new Date(e.start),i),u=c?l(e):``;return(0,a.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":o,"aria-label":u?`${s} with ${u}`:s,onClick:()=>r(o?null:e),className:`${oy} ${o?`bg-accent border-accent text-[var(--button-fg,#fff)] shadow-md shadow-accent/25`:`border-[var(--panel-border)] bg-transparent text-foreground/75 hover:border-accent/50 hover:text-foreground hover:bg-foreground/[0.04] active:scale-[0.98]`}`,children:[o&&(0,a.jsx)(n.rn,{className:`absolute left-2.5 w-3.5 h-3.5`,"aria-hidden":!0}),(0,a.jsx)(`span`,{className:`tabular-nums`,children:s}),u&&(0,a.jsx)(`span`,{className:`text-[11px] font-medium leading-tight ${o?`opacity-90`:`text-foreground/50`}`,children:u})]},`${Wg(e.memberId,e.start)}__${e.scheduleId}`)})}):null}function cy(e,t,n,r,a){let o=(0,i.useMemo)(()=>p_(o_(e,{now:r?r():new Date,taken:t},!!a),n),[e,t,n,r,a]),s=a&&e.length?e_(e).reduce((e,t)=>Math.min(e,t.horizonDays),1/0):e.reduce((e,t)=>Math.max(e,t.horizonDays),0);return{days:o,horizon:Number.isFinite(s)?s:0}}var ly=(e,t)=>e?Ig(new Date(e.start),t).dateKey:``;function uy({horizon:e}){return(0,a.jsx)(`p`,{className:`text-[13px] font-medium text-foreground/50 py-2`,children:e?`No free times in the next ${e} days.`:`No free times at the moment.`})}function dy({members:e,value:t,onChange:n,taken:r,timeZone:o,onTimeZone:s,now:c,together:l}){let{days:u,horizon:d}=cy(e,r,o,c,l),[f,p]=(0,i.useState)({tz:o,day:``}),m=f.tz===o?f.day:``,h=(u.some(e=>e.dateKey===m)?m:``)||ly(t,o)||u[0]?.dateKey||``,g=u.find(e=>e.dateKey===h)||u[0];return(0,a.jsxs)(`div`,{className:`flex flex-col gap-3 w-full`,children:[u.length===0?(0,a.jsx)(uy,{horizon:d}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:`flex gap-2 overflow-x-auto no-scrollbar pb-1 -mx-1 px-1`,role:`tablist`,"aria-label":`Days with free times`,children:u.map(e=>{let t=e.dateKey===g?.dateKey;return(0,a.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,onClick:()=>p({tz:o,day:e.dateKey}),className:`shrink-0 px-3.5 py-2 rounded-xl text-[13px] font-semibold whitespace-nowrap transition-all cursor-pointer glass-panel ${t?`bg-accent text-[var(--button-fg,#fff)] border-accent shadow-lg shadow-accent/20`:`text-foreground/70 hover:text-foreground hover:border-accent`}`,style:{borderRadius:`var(--input-radius, 0.75rem)`},children:e.label},e.dateKey)})}),g&&(0,a.jsx)(sy,{slots:g.slots,value:t,onChange:n,timeZone:o,members:e,together:l})]}),(0,a.jsx)(iy,{timeZone:o,onTimeZone:s})]})}var fy=`rounded-2xl flex items-center justify-center shrink-0 border border-[var(--panel-border)]/50 bg-accent/10 text-accent`;function py({slot:e,timeZone:t,who:r,onChange:i}){let o=__(e,t),s=(r||``).trim();return(0,a.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] px-3.5 py-3`,children:[(0,a.jsx)(`div`,{className:`w-10 h-10 ${fy}`,children:(0,a.jsx)(n.un,{className:`w-4 h-4`})}),(0,a.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1 gap-0.5`,children:[(0,a.jsx)(`span`,{className:`text-[14px] sm:text-[15px] font-bold text-foreground leading-tight truncate`,children:o.day}),(0,a.jsxs)(`span`,{className:`text-[12.5px] sm:text-[13px] font-semibold text-foreground/55 leading-tight tabular-nums truncate`,children:[o.time,s?` · with ${s}`:``]})]}),(0,a.jsxs)(`button`,{type:`button`,onClick:i,"aria-label":`Change the time`,className:`shrink-0 cursor-pointer flex items-center justify-center transition-all max-sm:w-9 max-sm:h-9 max-sm:rounded-xl max-sm:border max-sm:border-[var(--panel-border)] max-sm:text-foreground/50 max-sm:hover:text-accent max-sm:hover:border-accent/40 max-sm:active:scale-[0.98] sm:text-[12.5px] sm:font-bold sm:text-accent sm:hover:underline`,children:[(0,a.jsx)(n.q,{className:`w-3.5 h-3.5 sm:hidden`,"aria-hidden":!0}),(0,a.jsx)(`span`,{className:`max-sm:hidden`,children:`Change`})]})]})}var my=[`M`,`T`,`W`,`T`,`F`,`S`,`S`],hy=`rounded-2xl border border-[var(--panel-border)]/60 bg-foreground/[0.015] overflow-hidden`,gy=`flex items-center justify-between gap-2 px-3.5 py-2.5 border-b border-[var(--panel-border)]/40`,_y=`w-8 h-8 rounded-xl border border-[var(--panel-border)]/60 flex items-center justify-center shrink-0 text-foreground/50 hover:text-foreground hover:border-accent/40 hover:bg-foreground/5 active:scale-[0.98] transition-all cursor-pointer`;function vy(...e){let t=(0,i.useRef)(null),[n,r]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=t.current;if(!e)return;let n=()=>r(e.scrollTop+e.clientHeight<e.scrollHeight-2);n(),e.addEventListener(`scroll`,n,{passive:!0});let i=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return i?.observe(e),()=>{e.removeEventListener(`scroll`,n),i?.disconnect()}},e),{ref:t,moreBelow:n}}var yy=()=>(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-px bottom-px h-10 rounded-b-2xl bg-gradient-to-t from-[var(--bg-color)] to-transparent`}),by=e=>e.slice(0,7);function xy(e){let t=`${e}-01`,n=Lh.indexOf(Bg(t)),r=Array.from({length:n},()=>null);for(let n=0;;n++){let i=zg(t,n);if(by(i)!==e)break;r.push(i)}return r}function Sy({members:e,value:t,onChange:r,taken:o,timeZone:s,onTimeZone:c,now:l,together:u}){let{days:d,horizon:f}=cy(e,o,s,l,u),p=Ig(l?l():new Date,s).dateKey,m=new Map(d.map(e=>[e.dateKey,e])),h=ly(t,s),[g,_]=(0,i.useState)(()=>({tz:s,day:h,month:by(h||d[0]?.dateKey||p)})),v=g.tz===s,y=v?g.day:h,b=v?g.month:by(h||d[0]?.dateKey||p),x=e=>_({tz:s,day:y,month:e(b)}),S=e=>_({tz:s,day:e,month:b}),C=y?m.get(y):void 0,w=xy(b),T=C?.slots.length||0,{ref:E,moreBelow:D}=vy(T,y);return(0,a.jsxs)(`div`,{className:`flex flex-col gap-4 w-full`,children:[d.length===0&&(0,a.jsx)(uy,{horizon:f}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-[minmax(0,1.15fr)_minmax(0,1fr)] gap-3 md:gap-4 w-full md:items-stretch`,children:[(0,a.jsxs)(`div`,{className:`${hy} w-full min-w-0`,children:[(0,a.jsxs)(`div`,{className:gy,children:[(0,a.jsx)(`h4`,{className:`text-[14px] font-bold text-foreground tracking-tight truncate`,children:Vg(b)}),(0,a.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,a.jsx)(`button`,{type:`button`,onClick:()=>x(()=>by(p)),className:`h-8 px-3 rounded-xl border border-[var(--panel-border)]/60 text-[12.5px] font-semibold text-foreground/60 hover:text-foreground hover:border-accent/40 hover:bg-foreground/5 active:scale-[0.98] transition-all cursor-pointer`,children:`Today`}),(0,a.jsx)(`button`,{type:`button`,"aria-label":`Previous month`,onClick:()=>x(e=>Hg(e,-1)),className:_y,children:(0,a.jsx)(n.tn,{className:`w-4 h-4`})}),(0,a.jsx)(`button`,{type:`button`,"aria-label":`Next month`,onClick:()=>x(e=>Hg(e,1)),className:_y,children:(0,a.jsx)(n.en,{className:`w-4 h-4`})})]})]}),(0,a.jsx)(`div`,{className:`p-3`,children:(0,a.jsxs)(`div`,{className:`grid grid-cols-7 gap-1 w-full max-w-[26rem] mx-auto`,role:`grid`,"aria-label":Vg(b),children:[my.map((e,t)=>(0,a.jsx)(`div`,{className:`text-center text-[10.5px] font-bold uppercase tracking-wider text-foreground/35 pb-1`,children:e},t)),w.map((e,t)=>{if(!e)return(0,a.jsx)(`div`,{"aria-hidden":!0},`blank-${t}`);let n=m.has(e),r=e===y,i=e===p,o=Number(e.slice(8,10));return(0,a.jsxs)(`button`,{type:`button`,role:`gridcell`,"aria-label":m.get(e)?.label||e,"aria-selected":r,"aria-disabled":!n,disabled:!n,onClick:()=>S(e),className:`relative flex items-center justify-center h-10 md:h-11 rounded-xl text-[13.5px] md:text-[14px] font-semibold tabular-nums transition-all ${r?`bg-accent text-[var(--button-fg,#fff)] shadow-md shadow-accent/25 cursor-pointer`:n?`text-foreground hover:bg-foreground/[0.06] cursor-pointer`:`text-foreground/25 cursor-default`} ${i&&!r?`ring-1 ring-inset ring-accent/45`:``}`,children:[o,n&&(0,a.jsx)(`span`,{"aria-hidden":!0,className:`absolute bottom-1 w-1 h-1 rounded-full ${r?`bg-[var(--button-fg,#fff)]`:`bg-accent`}`})]},e)})]})})]}),(0,a.jsx)(`div`,{className:`w-full min-w-0 md:relative md:min-h-[320px]`,children:(0,a.jsxs)(`div`,{className:`${hy} flex flex-col md:absolute md:inset-0`,children:[(0,a.jsxs)(`div`,{className:gy,children:[(0,a.jsx)(`p`,{className:`text-[13px] font-bold text-foreground tracking-tight truncate`,children:C?C.label:`Pick a day`}),T>0&&(0,a.jsxs)(`span`,{className:`text-[11.5px] font-semibold text-foreground/40 shrink-0 tabular-nums`,children:[T,` `,T===1?`time`:`times`]})]}),(0,a.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,a.jsx)(`div`,{ref:E,className:`p-3 h-full overflow-y-auto styled-scrollbars-mini`,children:C?(0,a.jsx)(sy,{slots:C.slots,value:t,onChange:r,timeZone:s,members:e,together:u}):(0,a.jsxs)(`div`,{className:`flex flex-col items-center justify-center text-center gap-2 py-8 px-2`,children:[(0,a.jsx)(n.sn,{className:`w-5 h-5 text-foreground/25`,"aria-hidden":!0}),(0,a.jsx)(`p`,{className:`text-[12.5px] font-medium text-foreground/45 leading-relaxed`,children:d.length>0?`Pick a day with a dot to see its times.`:`No times to show.`})]})}),D&&(0,a.jsx)(yy,{})]})]})})]}),(0,a.jsx)(iy,{timeZone:s,onTimeZone:c})]})}var Cy=e=>e?.kind===`link`?`link`:`schedule`,wy=e=>e?.kind!==`schedule`&&e?.kind!==`link`,Ty=()=>`l_${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,Ey=()=>`s_${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,Dy=(e,t)=>({id:e,scheduleId:t.id,memberId:t.memberId,memberName:t.memberName,name:``,description:``,slotMinutes:30,horizonDays:30,noticeHours:12,questions:Qh(),paymentId:``,notifyOwner:!0,confirmBooker:!0,enabled:!0}),Oy=(e,t,n)=>{let r=typeof e==`number`?e:Number(e);return!Number.isFinite(r)||r<0||n&&!n.includes(r)?t:r},ky=(e,t)=>({id:e,scheduleId:String(t?.scheduleId||``),memberId:String(t?.memberId||``),memberName:String(t?.memberName||``),name:String(t?.name||``),description:String(t?.description||``),slotMinutes:Oy(t?.slotMinutes,30,dg.map(e=>Number(e.value))),horizonDays:Oy(t?.horizonDays,30),noticeHours:Oy(t?.noticeHours,12),questions:rg(t?.questions),paymentId:String(t?.paymentId||``),notifyOwner:t?.notifyOwner!==!1,confirmBooker:t?.confirmBooker!==!1,enabled:t?.enabled===!0,createdAt:typeof t?.createdAt==`number`?t.createdAt:void 0,updatedAt:typeof t?.updatedAt==`number`?t.updatedAt:void 0});function Ay(e,t){return t?{...t,id:e.id,scheduleId:t.id,memberId:t.memberId,memberName:e.memberName||t.memberName,name:e.name,description:e.description,slotMinutes:e.slotMinutes,horizonDays:e.horizonDays,noticeHours:e.noticeHours,questions:e.questions,paymentId:e.paymentId,notifyOwner:e.notifyOwner,confirmBooker:e.confirmBooker,enabled:e.enabled,createdAt:e.createdAt,updatedAt:e.updatedAt,joined:!0}:null}function jy(e){let t=new Map(e.schedules.map(e=>[e.id,e])),n=new Set(e.legacyIds),r=e.schedules.filter(e=>n.has(e.id));for(let n of e.links){let e=Ay(n,t.get(n.scheduleId));e&&r.push(e)}return r.sort((e,t)=>(e.createdAt||0)-(t.createdAt||0)||e.id.localeCompare(t.id))}var My=e=>e.name.trim()||j_(e),Ny=(e,t)=>t?`${My(e)} — ${L_(e.slotMinutes)} · ${K_(t)}`:`${My(e)} — the hours it was booked in are gone`,Py=(e,t)=>{let n=t?Ay(e,t):null;return n&&k_(n)?{state:`saved`,label:`Bookable`}:{state:`off`,label:e.enabled?`In progress`:`Turned off`}};function Fy(e,t){if(!t)return`The hours this link was booked in are gone — pick another set.`;let n=Ay(e,t);return n?E_({...n,enabled:!0}):`The hours this link was booked in are gone — pick another set.`}function Iy(e,t=`Working hours`){let n=[],r=[],i=new Map;for(let a of e){let e=[a.memberId,a.timeZone,JSON.stringify(a.days),JSON.stringify(a.blocked)].join(`|`),o=i.get(e);o||(o={..._g(Ey(),a.memberId,a.memberName,a.timeZone),name:t,days:a.days,blocked:a.blocked,enabled:!0,createdAt:a.createdAt},i.set(e,o),n.push(o)),r.push({...Dy(a.id,o),memberName:a.memberName,name:a.name,description:a.description,slotMinutes:a.slotMinutes,horizonDays:a.horizonDays,noticeHours:a.noticeHours,questions:a.questions,paymentId:a.paymentId,notifyOwner:a.notifyOwner,confirmBooker:a.confirmBooker,enabled:a.enabled,createdAt:a.createdAt})}return{schedules:n,links:r}}var Ly=e=>{let{id:t,...n}=e;return{...n,kind:`link`}},Ry=e=>({kind:`schedule`,memberId:e.memberId,memberName:e.memberName,name:e.name,timeZone:e.timeZone,days:e.days,blocked:e.blocked,enabled:!0,createdAt:e.createdAt||Date.now()}),zy=e=>e.entryId?`${e.entryId}__${e.start}`:e.id;function By(e){let t=e.filter(e=>!e.cancelled),n=t.length?t:e;return{copyIds:e.map(e=>e.id),pending:n.some(e=>e.pending),partySize:n.length,partyAccepted:n.filter(e=>!e.pending).length}}function Vy(e){let t=new Map;for(let n of e){if(n.own)continue;let e=zy(n),r=t.get(e);r?r.push(n):t.set(e,[n])}let n=new Map;for(let e of t.values()){let t=By(e);for(let r of e)n.set(r.id,t)}return n}var Hy=5*6e4;function Uy(e,t,n){let r=new Set(t.map(e=>e.id));return e.filter(e=>r.has(Wg(e.memberId,e.start))?!1:(e.createdAt||0)<n-Hy)}var Wy=(e,t=``)=>({id:Wg(e.memberId,e.start),memberId:e.memberId,memberName:t,scheduleId:``,scheduleName:``,own:!1,title:``,color:``,paymentId:``,paymentSession:``,cancelled:!1,cancelledAt:0,cancelReason:``,cancelledBy:``,cancelledSide:``,cancelledByUid:``,pending:!1,acceptedAt:0,heldOnly:!0,copyIds:[],partySize:0,partyAccepted:0,start:e.start,end:e.end,timeZone:``,name:``,email:``,answers:{},formId:``,entryId:``,uid:``,createdAt:e.createdAt||0}),Gy=(e,t)=>(e.createdAt||0)-(t.createdAt||0)||e.id.localeCompare(t.id),Ky={schedules:[],links:[],legacyIds:[]};function qy(){let[e,t]=(0,i.useState)({loading:!0,docs:Ky});return(0,i.useEffect)(()=>{let e=P(lg,()=>(0,c.collection)(O,lg),e=>{let n=[],r=[],i=[];e.forEach(e=>{let t=e.data();if(Cy(t)===`link`){r.push(ky(e.id,t));return}let a=Og(e.id,t);if(wy(t)){n.push(a),i.push(e.id);return}n.push({...a,enabled:!0})}),n.sort(Gy),r.sort(Gy);let a={schedules:n,links:r,legacyIds:i};Y_(jy(a)),Q_(n),t({loading:!1,docs:a})},()=>t({loading:!1,docs:Ky}));return()=>e()},[]),e}function Jy(){let{loading:e,docs:t}=qy();return{loading:e,schedules:(0,i.useMemo)(()=>jy(t),[t])}}function Yy(){let{loading:e,docs:t}=qy();return{loading:e,schedules:t.schedules}}function Xy(){let{loading:e,docs:t}=qy();return{loading:e,schedules:(0,i.useMemo)(()=>{let e=jy(t),n=new Set(e.map(e=>e.id));return[...e,...t.schedules.filter(e=>!n.has(e.id)&&k_(e))]},[t])}}function Zy(e){let[t,n]=(0,i.useState)({id:``,schedule:null});return(0,i.useEffect)(()=>{if(!e)return;let t=!1;return Qy(e).then(r=>{t||n({id:e,schedule:r})}).catch(()=>{t||n({id:e,schedule:null})}),()=>{t=!0}},[e]),e?t.id===e?{loading:!1,schedule:t.schedule}:{loading:!0,schedule:null}:{loading:!1,schedule:null}}async function Qy(e){let t=await(0,c.getDoc)((0,c.doc)(O,lg,e));if(!t.exists())return null;let n=t.data();if(Cy(n)!==`link`){let e=Og(t.id,n);return wy(n)?e:{...e,name:``}}let r=ky(t.id,n);if(!r.scheduleId)return null;let i=await(0,c.getDoc)((0,c.doc)(O,lg,r.scheduleId));return i.exists()?Ay(r,Og(i.id,i.data())):null}async function $y(e){if(e.joined)return console.error(`Refused to save a joined bookable as one schedule`,e.id),`That meeting is a booking link on a schedule — change the link or the schedule, not the two at once.`;try{return await(0,c.setDoc)((0,c.doc)(O,lg,e.id),{...Ry(e),updatedAt:Date.now()}),null}catch(e){return console.error(`Could not save the schedule`,e),`The hours could not be saved — make sure you are signed in and that this schedule is yours, then try again.`}}async function eb(e){try{return await(0,c.setDoc)((0,c.doc)(O,lg,e.id),{...Ly(e),updatedAt:Date.now()}),null}catch(e){return console.error(`Could not save the booking link`,e),`The link could not be saved — make sure you are signed in and that this schedule is yours, then try again.`}}async function tb(e){try{return await(0,c.deleteDoc)((0,c.doc)(O,lg,e)),null}catch(e){return console.error(`Could not remove the booking link`,e),`It could not be removed — make sure you are signed in and that this link is yours, then try again.`}}async function nb(e){if(!e.length)return null;let{schedules:t,links:n}=Iy(e);try{let e=Date.now();for(let n of t)await(0,c.setDoc)((0,c.doc)(O,lg,n.id),{...Ry(n),updatedAt:e});for(let t of n)await(0,c.setDoc)((0,c.doc)(O,lg,t.id),{...Ly(t),updatedAt:e});return null}catch(e){return console.error(`Could not split the older schedules into hours and links`,e),`Your older schedules could not be tidied into hours and booking links — make sure you are signed in, then reload the screen.`}}async function rb(e){try{return await(0,c.deleteDoc)((0,c.doc)(O,lg,e)),null}catch(e){return console.error(`Could not remove the schedule`,e),`It could not be removed — make sure you are signed in and that this schedule is yours, then try again.`}}var ib=e=>e.name.trim()||e.email.split(`@`)[0]||``;function ab(){let[e,t]=(0,i.useState)({loading:!0,members:[]});return(0,i.useEffect)(()=>{let e=P(`user_profiles/team`,()=>(0,c.query)((0,c.collection)(O,`user_profiles`),(0,c.where)(`role`,`in`,[`internal`,`admin`])),e=>{let n=[];e.forEach(e=>{let t=e.data()||{},r=t.role===`admin`||t.role===`internal`?t.role:null;!r||t.inactive===!0||n.push({id:e.id,name:String(t.displayName||``),email:String(t.email||``),role:r})}),n.sort((e,t)=>(e.name||e.email).localeCompare(t.name||t.email)),t({loading:!1,members:n})},()=>t({loading:!1,members:[]}));return()=>e()},[]),e}function ob(e,t){let[n,r]=(0,i.useState)([]),a=e.slice().sort().join(`,`),o=t.toISOString();return(0,i.useEffect)(()=>{if(!a)return;let e=new Set(a.split(`,`)),n=new Date(t.getTime()-cb).toISOString(),i=(0,c.onSnapshot)((0,c.query)((0,c.collection)(O,ug),(0,c.where)(`start`,`>=`,n)),t=>{let n=[];t.forEach(t=>{let r=t.data()||{},i=String(r.memberId||``);if(!e.has(i))return;let a={memberId:i,start:String(r.start||``),end:String(r.end||``),createdAt:typeof r.createdAt==`number`?r.createdAt:0};a.end>=o&&n.push(a)}),r(n)},()=>r([]));return()=>i()},[a,o]),a?n:sb}var sb=[],cb=4*36e5,lb=15*6e4,ub=`taken`,db=`That time was just taken — pick another.`;function fb(e){let t=Date.parse(e.start),n=Date.parse(e.end),r=Math.ceil((t-cb)/lb)*lb,i=[];for(let t=r;t<n;t+=lb)i.push(Wg(e.memberId,new Date(t).toISOString()));return i}async function pb(e){let t=Wg(e.memberId,e.start);try{return await(0,c.runTransaction)(O,async n=>{let r=(0,c.doc)(O,ug,t),i=fb(e).filter(e=>e!==t),[a,...o]=await Promise.all([n.get(r),...i.map(e=>n.get((0,c.doc)(O,ug,e)))]);if(a.exists())throw Error(ub);for(let t of o){if(!t.exists())continue;let n=t.data()||{};if(Ug({start:String(n.start||``),end:String(n.end||``)},e))throw Error(ub)}n.set(r,{memberId:e.memberId,start:e.start,end:e.end,createdAt:Date.now()})}),null}catch(e){return e?.message===ub?db:(console.error(`Could not claim the time`,e),`The time could not be saved — check your connection and try again.`)}}async function mb(e){try{await(0,c.deleteDoc)((0,c.doc)(O,ug,Wg(e.memberId,e.start)))}catch{}}async function hb(e,t){try{return await(0,c.setDoc)((0,c.doc)(O,Q,Wg(e.memberId,e.start)),{memberId:e.memberId,memberName:t.memberName,scheduleId:t.scheduleId,scheduleName:t.scheduleName,paymentId:t.paymentId||``,paymentSession:t.paymentSession||``,start:e.start,end:e.end,timeZone:t.timeZone,name:t.name,email:t.email.trim().toLowerCase(),answers:t.answers,formId:t.formId,entryId:t.entryId,uid:D.currentUser?.uid||`guest`,createdAt:Date.now(),pending:!0}),null}catch(e){return console.error(`Could not write the booking`,e),`The booking could not be saved — check your connection and try again.`}}var gb=(e,t)=>({id:e,memberId:String(t?.memberId||``),scheduleId:String(t?.scheduleId||``),scheduleName:String(t?.scheduleName||``),own:t?.own===!0,title:String(t?.title||``),color:String(t?.color||``),paymentId:String(t?.paymentId||``),paymentSession:String(t?.paymentSession||``),cancelled:t?.cancelled===!0,cancelledAt:typeof t?.cancelledAt==`number`?t.cancelledAt:0,cancelReason:String(t?.cancelReason||``),cancelledBy:String(t?.cancelledBy||``),cancelledSide:t?.cancelledSide===`host`||t?.cancelledSide===`booker`?t.cancelledSide:``,cancelledByUid:String(t?.cancelledByUid||``),pending:t?.pending===!0,acceptedAt:typeof t?.acceptedAt==`number`?t.acceptedAt:0,heldOnly:!1,copyIds:[e],partySize:1,partyAccepted:t?.pending===!0?0:1,start:String(t?.start||``),end:String(t?.end||``),memberName:String(t?.memberName||``),timeZone:String(t?.timeZone||``),name:String(t?.name||``),email:String(t?.email||``),answers:t?.answers&&typeof t.answers==`object`?Object.fromEntries(Object.entries(t.answers).map(([e,t])=>[e,String(t??``)])):{},formId:String(t?.formId||``),entryId:String(t?.entryId||``),uid:String(t?.uid||``),createdAt:typeof t?.createdAt==`number`?t.createdAt:0});function _b(e={}){let[t,n]=(0,i.useState)({loading:!0,bookings:[],error:null}),r=(e.members||[]).slice().sort().join(`,`),a=!!e.includePast,o=e.now;return(0,i.useEffect)(()=>{let e=r?new Set(r.split(`,`)):null,t=(o?o():new Date).toISOString(),i=(0,c.onSnapshot)(a?(0,c.collection)(O,Q):(0,c.query)((0,c.collection)(O,Q),(0,c.where)(`end`,`>=`,t)),t=>{let r=(o?o():new Date).toISOString(),i=[];t.forEach(t=>{let n=gb(t.id,t.data());e&&!e.has(n.memberId)||i.push(n)});let s=i.filter(e=>e.end>=r).sort((e,t)=>e.start.localeCompare(t.start)),c=a?i.filter(e=>e.end<r).sort((e,t)=>t.start.localeCompare(e.start)):[];n({loading:!1,bookings:[...s,...c],error:null})},e=>{n({loading:!1,bookings:[],error:String(e?.code||``).includes(`permission`)?`This is for the team — sign in as a team member or admin to see the bookings.`:`The bookings could not be loaded.`})});return()=>i()},[r,a,o]),t}function vb(e,t,n){return P(`${Q}/uid=${e}`,()=>(0,c.query)((0,c.collection)(O,Q),(0,c.where)(`uid`,`==`,e)),e=>t(e.docs),n)}function yb(e,t,n){return P(`${Q}/email=${e}`,()=>(0,c.query)((0,c.collection)(O,Q),(0,c.where)(`email`,`==`,e)),e=>t(e.docs),n)}function bb(e,t){let[n,r]=(0,i.useState)(xb),[a,o]=(0,i.useState)(xb),s=t.trim().toLowerCase();(0,i.useEffect)(()=>{if(e)return vb(e,e=>r({done:!0,list:e.map(e=>gb(e.id,e.data())),error:null}),e=>r({done:!0,list:[],error:Cb(e)}))},[e]),(0,i.useEffect)(()=>{if(s)return yb(s,e=>o({done:!0,list:e.map(e=>gb(e.id,e.data())),error:null}),e=>o({done:!0,list:[],error:Cb(e)}))},[s]);let c=e?n:Sb,l=s?a:Sb;return{loading:!c.done||!l.done,bookings:(0,i.useMemo)(()=>Db(Eb(c.list,l.list)),[c.list,l.list]),error:c.error&&l.error?c.error:null}}var xb={done:!1,list:[],error:null},Sb={done:!0,list:[],error:null},Cb=e=>String(e?.code||``).includes(`permission`)?`These are not readable from this account.`:`The bookings could not be loaded.`,wb=e=>{let t=new Set(e.legacyIds);return new Set(e.schedules.filter(e=>!t.has(e.id)).map(e=>e.id))},Tb=(e,t)=>e.map(e=>e.scheduleId&&t.has(e.scheduleId)?{...e,scheduleName:``}:e);function Eb(...e){let t=new Map;for(let n of e)for(let e of n)e.own||t.set(e.id,e);return[...t.values()].sort((e,t)=>e.start.localeCompare(t.start))}function Db(e){let t=new Map;for(let n of e){let e=zy(n),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.values()].map(e=>{let t=By(e);if(e.length===1)return{...e[0],...t};let n=e.map(e=>e.memberName.trim()).filter(Boolean),r=n.length<=1?n.join(``):`${n.slice(0,-1).join(`, `)} and ${n[n.length-1]}`,i=e.find(e=>e.cancelled&&(e.cancelReason||e.cancelledBy));return{...e[0],...t,memberName:r,cancelled:e.every(e=>e.cancelled),cancelReason:i?.cancelReason||e[0].cancelReason,cancelledBy:i?.cancelledBy||e[0].cancelledBy,cancelledSide:i?.cancelledSide||e[0].cancelledSide}})}async function Ob(e,t){try{return await(0,c.setDoc)((0,c.doc)(O,Q,e),{color:t},{merge:!0}),null}catch(e){return console.error(`Could not colour the booking`,e),`The colour could not be saved — make sure you are signed in as a team member and try again.`}}async function kb(e){let t={memberId:e.memberId,scheduleId:``,start:e.start,end:e.end},n=await pb(t);if(n)return n===`That time was just taken — pick another.`?`Something is already booked at that time — pick another.`:n;try{return await(0,c.setDoc)((0,c.doc)(O,Q,Wg(e.memberId,e.start)),{memberId:e.memberId,memberName:e.memberName,scheduleId:``,scheduleName:``,paymentId:``,paymentSession:``,own:!0,title:e.title,color:e.color,start:e.start,end:e.end,timeZone:e.timeZone,name:``,email:``,answers:e.note?{note:e.note}:{},formId:``,entryId:``,uid:D.currentUser?.uid||``,createdAt:Date.now()}),null}catch(e){return console.error(`Could not save the event`,e),await mb(t),`The event could not be saved — make sure you are signed in as a team member and try again.`}}async function Ab(e){try{return await(0,c.setDoc)((0,c.doc)(O,Q,e),{pending:!1,acceptedAt:Date.now()},{merge:!0}),null}catch(e){return console.error(`Could not accept the booking`,e),`It could not be accepted — make sure you are signed in as a team member and try again.`}}async function jb(e,t={}){try{let n=t.ids?.length?t.ids:await Mb(e),r={cancelled:!0,cancelledAt:Date.now(),cancelReason:(t.reason||``).trim(),cancelledBy:(t.by||``).trim(),cancelledSide:t.side||``,...t.byUid&&t.side!==`booker`?{cancelledByUid:t.byUid}:{}};for(let e of n)await(0,c.setDoc)((0,c.doc)(O,Q,e),r,{merge:!0}),await(0,c.deleteDoc)((0,c.doc)(O,ug,e));return null}catch(e){return console.error(`Could not cancel the booking`,e),t.side===`booker`?`It could not be cancelled — check your connection and try again.`:`It could not be cancelled — make sure you are signed in as a team member and try again.`}}async function Mb(e){try{let t=await(0,c.getDoc)((0,c.doc)(O,Q,e)),n=t.exists()&&t.data()||{},r=String(n.entryId||``),i=String(n.start||``);if(!r||!i)return[e];let a=await(0,c.getDocs)((0,c.query)((0,c.collection)(O,Q),(0,c.where)(`entryId`,`==`,r))),o=new Set([e]);return a.forEach(e=>{String(e.data()?.start||``)===i&&o.add(e.id)}),[...o]}catch{return[e]}}async function Nb(e,t){try{let n=t?.length?t:await Mb(e);for(let e of n)await(0,c.deleteDoc)((0,c.doc)(O,Q,e)),await(0,c.deleteDoc)((0,c.doc)(O,ug,e));return null}catch(e){return console.error(`Could not remove the booking`,e),`It could not be removed — make sure you are signed in as a team member and try again.`}}async function Pb(e,t){try{return await(0,c.deleteDoc)((0,c.doc)(O,ug,Wg(e,t))),null}catch(e){return console.error(`Could not free the held time`,e),`The time could not be freed — make sure you are signed in as a team member and try again.`}}var Fb=new Set([`uid`,`formId`,`submittedAt`,`submitterName`,`submitterEmail`,`submitterAvatar`]),Ib=(e,t)=>{if(!e||typeof e!=`object`)return{};let n;try{n=JSON.parse(JSON.stringify(e))}catch{return{}}let r={};for(let[e,i]of Object.entries(n||{}))Fb.has(e)||e in t||(r[e]=i);return r},Lb=i.default.lazy(()=>Promise.resolve().then(()=>require(`./PhoneInputField-B0gTYm_q.cjs`))),Rb=i.default.lazy(()=>Promise.resolve().then(()=>require(`./AddressField-xsA-q7vk.cjs`))),zb=/^[^\s@,;]+@[^\s@,;.]+(\.[^\s@,;.]+)*\.[a-z]{2,}$/i;function Bb({field:e,value:t,error:n,timeZone:r,onTimeZone:o,onChange:s}){let{schedules:c}=Xy(),l=av(e),u=c.filter(e=>l.includes(e.id)&&k_(e)),d=new Set(u.map(e=>e.memberId)).size>1,f=iv(e),p=f===`choose`&&d,[m,h]=(0,i.useState)(!1),g=d&&(f===`all`||p&&m),_=g?e_(u):[],[v]=(0,i.useState)(()=>new Date),y=ob(u.map(e=>e.memberId),v),b=x_(t),x=e.look===`calendar`?Sy:dy;return(0,a.jsxs)(`div`,{className:`flex flex-col w-full`,children:[(0,a.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1`,children:e.label}),p&&(0,a.jsx)(`div`,{className:`flex gap-1.5 mb-2.5 p-1 rounded-[var(--input-radius,0.75rem)] border border-[var(--panel-border)] bg-[var(--panel-bg)] w-fit`,children:[{on:!m,label:`One of them`,v:!1},{on:m,label:`All of them`,v:!0}].map(e=>(0,a.jsx)(`button`,{type:`button`,"aria-pressed":e.on,onClick:()=>{e.v!==m&&(h(e.v),s(``))},className:`px-3 h-8 rounded-[calc(var(--input-radius,0.75rem)-0.25rem)] text-[12.5px] font-semibold transition-all cursor-pointer ${e.on?`bg-accent text-[var(--button-fg,#fff)] shadow-sm`:`text-foreground/55 hover:text-foreground`}`,children:e.label},e.label))}),g&&(0,a.jsxs)(`p`,{className:`text-[12.5px] font-medium text-foreground/50 mb-2 ml-1`,children:[`Times `,dv(_),` are all free.`]}),(0,a.jsx)(x,{members:u,value:b,onChange:e=>s(e?b_(e,g):``),taken:y,timeZone:r,onTimeZone:o,together:g}),n&&(0,a.jsx)(`span`,{className:`text-xs text-red-500 font-medium mt-1.5 ml-1`,children:n})]})}var Vb=(e,t)=>{let n=e.find(e=>e.type===`text`&&/name/i.test(String(e.name||``)))||e.find(e=>e.type===`text`);return String(n&&t[n.name]||D.currentUser?.displayName||``).trim()},Hb=(e,t)=>{let n=e.find(e=>e.type===`email`);return String(n&&t[n.name]||D.currentUser?.email||``).trim()},Ub=(e,t)=>{let n=iv(e);if(!(n===`all`||n===`choose`&&S_(t)))return[];let r=av(e),i=e_(ev().filter(e=>r.includes(e.id)&&k_(e)));return i.length>1?i:[]};function Wb(e,t){if(!t||!e.some(e=>e?.type===`schedule`))return{};let n={},r=String(t.email||``).trim(),i=e.find(e=>e?.type===`email`&&e.name);i&&r&&(n[i.name]=r);let a=String(t.displayName||``).trim(),o=e.find(e=>e?.type===`text`&&e.name&&/name/i.test(`${e.name} ${e.label||``}`));return o&&a&&(n[o.name]=a),n}var Gb=(e,t)=>Object.fromEntries(e.filter(e=>e.type!==`schedule`&&e.name&&t[e.name]!==void 0&&t[e.name]!==``).map(e=>[e.name,String(t[e.name])]));function Kb({onClose:e,formId:t,formConfig:o,isInline:s,bare:l,onSubmitted:f,extra:m}){let[g,_]=(0,i.useState)({}),[v,b]=(0,i.useState)(`idle`),[x,S]=(0,i.useState)(``),[C,w]=(0,i.useState)({}),[T,E]=(0,i.useState)(()=>kg()),[k,ee]=(0,i.useState)(``),te=(0,i.useRef)(null),[A,j]=(0,i.useState)(o||null),[ne,re]=(0,i.useState)(!o),M=(0,u.useNavigate)(),N=y(),{user:P}=Fn(),F=Wb(A?.fields||[],P),ie=String(P?.displayName||``).trim(),I=String(P?.email||``).trim(),L=e=>{let t=(typeof window<`u`?window.__FBOS_FORMS__:null)||{};return N?.defaultConfigs?.[e]||N?.defaultConfigs?.[`${e}Form`]||t[e]||(e===`contact`?p:e===`support`?h:null)};(0,i.useEffect)(()=>{if(o){j(o),re(!1);return}if(!t){j(L(`contact`)),re(!1);return}if(!localStorage.getItem(`fbos_custom_form_${t}`)){let e=L(t);if(e){j(e),re(!1);return}}try{let e=localStorage.getItem(`fbos_form_${t}`);e&&(j(JSON.parse(e)),re(!1))}catch{}(async()=>{try{let e=await(0,c.getDoc)((0,c.doc)(O,`sys_forms`,t));if(e.exists()){let n={...e.data(),id:e.id};j(n),localStorage.setItem(`fbos_form_${t}`,JSON.stringify(n))}else{let e=L(t);e&&(j(e),localStorage.removeItem(`fbos_custom_form_${t}`))}}catch(e){console.error(`Failed to load form config:`,e);let n=L(t);n&&j(n)}finally{re(!1)}})()},[t,o]),(0,i.useEffect)(()=>{A&&A.fields&&_(e=>{let t={...e},n=!1;return A.fields.forEach(e=>{(e.name===`contactEmail`||e.type===`email`)&&!t[e.name]&&D.currentUser?.email&&(t[e.name]=D.currentUser.email,n=!0)}),n?t:e})},[A]),(0,i.useEffect)(()=>{function t(t){te.current&&!te.current.contains(t.target)&&e?.()}return document.addEventListener(`mousedown`,t),()=>document.removeEventListener(`mousedown`,t)},[e]),(0,i.useEffect)(()=>{if(s)return;let t=t=>{t.key===`Escape`&&e?.()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,s]),(0,i.useEffect)(()=>{if(!s)return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=`unset`}},[s]);let ae=async n=>{n.preventDefault();let r=(A?.fields||[]).filter(e=>e.type===`email`),i={},a={};r.forEach(e=>{let t=String(g[e.name]??``).trim();t&&(a[e.name]=t,zb.test(t)||(i[e.name]=`That does not look like an email address — check for a typo, e.g. jane@example.com`))}),(A?.fields||[]).filter(e=>e.type===`file`&&e.required&&!g[e.name]).forEach(e=>{i[e.name]=`Please attach a file before sending.`});let s=(A?.fields||[]).filter(e=>e.type===`schedule`);if(s.filter(e=>e.required&&!x_(g[e.name])).forEach(e=>{i[e.name]=`Pick a time before sending.`}),Object.keys(i).length>0){w(i);return}w({}),b(`loading`),S(``);try{let n=kp(A),r=t||A?.systemName||A?.title||`unknown`,i=[],l=[],u=async()=>{for(let e of l)await mb(e)};for(let e of s){let t=x_(g[e.name]);if(!t)continue;let n=Ub(e,g[e.name]),r=n.length?s_(t,n):[t],a=[],o=null;for(let e of r){if(o=await pb(e),o)break;l.push(e);let t=l_(e,ev());a.push({slot:e,memberName:t?.memberName||``,scheduleId:t?.id||e.scheduleId,scheduleName:F_(t,String(A?.title||``))})}if(o){await u(),w({[e.name]:o}),b(`idle`);return}i.push({field:e,slot:t,whoName:n.length?dv(n):a[0]?.memberName||``,each:a})}let d={...g,...a,...F};for(let e of i)delete d[e.field.name],Object.assign(d,C_(e.field.name,e.slot,e.whoName,T));let p=D.currentUser?{uid:D.currentUser.uid,submitterName:D.currentUser.displayName||``,submitterEmail:D.currentUser.email||``,submitterAvatar:D.currentUser.photoURL||``}:{uid:`guest`},h=i.length>0,v;if(h)v=(0,c.doc)((0,c.collection)(O,n));else try{v=await(0,c.addDoc)((0,c.collection)(O,n),{...Ib(m,d),...d,...p,formId:r,submittedAt:(0,c.serverTimestamp)()})}catch(e){throw await u(),e}let y=A?.fields||[],x=``;for(let e of i)for(let t of e.each){let e=await hb(t.slot,{memberName:t.memberName,scheduleId:t.scheduleId,scheduleName:t.scheduleName,timeZone:T,name:Vb(y,d),email:Hb(y,d),answers:Gb(y,d),formId:r,entryId:v.id});if(e){await u(),b(`error`),S(e);return}x||=Wg(t.slot.memberId,t.slot.start)}i.length&&ee(i.map(e=>y_(e.slot,e.whoName,T)).join(`; `)),b(`success`);try{f?.(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,String(t??``)])),h?{collection:Q,id:x}:{collection:n,id:v.id})}catch{}setTimeout(()=>{A?.redirectTo&&!o&&(A.redirectTo.startsWith(`/`)?M(A.redirectTo):window.location.href=A.redirectTo),e?.(),b(`idle`),_({}),ee(``)},3e3)}catch(e){console.error(`Submission error:`,e),b(`error`),S(`We could not send your message right now. Please try again.`)}},[oe,R]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{let e;return ne||!A&&!o?e=setTimeout(()=>R(!0),150):R(!1),()=>clearTimeout(e)},[ne,A,o]),ne||!A)return oe?s?(0,a.jsx)(`div`,{className:`w-full flex items-center justify-center py-[10vh]`,children:(0,a.jsxs)(`div`,{className:`p-4 rounded-2xl glass-panel border border-[var(--panel-border)]/40 bg-background/80 shadow-md flex items-center gap-3`,children:[(0,a.jsx)(n.ft,{className:`w-4 h-4 animate-spin text-accent`}),(0,a.jsx)(`span`,{className:`text-[12px] font-medium text-foreground/60 tracking-wide`,children:`Loading form...`})]})}):(0,d.createPortal)((0,a.jsx)(`div`,{className:`fixed inset-0 z-[100] flex items-center justify-center bg-background/10 backdrop-blur-sm`,children:(0,a.jsxs)(`div`,{className:`p-4 rounded-2xl glass-panel border border-[var(--panel-border)]/40 bg-background/80 shadow-xl flex items-center gap-3`,children:[(0,a.jsx)(n.ft,{className:`w-4 h-4 animate-spin text-accent`}),(0,a.jsx)(`span`,{className:`text-[12px] font-medium text-foreground/60 tracking-wide`,children:`Loading form...`})]})}),document.body):null;let z=(A.fields||[]).find(e=>e.type===`schedule`&&e.look===`calendar`),se=z?x_(g[z.name]):null,ce=!!z&&!se,le=ce?`max-w-[880px]`:`max-w-[500px]`,ue=se?Ub(z,g[z.name]):[],de=se?ue.length?dv(ue):l_(se,ev())?.memberName||``:``,fe=(0,a.jsx)(`div`,{className:`relative z-10 w-full`,children:v===`success`?(0,a.jsxs)(Op.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,a.jsx)(`div`,{className:`w-16 h-16 rounded-full bg-green-500/10 border border-green-500/20 flex items-center justify-center text-green-500 mb-4`,children:(0,a.jsx)(n.Qt,{className:`w-8 h-8`})}),(0,a.jsx)(`h4`,{className:`text-lg font-bold text-foreground mb-2`,children:`Message Sent!`}),(0,a.jsx)(`p`,{className:`text-[14px] text-foreground/60 leading-relaxed`,children:`Thank you for your interest. We'll get back to you shortly.`}),k&&(0,a.jsxs)(`p`,{className:`text-[14px] font-semibold text-foreground mt-3`,children:[`Booked: `,k]})]}):v===`loading`?(0,a.jsxs)(Op.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,a.jsx)(n.ft,{className:`w-10 h-10 animate-spin text-accent mb-4`}),(0,a.jsx)(`h4`,{className:`text-lg font-bold text-foreground tracking-tight`,children:`Processing`}),(0,a.jsx)(`p`,{className:`text-[13px] text-foreground/50 mt-1`,children:`Please wait a moment...`})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`div`,{className:s&&l?`sr-only`:`mb-6 text-center`,children:[(0,a.jsx)(`h3`,{className:`text-2xl sm:text-3xl font-extrabold mb-2 text-foreground tracking-tight break-words`,children:A.title}),A.description&&(0,a.jsx)(`p`,{className:`text-[14px] md:text-[15px] font-medium text-foreground/60 tracking-wide leading-relaxed`,children:A.description})]}),v===`error`&&(0,a.jsxs)(Op.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`mb-4 p-3 sm:p-4 rounded-xl bg-red-500/10 border border-red-500/20 flex items-start gap-3`,children:[(0,a.jsx)(n.$t,{className:`w-5 h-5 text-red-500 shrink-0 mt-0.5`}),(0,a.jsx)(`p`,{className:`text-[14px] font-medium text-red-500/90`,children:x})]}),(0,a.jsxs)(`form`,{onSubmit:ae,className:`flex flex-col gap-4 sm:gap-5 w-full`,children:[z&&(se?(0,a.jsx)(py,{slot:se,timeZone:T,who:de,onChange:()=>_(e=>({...e,[z.name]:``}))}):(0,a.jsx)(Bb,{field:z,value:g[z.name]||``,error:C[z.name],timeZone:T,onTimeZone:E,onChange:e=>_(t=>({...t,[z.name]:e}))})),!ce&&Object.keys(F).length>0&&(0,a.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl px-4 py-3 glass-panel`,style:{borderRadius:`var(--input-radius, 0.75rem)`},children:[(0,a.jsx)(`span`,{className:`text-[13px] font-medium text-foreground/50 shrink-0`,children:`Booking as`}),(0,a.jsx)(`span`,{className:`text-[14px] font-semibold text-foreground truncate`,children:[ie,I].filter(Boolean).join(` · `)})]}),!ce&&[...A.fields||[]].filter(e=>e!==z&&!(e.name in F)).sort((e,t)=>{let n=e.type===`checkbox`,r=t.type===`checkbox`;return n&&!r?1:!n&&r?-1:0}).map((e,t)=>{if(e.type===`schedule`)return(0,a.jsx)(Bb,{field:e,value:g[e.name]||``,error:C[e.name],timeZone:T,onTimeZone:E,onChange:t=>{_(n=>({...n,[e.name]:t})),C[e.name]&&w(t=>{let n={...t};return delete n[e.name],n})}},t);if(e.type===`tel`)return(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(`div`,{className:`h-12 w-full glass-panel animate-pulse rounded-xl`}),children:(0,a.jsx)(Lb,{field:e,value:g[e.name]||``,onChange:t=>_(n=>({...n,[e.name]:t}))})},t);if(e.type===`address`)return(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(`div`,{className:`h-12 w-full glass-panel animate-pulse rounded-xl`}),children:(0,a.jsx)(Rb,{id:`form-${e.name}`,label:e.label,required:e.required,placeholder:e.placeholder,error:C[e.name],value:r.r(e.name,g),onChange:t=>{_(n=>({...n,...r.n(e.name,t)})),C[e.name]&&w(t=>{let n={...t};return delete n[e.name],n})}})},t);if(e.type===`file`)return(0,a.jsx)(Ih,{field:e,value:g[e.name]||``,error:C[e.name],onChange:t=>{_(n=>({...n,[e.name]:t(n[e.name]||``)})),C[e.name]&&w(t=>{let n={...t};return delete n[e.name],n})}},t);if(e.type===`textarea`)return(0,a.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[(0,a.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1`,children:e.label}),(0,a.jsx)(`textarea`,{required:e.required,rows:3,placeholder:e.placeholder,value:g[e.name]||``,onChange:t=>_(n=>({...n,[e.name]:t.target.value})),className:`flex w-full rounded-xl text-[15px] text-foreground px-4 py-3 transition-all duration-300 placeholder:text-foreground/40 focus:outline-none focus:border-accent glow-focus disabled:cursor-not-allowed disabled:opacity-50 glass-panel min-h-[100px] resize-none`})]},t);if(e.type===`select`)return(0,a.jsx)(`div`,{className:`w-full`,children:(0,a.jsx)(ah,{label:e.label,direction:`auto`,value:g[e.name]||``,options:[{value:``,label:(0,a.jsx)(`span`,{className:`text-foreground/40`,children:`Select an option...`})},...(e.options||[]).map(e=>({value:e,label:e}))],onChange:t=>_(n=>({...n,[e.name]:t}))})},t);if(e.type===`checkbox`)return(0,a.jsxs)(`label`,{className:`flex items-center gap-3 w-full cursor-pointer group py-2`,children:[(0,a.jsxs)(`div`,{className:`relative flex items-center justify-center w-5 h-5 rounded border border-foreground/20 bg-background/50 group-hover:border-accent transition-colors`,children:[(0,a.jsx)(`input`,{type:`checkbox`,required:e.required,checked:!!g[e.name],onChange:t=>_(n=>({...n,[e.name]:t.target.checked})),className:`absolute opacity-0 w-full h-full cursor-pointer`}),g[e.name]&&(0,a.jsx)(`span`,{className:`w-2.5 h-2.5 bg-accent rounded-sm shrink-0`})]}),(0,a.jsx)(`span`,{className:`text-[14px] font-medium text-foreground/80 leading-snug group-hover:text-foreground transition-colors`,children:e.label})]},t);if(e.type===`date`){let r=g[e.name]||``;return(0,a.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[(0,a.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1`,children:e.label}),(0,a.jsxs)(`div`,{className:`relative flex items-center lift-focus`,children:[(0,a.jsx)(`input`,{type:`date`,required:e.required,value:r,onChange:t=>_(n=>({...n,[e.name]:t.target.value})),className:`date-field block h-12 w-full text-[15px] pl-4 pr-11 py-2 transition-all duration-300 focus:outline-none focus:border-accent glow-focus disabled:cursor-not-allowed disabled:opacity-50 glass-panel ${r?`text-foreground`:`text-foreground/40`}`,style:{borderRadius:`var(--input-radius, 0.75rem)`}}),(0,a.jsx)(n.an,{className:`w-4 h-4 text-foreground/50 absolute right-4 pointer-events-none`})]})]},t)}return e.type===`age`?(0,a.jsx)(nh,{label:e.label,required:e.required,type:`number`,min:0,max:120,placeholder:e.placeholder||`Age (Max 120)`,value:g[e.name]||``,onChange:t=>{let n=t.target.value;if(n===``)_(t=>({...t,[e.name]:``}));else{let t=Math.max(0,Math.min(120,parseInt(n,10)));_(n=>({...n,[e.name]:isNaN(t)?``:String(t)}))}}},t):e.type===`currency`||e.type===`number`&&e.name===`budget`?(0,a.jsxs)(`div`,{className:`flex flex-col w-full relative`,children:[(0,a.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1`,children:e.label}),(0,a.jsxs)(`div`,{className:`relative flex items-center justify-center lift-focus`,children:[(0,a.jsx)(`span`,{className:`absolute left-4 text-foreground/70 font-bold flex items-center h-full z-10 pointer-events-none text-[15px]`,children:e.currencySymbol||`$`}),(0,a.jsx)(`input`,{required:e.required,type:`number`,placeholder:e.placeholder,value:g[e.name]||``,onChange:t=>_(n=>({...n,[e.name]:t.target.value})),className:`block h-12 w-full text-[15px] text-foreground pl-8 pr-4 py-2 transition-all duration-300 placeholder:text-foreground/40 focus:outline-none focus:border-accent glow-focus disabled:cursor-not-allowed disabled:opacity-50 glass-panel`,style:{borderRadius:`var(--input-radius, 0.75rem)`}})]})]},t):(0,a.jsx)(nh,{label:e.label,required:e.required,type:e.type,placeholder:e.placeholder,currencySymbol:e.currencySymbol,error:C[e.name],value:g[e.name]||``,onChange:t=>{_(n=>({...n,[e.name]:t.target.value})),C[e.name]&&w(t=>{let n={...t};return delete n[e.name],n})}},t)}),se?(0,a.jsxs)(`div`,{className:`flex flex-col gap-4 pt-1`,children:[(0,a.jsx)(`div`,{className:`h-px bg-[var(--panel-border)]/60`}),(0,a.jsx)(iy,{timeZone:T,onTimeZone:E,action:(0,a.jsx)(rh,{type:`submit`,className:`max-sm:w-full h-11 px-6 text-[13.5px] font-bold shrink-0`,isLoading:!1,children:A.submitText||A.buttonName||`Submit`})})]}):!ce&&(0,a.jsx)(`div`,{className:`pt-2`,children:(0,a.jsx)(rh,{type:`submit`,className:`w-full px-6 md:px-8 py-3 md:py-3.5 rounded-xl font-semibold tracking-wide btn-primary text-[15px] shadow-xl transition-all duration-300 hover:-translate-y-1 active:scale-95 flex items-center justify-center`,isLoading:!1,children:A.submitText||A.buttonName||`Submit`})})]})]})});return s&&l?(0,a.jsx)(`div`,{className:`w-full ${le} mx-auto relative transition-[max-width] duration-500 ease-out`,children:fe}):s?(0,a.jsx)(`div`,{className:`w-full flex justify-center flex-col items-center`,children:(0,a.jsxs)(Op.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`w-full ${le} p-6 sm:p-8 lg:p-10 rounded-3xl md:rounded-3xl glass-form relative glow-hover shadow-[0_8px_32px_rgba(0,0,0,0.08)] z-10 mx-auto transition-[max-width] duration-500 ease-out`,children:[(0,a.jsx)(`div`,{className:`absolute -inset-[1px] bg-gradient-to-br from-[var(--primary-glow)] to-transparent opacity-30 blur-[20px] rounded-3xl md:rounded-3xl -z-10`}),fe]})}):(0,d.createPortal)((0,a.jsxs)(`div`,{className:`fixed inset-0 z-[100] flex items-start justify-center p-4 py-20 md:py-10 h-[-webkit-fill-available] md:h-screen w-screen overflow-y-auto no-scrollbar`,children:[(0,a.jsx)(Op.div,{onClick:e,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 bg-background/60 backdrop-blur-xl cursor-pointer`}),(0,a.jsxs)(Op.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},ref:te,className:`w-full ${le} p-6 sm:p-8 lg:p-10 rounded-3xl md:rounded-3xl glass-popover relative shadow-[0_8px_32px_rgba(0,0,0,0.08)] z-10 mx-auto my-auto border border-[var(--panel-border)] shrink-0 transition-[max-width] duration-500 ease-out`,children:[(0,a.jsx)(`div`,{className:`absolute -inset-[1px] bg-gradient-to-br from-[var(--primary-glow)] to-transparent opacity-30 blur-[20px] rounded-3xl md:rounded-3xl -z-10`}),fe]})]}),document.body)}Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return Mv}}),Object.defineProperty(exports,`$i`,{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,`$n`,{enumerable:!0,get:function(){return W_}}),Object.defineProperty(exports,`$r`,{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,`$t`,{enumerable:!0,get:function(){return ag}}),Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return Vy}}),Object.defineProperty(exports,`Ai`,{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,`An`,{enumerable:!0,get:function(){return Vg}}),Object.defineProperty(exports,`Ar`,{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,`At`,{enumerable:!0,get:function(){return Rh}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return _y}}),Object.defineProperty(exports,`Bi`,{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,`Bn`,{enumerable:!0,get:function(){return xv}}),Object.defineProperty(exports,`Br`,{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,`Bt`,{enumerable:!0,get:function(){return f_}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return ab}}),Object.defineProperty(exports,`Ci`,{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,`Cn`,{enumerable:!0,get:function(){return q_}}),Object.defineProperty(exports,`Cr`,{enumerable:!0,get:function(){return nh}}),Object.defineProperty(exports,`Ct`,{enumerable:!0,get:function(){return tv}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return Tb}}),Object.defineProperty(exports,`Di`,{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,`Dn`,{enumerable:!0,get:function(){return jv}}),Object.defineProperty(exports,`Dr`,{enumerable:!0,get:function(){return jd}}),Object.defineProperty(exports,`Dt`,{enumerable:!0,get:function(){return Vh}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return wb}}),Object.defineProperty(exports,`Ei`,{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,`En`,{enumerable:!0,get:function(){return $_}}),Object.defineProperty(exports,`Er`,{enumerable:!0,get:function(){return Op}}),Object.defineProperty(exports,`Et`,{enumerable:!0,get:function(){return Uh}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return Fy}}),Object.defineProperty(exports,`Fi`,{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,`Fn`,{enumerable:!0,get:function(){return d_}}),Object.defineProperty(exports,`Fr`,{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,`Ft`,{enumerable:!0,get:function(){return fg}}),Object.defineProperty(exports,`G`,{enumerable:!0,get:function(){return xy}}),Object.defineProperty(exports,`Gi`,{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,`Gn`,{enumerable:!0,get:function(){return Wg}}),Object.defineProperty(exports,`Gr`,{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(exports,`Gt`,{enumerable:!0,get:function(){return Qg}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return hy}}),Object.defineProperty(exports,`Hi`,{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,`Hn`,{enumerable:!0,get:function(){return N_}}),Object.defineProperty(exports,`Hr`,{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,`Ht`,{enumerable:!0,get:function(){return ig}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return Ny}}),Object.defineProperty(exports,`Ii`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`In`,{enumerable:!0,get:function(){return uv}}),Object.defineProperty(exports,`Ir`,{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,`It`,{enumerable:!0,get:function(){return pg}}),Object.defineProperty(exports,`J`,{enumerable:!0,get:function(){return fy}}),Object.defineProperty(exports,`Ji`,{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,`Jn`,{enumerable:!0,get:function(){return __}}),Object.defineProperty(exports,`Jr`,{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,`Jt`,{enumerable:!0,get:function(){return _g}}),Object.defineProperty(exports,`K`,{enumerable:!0,get:function(){return vy}}),Object.defineProperty(exports,`Ki`,{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,`Kn`,{enumerable:!0,get:function(){return L_}}),Object.defineProperty(exports,`Kr`,{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,`Kt`,{enumerable:!0,get:function(){return $g}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return My}}),Object.defineProperty(exports,`Li`,{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,`Ln`,{enumerable:!0,get:function(){return z_}}),Object.defineProperty(exports,`Lr`,{enumerable:!0,get:function(){return mn}}),Object.defineProperty(exports,`Lt`,{enumerable:!0,get:function(){return Jg}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return Dy}}),Object.defineProperty(exports,`Mi`,{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,`Mn`,{enumerable:!0,get:function(){return e_}}),Object.defineProperty(exports,`Mr`,{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(exports,`Mt`,{enumerable:!0,get:function(){return Gg}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return Ay}}),Object.defineProperty(exports,`Ni`,{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,`Nn`,{enumerable:!0,get:function(){return ov}}),Object.defineProperty(exports,`Nr`,{enumerable:!0,get:function(){return wn}}),Object.defineProperty(exports,`Nt`,{enumerable:!0,get:function(){return Yg}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return hb}}),Object.defineProperty(exports,`Oi`,{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,`On`,{enumerable:!0,get:function(){return dv}}),Object.defineProperty(exports,`Or`,{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(exports,`Ot`,{enumerable:!0,get:function(){return bv}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return Py}}),Object.defineProperty(exports,`Pi`,{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,`Pn`,{enumerable:!0,get:function(){return s_}}),Object.defineProperty(exports,`Pr`,{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,`Pt`,{enumerable:!0,get:function(){return mg}}),Object.defineProperty(exports,`Q`,{enumerable:!0,get:function(){return zv}}),Object.defineProperty(exports,`Qi`,{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,`Qn`,{enumerable:!0,get:function(){return v_}}),Object.defineProperty(exports,`Qr`,{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,`Qt`,{enumerable:!0,get:function(){return sg}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return Ty}}),Object.defineProperty(exports,`Ri`,{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,`Rn`,{enumerable:!0,get:function(){return M_}}),Object.defineProperty(exports,`Rr`,{enumerable:!0,get:function(){return vn}}),Object.defineProperty(exports,`Rt`,{enumerable:!0,get:function(){return dg}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return Yy}}),Object.defineProperty(exports,`Si`,{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,`Sn`,{enumerable:!0,get:function(){return O_}}),Object.defineProperty(exports,`Sr`,{enumerable:!0,get:function(){return rh}}),Object.defineProperty(exports,`St`,{enumerable:!0,get:function(){return cg}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return vb}}),Object.defineProperty(exports,`Ti`,{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,`Tn`,{enumerable:!0,get:function(){return X_}}),Object.defineProperty(exports,`Tr`,{enumerable:!0,get:function(){return Ap}}),Object.defineProperty(exports,`Tt`,{enumerable:!0,get:function(){return nv}}),Object.defineProperty(exports,`U`,{enumerable:!0,get:function(){return gy}}),Object.defineProperty(exports,`Ui`,{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,`Un`,{enumerable:!0,get:function(){return fv}}),Object.defineProperty(exports,`Ur`,{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,`Ut`,{enumerable:!0,get:function(){return R_}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return Sy}}),Object.defineProperty(exports,`Vi`,{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,`Vn`,{enumerable:!0,get:function(){return U_}}),Object.defineProperty(exports,`Vr`,{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(exports,`Vt`,{enumerable:!0,get:function(){return Zh}}),Object.defineProperty(exports,`W`,{enumerable:!0,get:function(){return yy}}),Object.defineProperty(exports,`Wi`,{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,`Wn`,{enumerable:!0,get:function(){return Hg}}),Object.defineProperty(exports,`Wr`,{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,`Wt`,{enumerable:!0,get:function(){return j_}}),Object.defineProperty(exports,`X`,{enumerable:!0,get:function(){return iy}}),Object.defineProperty(exports,`Xi`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`Xn`,{enumerable:!0,get:function(){return iv}}),Object.defineProperty(exports,`Xr`,{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,`Xt`,{enumerable:!0,get:function(){return k_}}),Object.defineProperty(exports,`Y`,{enumerable:!0,get:function(){return sy}}),Object.defineProperty(exports,`Yi`,{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,`Yn`,{enumerable:!0,get:function(){return o_}}),Object.defineProperty(exports,`Yr`,{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,`Yt`,{enumerable:!0,get:function(){return wg}}),Object.defineProperty(exports,`Z`,{enumerable:!0,get:function(){return ry}}),Object.defineProperty(exports,`Zi`,{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,`Zn`,{enumerable:!0,get:function(){return av}}),Object.defineProperty(exports,`Zr`,{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,`Zt`,{enumerable:!0,get:function(){return og}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return Jy}}),Object.defineProperty(exports,`_a`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`_i`,{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,`_n`,{enumerable:!0,get:function(){return h_}}),Object.defineProperty(exports,`_r`,{enumerable:!0,get:function(){return hh}}),Object.defineProperty(exports,`_t`,{enumerable:!0,get:function(){return Xv}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return pb}}),Object.defineProperty(exports,`aa`,{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,`ai`,{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,`an`,{enumerable:!0,get:function(){return Kh}}),Object.defineProperty(exports,`ar`,{enumerable:!0,get:function(){return Ih}}),Object.defineProperty(exports,`at`,{enumerable:!0,get:function(){return Fv}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return qy}}),Object.defineProperty(exports,`bi`,{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,`bn`,{enumerable:!0,get:function(){return G_}}),Object.defineProperty(exports,`br`,{enumerable:!0,get:function(){return mh}}),Object.defineProperty(exports,`bt`,{enumerable:!0,get:function(){return Wv}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return mb}}),Object.defineProperty(exports,`ca`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`ci`,{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,`cn`,{enumerable:!0,get:function(){return y_}}),Object.defineProperty(exports,`cr`,{enumerable:!0,get:function(){return yh}}),Object.defineProperty(exports,`ct`,{enumerable:!0,get:function(){return Kv}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return eb}}),Object.defineProperty(exports,`da`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`di`,{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,`dn`,{enumerable:!0,get:function(){return kg}}),Object.defineProperty(exports,`dr`,{enumerable:!0,get:function(){return Sh}}),Object.defineProperty(exports,`dt`,{enumerable:!0,get:function(){return qv}}),Object.defineProperty(exports,`ea`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`ei`,{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,`en`,{enumerable:!0,get:function(){return pv}}),Object.defineProperty(exports,`er`,{enumerable:!0,get:function(){return wv}}),Object.defineProperty(exports,`et`,{enumerable:!0,get:function(){return Yv}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return $y}}),Object.defineProperty(exports,`fa`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`fi`,{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,`fn`,{enumerable:!0,get:function(){return T_}}),Object.defineProperty(exports,`fr`,{enumerable:!0,get:function(){return Ah}}),Object.defineProperty(exports,`ft`,{enumerable:!0,get:function(){return Bv}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return _b}}),Object.defineProperty(exports,`ga`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`gi`,{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,`gn`,{enumerable:!0,get:function(){return m_}}),Object.defineProperty(exports,`gr`,{enumerable:!0,get:function(){return Ch}}),Object.defineProperty(exports,`gt`,{enumerable:!0,get:function(){return Qv}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return ib}}),Object.defineProperty(exports,`ha`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`hi`,{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,`hn`,{enumerable:!0,get:function(){return qg}}),Object.defineProperty(exports,`hr`,{enumerable:!0,get:function(){return wh}}),Object.defineProperty(exports,`ht`,{enumerable:!0,get:function(){return Jv}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return jb}}),Object.defineProperty(exports,`ia`,{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,`ii`,{enumerable:!0,get:function(){return ln}}),Object.defineProperty(exports,`in`,{enumerable:!0,get:function(){return u_}}),Object.defineProperty(exports,`ir`,{enumerable:!0,get:function(){return Rg}}),Object.defineProperty(exports,`it`,{enumerable:!0,get:function(){return Pv}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return Uy}}),Object.defineProperty(exports,`ji`,{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,`jn`,{enumerable:!0,get:function(){return Zg}}),Object.defineProperty(exports,`jr`,{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,`jt`,{enumerable:!0,get:function(){return hg}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return Wy}}),Object.defineProperty(exports,`ki`,{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,`kn`,{enumerable:!0,get:function(){return hv}}),Object.defineProperty(exports,`kr`,{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(exports,`kt`,{enumerable:!0,get:function(){return Lh}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return tb}}),Object.defineProperty(exports,`la`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`li`,{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,`ln`,{enumerable:!0,get:function(){return Tg}}),Object.defineProperty(exports,`lr`,{enumerable:!0,get:function(){return jh}}),Object.defineProperty(exports,`lt`,{enumerable:!0,get:function(){return Iv}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return nb}}),Object.defineProperty(exports,`ma`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`mi`,{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,`mn`,{enumerable:!0,get:function(){return Xg}}),Object.defineProperty(exports,`mr`,{enumerable:!0,get:function(){return Mh}}),Object.defineProperty(exports,`mt`,{enumerable:!0,get:function(){return Hv}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Ab}}),Object.defineProperty(exports,`na`,{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,`ni`,{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(exports,`nn`,{enumerable:!0,get:function(){return Av}}),Object.defineProperty(exports,`nr`,{enumerable:!0,get:function(){return a_}}),Object.defineProperty(exports,`nt`,{enumerable:!0,get:function(){return Uv}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Nb}}),Object.defineProperty(exports,`oa`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`oi`,{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,`on`,{enumerable:!0,get:function(){return Gh}}),Object.defineProperty(exports,`or`,{enumerable:!0,get:function(){return Fh}}),Object.defineProperty(exports,`ot`,{enumerable:!0,get:function(){return Lv}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return Ob}}),Object.defineProperty(exports,`pa`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`pi`,{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,`pn`,{enumerable:!0,get:function(){return Kg}}),Object.defineProperty(exports,`pr`,{enumerable:!0,get:function(){return xh}}),Object.defineProperty(exports,`pt`,{enumerable:!0,get:function(){return $v}}),Object.defineProperty(exports,`q`,{enumerable:!0,get:function(){return py}}),Object.defineProperty(exports,`qi`,{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,`qn`,{enumerable:!0,get:function(){return B_}}),Object.defineProperty(exports,`qr`,{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,`qt`,{enumerable:!0,get:function(){return $h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return kb}}),Object.defineProperty(exports,`ra`,{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,`ri`,{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,`rn`,{enumerable:!0,get:function(){return lv}}),Object.defineProperty(exports,`rr`,{enumerable:!0,get:function(){return Ig}}),Object.defineProperty(exports,`rt`,{enumerable:!0,get:function(){return Rv}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Pb}}),Object.defineProperty(exports,`sa`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`si`,{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,`sn`,{enumerable:!0,get:function(){return tg}}),Object.defineProperty(exports,`sr`,{enumerable:!0,get:function(){return Th}}),Object.defineProperty(exports,`st`,{enumerable:!0,get:function(){return Vv}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Kb}}),Object.defineProperty(exports,`ta`,{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,`ti`,{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,`tn`,{enumerable:!0,get:function(){return I_}}),Object.defineProperty(exports,`tr`,{enumerable:!0,get:function(){return c_}}),Object.defineProperty(exports,`tt`,{enumerable:!0,get:function(){return Nv}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return rb}}),Object.defineProperty(exports,`ua`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`ui`,{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,`un`,{enumerable:!0,get:function(){return H_}}),Object.defineProperty(exports,`ur`,{enumerable:!0,get:function(){return Dh}}),Object.defineProperty(exports,`ut`,{enumerable:!0,get:function(){return ny}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return bb}}),Object.defineProperty(exports,`va`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`vi`,{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,`vn`,{enumerable:!0,get:function(){return cv}}),Object.defineProperty(exports,`vr`,{enumerable:!0,get:function(){return _h}}),Object.defineProperty(exports,`vt`,{enumerable:!0,get:function(){return ty}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return yb}}),Object.defineProperty(exports,`wi`,{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,`wn`,{enumerable:!0,get:function(){return Yh}}),Object.defineProperty(exports,`wr`,{enumerable:!0,get:function(){return th}}),Object.defineProperty(exports,`wt`,{enumerable:!0,get:function(){return Ev}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return ob}}),Object.defineProperty(exports,`xi`,{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,`xn`,{enumerable:!0,get:function(){return D_}}),Object.defineProperty(exports,`xr`,{enumerable:!0,get:function(){return ah}}),Object.defineProperty(exports,`xt`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return Zy}}),Object.defineProperty(exports,`ya`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`yi`,{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,`yn`,{enumerable:!0,get:function(){return K_}}),Object.defineProperty(exports,`yr`,{enumerable:!0,get:function(){return ph}}),Object.defineProperty(exports,`yt`,{enumerable:!0,get:function(){return ey}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return Ey}}),Object.defineProperty(exports,`zi`,{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,`zn`,{enumerable:!0,get:function(){return E_}}),Object.defineProperty(exports,`zr`,{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,`zt`,{enumerable:!0,get:function(){return Dv}});