your-ai-workflow-firebase-os 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AccessNotice-BZ5Gt1nP.js +40 -0
- package/dist/AccessNotice-CN7kc70o.cjs +1 -0
- package/dist/{AddressField-R-HvndkG.js → AddressField-9Sqn8TvC.js} +3 -3
- package/dist/{AddressField-BkzFOo2t.cjs → AddressField-B7wtV8yA.cjs} +1 -1
- package/dist/Assets-DBMwZ3bN.cjs +1 -0
- package/dist/Assets-DT-NU_WO.js +296 -0
- package/dist/Attachments-Bl9_dfsu.js +46 -0
- package/dist/Attachments-UVK9SRXf.cjs +1 -0
- package/dist/Billing-0RIHayHy.cjs +1 -0
- package/dist/Billing-FNE2r3_d.js +379 -0
- package/dist/BookingCalendar-BP5kiv3d.cjs +1 -0
- package/dist/BookingCalendar-DZ2fEFja.js +309 -0
- package/dist/Button-4lzOE31p.js +48 -0
- package/dist/Button-5DlB2MCi.cjs +1 -0
- package/dist/CalendarView-BimoXy_k.cjs +1 -0
- package/dist/CalendarView-D-ykjpvI.js +664 -0
- package/dist/ConfirmModal-Di9GR-vV.cjs +1 -0
- package/dist/ConfirmModal-gKQEpd4d.js +113 -0
- package/dist/ContactPopup-BXnHrRwl.js +1114 -0
- package/dist/ContactPopup-lxmRMoIa.cjs +1 -0
- package/dist/CopyLink-BpEQWmfI.cjs +1 -0
- package/dist/CopyLink-CBAVfcm1.js +43 -0
- package/dist/DashboardNav-CXa_ci-_.cjs +1 -0
- package/dist/DashboardNav-Dmn7PVSp.js +886 -0
- package/dist/EmailAdmin-CjN_rvxT.js +318 -0
- package/dist/EmailAdmin-lAEBdY1s.cjs +1 -0
- package/dist/EventCard-46EquygT.cjs +1 -0
- package/dist/EventCard-B6xD-mk3.js +97 -0
- package/dist/FileViewerPopup-CX-J75TM.js +1283 -0
- package/dist/FileViewerPopup-D8-MmIoS.cjs +3 -0
- package/dist/FormNote-BivRNA3J.js +50 -0
- package/dist/FormNote-BtdTGpml.cjs +1 -0
- package/dist/FormsAdmin-B5PBCG2W.js +812 -0
- package/dist/FormsAdmin-BQCULvi5.cjs +1 -0
- package/dist/Inbox-BPk2ZkE5.js +779 -0
- package/dist/Inbox-DNrcBx0o.cjs +3 -0
- package/dist/Loader-Bu89fsbB.cjs +1 -0
- package/dist/Loader-D4gwgBOq.js +32 -0
- package/dist/ManagePlanButton-B0dwqZBd.cjs +1 -0
- package/dist/ManagePlanButton-BSrOHYze.js +29 -0
- package/dist/MyBookings-6qr0GgzO.cjs +1 -0
- package/dist/MyBookings-BQjGM2LQ.js +113 -0
- package/dist/PageTitle-CZhgmmDT.cjs +3 -0
- package/dist/PageTitle-D93YCiN8.js +1606 -0
- package/dist/PagesAdmin-BcHIcqM5.cjs +34 -0
- package/dist/PagesAdmin-D69P9nRb.js +5802 -0
- package/dist/PagesAdmin-DNwZOKjA.cjs +1 -0
- package/dist/PagesAdmin-HUITEcHx.js +3 -0
- package/dist/PaymentsAdmin-C2iCI9qC.js +1291 -0
- package/dist/PaymentsAdmin-CoXi2vCm.cjs +2 -0
- package/dist/{PhoneInputField-B3P_vUDW.cjs → PhoneInputField-BEwYZMB7.cjs} +1 -1
- package/dist/{PhoneInputField-BlYHb5e0.js → PhoneInputField-BG0L2djE.js} +2 -2
- package/dist/PhoneInputField-DfOtCIH_.js +2 -0
- package/dist/{PhoneInputField-CdNTvWXQ.cjs → PhoneInputField-jhWvto8C.cjs} +1 -1
- package/dist/Popup-DHYGFl2-.cjs +1 -0
- package/dist/Popup-xROLytgr.js +142 -0
- package/dist/ProviderMark-BBfaM5Yl.js +52 -0
- package/dist/ProviderMark-xLkUN3Fx.cjs +1 -0
- package/dist/PublishApp-Bm-6r3Td.js +595 -0
- package/dist/PublishApp-D4XJUkJa.cjs +2 -0
- package/dist/Said-CoC15awL.js +94 -0
- package/dist/Said-IqCNofdh.cjs +1 -0
- package/dist/ScheduleAdmin-BKfQkrR8.js +1853 -0
- package/dist/ScheduleAdmin-DwK36GAZ.cjs +1 -0
- package/dist/SchedulePicker--urIH2Eb.js +112 -0
- package/dist/SchedulePicker-nmqzUnUH.cjs +1 -0
- package/dist/Setup-CHLgd-ag.js +849 -0
- package/dist/Setup-CaDranTm.cjs +1374 -0
- package/dist/SetupPayments-CVIwh1eQ.js +411 -0
- package/dist/SetupPayments-HNXWA25X.cjs +1 -0
- package/dist/SignInAdmin-C94-A-0w.cjs +4 -0
- package/dist/SignInAdmin-Yxgv_8U4.js +766 -0
- package/dist/SupportBar-CDT0HwdP.cjs +1 -0
- package/dist/SupportBar-CN_JGC-9.js +117 -0
- package/dist/SystemTabContent-L3vGGF3P.cjs +1 -0
- package/dist/SystemTabContent-QdxxLILE.js +35 -0
- package/dist/TemplateDrive-DV8zNjYe.cjs +1 -0
- package/dist/TemplateDrive-NJY_AAvV.js +1197 -0
- package/dist/ThemeAdmin-BzFjJkLg.js +269 -0
- package/dist/ThemeAdmin-DVnPNxe7.cjs +1 -0
- package/dist/ThemeAdmin-DY7Vc4Sj.cjs +3 -0
- package/dist/ThemeAdmin-DnC-D2N3.js +2 -0
- package/dist/{ContactPopup-9J_YeJrb.js → TimeZoneField-DkI1Bkcz.js} +3382 -5513
- package/dist/TimeZoneField-qs7NPR30.cjs +12 -0
- package/dist/TransactionsAdmin-BsZ-oQWi.js +582 -0
- package/dist/TransactionsAdmin-CTSTiPld.cjs +1 -0
- package/dist/Trouble-9es_AI4F.cjs +1 -0
- package/dist/Trouble-oWt9fMsm.js +164 -0
- package/dist/Users-CTitWXyd.cjs +1 -0
- package/dist/Users-DJjQTWJF.js +1207 -0
- package/dist/aiModels-DIP9fn8T.cjs +1 -0
- package/dist/{aiModels-BHlEfuRJ.js → aiModels-DnDhNGup.js} +29 -61
- package/dist/arrivalRoads-BJ-35vkk.js +228 -0
- package/dist/arrivalRoads-qoU-B4jt.cjs +4 -0
- package/dist/{bake-D0gLVNTL.cjs → bake-n2wyFw0B.cjs} +1 -1
- package/dist/{bake-OErV2MLy.js → bake-naZeMu98.js} +14 -14
- package/dist/bookingPages-C7a3srPG.js +102 -0
- package/dist/bookingPages-DvbFbD9X.cjs +1 -0
- package/dist/components/CustomSelect.d.ts +7 -1
- package/dist/components/RegistrationFields.d.ts +6 -1
- package/dist/components/Reveal.d.ts +12 -0
- package/dist/components/ScrollToTop.d.ts +4 -0
- package/dist/contentFallback-C9MZjdq7.cjs +1 -0
- package/dist/contentFallback-CEDY0Pwp.js +96 -0
- package/dist/contentKey-Bwry4lDa.js +13 -0
- package/dist/contentKey-DJGYYnAE.cjs +1 -0
- package/dist/{dist-_zWHDDrc.js → dist-DUPvBnOA.js} +1 -1
- package/dist/email-BfnZnMwD.cjs +1 -0
- package/dist/email-Ddj8Dlu6.js +58 -0
- package/dist/{fileBytes-B0qxHYQL.cjs → fileBytes-BJPaiX9Y.cjs} +1 -1
- package/dist/{fileBytes-uhq3pGCS.js → fileBytes-bjgvCfWu.js} +2 -2
- package/dist/forms-Bvx9HTM6.js +75 -0
- package/dist/forms-CmNeTETW.cjs +1 -0
- package/dist/lib/ThemeContext.d.ts +0 -14
- package/dist/lib/bareImgWatch.d.ts +6 -1
- package/dist/lib/localEdits.d.ts +2 -0
- package/dist/lib/pageDesignLines.d.ts +1 -1
- package/dist/lib/paymentProducts.d.ts +8 -0
- package/dist/lib/payments.d.ts +11 -1
- package/dist/lib/people.d.ts +9 -0
- package/dist/lib/recordsKey.d.ts +24 -0
- package/dist/{lucide-react-DiyP8FA_.js → lucide-react-CA7GD7Nv.js} +8 -8
- package/dist/notices-B7iIrIEg.js +29 -0
- package/dist/notices-upMg8UVh.cjs +1 -0
- package/dist/openOnArrival-Buwqb86D.cjs +1 -0
- package/dist/openOnArrival-S2K6v-lB.js +35 -0
- package/dist/pageFiles--Ih60ITP.js +45 -0
- package/dist/pageFiles-UtBmlOcD.cjs +1 -0
- package/dist/pages/PagesAdmin.d.ts +69 -7
- package/dist/{pdf-DLuvpvHg.js → pdf-DRXcPGkr.js} +1 -1
- package/dist/{pdf.worker.min-C0gkd2Ec.js → pdf.worker.min-CfKZezeM.js} +1 -1
- package/dist/people-2jZE_pdI.js +102 -0
- package/dist/people-BpVvIr9-.cjs +1 -0
- package/dist/personName-CFw3pxuu.js +18 -0
- package/dist/personName-CbzN_i57.cjs +1 -0
- package/dist/publishSteps-C1cDFzzB.js +88 -0
- package/dist/publishSteps-SSm8afDw.cjs +1 -0
- package/dist/recordLock-DHVvI9bP.js +61 -0
- package/dist/recordLock-DWeIxiwh.cjs +1 -0
- package/dist/recordsKey-B7QrxdeU.cjs +1 -0
- package/dist/recordsKey-D5-wC0Aw.js +141 -0
- package/dist/registrationFields-CLeR2lQJ.js +181 -0
- package/dist/registrationFields-v4pOoRdn.cjs +1 -0
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.es.js +1 -1
- package/dist/roles-D6VaHWfV.js +147 -0
- package/dist/roles-DQUFFBQe.cjs +1 -0
- package/dist/scheduleData-ATN8w5hI.js +727 -0
- package/dist/scheduleData-Cltj0ABZ.cjs +1 -0
- package/dist/server.cjs.js +6 -6
- package/dist/server.es.js +716 -715
- package/dist/serviceStatus-TQyZO_Y_.cjs +1 -0
- package/dist/serviceStatus-vS8AI7SZ.js +125 -0
- package/dist/tabAudience-BqpN6dsR.cjs +1 -0
- package/dist/tabAudience-CRyMvv0v.js +34 -0
- package/dist/transactions-BqMQDRx3.js +343 -0
- package/dist/transactions-CufFrdAM.cjs +1 -0
- package/dist/useIsPhone-BVGx_X3e.js +13 -0
- package/dist/useIsPhone-o63tNneA.cjs +1 -0
- package/dist/{validate-DzSJWuyL.js → validate-CmC_tLK-.js} +433 -351
- package/dist/validate-DZMwqSrb.cjs +103 -0
- package/dist/vite/validate.d.ts +14 -0
- package/dist/vite.cjs.js +1 -1
- package/dist/vite.es.js +1 -1
- package/dist/your-ai-workflow-firebase-os.cjs.js +15 -1431
- package/dist/your-ai-workflow-firebase-os.css +1 -1
- package/dist/your-ai-workflow-firebase-os.es.js +11695 -35911
- package/package.json +1 -1
- package/src/index.css +122 -2
- package/dist/ContactPopup-DF8qQCoY.cjs +0 -12
- package/dist/PhoneInputField-Btx07xvM.js +0 -2
- package/dist/aiModels-BIhoTNH0.cjs +0 -1
- package/dist/validate-e48WXJdP.cjs +0 -103
- /package/dist/{address-DI1YaCI4.cjs → address-Bsb8COq2.cjs} +0 -0
- /package/dist/{address-Ca1h_UZX.js → address-C2bHNxJU.js} +0 -0
- /package/dist/{dist-BLGlDv1e.cjs → dist-E4jTFPs7.cjs} +0 -0
- /package/dist/{lucide-react-BYniZ3lQ.cjs → lucide-react-BwV6L6Is.cjs} +0 -0
- /package/dist/{mediaKind-dk396a03.cjs → mediaKind-D0MWyv6b.cjs} +0 -0
- /package/dist/{mediaKind-De2Cx_kB.js → mediaKind-DmKMsjeY.js} +0 -0
- /package/dist/{pdf-CC5g01eC.cjs → pdf-jLjjhvjp.cjs} +0 -0
- /package/dist/{pdf.worker.min-pI_P-OCl.cjs → pdf.worker.min-bLgNWd7w.cjs} +0 -0
- /package/dist/{verifiedAccount-C1iCxopN.js → verifiedAccount-DRbRFJ6H.js} +0 -0
- /package/dist/{verifiedAccount-D3OeaOBo.cjs → verifiedAccount-DScyKk96.cjs} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./verifiedAccount-DScyKk96.cjs`),n=require(`./lucide-react-BwV6L6Is.cjs`),r=require(`./mediaKind-D0MWyv6b.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-dom`);var d=(0,i.createContext)({});function f({config:e,children:t}){return(0,a.jsx)(d.Provider,{value:e,children:t})}var p=()=>(0,i.useContext)(d),m=null,h=null,g=null,_=null,v=null,y=`https://firebasestorage.googleapis.com`;function b(){if(typeof document>`u`||!document.head||document.head.querySelector(`link[rel="preconnect"][href="${y}"]`))return;let e=document.createElement(`link`);e.rel=`preconnect`,e.href=y,document.head.appendChild(e)}var x={ignoreUndefinedProperties:!0};function S(e){b();let t=e.projectId||``;if((0,o.getApps)().length&&v===t){m=(0,o.getApp)(),h=(0,s.getAuth)(m);try{g=(0,c.initializeFirestore)(m,x)}catch{g=(0,c.getFirestore)(m)}_=(0,l.getStorage)(m);return}if((0,o.getApps)().length&&v!==t)try{(0,o.deleteApp)((0,o.getApp)())}catch{}m=(0,o.initializeApp)(e),v=t,h=(0,s.getAuth)(m);try{g=(0,c.initializeFirestore)(m,x)}catch{g=(0,c.getFirestore)(m)}_=(0,l.getStorage)(m)}function C(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 w=[`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`],T={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 ee(){let e={};for(let t of w){let n=C(t);if(!n)return null;e[T[t]]=n}return e}var E=ee();E&&!(0,o.getApps)().length&&S(E);var D=`firebase-os:chunk-reloaded`,te=400,ne=()=>{try{return sessionStorage.getItem(D)===`1`}catch{return!0}},O=e=>{let t=String(e?.message??e??``).toLowerCase();return t.includes(`dynamically imported module`)||t.includes(`error loading dynamically imported module`)||t.includes(`failed to fetch dynamically imported module`)||t.includes(`importing a module script failed`)||t.includes(`loading chunk`)||t.includes(`loading css chunk`)},k=e=>new Promise(t=>setTimeout(t,e));function re(e,t={}){let n=t.pause??te,r=t.reload??(()=>{typeof window<`u`&&window.location.reload()});return(0,i.lazy)(async()=>{try{return await e()}catch(t){if(!O(t))throw t;await k(n);try{return await e()}catch(e){if(!O(e))throw e;if(!ne()){try{sessionStorage.setItem(D,`1`)}catch{}r(),await new Promise(()=>{})}throw e}}})}var ie=`Part of the app did not load`,ae=`A piece of this page never arrived — usually a connection that dropped, or a new version of your app being published while this tab was open. Reloading picks up the new one.`,A=e=>{let t=e?.code??e?.error?.code??``;return typeof t==`string`?t.toLowerCase():``},j=e=>{let t=e?.message??e??``;return String(t).toLowerCase()},M=()=>typeof navigator<`u`&&navigator.onLine===!1,oe=`A picture here is drawn the slow way`,N=`A picture on this page is drawn by hand. Paste the message to your assistant.`,P=`firebaseOsHandDrawn`;function F(e){return Object.assign(Error(e),{[P]:!0})}var I=`firebaseOsSaid`;function se(e,t=`again`){return Object.assign(Error(e),{[I]:!0,firebaseOsNext:t})}var L=e=>e?.[I]===!0,ce=e=>{if(e?.code)return null;let t=typeof e?.message==`string`?e.message.trim():``;return t.length<20||t.length>220||!/^[A-Z]/.test(t)||!/[.!]$/.test(t)||t.split(/\s+/).length<4||/insufficient permissions|firebase|firestore|storage bucket|quota|websocket/i.test(t)||/\bundefined\b|\bnull\b|\bNaN\b|Error\b|\bfunction\b|=>|[{}<>[\]$_]|\.[a-z]{2,4}\b(?!\s)|https?:\/\/|[a-z]+\/[a-z-]+|\(reading|\bis not a\b/.test(t)?null:t},le=(e,t)=>e===`auth/network-request-failed`||e===`unavailable`||e===`storage/retry-limit-exceeded`||t.includes(`failed to fetch`)||t.includes(`load failed`)||t.includes(`networkerror`)||t.includes(`network request failed`)||t.includes(`err_internet_disconnected`)||t.includes(`could not be reached`)||t.includes(`the server could not be reached`),ue={kind:`offline`,title:`No connection`,message:`This device is not online just now, so that could not go through. Nothing you have typed has been lost — check your connection, then try again.`,short:`No connection just now — check it, then try again.`,next:`again`},de={kind:`signedOut`,title:`You have been signed out`,message:`Your sign-in ran out while this page was open. Sign in again and you will come straight back to what you were doing.`,short:`Your sign-in ran out. Sign in again to carry on.`,next:`signin`},fe={kind:`notAllowed`,title:`Not allowed`,message:`Your account is not allowed to do that here. If you were signed in a moment ago, signing in again usually puts it right — if not, ask whoever runs this app.`,short:`Your account is not allowed to do that here.`,next:`signin`},pe={kind:`unreachable`,title:`Cannot reach the app right now`,message:`The app did not answer. This is almost always a moment on the line rather than anything you did — try again in a moment.`,short:`The app did not answer. Try again in a moment.`,next:`again`},me={kind:`slow`,title:`That took too long`,message:`No answer came back in time. Nothing has been changed — try again.`,short:`That took too long. Nothing was changed — try again.`,next:`again`},he={kind:`busy`,title:`Too many tries just now`,message:`This app has been asked for a great deal in a short time. Give it a minute or two, then try again.`,short:`Too many tries just now. Wait a minute, then try again.`,next:`again`},ge={kind:`gone`,title:`That is not there any more`,message:`Whatever this was showing has been removed, or moved somewhere else. Reloading shows what is there now.`,short:`That is not there any more.`,next:`reload`},_e={kind:`noRoom`,title:`There is no room left`,message:`This app's storage is full, so the file could not be kept. Trying again will not help — whoever runs this app has to make room first.`,short:`This app's storage is full, so the file could not be kept.`,next:`none`},ve={kind:`notReady`,title:`That is not ready yet`,message:`Something this page needs has not finished being set up. Try again in a moment, and if it keeps happening tell whoever runs this app.`,short:`That is not ready yet. Try again in a moment.`,next:`again`},ye={kind:`stopped`,title:`That stopped part-way`,message:`It did not finish, so nothing was changed. Try again.`,short:`That stopped part-way, so nothing was changed.`,next:`again`},be={kind:`tooBig`,title:`That file is too big`,message:`The file is larger than this app can take. A smaller one — or the same picture saved at a lower size — will go through.`,short:`That file is too big for this app. Try a smaller one.`,next:`none`},xe={kind:`unknown`,title:`That did not work`,message:`Something went wrong and the app stopped short. Nothing you have typed has been lost — try again, and reload the page if it keeps happening.`,short:`That did not work. Nothing you typed has been lost — try again.`,next:`again`};function Se(e){let t=A(e),n=j(e);if(e?.[P]===!0)return{kind:`drawnByHand`,title:oe,message:String(e?.message||``),short:N,next:`none`};if(L(e)){let t=String(e?.message||``);return{kind:`said`,title:`That did not work`,message:t,short:t,next:e?.firebaseOsNext??`again`}}if(O(e))return{kind:`missingPart`,title:ie,message:ae,short:`Part of this page did not load. Reload the page.`,next:`reload`};let r=ce(e);return r?{kind:`said`,title:`That did not work`,message:r,short:r,next:`again`}:M()||le(t,n)?ue:t===`unauthenticated`||t===`auth/user-token-expired`||t===`auth/user-disabled`||t===`auth/requires-recent-login`||t===`auth/user-signed-out`||t===`auth/invalid-user-token`||t===`auth/null-user`?de:t===`permission-denied`||t===`storage/unauthorized`||t===`storage/unauthenticated`||n.includes(`missing or insufficient permissions`)?fe:t===`deadline-exceeded`||n.includes(`timeout`)||n.includes(`timed out`)?me:t===`resource-exhausted`||t===`auth/too-many-requests`||t===`storage/quota-exceeded`||n.includes(`too many requests`)?t===`storage/quota-exceeded`?_e:he:t===`not-found`||t===`storage/object-not-found`?ge:t===`failed-precondition`||n.includes(`requires an index`)?ve:t===`cancelled`||t===`aborted`||t===`storage/canceled`||n.includes(`aborted`)?ye:n.includes(`exceeds the maximum`)||n.includes(`file is too large`)||n.includes(`payload too large`)?be:t===`internal`||t===`unknown`||t===`storage/unknown`||t===`data-loss`?pe:xe}function Ce(e,t){let n=Se(e);return t&&n.kind===`unknown`?t:n.short}var we={again:`Try again`,reload:`Reload the page`,signin:`Sign in again`,none:`Reload the page`},Te=1e4,Ee=new Map;function De(e,t,n,r){let i=Ee.get(e);if(i&&i.refused!==void 0&&Date.now()-i.refusedAt>Te&&(Ee.delete(e),i=void 0),!i){let n={subscribers:new Set,stop:()=>{},last:null,refused:void 0,refusedAt:0};Ee.set(e,n),n.stop=(0,c.onSnapshot)(t(),e=>{n.last=e,n.refused=void 0,n.subscribers.forEach(t=>Oe(()=>t.next(e)))},e=>{n.refused=e,n.refusedAt=Date.now(),n.subscribers.forEach(t=>Oe(()=>t.fail(e)))}),i=n}let a={next:n,fail:r};return i.subscribers.add(a),i.last?Oe(()=>n(i.last)):i.refused!==void 0&&Oe(()=>r(i.refused)),()=>{let t=Ee.get(e);!t||!t.subscribers.delete(a)||t.subscribers.size===0&&(t.stop(),Ee.delete(e))}}function Oe(e){try{e()}catch(e){console.error(`A screen could not take a shared Firestore answer`,e)}}var ke=[`user`,`internal`,`admin`],Ae=e=>ke.includes(e),je={user:`Members`,internal:`Your team`,admin:`Admins`},Me={user:`user-round`,internal:`users`,admin:`shield`},Ne=`id-card`,Pe=[],Fe={},Ie={},Le=e=>{Pe=e},Re=()=>Pe,ze=e=>{Fe=e},Be=e=>{Ie=e},Ve=e=>Ae(e)&&String(Ie[e]||``).trim()||``,He=e=>Ae(e)&&String(Fe[e]||``).trim()||``,Ue=(e,t=Re())=>t.find(t=>t.id===e)?.name||He(e)||(Ae(e)?je[e]:``)||e,We=(e=Re())=>[...ke.map(t=>({id:t,name:Ue(t,e)})),...e.map(e=>({id:e.id,name:e.name}))],Ge=`sys_payments`,Ke=`_settings`,qe=()=>({on:!1,amount:``,priceId:``,livePriceId:``}),Je=()=>({name:``,description:``,monthly:{...qe(),on:!0},yearly:qe(),roleId:``}),Ye=()=>({name:``,amount:``}),Xe=e=>({id:e,name:``,description:``,kind:``,amount:``,items:[],plans:[],how:``,emailReceipt:!0,notifyOwner:!0,pageIds:[],customNote:``,customPath:``,createdAt:Date.now()}),Ze=e=>e.kind===`once`?e.items.length?e.items:e.name.trim()||e.amount.trim()?[{name:e.name,amount:e.amount}]:[]:[],Qe=e=>{let t=Number(String(e||``).trim().replace(/[^0-9.]/g,``));return Number.isFinite(t)&&t>0?t:null},$e=e=>({on:!!e?.on,amount:String(e?.amount||``),priceId:String(e?.priceId||``),livePriceId:String(e?.livePriceId||``)}),et=e=>/^(no|none|nothing|n\/?a|nothing needed|nothing else|-)[.!]*$/i.test(e.trim()),tt=e=>/[.!?]$/.test(e)?e:`${e}.`,nt=e=>{let t=[],n=String(e?.how||``),r=String(e?.collect||``).trim();r&&!et(r)&&t.push(`Before paying, the buyer tells me: ${tt(r)}`);let i=String(e?.after||``).trim();if(i&&t.push(`After they pay: ${tt(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: ${tt(r)}`),i&&t.push(`Someone on ${e} sees: ${tt(i)}`)}return t.length?[...n.trim()?[tt(n.trim())]:[],...t].join(` `):n},rt=(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:$e(e?.monthly),yearly:$e(e?.yearly),roleId:t.v(e?.roleId)?String(e.roleId):``})):[],how:nt(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}},it=e=>/^price_[A-Za-z0-9]+$/.test(e.trim()),at=(e,t=Ht())=>t?e.livePriceId:e.priceId;function ot(e,t=Ht()){if(!e.kind)return`Say how it is paid — once, or a subscription.`;if(e.kind===`once`){let t=Ze(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(Qe(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(Qe(i.amount)===null)return`Give ${e} its ${r} price — just a number.`;if(!it(at(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 st=(e,t=Ht())=>ot(e,t)===``,ct=e=>e.kind===`subscription`&&e.plans.length>0&&e.plans.every(e=>e.name.trim()!==``&&(e.monthly.on||e.yearly.on)&&(!e.monthly.on||Qe(e.monthly.amount)!==null)&&(!e.yearly.on||Qe(e.yearly.amount)!==null));function lt(e){let t=e.name.trim();if(t)return t;let n=Ze(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 ut(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=Ze(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 dt(e,t,n=Ht()){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 ft=e=>e.includes(`'`)?`"${e}"`:`'${e}'`,pt=`Every payment goes through the app's own pieces — a <BuyButton> for one thing bought, a <Basket> for a basket of them — never 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.`,mt=(e,t=Ht())=>{let n=e.name.trim()||`this product`,r=e.description.trim();if(e.kind===`once`){let t=Ze(e),r=e=>`<BuyButton amount={${Qe(e.amount)??0}} productName=${ft(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, and its whole pricing section is ONE piece of my app: <Plans product='${e.id}' /> from 'your-ai-workflow-firebase-os'. It reads the plans, what each includes, the prices and the Stripe ids from my Payments screen as they stand — so type no plan, price or id into the page — offers a monthly/yearly switch where a plan has both, and each plan's button asks who is paying and goes on to Stripe. Add featured='a plan's name' to draw one forward, and phone / address when my words ask for them. The heading over it and the words round it are yours. Only if my words ask for a layout it cannot give, read the same plans with usePlans('${e.id}') and buy each with a <BuyButton>. What it sells, so the words round it are right:`];for(let t of e.plans){let e=t.name.trim()||`Plan`,n=t.description.trim(),r=[];t.monthly.on&&r.push(`${t.monthly.amount.trim()} per month`),t.yearly.on&&r.push(`${t.yearly.amount.trim()} per year`);let a=t.roleId?` Buying it makes the buyer my ${Ue(t.roleId)} role — userRole '${t.roleId}'.`:``;i.push(`${e}${n?` (${n})`:``} — ${r.join(` or `)}.${a}`)}return i},ht=`Who is paying is asked by the button ITSELF: the press of a <BuyButton> from 'your-ai-workflow-firebase-os' opens one small window that says what is being bought, asks who is paying and goes straight on to Stripe. So NEVER a <BuyerDetails> and a <PayButton> put together by you, never a form, never a *Form.config.ts, never a name, email, phone or <AddressField> box of your own, and no delivery step of your own: that asks the buyer twice. It asks a buyer who is not signed in for their name and email, and for a phone number or the address when you pass phone / address on the button (true to require it, 'optional' to offer it — pass them when my words ask for them, and address whenever something is delivered), and makes them an account there and then, signed in on this device; a signed-in buyer is asked only for what is missing, and one the app already knows sees one line saying who is paying and the button. Who they are rides onto the payment by itself and reads beside it on my Transactions screen. Anything else my words ask before paying — a note, a chosen session, a size — is a box or a choice of your own on the page (it is not a form: nothing is sent anywhere) whose answer goes into the button's metadata as a plain string, and disabled on the button holds it back until it is chosen. Never ask for their email twice, and never build a backend of your own for it: the app tells them and me in the bell when the payment happens.`,gt=`Put what was bought into the button's metadata as well, whenever the page knows more than productName says — a basket, a chosen plan, options, a quantity, hours: items as one line per thing (quantity, name, the options chosen and its price — '2 × Blazer, Noir Black, size M — 240; 1 × Belt — 60', joined with '; '), total as the number charged, and delivery, discount or whatever else made up the amount under a key each. Every value a plain string under 500 characters, never an object or an array. My Transactions screen shows those under What they bought, so a payment there says what the money was for and not only how much.`,_t=/\b(?:unlock(?:s|ed)?|access|credits?|extra|top[- ]?up|added to (?:their|the) (?:count|balance|account)|download(?:s|able)?|members?hip|premium|lifetime|licen[cs]e|seats?)\b/i,vt=e=>`What this buyer has already bought is the app's to tell: const mine = useMyPayments() from 'your-ai-workflow-firebase-os' — { loading, active, payments }, each payment with its productName, its amount and when it was paid — so whatever a paid ${e} unlocks, adds or counts is worked out from the payments whose productName is ${e} (how many, and when), shown as words and numbers, and it refreshes by itself the moment <CheckoutReturn> says paid. That is presentation, not protection: anything genuinely paid for — a file, a secret — must come from the server, and nothing is written onto a record by hand to remember a purchase.`,yt=`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.`,bt=`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().`,xt=`This plan gives its buyer a role, and a role belongs to an ACCOUNT — so anybody buying it here needs one. Check with useAuth() from 'your-ai-workflow-firebase-os': for somebody who is not signed in, put a link to /login where the buy button would be, saying they sign in first and come straight back. If you leave the button there for them as well, say beside it that they must use the same email address when they register, or what they have paid for opens nothing. This is only about a plan that gives a role — a one-off payment and a plan without one are bought by anybody, signed in or not.`;function St(e,t=``,n=Ht()){let r=[...mt(e,n)],i=e.how.trim();return i&&r.push(`Here is how this payment should work, start to finish: ${i}`),r.push(ht,gt),e.kind===`once`&&_t.test(i)&&r.push(vt(Ze(e).map(e=>`'${e.name.trim()}'`).join(` or `))),e.kind===`subscription`&&(e.plans.some(e=>e.roleId)&&r.push(bt),e.plans.some(e=>!e.roleId)&&r.push(yt)),r.push(...wt(t,e)),r}var Ct=`What happens when they come back from paying is my app's own as well: write <CheckoutReturn /> from the same package ONCE near the top of the page, outside any window or step. It asks the server whether the money really moved and only then thanks them; give it orderPath='/billing' — the app's own page where what they bought is — unless my words name another page of mine they go to afterwards, and then that page's address. Never read session_id off the web address, never call confirmPayment, and never build a thank-you, an order confirmation, a receipt or a notification of your own: the bell tells them their order is placed and tells me a payment came in. Never send them to /login or /register after paying, and never make anybody sign in BEFORE they pay: somebody whose email already has an account pays as a guest and is emailed their way in afterwards.`;function wt(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 — that is the page <CheckoutReturn> is on, and the only place the payment is checked.`,Ct],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 Tt=e=>e===`internal`||e===`admin`,Et=e=>Array.isArray(e?.links)?e.links.map(e=>({pageId:String(e?.pageId||``),how:String(e?.how||``)})):[],Dt=(e,t)=>t.find(t=>t.id===e)||t.find(t=>String(t.config?.contentKey||``).trim()===e),Ot=(e,t)=>e===t.id||e===String(t.config?.contentKey||``).trim();function kt(e){return e.how.trim()?``:`Describe how this payment will work.`}var At=(e,t)=>e.pageIds.some(e=>Ot(e,t)),jt=(e,t)=>At(e,t)?e.pageIds.filter(e=>!Ot(e,t)):[...e.pageIds,t.id],Mt=`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.`,Nt="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.",Pt=e=>`/payments?new=subscription&page=${encodeURIComponent(e)}`,Ft=(e,t)=>`/payments?open=${encodeURIComponent(e)}&page=${encodeURIComponent(t)}`,It=(e,t)=>`/pages/${encodeURIComponent(e)}?addPayment=${encodeURIComponent(t)}`,Lt=[],Rt=!1,zt=e=>{Lt=e},Bt=()=>Lt,Vt=e=>{Rt=e},Ht=()=>Rt;function Ut(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();it(o)&&it(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 Wt(e=Bt()){let t=Ut(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 <BuyButton> or <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, and neither does a pricing section drawn with <Plans> — it reads the live ids itself.`):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 Gt=`admin_keys`,Kt=`plans`,qt=()=>({planUntil:(0,c.deleteField)(),planPass:(0,c.deleteField)()}),Jt=e=>typeof e?.planUntil==`number`&&e.planUntil>0?e.planUntil:0,Yt=e=>Jt(e)>0,Xt=e=>Jt(e);function Zt(e){if(!e)return!1;if(Yt(e))return!0;let t=e.role;return t==null||t===`user`||t===`free`}function Qt(e,t=Date.now()){let n=e?.role?String(e.role):`user`,r=Jt(e);return r&&t>=r?`user`:n}function $t(e,n){if(!Zt(e))return null;let r=String(n?.role||``);return r?!t.v(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}:Yt(e)?{role:`user`,...qt()}:null}async function en(e,n){try{let r=h?.currentUser;if(!r||r.uid!==e||!t.t(r)||typeof fetch!=`function`)return;let i=(0,c.doc)(g,`user_profiles`,e),a=n??(await(0,c.getDoc)(i)).data();if(!Zt(a))return;let o=await r.getIdToken(),s=await fetch(`/api/payments/plan-role`,{headers:{Authorization:`Bearer ${o}`}});if(!s.ok)return;let l=$t(a,await s.json());l&&await(0,c.updateDoc)(i,l)}catch{}}function tn(e){(0,i.useEffect)(()=>{let e=!1;return(async()=>{let t=h?.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)(g,Gt,Kt),a=await(0,c.getDoc)(i);!e&&a.data()?.key!==r&&await(0,c.setDoc)(i,{key:r})})().catch(()=>{}),()=>{e=!0}},[e])}function nn(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 rn(){let[e,t]=(0,i.useState)({});return(0,i.useEffect)(()=>De(Ge,()=>(0,c.collection)(g,Ge),e=>{let n=[];e.forEach(e=>{e.id!==`_settings`&&n.push(rt(e.id,e.data()))}),t(nn(n))},()=>{}),[]),e}var an=null,on=null,sn=`fbos:payment-news`;function cn(){an=null,on=null,typeof window<`u`&&window.dispatchEvent(new Event(sn))}async function ln(){try{return await h?.currentUser?.getIdToken()||null}catch{return null}}function un(e,t){if(e==null||!Number.isFinite(e))return``;let n=String(t||``).toUpperCase();if(!n)return String(e);try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:n}).format(e)}catch{return`${e} ${n}`}}function dn(e,t=!0){let n=[];return t&&n.push(String(e.name||e.email||``).trim()),n.push(un(e.amount,e.currency)),n.push(String(e.productName||``).trim()),n.filter(Boolean).join(` · `)}function fn(e){let t=String(e?.id||``);if(!t||e?.paid===!1||e?.refunded===!0)return null;let n=Number(e?.created),r=e?.amount!=null&&Number.isFinite(Number(e.amount))?Number(e.amount):null;return{id:t,at:Number.isFinite(n)?n>0xe8d4a51000?n:n*1e3:0,amount:r,currency:e?.currency?String(e.currency):null,name:e?.name?String(e.name):null,email:e?.email?String(e.email):null,productName:e?.productName||e?.description?String(e.productName||e.description):null,page:e?.page?String(e.page):null}}async function pn(e,t,n){try{let r=await fetch(e,{headers:t?{Authorization:`Bearer ${t}`}:{}});if(!r.ok)return[];let i=await r.json();return(Array.isArray(i?.[n])?i[n]:[]).map(fn).filter(e=>!!e)}catch{return[]}}var mn=(e,t)=>!!e&&e.key===t&&Date.now()-e.at<6e4;function hn(e){if(mn(an,e))return an.promise;let t=ln().then(e=>e?pn(`/api/payments/recent`,e,`payments`):[]);return an={key:e,at:Date.now(),promise:t},t}function gn(e){if(mn(on,e))return on.promise;let t=ln().then(e=>e?pn(`/api/payments/me`,e,`payments`).then(e=>e.filter(e=>e.at>0)):[]);return on={key:e,at:Date.now(),promise:t},t}function _n(e,t,n){let[r,a]=(0,i.useState)([]);return(0,i.useEffect)(()=>{if(!t||!n)return;let r=!1,i=0,o=()=>{let n=++i;(e===`sales`?hn(t):gn(t)).then(e=>{!r&&n===i&&a(e)})};o();let s=()=>{(typeof document>`u`||document.visibilityState===`visible`)&&o()};return typeof document<`u`&&document.addEventListener(`visibilitychange`,s),typeof window<`u`&&(window.addEventListener(`focus`,s),window.addEventListener(sn,o)),()=>{r=!0,typeof document<`u`&&document.removeEventListener(`visibilitychange`,s),typeof window<`u`&&(window.removeEventListener(`focus`,s),window.removeEventListener(sn,o))}},[e,t,n]),t&&n?r:vn}var vn=[],yn=`Could not reach the server. Check your connection and try again.`,bn={goTo(e){window.location.href=e}},xn=`/api/payments/webhook`,Sn=e=>e?`${e.replace(/\/$/,``)}${xn}`:``;async function Cn(){try{let e=h?.currentUser;if(!e)return null;let t=e.emailVerified===!0&&(await e.getIdTokenResult?.())?.claims?.email_verified!==!0;return await e.getIdToken(t||void 0)}catch{return null}}function wn(e){return e?{Authorization:`Bearer ${e}`}:{}}async function Tn(e,t){try{let t=await e.json();if(t&&typeof t.error==`string`&&t.error)return t.error}catch{}return t}async function En(e){let t=await Dn(e);return typeof t==`string`?t:(bn.goTo(t.url),null)}async function Dn(e){try{let t=await Cn(),n=await fetch(`/api/payments/checkout`,{method:`POST`,headers:{"Content-Type":`application/json`,...wn(t)},body:JSON.stringify({...e,origin:window.location.origin})});if(!n.ok)return await Tn(n,`The payment could not be started. Please try again.`);let r=await n.json();return r?.url?{sessionId:String(r.sessionId||``),url:String(r.url)}:`The payment could not be started. Please try again.`}catch{return yn}}async function On(){let e=await Cn();if(!e)return`Sign in to manage your plan.`;try{let t=await fetch(`/api/payments/portal`,{method:`POST`,headers:{"Content-Type":`application/json`,...wn(e)},body:JSON.stringify({origin:window.location.origin})});if(!t.ok)return await Tn(t,`The billing portal could not be opened.`);let n=await t.json();return n?.url?(bn.goTo(String(n.url)),null):`The billing portal could not be opened.`}catch{return yn}}async function kn(e,t={}){let n={paid:!1,paymentStatus:null,amountTotal:null,currency:null,customerEmail:null,metadata:{},error:null};if(!e)return{...n,error:`No payment session to confirm.`};try{let r=await fetch(`/api/payments/session/${encodeURIComponent(e)}`);if(!r.ok)return{...n,error:await Tn(r,`That payment could not be found.`)};let i=await r.json();return i?.paid===!0&&!t.quiet&&($n(),cn()),{paid:i?.paid===!0,paymentStatus:i?.paymentStatus??null,amountTotal:i?.amountTotal??null,currency:i?.currency??null,customerEmail:i?.customerEmail??null,metadata:i?.metadata||{},error:null}}catch{return{...n,error:yn}}}var An={configured:!1,mode:null},jn=5e3,Mn=null,Nn=null,Pn=new Set,Fn=0,In=null,Ln=(e,t)=>!!e&&e.configured===t.configured&&e.mode===t.mode;function Rn(e){if(Ln(Nn,e)){Nn=e;return}Nn=e;for(let t of[...Pn])t(e)}var zn=e=>({configured:e?.configured===!0&&e?.enabled!==!1,mode:e?.mode===`live`||e?.mode===`test`?e.mode:null});function Bn(){return Mn||=Promise.resolve().then(()=>fetch(`/api/payments/status`)).then(e=>e.json()).then(e=>{let t=zn(e);return Rn(t),t}).catch(()=>(Mn=null,Rn(An),An)),Mn}function Vn(){Mn=null,Pn.size&&Bn()}function Hn(){Mn=null,Nn=null,Pn.size&&Bn()}function Un(e){let t=zn(e);Ln(Nn,t)||(Mn=Promise.resolve(t),Rn(t))}var Wn=()=>{typeof document<`u`&&document.visibilityState!==`visible`||Nn?.configured||Vn()};function Gn(){In||=setInterval(()=>{if(!Fn||Nn?.configured){Kn();return}typeof document<`u`&&document.visibilityState===`hidden`||Vn()},jn)}function Kn(){In&&clearInterval(In),In=null}function qn(e=!1){let[t,n]=(0,i.useState)(()=>Nn?{loading:!1,...Nn}:{loading:!0,...An});return(0,i.useEffect)(()=>{let e=!1,t=t=>{e||n({loading:!1,...t})};return Pn.add(t),Pn.size===1&&typeof document<`u`&&document.addEventListener(`visibilitychange`,Wn),Bn().then(t),()=>{e=!0,Pn.delete(t),!Pn.size&&typeof document<`u`&&document.removeEventListener(`visibilitychange`,Wn)}},[]),(0,i.useEffect)(()=>{if(e)return Fn+=1,Gn(),()=>{--Fn,Fn||Kn()}},[e]),t}var Jn=e=>String(e??``).trim(),Yn=e=>{let t={name:Jn(e?.name),phone:Jn(e?.phone),address:Jn(e?.address)};return t.name||t.phone||t.address?t:null};async function Xn(){let e={active:!1,subscriptions:[],payments:[],buyer:null},t=await Cn();if(!t)return{...e,error:null};try{let n=await fetch(`/api/payments/me`,{headers:wn(t)});if(!n.ok)return{...e,error:await Tn(n,`Your payments could not be loaded.`)};let r=await n.json();return{active:r?.active===!0,subscriptions:r?.subscriptions||[],payments:r?.payments||[],buyer:Yn(r?.buyer),error:null}}catch{return{...e,error:yn}}}var Zn=null,Qn=e=>e.subscriptions.length>0||e.payments.length>0;function $n(){Zn=null}function er(e){return(!Zn||Zn.uid!==e)&&(Zn={uid:e,promise:Xn().then(e=>(e.error&&(Zn=null),{bought:Qn(e),buyer:e.buyer,failed:!!e.error}))}),Zn.promise}var tr=e=>er(e).then(e=>e.bought);async function nr(e){if(!e||!(await Bn()).configured)return null;let t=await er(e);if(t.failed)throw Error(`The payments could not be read.`);return t.buyer}function rr(e){let[t,n]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(!e)return;let t=!1;return tr(e).then(r=>{t||n({uid:e,bought:r})}),()=>{t=!0}},[e]),e?t?.uid===e?{loading:!1,bought:t.bought}:{loading:!0,bought:!1}:{loading:!1,bought:!1}}function ir(){let[e,t]=(0,i.useState)({loading:!0,active:!1,subscriptions:[],payments:[],error:null});return(0,i.useEffect)(()=>{let e=!1,n=h?.currentUser?.uid||``;return Xn().then(r=>{n&&!r.error&&(Zn={uid:n,promise:Promise.resolve({bought:Qn(r),buyer:r.buyer,failed:!1})}),e||t({loading:!1,...r})}),()=>{e=!0}},[]),e}function ar(){let[e,t]=(0,i.useState)({loading:!0,charges:[],subscriptions:[],error:null});return(0,i.useEffect)(()=>{let e=!1,n=n=>{e||t({loading:!1,...n})};return(async()=>{let e=await Cn();if(!e)return n({charges:[],subscriptions:[],error:`Please sign in first.`});try{let t=await fetch(`/api/payments/sales`,{headers:wn(e)});if(!t.ok)return n({charges:[],subscriptions:[],error:await Tn(t,`The sales could not be loaded.`)});let r=await t.json();return n({charges:r?.charges||[],subscriptions:r?.subscriptions||[],error:null})}catch{return n({charges:[],subscriptions:[],error:yn})}})(),()=>{e=!0}},[]),e}var or=4e3,sr=e=>String(e??``).trim();function cr(e,t){return!t?.email||t.emailVerified!==!0||e?.removed===!0?!1:!sr(e?.displayName)&&!sr(t.displayName)}function lr(e,t){if(!t||e?.removed===!0)return null;let n={};return t.name&&!sr(e?.displayName)&&(n.displayName=t.name),t.phone&&!sr(e?.phone)&&(n.phone=t.phone),t.address&&!sr(e?.address)&&(n.address=t.address),Object.keys(n).length?n:null}var ur=`firebase-os:buyer-basics-asked`,dr=e=>{try{return sessionStorage.getItem(`${ur}:${e}`)===`1`}catch{return!1}},fr=e=>{try{sessionStorage.setItem(`${ur}:${e}`,`1`)}catch{}};async function pr(e,t){if(dr(e))return!1;let n=(async()=>{let n=h?.currentUser;if(!n||n.uid!==e||typeof fetch!=`function`)return!1;let r=lr(t,await nr(e));return fr(e),r?(await(0,c.setDoc)((0,c.doc)(g,`user_profiles`,e),r,{merge:!0}),r.displayName&&h.currentUser?.uid===e&&(0,s.updateProfile)(h.currentUser,{displayName:r.displayName}).catch(()=>{}),!!r.displayName):!1})().catch(()=>!1),r=new Promise(e=>setTimeout(()=>e(!1),or));return Promise.race([n,r])}var mr=e=>`fbos_verify_sent_${e}`,hr=e=>{if(!e)return!1;try{return localStorage.getItem(mr(e))===`1`}catch{return!1}},gr=e=>{if(e)try{localStorage.setItem(mr(e),`1`)}catch{}},_r=e=>{if(e)try{localStorage.removeItem(mr(e))}catch{}};async function vr(e){if(!e?.uid||!e.email)return`failed`;if(hr(e.uid))return`already`;try{return await(0,s.sendEmailVerification)(e),gr(e.uid),`sent`}catch{return`failed`}}var yr={collection:`sys_configs`,doc:`auth_methods`},br=[`Open console.firebase.google.com and pick your project.`,`In the menu on the left open Authentication, then the Sign-in method tab.`],xr=`https://console.firebase.google.com/`;function Sr(){try{let e=h;return String(e?.app?.options?.authDomain||e?.config?.authDomain||``)}catch{return``}}var Cr=e=>e?`https://${e}/__/auth/handler`:``,wr=()=>{try{let e=typeof window<`u`?String(window.location?.origin||``):``;return/^https?:\/\//.test(e)?e:``}catch{return``}},Tr=`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.`,Er=`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.`,Dr=[{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:!0,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.`,Er,`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:Tr}},{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:Tr}},{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.`,Er]}],Or=e=>Dr.find(t=>t.id===e),kr=Dr.filter(e=>e.kind===`signIn`),Ar=e=>e===`internal`||t.v(e);function jr(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=String(n??``).trim();Ar(e)&&!t.includes(e)&&t.push(e)}return t}var Mr=()=>{let e={};for(let t of Dr)e[t.id]=t.defaultOn;return{on:e,registerAs:{on:!1,roles:[]},twoStepOptional:!1,finishRegistration:{skippable:!0,perRole:!1}}};function Nr(e){let t=Mr(),n=e?.methods&&typeof e.methods==`object`?e.methods:{};for(let e of Dr)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:jr(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 Pr(e,t){if(!e.registerAs.on)return[];let n=e.registerAs.roles.includes(`internal`)?[{id:`internal`,name:Ue(`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 Fr=(e,t,n)=>Pr(e,n).find(e=>e.id===String(t??``))??null;function Ir(e,t){let n=String(t||e).trim()||e;return e===`internal`?n===je.internal?`one of our team`:`one of ${n}`:`${/^[aeiou]/i.test(n)?`an`:`a`} ${n}`}function Lr(e){let t=e.map(e=>Ir(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 Rr(e){let t=kr.filter(t=>e.on[t.id]);return t.length>0?t:kr.filter(e=>e.id===`password`)}var zr=e=>Rr(e).some(e=>e.id===`password`);function Br(e){let t=Rr(e).map(e=>e.inSentence);return t.length===1?t[0]:`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`}function Vr(e,t){let n=Or(t);return!n||n.kind!==`signIn`||kr.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 Hr=e=>`${Or(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.`,Ur=null,Wr=null,Gr=null,Kr=null;function qr(e){Gr=e,Ur?.forEach(t=>t(e))}var Jr=6e3,Yr=null;function Xr(e){Yr&&=(clearTimeout(Yr),null),Kr=e,qr(e)}function Zr(e){let t=!Ur;return Ur||=new Set,Ur.add(e),t?(Kr||(Yr=setTimeout(()=>{Yr=null,Kr||Xr(Mr())},Jr)),Wr=(0,c.onSnapshot)((0,c.doc)(g,yr.collection,yr.doc),e=>Xr(Nr(e.exists()?e.data():null)),()=>{Kr||Xr(Mr())})):Gr&&e(Gr),()=>{Ur?.delete(e),!Ur?.size&&(Yr&&=(clearTimeout(Yr),null),Wr?.(),Ur=null,Wr=null)}}function Qr(){let[e,t]=(0,i.useState)(()=>Gr?{loading:!1,settings:Gr}:{loading:!0,settings:Mr()});(0,i.useEffect)(()=>Zr(e=>t({loading:!1,settings:e})),[]);let n=()=>Gr??e.settings,r=e=>(0,c.setDoc)((0,c.doc)(g,yr.collection,yr.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=Vr(n(),e);if(t)return t}let i=n().on[e];qr({...n(),on:{...n().on,[e]:t}});try{return await r({methods:{[e]:t}}),null}catch{let t=n(),r=Kr?Kr.on[e]:i;return qr({...t,on:{...t.on,[e]:r}}),a}},s=async e=>{let t=n().registerAs,i={on:e.on??t.on,roles:jr(e.roles??t.roles)};qr({...n(),registerAs:i});try{return await r({registerAs:i}),null}catch{return qr({...n(),registerAs:Kr?Kr.registerAs:t}),a}},l=async e=>{let t=n().twoStepOptional;qr({...n(),twoStepOptional:e});try{return await r({twoStepOptional:e}),null}catch{return qr({...n(),twoStepOptional:Kr?Kr.twoStepOptional:t}),a}},u=async e=>{let t=n().finishRegistration,i={skippable:e.skippable??t.skippable,perRole:e.perRole??t.perRole};qr({...n(),finishRegistration:i});try{return await r({finishRegistration:{required:!i.skippable,perRole:i.perRole}}),null}catch{return qr({...n(),finishRegistration:Kr?Kr.finishRegistration:t}),a}};return{...e.settings,loading:e.loading,set:o,setRegisterAs:s,setTwoStepOptional:l,setFinishRegistration:u}}var $r=`fbos_register_as`,ei=[`/register`,`/login`],ti=()=>{try{return typeof window<`u`?window.sessionStorage:null}catch{return null}};function ni(e,t=Date.now()){if(Ar(e))try{ti()?.setItem($r,JSON.stringify({id:e,at:t}))}catch{}}function ri(){try{ti()?.removeItem($r)}catch{}}function ii(e,t=Date.now()){let n=ti();if(!n)return``;let r=null;try{r=n.getItem($r),r!==null&&n.removeItem($r)}catch{return``}if(!r||!ei.includes(String(e||``).replace(/\/+$/,``)||`/`))return``;try{let{id:e,at:n}=JSON.parse(r);return typeof n!=`number`||t-n>36e5||t<n?``:Ar(e)?String(e):``}catch{return``}}function ai(e,t,n=Date.now()){if(!t||!Ar(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 oi=()=>({requestedRole:(0,c.deleteField)(),requestedRoleAt:(0,c.deleteField)()});function si(e){let t=e?.requestedRole;return Ar(t)?{role:String(t),at:typeof e?.requestedRoleAt==`string`?e.requestedRoleAt:``}:null}var ci=(e,t)=>`Register as ${Ir(e,t)}`,li=(e,t)=>`Asked to be ${Ir(e,t)}`,ui=`Your registration goes to an admin for approval. Until then everything works as usual.`,di=`Your registration is pending approval`,fi=`We'll let you know as soon as it's approved. Everything else works as usual.`,pi=()=>({title:`Your registration has been approved`,body:`Everything that was waiting on it is open to you now.`,link:`/dashboard`}),mi=()=>({title:`Your registration was not approved`,body:`You still have your account, and everything works as usual.`,link:`/dashboard`}),hi=()=>{if(!h)throw Error(`Firebase is not initialized. Check your configuration.`);return h};function gi(e){switch(Or(e)?.providerId){case`google.com`:return new s.GoogleAuthProvider;case`github.com`:return new s.GithubAuthProvider;case`twitter.com`:return new s.TwitterAuthProvider;default:return null}}var _i=e=>gi(e)!==null;async function vi(e){let t=gi(e);if(!t)throw Error(`${Or(e)?.label??e} is not a one-button sign-in.`);try{return await(0,s.signInWithPopup)(hi(),t),`done`}catch(n){if(n?.code===`auth/popup-blocked`||n?.code===`auth/popup-closed-by-user`||n?.code===`auth/cancelled-popup-request`){let{signInWithRedirect:n}=await import(`firebase/auth`);try{sessionStorage.setItem(Ai,e)}catch{}return await n(hi(),t),`redirecting`}throw n}}var yi=`firebase-os:sign-in-link-email`,bi=`email`;async function xi(e,t=`/login`){let n=new URL(t,window.location.origin);n.searchParams.set(bi,e),await(0,s.sendSignInLinkToEmail)(hi(),e,{url:n.toString(),handleCodeInApp:!0});try{localStorage.setItem(yi,e)}catch{}}function Si(e=window.location.href){try{return(0,s.isSignInWithEmailLink)(hi(),e)}catch{return!1}}function Ci(){try{return localStorage.getItem(`firebase-os:sign-in-link-email`)||``}catch{return``}}function wi(e=window.location.href){let t=Ci();if(t)return t;try{let t=String(new URL(e).searchParams.get(`email`)||``).trim();return/^[^\s@]+@[^\s@]+$/.test(t)?t:``}catch{return``}}async function Ti(e,t=window.location.href){let{user:n}=await(0,s.signInWithEmailLink)(hi(),e,t);try{await n.getIdToken(!0)}catch{}try{localStorage.removeItem(yi)}catch{}}async function Ei(e,t){return Di(t,t=>(0,s.signInWithPhoneNumber)(hi(),e,t))}async function Di(e,t){let n=new s.RecaptchaVerifier(hi(),e,{size:`invisible`});try{return await t(n)}finally{try{n.clear()}catch{}}}function Oi(e,t){let n=Or(t)?.providerId;try{switch(n){case`google.com`:return s.GoogleAuthProvider.credentialFromError(e);case`github.com`:return s.GithubAuthProvider.credentialFromError(e);case`twitter.com`:return s.TwitterAuthProvider.credentialFromError(e);default:return null}}catch{return null}}var ki=`firebase-os:refused-credential`,Ai=`firebase-os:redirecting-with`,ji=`firebase-os:redirect-failure`,Mi=null;function Ni(e,t){if(!e)return;let n=String(t||``).trim().toLowerCase();Mi={credential:e,email:n};try{let t=typeof e.toJSON==`function`?e.toJSON():null;t&&sessionStorage.setItem(ki,JSON.stringify({email:n,json:t}))}catch{}}var Pi=()=>{if(Mi)return!0;try{return!!sessionStorage.getItem(ki)}catch{return!1}};function Fi(){Mi=null;try{sessionStorage.removeItem(ki)}catch{}}async function Ii(){if(Mi){let e=Mi;return Fi(),e}let e=null;try{e=sessionStorage.getItem(ki)}catch{return null}if(Fi(),!e)return null;try{let{email:t,json:n}=JSON.parse(e),{OAuthCredential:r}=await import(`firebase/auth`),i=r.fromJSON(n);return i?{credential:i,email:String(t||``)}:null}catch{return null}}async function Li(){let e=await Ii(),t=h?.currentUser;if(!e||!t)return;let n=String(t.email||``).trim().toLowerCase();e.email&&n&&e.email!==n||await Bi(e.credential)}function Ri(e){let t=null;try{t=sessionStorage.getItem(Ai)||null,sessionStorage.removeItem(Ai)}catch{}let n=String(e?.code||``);if(!n)return;let r=String(e?.customData?.email||e?.email||``);t&&Ni(Oi(e,t),r);try{sessionStorage.setItem(ji,JSON.stringify({id:t||`google`,code:n,email:r}))}catch{}}function zi(){let e=null;try{e=sessionStorage.getItem(ji),e&&sessionStorage.removeItem(ji)}catch{return null}if(!e)return null;try{let{id:t,code:n,email:r}=JSON.parse(e);return{id:t,err:{code:String(n||``),customData:{email:String(r||``)}}}}catch{return null}}async function Bi(e){let t=h?.currentUser;if(!(!e||!t))try{await(0,s.linkWithCredential)(t,e)}catch(e){console.warn(`That way in could not be added to the account. The sign-in itself stands.`,e)}}var Vi=e=>Dr.find(t=>t.providerId===e)?.id;async function Hi(e){if(e)try{let t=await(0,s.fetchSignInMethodsForEmail)(hi(),e);for(let e of t){let t=Vi(e);if(t)return t}}catch{}}async function Ui(e,t,n,r={}){let i=e?.code||``,a=String(e?.message||``);if(i===`auth/operation-not-allowed`)return{text:Hr(t)};if(i===`auth/account-exists-with-different-credential`){let n=String(e?.customData?.email||e?.email||r.email||``),i=await Hi(n),a=i?Or(i)?.label:``,o=Oi(e,t)??void 0;o&&Ni(o,n);let s=o||Pi()?` Both will work after that.`:``;return{text:a?`That email is already yours here — you set it up with ${a}. Sign in with ${a} and you are straight back in.${s}`:`That email is already yours here, set up a different way. Sign in the way you did the first time and you are straight back in.${s}`,tryInstead:i,pending:o}}if(i===`auth/email-already-in-use`){let t=await Hi(String(r.email||e?.customData?.email||``)),n=t?Or(t)?.label:``;return{text:n&&t!==`password`?`That email already has an account here — it was set up with ${n}. Sign in with ${n} and you are straight back in.`:`That email already has an account here. Sign in with it instead — and if you have forgotten the password, the sign-in page can reset it.`,tryInstead:t}}return i===`auth/invalid-credential`||i===`auth/user-not-found`||i===`auth/wrong-password`||i===`auth/invalid-login-credentials`?{text:`That email and password do not match. Check both — or, if you first came in with one of the buttons, use that button.`}:i===`auth/user-disabled`?{text:`This account has been switched off. If you think that is a mistake, ask whoever runs the app.`}:i===`auth/invalid-email`?t===`emailLink`?{text:`That is not the address this link was sent to. Type the one you asked us to send it to.`}:{text:`That does not look like an email address. Check it and try again.`}:i===`auth/missing-email`?{text:`Type your email address first.`}:i===`auth/missing-password`?{text:`Type your password first.`}:i===`auth/weak-password`?{text:`That password is too easy to guess. Make it longer, and mix letters and numbers.`}:i===`auth/unauthorized-domain`||a.includes(`requested action is invalid`)?{text:`This app's address is not on your Firebase project's allowed list yet. An admin can add it: Firebase console → Authentication → Settings → Authorized domains.`}:i===`auth/unauthorized-continue-uri`||i===`auth/invalid-continue-uri`?{text:`The link would bring you back to ${(()=>{try{return typeof window>`u`?``:window.location.hostname}catch{return``}})()||`this app's address`}, which this app's Firebase project does not know — so Firebase would not send it. An admin can add it: Firebase console → Authentication → Settings → Authorized domains.`}:i===`auth/invalid-api-key`||i===`auth/app-not-authorized`||i===`auth/configuration-not-found`||i===`auth/api-key-not-valid.-please-pass-a-valid-api-key.`?{text:`This app is not connected to its Firebase project properly. If this app is yours, check the Firebase details on the setup screen.`}:i===`auth/network-request-failed`?{text:`We could not reach the sign-in service. Check your internet connection and try again.`}:i===`auth/invalid-phone-number`?{text:`That does not look like a phone number. Check the country and the digits after it.`}:i===`auth/missing-phone-number`?{text:`Type your phone number first.`}:i===`auth/invalid-verification-code`?{text:`That code is not right. Check the text message and type it again.`}:i===`auth/code-expired`?{text:`That code has expired. Press "Send it again" and a new one will come straight through.`}:i===`auth/captcha-check-failed`?{text:`The check that you are not a robot did not pass. Reload the page and try again.`}:i===`auth/quota-exceeded`?{text:`This app has sent as many text messages as it is allowed to for now. Try again later, or sign in another way.`}:i===`auth/too-many-requests`?{text:`Too many tries from here just now. Wait a few minutes and it will let you through again.`}:i===`auth/invalid-action-code`||i===`auth/expired-action-code`?t===`emailLink`?{text:`That link has been used already, has expired, or was sent to a different address from the one you typed. Ask for a new one and it will come straight through.`}:{text:`That link has been used already, or it has expired. Ask for a new one and it will come straight through.`}:i===`auth/credential-already-in-use`||i===`auth/provider-already-linked`?{text:`That way of signing in already belongs to an account here. Sign in with it directly.`}:i===`auth/user-token-expired`||i===`auth/user-mismatch`||i===`auth/null-user`?{text:`Your sign-in has run out. Sign in again and carry on from there.`}:i===`auth/popup-blocked`||i===`auth/popup-closed-by-user`||i===`auth/cancelled-popup-request`?{text:`The sign-in window was closed before it finished. Press the button again and let it open.`}:i===`auth/requires-recent-login`?{text:`For safety this needs a fresh sign-in. Sign out, sign back in, and set it up straight away.`}:i===`auth/unverified-email`?{text:`Verify your email address first, then come back and set this up — the link is in your inbox.`}:i===`auth/unsupported-first-factor`?{text:`A text code can only be added to an account with a password. The way you signed in has its own checks already.`}:i===`auth/second-factor-already-in-use`?{text:`That number is already the second step on another account here. Use a different one.`}:i===`auth/maximum-second-factor-count-exceeded`?{text:`This account already has as many second steps as Firebase allows. Remove one before adding another.`}:i===`auth/missing-multi-factor-session`||i===`auth/invalid-multi-factor-session`?{text:`That took too long. Start again and the code will come straight through.`}:i===`auth/missing-verification-code`?{text:`Type the code from the text message first.`}:((i||a)&&console.warn(`[signIn] a failure with no words of its own:`,i||a),{text:n})}var Wi=[3e3,6e3,12e3,2e4,3e4,6e4],Gi=900*1e3,Ki=`fbos_rules_copied`,qi=e=>{let t=e?.code;return t===`permission-denied`||t===`not-found`};function Ji(e,t=Date.now()){try{localStorage.setItem(Ki,JSON.stringify({emails:e.map(e=>e.trim().toLowerCase()).filter(Boolean),at:t}))}catch{}}function Yi(e,t=Date.now()){if(!e)return!1;try{let n=JSON.parse(localStorage.getItem(Ki)||`null`);return!n||!Array.isArray(n.emails)||typeof n.at!=`number`||t<n.at||t-n.at>36e5?!1:n.emails.includes(e.trim().toLowerCase())}catch{return!1}}var Xi=`fbos_rules_typed`;function Zi(){try{return localStorage.getItem(Xi)||``}catch{return``}}function Qi(e){try{localStorage.setItem(Xi,e)}catch{}}function $i(e=Wi,t=Gi){let n,r,i=0,a=null,o=()=>{n!==void 0&&clearTimeout(n),n=void 0},s=()=>{o();let e=r;r=void 0,e?.()};return{later(c){o(),r=c;let l=Date.now();a===null&&(a=l),!(l-a>=t)&&(n=setTimeout(s,e[Math.min(i,e.length-1)]),i+=1)},now(){r&&s()},stop(){o(),r=void 0,i=0,a=null},get waiting(){return r!==void 0}}}var ea=(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 ta(e,{deleteLogin:t=!0}={}){if(t)try{return await(0,s.deleteUser)(e),`deleted`}catch{}try{return await(0,s.signOut)(h),`signed-out`}catch{return`failed`}}function na(e,t){if(e?.removed!==!0)return!1;let n=typeof t==`number`?t:Date.parse(String(t||``));return Number.isFinite(n)?n>(Number(e.removedMs)||0):!1}var ra=/user_avatars(?:\/|%2F)/i;async function ia(e,t){let n=null;try{n=(await e.getIdTokenResult()).authTime}catch{return`too-early`}if(!na(t,n))return`too-early`;let r=ua(null,{uid:e.uid,email:e.email,displayName:e.displayName,phone:e.phoneNumber});try{await(0,c.setDoc)((0,c.doc)(g,`user_profiles`,e.uid),r)}catch{return`refused`}return ra.test(e.photoURL||``)&&(0,s.updateProfile)(e,{photoURL:null}).catch(()=>{}),`started`}var aa=e=>`fbos_role2_${e}`,oa=e=>{try{return localStorage.getItem(aa(e))}catch{return null}},sa=(e,t)=>{try{localStorage.setItem(aa(e),t)}catch{}},ca=e=>{try{localStorage.removeItem(aa(e))}catch{}},la=e=>{try{localStorage.removeItem(`fbos_role_${e}`)}catch{}};function ua(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,s=t.phone||r.phone||null;if(e&&r.uid===t.uid&&r.email===o&&(r.phone??null)===s&&r.createdAt&&(!t.displayName||r.displayName===t.displayName)&&a)return null;let c=new Date(n).toISOString();return{uid:t.uid,email:o,phone:s,displayName:t.displayName||r.displayName||``,lastLoginAt:c,createdAt:r.createdAt||c}}function da({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,_]=(0,i.useState)(!0),[v,y]=(0,i.useState)(!1),[b,x]=(0,i.useState)(!1),[S,C]=(0,i.useState)(null),[w,T]=(0,i.useState)(null),[ee,E]=(0,i.useState)(!1),D=i.default.useRef(null),te=i.default.useRef(null),ne=i.default.useRef(null),O=i.default.useRef(``),k=i.default.useRef(null),re=i.default.useRef(n);re.current=n;let ie=i.default.useRef(r);ie.current=r;let ae=i.default.useRef(null),A=i.default.useRef(null),j=i.default.useRef(null),M=i.default.useRef(null),oe=i.default.useRef(null),N=i.default.useRef(null),P=i.default.useRef(null),F=i.default.useRef($i()),I=i.default.useRef(null),se=i.default.useRef(null),L=i.default.useRef(null),ce=(e,{certain:t=!1}={})=>{if(k.current!==e)return;if(t)I.current=e;else if(I.current!==e&&!Yi(h.currentUser?.email))return;let n=L.current;n?.uid===e&&F.current.later(n.run)},le=i.default.useRef(new Set),ue=e=>(0,c.updateDoc)((0,c.doc)(g,`user_profiles`,e),{role:`admin`}),de=async(e,{again:t=!1}={})=>{if(!(le.current.has(e)&&!t)){le.current.add(e);try{await ue(e)}catch(t){if(t?.code!==`permission-denied`){console.error(`Error claiming the admin role:`,t);return}try{if(!h.currentUser)return;await h.currentUser.getIdToken(!0),await ue(e)}catch(t){if(t?.code!==`permission-denied`){console.error(`Error claiming the admin role:`,t);return}ce(e)}}}};return(0,i.useEffect)(()=>{let e,n=F.current;if(!h){_(!1),y(!0),E(!0);return}(0,s.getRedirectResult)(h).then(e=>{e?.user&&Li()}).catch(e=>{e?.code&&Ri(e)});let r=(0,s.onAuthStateChanged)(h,async n=>{if(n?.uid===k.current&&v){l(n);return}let r=k.current;if(k.current=n?.uid||null,n){O.current=ii(typeof window<`u`?window.location.pathname:``),x(!1),n.uid!==r&&(M.current=null,F.current.stop(),I.current=null,se.current=null),r!==n.uid&&E(!1),la(n.uid);let i=oa(n.uid);i?(d(i),y(!0),_(!1)):y(!1),l(n);try{let r=(0,c.doc)(g,`user_profiles`,n.uid),i=e=>{console.error(`[AuthContext] the profile could not be read to the end:`,e),N.current=null,P.current=null,y(!0),x(!0),E(!0),_(!1)},a=(e,{deleteLogin:t})=>{ae.current=n.uid,A.current!==n.uid&&(A.current=n.uid,ta(n,{deleteLogin:t}).then(e=>{e===`failed`&&(A.current=null)})),d(null),M.current=null,ca(n.uid),p(!0),C(null),T(e),y(!0),x(!0),E(!0),_(!1)},o=e=>{try{let i=e.exists()?e.data():null,o=e.metadata?.hasPendingWrites===!0;if(o||(se.current={uid:n.uid,data:i},(i?.role||i?.removed)&&F.current.stop()),i?.removed===!0){let e=j.current?.uid===n.uid?j.current:null;if(!e){j.current={uid:n.uid,state:`asking`};let e=i;d(null),M.current=null,ca(n.uid),ia(n,e).catch(()=>`too-early`).then(t=>{j.current?.uid!==n.uid||k.current!==n.uid||(j.current={uid:n.uid,state:t},t!==`started`&&a(e,{deleteLogin:t===`refused`}))});return}if(e.state===`asking`)return;a(i,{deleteLogin:e.state===`refused`});return}if(o&&j.current?.uid===n.uid&&j.current.state===`asking`)return;let s=null;if(ne.current!==n.uid){ne.current=n.uid;let e=ua(i,{uid:n.uid,email:n.email,displayName:n.displayName,phone:n.phoneNumber});i&&e&&(s=e);let t=ai(i,O.current);O.current=``,(e||t)&&(i||(N.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.`),ce(n.uid)):console.error(`Failed to sync profile:`,e)}).finally(()=>{N.current===n.uid&&(N.current=null,P.current!==n.uid&&E(!0))}));let a={...i||{},...e||{}};cr(a,n)&&(P.current=n.uid,pr(n.uid,a).finally(()=>{P.current===n.uid&&(P.current=null,N.current!==n.uid&&E(!0))}))}if(i){let e=Qt(i);o?e=M.current??`user`:M.current=e,!o&&te.current!==n.uid&&Zt(i)&&t.t(h.currentUser)&&(te.current=n.uid,en(n.uid,i)),!o&&!i.role&&!i.removed&&h.currentUser?.emailVerified&&de(n.uid),D.current===null&&(D.current=e),d(e),sa(n.uid,e),p(i.inactive===!0),C(si(i)?.role??null),T(s?{...i,...s}:i)}else d(null),o||(M.current=null),ca(n.uid),p(!1),C(null),T(null);y(!0),x(!0),(i||N.current!==n.uid)&&P.current!==n.uid&&E(!0),_(!1)}catch(e){i(e)}},s=e=>{y(!0),N.current=null,P.current=null,E(!0),_(!1),qi(e)&&ce(n.uid,{certain:!0})},l=()=>{e&&e(),e=(0,c.onSnapshot)(r,{includeMetadataChanges:!0},o,s)};L.current={uid:n.uid,run:()=>{k.current===n.uid&&(ne.current=null,le.current.delete(n.uid),l())}},l()}catch(e){console.error(`[AuthContext] ERROR in auth resolution:`,e),y(!0),N.current=null,P.current=null,E(!0),_(!1)}}else{if(r){let e=ae.current===r;e&&(ae.current=null),(e&&ie.current||re.current)?.()}l(null),d(null),p(!1),C(null),T(null),y(!0),x(!1),E(!1),_(!1),D.current=null,M.current=null,oe.current=null,O.current=``,te.current=null,ne.current=null,N.current=null,P.current=null,j.current=null,A.current=null,F.current.stop(),I.current=null,se.current=null,L.current=null,e&&e()}});return()=>{r(),n.stop(),e&&e()}},[]),(0,i.useEffect)(()=>{if(typeof window>`u`)return;let e=0,t=()=>{if(typeof document<`u`&&document.visibilityState===`hidden`)return;let t=k.current;if(!t||Date.now()-e<2e3)return;let n=F.current;if(n.waiting){e=Date.now(),n.now();return}let r=se.current,i=r?.uid===t&&!r.data?.role&&!r.data?.removed,a=L.current;i&&a?.uid===t&&Yi(h.currentUser?.email)&&(e=Date.now(),a.run())};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`focus`,t),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}},[]),(0,i.useEffect)(()=>{let e=o?.uid??null,t=o?.emailVerified===!0,n=oe.current,r=!!e&&!!n&&n.uid===e&&!n.verified&&t;if(oe.current=e?{uid:e,verified:t}:null,!r||u===`admin`)return;let i=!1;return(0,c.getDoc)((0,c.doc)(g,`user_profiles`,o.uid)).then(e=>{!i&&e.exists()&&!e.data().role&&!e.data().removed&&de(o.uid,{again:!0})}).catch(()=>{}),()=>{i=!0}},[o?.uid,o?.emailVerified,u]),(0,a.jsx)(ea.Provider,{value:{user:o,userRole:u,accessLevel:t.b(u),isInternal:t.p(u),isAdmin:t.h(u),loading:m,signOut:async()=>{await(0,s.signOut)(h),l(null)},registerUser:async(e,t,n,r)=>{let{createUserWithEmailAndPassword:i}=await import(`firebase/auth`),{user:a}=await i(h,e,t),o=`${n} ${r}`.trim();await(0,s.updateProfile)(a,{displayName:o}).catch(e=>{console.warn(`The name could not be put on the sign-in; the profile carries it.`,e)});try{await a.getIdToken(!0),await(0,c.setDoc)((0,c.doc)(g,`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)}try{await(0,s.sendEmailVerification)(a),gr(a.uid)}catch(e){console.warn(`The verification mail could not be sent at registration; /verify sends it.`,e)}},refreshUser:async()=>{h.currentUser&&(await h.currentUser.reload(),l(Object.assign(Object.create(h.currentUser),{photoURL:h.currentUser.photoURL,displayName:h.currentUser.displayName,email:h.currentUser.email,emailVerified:h.currentUser.emailVerified})))},userInactive:f,roleResolved:v,roleConfirmed:b,requestedRole:S,profile:w,profileReady:ee},children:e})}var fa=()=>(0,i.useContext)(ea),pa=(0,i.createContext)({});function ma(e){let t=(0,i.useRef)(null);return t.current===null&&(t.current=e()),t.current}var ha=typeof window<`u`?i.useLayoutEffect:i.useEffect,ga=(0,i.createContext)(null);function _a(e,t){e.indexOf(t)===-1&&e.push(t)}function va(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var ya=(e,t,n)=>n>t?t:n<e?e:n;function ba(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var xa=()=>{},Sa=()=>{};typeof process<`u`&&process.env.NODE_ENV!==`production`&&(xa=(e,t,n)=>{!e&&typeof console<`u`&&console.warn(ba(t,n))},Sa=(e,t,n)=>{if(!e)throw Error(ba(t,n))});var Ca={},wa=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Ta(e){return typeof e==`object`&&!!e}var Ea=e=>/^0[^.\s]+$/u.test(e);function Da(e){let t;return()=>(t===void 0&&(t=e()),t)}var Oa=e=>e,ka=(e,t)=>n=>t(e(n)),Aa=(...e)=>e.reduce(ka),ja=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},Ma=class{constructor(){this.subscriptions=[]}add(e){return _a(this.subscriptions,e),()=>va(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}},R=e=>e*1e3,Na=e=>e/1e3;function Pa(e,t){return t?1e3/t*e:0}var Fa=new Set;function Ia(e,t,n){e||Fa.has(t)||(console.warn(ba(t,n)),Fa.add(t))}var La=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Ra=1e-7,za=12;function Ba(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=La(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Ra&&++s<za);return o}function Va(e,t,n,r){if(e===t&&n===r)return Oa;let i=t=>Ba(t,0,1,e,n);return e=>e===0||e===1?e:La(i(e),t,r)}var Ha=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ua=e=>t=>1-e(1-t),Wa=Va(.33,1.53,.69,.99),Ga=Ua(Wa),Ka=Ha(Ga),qa=e=>e>=1?1:(e*=2)<1?.5*Ga(e):.5*(2-2**(-10*(e-1))),Ja=e=>1-Math.sin(Math.acos(e)),Ya=Ua(Ja),Xa=Ha(Ja),Za=Va(.42,0,1,1),Qa=Va(0,0,.58,1),$a=Va(.42,0,.58,1),eo=e=>Array.isArray(e)&&typeof e[0]!=`number`,to=e=>Array.isArray(e)&&typeof e[0]==`number`,no={linear:Oa,easeIn:Za,easeInOut:$a,easeOut:Qa,circIn:Ja,circInOut:Xa,circOut:Ya,backIn:Ga,backInOut:Ka,backOut:Wa,anticipate:qa},ro=e=>typeof e==`string`,io=e=>{if(to(e)){Sa(e.length===4,`Cubic bezier arrays must contain four numerical values.`,`cubic-bezier-length`);let[t,n,r,i]=e;return Va(t,n,r,i)}else if(ro(e))return Sa(no[e]!==void 0,`Invalid easing type '${e}'`,`invalid-easing-type`),no[e];return e},ao=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],oo={value:null,addProjectionMetrics:null};function so(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&&oo.value&&oo.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var co=40;function lo(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=ao.reduce((e,n)=>(e[n]=so(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=Ca.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,co),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:ao.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<ao.length;t++)o[ao[t]].cancel(e)},state:i,steps:o}}var{schedule:z,cancel:uo,state:B,steps:fo}=lo(typeof requestAnimationFrame<`u`?requestAnimationFrame:Oa,!0),po;function mo(){po=void 0}var V={now:()=>(po===void 0&&V.set(B.isProcessing||Ca.useManualTiming?B.timestamp:performance.now()),po),set:e=>{po=e,queueMicrotask(mo)}},ho={layout:0,mainThread:0,waapi:0},go=e=>t=>typeof t==`string`&&t.startsWith(e),_o=go(`--`),vo=go(`var(--`),yo=e=>vo(e)?bo.test(e.split(`/*`)[0].trim()):!1,bo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function xo(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var So={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Co={...So,transform:e=>ya(0,1,e)},wo={...So,default:1},To=e=>Math.round(e*1e5)/1e5,Eo=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Do(e){return e==null}var Oo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ko=(e,t)=>n=>!!(typeof n==`string`&&Oo.test(n)&&n.startsWith(e)||t&&!Do(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ao=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Eo);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},jo=e=>ya(0,255,e),Mo={...So,transform:e=>Math.round(jo(e))},No={test:ko(`rgb`,`red`),parse:Ao(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Mo.transform(e)+`, `+Mo.transform(t)+`, `+Mo.transform(n)+`, `+To(Co.transform(r))+`)`};function Po(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 Fo={test:ko(`#`),parse:Po,transform:No.transform},Io=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Lo=Io(`deg`),Ro=Io(`%`),H=Io(`px`),zo=Io(`vh`),Bo=Io(`vw`),Vo={...Ro,parse:e=>Ro.parse(e)/100,transform:e=>Ro.transform(e*100)},Ho={test:ko(`hsl`,`hue`),parse:Ao(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Ro.transform(To(t))+`, `+Ro.transform(To(n))+`, `+To(Co.transform(r))+`)`},U={test:e=>No.test(e)||Fo.test(e)||Ho.test(e),parse:e=>No.test(e)?No.parse(e):Ho.test(e)?Ho.parse(e):Fo.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?No.transform(e):Ho.transform(e),getAnimatableNone:e=>{let t=U.parse(e);return t.alpha=0,U.transform(t)}},Uo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Wo(e){return isNaN(e)&&typeof e==`string`&&(e.match(Eo)?.length||0)+(e.match(Uo)?.length||0)>0}var Go=`number`,Ko=`color`,qo=`var`,Jo=`var(`,Yo="${}",Xo=/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 Zo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Xo,e=>(U.test(e)?(r.color.push(a),i.push(Ko),n.push(U.parse(e))):e.startsWith(Jo)?(r.var.push(a),i.push(qo),n.push(e)):(r.number.push(a),i.push(Go),n.push(parseFloat(e))),++a,Yo)).split(Yo),indexes:r,types:i}}function Qo(e){return Zo(e).values}function $o({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===Go?i+=To(r[a]):e===Ko?i+=U.transform(r[a]):i+=r[a]}return i}}function es(e){return $o(Zo(e))}var ts=e=>typeof e==`number`?0:U.test(e)?U.getAnimatableNone(e):e,ns=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:ts(e);function rs(e){let t=Zo(e);return $o(t)(t.values.map((e,n)=>ns(e,t.split[n])))}var is={test:Wo,parse:Qo,createTransformer:es,getAnimatableNone:rs};function as(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 os({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=as(s,r,e+1/3),a=as(s,r,e),o=as(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function ss(e,t){return n=>n>0?t:e}var W=(e,t,n)=>e+(t-e)*n,cs=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},ls=[Fo,No,Ho],us=e=>ls.find(t=>t.test(e));function ds(e){let t=us(e);if(xa(!!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===Ho&&(n=os(n)),n}var fs=(e,t)=>{let n=ds(e),r=ds(t);if(!n||!r)return ss(e,t);let i={...n};return e=>(i.red=cs(n.red,r.red,e),i.green=cs(n.green,r.green,e),i.blue=cs(n.blue,r.blue,e),i.alpha=W(n.alpha,r.alpha,e),No.transform(i))},ps=new Set([`none`,`hidden`]);function ms(e,t){return ps.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function hs(e,t){return n=>W(e,t,n)}function gs(e){return typeof e==`number`?hs:typeof e==`string`?yo(e)?ss:U.test(e)?fs:bs:Array.isArray(e)?_s:typeof e==`object`?U.test(e)?fs:vs:ss}function _s(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>gs(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function vs(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=gs(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function ys(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 bs=(e,t)=>{let n=is.createTransformer(t),r=Zo(e),i=Zo(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?ps.has(e)&&!i.values.length||ps.has(t)&&!r.values.length?ms(e,t):Aa(_s(ys(r,i),i.values),n):(xa(!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`),ss(e,t))};function xs(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?W(e,t,n):gs(e)(e,t)}var Ss=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>z.update(t,e),stop:()=>uo(t),now:()=>B.isProcessing?B.timestamp:V.now()}},Cs=(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)})`},ws=2e4;function Ts(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 Es(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Ts(r),ws);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Na(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 Ds(e,t){return e*Math.sqrt(1-t*t)}var Os=12;function ks(e,t,n){let r=n;for(let n=1;n<Os;n++)r-=e(r)/t(r);return r}var As=.001;function js({duration:e=G.duration,bounce:t=G.bounce,velocity:n=G.velocity,mass:r=G.mass}){let i,a;xa(e<=R(G.maxDuration),`Spring duration must be 10 seconds or less`,`spring-duration-limit`);let o=1-t;o=ya(G.minDamping,G.maxDamping,o),e=ya(G.minDuration,G.maxDuration,Na(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Ds(t,o),c=Math.exp(-i);return As-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=Ds(t**2,o);return(-i(t)+As>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-As+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=ks(i,a,s);if(e=R(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 Ms=[`duration`,`bounce`],Ns=[`stiffness`,`damping`,`mass`];function Ps(e,t){return t.some(t=>e[t]!==void 0)}function Fs(e){let t={velocity:G.velocity,stiffness:G.stiffness,damping:G.damping,mass:G.mass,isResolvedFromDuration:!1,...e};if(!Ps(e,Ns)&&Ps(e,Ms))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*ya(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:G.mass,stiffness:i,damping:a}}else{let n=js({...e,velocity:0});t={...t,...n,mass:G.mass},t.isResolvedFromDuration=!0}return t}function Is(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}=Fs({...n,velocity:-Na(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Na(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=Ds(_,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=>R(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=R(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=R(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(Ts(T),ws),t=Cs(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Is.applyToOptions=e=>{let t=Es(e,100,Is);return e.ease=t.ease,e.duration=R(t.duration),e.type=`keyframes`,e};var Ls=5;function Rs(e,t,n){let r=Math.max(t-Ls,0);return Pa(n-e(r),t-r)}function zs({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=Is({keyframes:[f.value,m(f.value)],velocity:Rs(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 Bs(e,t,n){let r=[],i=n||Ca.mix||xs,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Aa(Array.isArray(t)?t[n]||Oa:t,a)),r.push(a)}return r}function Vs(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(Sa(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=Bs(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=ja(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ya(e[0],e[a-1],t)):l}function Hs(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=ja(0,t,r);e.push(W(n,1,i))}}function Us(e){let t=[0];return Hs(t,e.length-1),t}function Ws(e,t){return e.map(e=>e*t)}function Gs(e,t){return e.map(()=>t||$a).splice(0,e.length-1)}function Ks({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=eo(r)?r.map(io):io(r),a={done:!1,value:t[0]},o=Vs(Ws(n&&n.length===t.length?n:Us(t),e),t,{ease:Array.isArray(i)?i:Gs(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var qs=e=>e!==null;function Js(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(qs),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Ys={decay:zs,inertia:zs,tween:Ks,keyframes:Ks,spring:Is};function Xs(e){typeof e.type==`string`&&(e.type=Ys[e.type])}var Zs=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)}},Qs=e=>e/100,$s=class extends Zs{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!==V.now()&&this.tick(V.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},ho.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Xs(e);let{type:t=Ks,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Ks;process.env.NODE_ENV!==`production`&&s!==Ks&&Sa(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`,`spring-two-frames`),s!==Ks&&typeof o[0]!=`number`&&(this.mixKeyframes=Aa(Qs,xs(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=Ts(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=ya(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!==zs&&(b.value=Js(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 Na(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Na(e)}get time(){return Na(this.currentTime)}set time(e){e=R(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 Rs(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(V.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Na(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ss,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(V.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,ho.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 ec(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var tc=e=>e*180/Math.PI,nc=e=>ic(tc(Math.atan2(e[1],e[0]))),rc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:nc,rotateZ:nc,skewX:e=>tc(Math.atan(e[1])),skewY:e=>tc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ic=e=>(e%=360,e<0&&(e+=360),e),ac=nc,oc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),cc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:oc,scaleY:sc,scale:e=>(oc(e)+sc(e))/2,rotateX:e=>ic(tc(Math.atan2(e[6],e[5]))),rotateY:e=>ic(tc(Math.atan2(-e[2],e[0]))),rotateZ:ac,rotate:ac,skewX:e=>tc(Math.atan(e[4])),skewY:e=>tc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function lc(e){return+!!e.includes(`scale`)}function uc(e,t){if(!e||e===`none`)return lc(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=cc,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=rc,i=t}if(!i)return lc(t);let a=r[t],o=i[1].split(`,`).map(fc);return typeof a==`function`?a(o):o[a]}var dc=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return uc(n,t)};function fc(e){return parseFloat(e.trim())}var pc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],mc=new Set(pc),hc=e=>e===So||e===H,gc=new Set([`x`,`y`,`z`]),_c=pc.filter(e=>!gc.has(e));function vc(e){let t=[];return _c.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var yc={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})=>uc(t,`x`),y:(e,{transform:t})=>uc(t,`y`)};yc.translateX=yc.x,yc.translateY=yc.y;var bc=new Set,xc=!1,Sc=!1,Cc=!1;function wc(){if(Sc){let e=Array.from(bc).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=vc(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)})}Sc=!1,xc=!1,bc.forEach(e=>e.complete(Cc)),bc.clear()}function Tc(){bc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Sc=!0)})}function Ec(){Cc=!0,Tc(),wc(),Cc=!1}var Dc=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?(bc.add(this),xc||(xc=!0,z.read(Tc),z.resolveKeyframes(wc))):(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])}ec(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),bc.delete(this)}cancel(){this.state===`scheduled`&&(bc.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Oc=e=>e.startsWith(`--`);function kc(e,t,n){Oc(t)?e.style.setProperty(t,n):e.style[t]=n}var Ac={};function jc(e,t){let n=Da(e);return()=>Ac[t]??n()}var Mc=jc(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Nc=jc(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Pc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Fc={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Pc([0,.65,.55,1]),circOut:Pc([.55,0,1,.45]),backIn:Pc([.31,.01,.66,-.59]),backOut:Pc([.33,1.53,.69,.99])};function Ic(e,t){if(e)return typeof e==`function`?Nc()?Cs(e,t):`ease-out`:to(e)?Pc(e):Array.isArray(e)?e.map(e=>Ic(e,t)||Fc.easeOut):Fc[e]}function Lc(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=Ic(s,i);Array.isArray(d)&&(u.easing=d),oo.value&&ho.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 oo.value&&p.finished.finally(()=>{ho.waapi--}),p}function Rc(e){return typeof e==`function`&&`applyToOptions`in e}function zc({type:e,...t}){return Rc(e)&&Nc()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Bc=class extends Zs{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,Sa(typeof e.type!=`string`,`Mini animate() doesn't support "type" as a string.`,`mini-spring`);let c=zc(e);this.animation=Lc(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Js(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),kc(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 Na(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Na(e)}get time(){return Na(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=R(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&&Mc()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Oa):r(this)}},Vc={anticipate:qa,backInOut:Ka,circInOut:Xa};function Hc(e){return e in Vc}function Uc(e){typeof e.ease==`string`&&Hc(e.ease)&&(e.ease=Vc[e.ease])}var Wc=10,Gc=class extends Bc{constructor(e){Uc(e),Xs(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 $s({...a,autoplay:!1}),s=Math.max(Wc,V.now()-this.startTime),c=ya(0,Wc,s-Wc),l=o.sample(s).value,{name:u}=this.options;i&&u&&kc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Kc=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(is.test(e)||e===`0`)&&!e.startsWith(`url(`));function qc(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 Jc(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=Kc(i,t),s=Kc(a,t);return xa(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:qc(e)||(n===`spring`||Rc(n))&&r}function Yc(e){e.duration=0,e.type=`keyframes`}var Xc=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Zc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Qc(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Zc.test(e[t]))return!0;return!1}var $c=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),el=Da(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function tl(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 el()&&n&&(Xc.has(n)||$c.has(n)&&Qc(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var nl=40,rl=class extends Zs{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=V.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||Dc)(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=V.now();let u=!0;Jc(e,i,a,o)||(u=!1,(Ca.instantAnimations||!s)&&l?.(Js(e,n,t)),e[0]=e[e.length-1],Yc(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>nl?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&tl(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Gc({...d,element:p})}catch{m=new $s(d)}else m=new $s(d);m.finished.then(()=>{this.notifyFinished()}).catch(Oa),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(),Ec()),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 il(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 al=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ol(e){let t=al.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}var sl=4;function cl(e,t,n=1){Sa(n<=sl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,`max-css-var-depth`);let[r,i]=ol(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return wa(e)?parseFloat(e):e}return yo(i)?cl(i,t,n+1):i}var ll={type:`spring`,stiffness:500,damping:25,restSpeed:10},ul=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),dl={type:`keyframes`,duration:.8},fl={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},pl=(e,{keyframes:t})=>t.length>2?dl:mc.has(e)?e.startsWith(`scale`)?ul(t[1]):ll:fl;function ml(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function hl(e,t){let n=e?.[t]??e?.default??e;return n===e?n:ml(n,e)}var gl=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function _l(e){for(let t in e)if(!gl.has(t))return!0;return!1}var vl=(e,t,n,r={},i,a)=>o=>{let s=hl(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=R(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};_l(s)||Object.assign(u,pl(e,u)),u.duration&&=R(u.duration),u.repeatDelay&&=R(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Yc(u),u.delay===0&&(d=!0)),(Ca.instantAnimations||Ca.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,Yc(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Js(u.keyframes,s);if(e!==void 0){z.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new $s(u):new rl(u)};function yl(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function bl(e,t,n,r){if(typeof t==`function`){let[i,a]=yl(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]=yl(r);t=t(n===void 0?e.custom:n,i,a)}return t}function xl(e,t,n){let r=e.getProps();return bl(r,t,n===void 0?r.custom:n,e)}var Sl=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...pc]),Cl=30,wl=e=>!isNaN(parseFloat(e)),Tl={current:void 0},El=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=V.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=V.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wl(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!==`production`&&Ia(!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 Ma);let n=this.events[e].add(t);return e===`change`?()=>{n(),z.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 Tl.current&&Tl.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=V.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Cl)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Cl);return Pa(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 Dl(e,t){return new El(e,t)}var Ol=e=>Array.isArray(e);function kl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dl(n))}function Al(e){return Ol(e)?e[e.length-1]||0:e}function jl(e,t){let{transitionEnd:n={},transition:r={},...i}=xl(e,t)||{};i={...i,...n};for(let t in i)kl(e,t,Al(i[t]))}var K=e=>!!(e&&e.getVelocity);function Ml(e){return!!(K(e)&&e.add)}function Nl(e,t){let n=e.getValue(`willChange`);if(Ml(n))return n.add(t);if(!n&&Ca.WillChange){let n=new Ca.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Pl(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Fl=`data-`+Pl(`framerAppearId`);function Il(e){return e.props[Fl]}function Ll({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Rl(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?ml(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&&Ll(d,t))continue;let o={delay:n,...hl(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){z.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=Il(e);if(n){let e=window.MotionHandoffAnimation(n,t,z);e!==null&&(o.startTime=e,f=!0)}}Nl(e,t);let p=l??e.shouldReduceMotion;r.start(vl(t,r,i,p&&Sl.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>z.update(()=>{o&&jl(e,o)});u.length?Promise.all(u).then(t):t()}return u}function zl(e,t,n={}){let r=xl(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(Rl(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Bl(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 Bl(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(zl(c,t,{...o,delay:n+(typeof r==`function`?0:r)+il(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Vl(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>zl(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=zl(e,t,n);else{let i=typeof t==`function`?xl(e,t,n.custom):t;r=Promise.all(Rl(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Hl={test:e=>e===`auto`,parse:e=>e},Ul=e=>t=>t.test(e),Wl=[So,H,Ro,Lo,Bo,zo,Hl],Gl=e=>Wl.find(Ul(e));function Kl(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||Ea(e)}var ql=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Jl(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Eo)||[];if(!r)return e;let i=n.replace(r,``),a=+!!ql.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Yl=/\b([a-z-]*)\(.*?\)/gu,Xl={...is,getAnimatableNone:e=>{let t=e.match(Yl);return t?t.map(Jl).join(` `):e}},Zl={...is,getAnimatableNone:e=>{let t=is.parse(e);return is.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Ql={...So,transform:Math.round},$l={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:Lo,rotateX:Lo,rotateY:Lo,rotateZ:Lo,scale:wo,scaleX:wo,scaleY:wo,scaleZ:wo,skew:Lo,skewX:Lo,skewY:Lo,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:Co,originX:Vo,originY:Vo,originZ:H,zIndex:Ql,fillOpacity:Co,strokeOpacity:Co,numOctaves:Ql},eu={...$l,color:U,backgroundColor:U,outlineColor:U,fill:U,stroke:U,borderColor:U,borderTopColor:U,borderRightColor:U,borderBottomColor:U,borderLeftColor:U,filter:Xl,WebkitFilter:Xl,mask:Zl,WebkitMask:Zl},tu=e=>eu[e],nu=new Set([Xl,Zl]);function ru(e,t){let n=tu(e);return nu.has(n)||(n=is),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var iu=new Set([`auto`,`none`,`0`]);function au(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!iu.has(t)&&Zo(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=ru(n,i)}var ou=class extends Dc{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(),yo(r))){let i=cl(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Sl.has(n)||e.length!==2)return;let[r,i]=e,a=Gl(r),o=Gl(i);if(xo(r)!==xo(i)&&yc[n]){this.needsMeasurement=!0;return}if(a!==o)if(hc(a)&&hc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else yc[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Kl(e[t]))&&n.push(t);n.length&&au(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=yc[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]=yc[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 su(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 cu=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function lu(e){return Ta(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:uu,cancel:du}=lo(queueMicrotask,!1),fu={x:!1,y:!1};function pu(){return fu.x||fu.y}function mu(e){return e===`x`||e===`y`?fu[e]?null:(fu[e]=!0,()=>{fu[e]=!1}):fu.x||fu.y?null:(fu.x=fu.y=!0,()=>{fu.x=fu.y=!1})}function hu(e,t){let n=su(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function gu(e){return!(e.pointerType===`touch`||pu())}function _u(e,t,n={}){let[r,i,a]=hu(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(!gu(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 vu=(e,t)=>t?e===t?!0:vu(e,t.parentElement):!1,yu=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,bu=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function xu(e){return bu.has(e.tagName)||e.isContentEditable===!0}var Su=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Cu(e){return Su.has(e.tagName)||e.isContentEditable===!0}var wu=new WeakSet;function Tu(e){return t=>{t.key===`Enter`&&e(t)}}function Eu(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Du=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Tu(()=>{if(wu.has(n))return;Eu(n,`down`);let e=Tu(()=>{Eu(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Eu(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Ou(e){return yu(e)&&!pu()}var ku=new WeakSet;function Au(e,t,n={}){let[r,i,a]=hu(e,n),o=e=>{let r=e.currentTarget;if(!Ou(e)||ku.has(e))return;wu.add(r),n.stopPropagation&&ku.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),wu.has(r)&&wu.delete(r),Ou(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||vu(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),lu(e)&&(e.addEventListener(`focus`,e=>Du(e,i)),!xu(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function ju(e){return Ta(e)&&`ownerSVGElement`in e}var Mu=new WeakMap,Nu,Pu=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:ju(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Fu=Pu(`inline`,`width`,`offsetWidth`),Iu=Pu(`block`,`height`,`offsetHeight`);function Lu({target:e,borderBoxSize:t}){Mu.get(e)?.forEach(n=>{n(e,{get width(){return Fu(e,t)},get height(){return Iu(e,t)}})})}function Ru(e){e.forEach(Lu)}function zu(){typeof ResizeObserver>`u`||(Nu=new ResizeObserver(Ru))}function Bu(e,t){Nu||zu();let n=su(e);return n.forEach(e=>{let n=Mu.get(e);n||(n=new Set,Mu.set(e,n)),n.add(t),Nu?.observe(e)}),()=>{n.forEach(e=>{let n=Mu.get(e);n?.delete(t),n?.size||Nu?.unobserve(e)})}}var Vu=new Set,Hu;function Uu(){Hu=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Vu.forEach(t=>t(e))},window.addEventListener(`resize`,Hu)}function Wu(e){return Vu.add(e),Hu||Uu(),()=>{Vu.delete(e),!Vu.size&&typeof Hu==`function`&&(window.removeEventListener(`resize`,Hu),Hu=void 0)}}function Gu(e,t){return typeof e==`function`?Wu(e):Bu(e,t)}function Ku(e){return ju(e)&&e.tagName===`svg`}var qu=[...Wl,U,is],Ju=e=>qu.find(Ul(e)),Yu=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xu=()=>({x:Yu(),y:Yu()}),Zu=()=>({min:0,max:0}),q=()=>({x:Zu(),y:Zu()}),Qu=new WeakMap;function $u(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function ed(e){return typeof e==`string`||Array.isArray(e)}var td=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],nd=[`initial`,...td];function rd(e){return $u(e.animate)||nd.some(t=>ed(e[t]))}function id(e){return!!(rd(e)||e.variants)}function ad(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,Dl(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,Dl(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var od={current:null},sd={current:!1},cd=typeof window<`u`;function ld(){if(sd.current=!0,cd)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>od.current=e.matches;e.addEventListener(`change`,t),t()}else od.current=!1}var ud=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],dd={};function fd(e){dd=e}function pd(){return dd}var md=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=Dc,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=V.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,z.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=rd(t),this.isVariantNode=id(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,Qu.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:(sd.current||ld(),this.shouldReduceMotion=od.current),process.env.NODE_ENV!==`production`&&Ia(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(),uo(this.notifyUpdate),uo(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&&Xc.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Bc({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:R(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=mc.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&z.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 dd){let t=dd[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<ud.length;t++){let n=ud[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=ad(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=Dl(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`&&(wa(n)||Ea(n))?n=parseFloat(n):!Ju(n)&&is.test(t)&&(n=ru(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=bl(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 Ma),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){uu.render(this.render)}},hd=class extends md{constructor(){super(...arguments),this.KeyframeResolver=ou}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}`)}))}},gd=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function _d({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function vd({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function yd(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 bd(e){return e===void 0||e===1}function xd({scale:e,scaleX:t,scaleY:n}){return!bd(e)||!bd(t)||!bd(n)}function Sd(e){return xd(e)||Cd(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Cd(e){return wd(e.x)||wd(e.y)}function wd(e){return e&&e!==`0%`}function Td(e,t,n){return n+t*(e-n)}function Ed(e,t,n,r,i){return i!==void 0&&(e=Td(e,i,r)),Td(e,n,r)+t}function Dd(e,t=0,n=1,r,i){e.min=Ed(e.min,t,n,r,i),e.max=Ed(e.max,t,n,r,i)}function Od(e,{x:t,y:n}){Dd(e.x,t.translate,t.scale,t.originPoint),Dd(e.y,n.translate,n.scale,n.originPoint)}var kd=.999999999999,Ad=1.0000000000001;function jd(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&&(Md(e.x,-a.scroll.offset.x),Md(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Od(e,o)),r&&Sd(a.latestValues)&&Fd(e,a.latestValues,a.layout?.layoutBox))}t.x<Ad&&t.x>kd&&(t.x=1),t.y<Ad&&t.y>kd&&(t.y=1)}function Md(e,t){e.min+=t,e.max+=t}function Nd(e,t,n,r,i=.5){Dd(e,t,n,W(e.min,e.max,i),r)}function Pd(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Fd(e,t,n){let r=n??e;Nd(e.x,Pd(t.x,r.x),t.scaleX,t.scale,t.originX),Nd(e.y,Pd(t.y,r.y),t.scaleY,t.scale,t.originY)}function Id(e,t){return _d(yd(e.getBoundingClientRect(),t))}function Ld(e,t,n){let r=Id(e,n),{scroll:i}=t;return i&&(Md(r.x,i.offset.x),Md(r.y,i.offset.y)),r}var Rd={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},zd=pc.length;function Bd(e,t,n){let r=``,i=!0;for(let a=0;a<zd;a++){let o=pc[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=cu(s,$l[o]);if(!c){i=!1;let t=Rd[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Vd(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(mc.has(e)){o=!0;continue}else if(_o(e)){i[e]=n;continue}else{let t=cu(n,$l[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Bd(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 Hd(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 Ud(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Wd={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(H.test(e))e=parseFloat(e);else return e;return`${Ud(e,t.target.x)}% ${Ud(e,t.target.y)}%`}},Gd={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=is.parse(e);if(i.length>5)return r;let a=is.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)}},Kd={borderRadius:{...Wd,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Wd,borderTopRightRadius:Wd,borderBottomLeftRadius:Wd,borderBottomRightRadius:Wd,boxShadow:Gd};function qd(e,{layout:t,layoutId:n}){return mc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Kd[e]||e===`opacity`)}function Jd(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])||qd(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Yd(e){return window.getComputedStyle(e)}var Xd=class extends hd{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Hd}readValueFromInstance(e,t){if(mc.has(t))return this.projection?.isProjecting?lc(t):dc(e,t);{let n=Yd(e),r=(_o(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Id(e,t)}build(e,t,n){Vd(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Jd(e,t,n)}},Zd={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Qd={offset:`strokeDashoffset`,array:`strokeDasharray`};function $d(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Zd:Qd;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var ef=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function tf(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Vd(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 ef)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&&$d(d,i,a,o,!1)}var nf=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`]),rf=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function af(e,t,n,r){Hd(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(nf.has(n)?n:Pl(n),t.attrs[n])}function of(e,t,n){let r=Jd(e,t,n);for(let n in e)if(K(e[n])||K(t[n])){let t=pc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var sf=class extends hd{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=q}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(mc.has(t)){let e=tu(t);return e&&e.default||0}return t=nf.has(t)?t:Pl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return of(e,t,n)}build(e,t,n){tf(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){af(e,t,n,r)}mount(e){this.isSVGTag=rf(e.tagName),super.mount(e)}},cf=nd.length;function lf(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&lf(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<cf;n++){let r=nd[n],i=e.props[r];(ed(i)||i===!1)&&(t[r]=i)}return t}function uf(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 df=[...td].reverse(),ff=td.length;function pf(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Vl(e,t,n)))}function mf(e){let t=pf(e),n=_f(),r=!0,i=!1,a=t=>(n,r)=>{let i=xl(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=lf(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<ff;t++){let p=df[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=ed(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||$u(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=hf(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},ee=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=Ol(t)&&Ol(n)?!uf(t,n):t!==n,r?t==null?u.add(e):ee(e):t!==void 0&&u.has(e)?ee(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let E=v&&y;b&&(!E||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=xl(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=il(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=xl(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=_f(),i=!0}}}function hf(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!uf(t,e):!1}function gf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _f(){return{animate:gf(!0),whileInView:gf(),whileHover:gf(),whileTap:gf(),whileDrag:gf(),whileFocus:gf(),exit:gf()}}function vf(e,t){e.min=t.min,e.max=t.max}function yf(e,t){vf(e.x,t.x),vf(e.y,t.y)}function bf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var xf=1e-4,Sf=1-xf,Cf=1+xf,wf=.01,Tf=0-wf,Ef=0+wf;function J(e){return e.max-e.min}function Df(e,t,n){return Math.abs(e-t)<=n}function Of(e,t,n,r=.5){e.origin=r,e.originPoint=W(t.min,t.max,e.origin),e.scale=J(n)/J(t),e.translate=W(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Sf&&e.scale<=Cf||isNaN(e.scale))&&(e.scale=1),(e.translate>=Tf&&e.translate<=Ef||isNaN(e.translate))&&(e.translate=0)}function kf(e,t,n,r){Of(e.x,t.x,n.x,r?r.originX:void 0),Of(e.y,t.y,n.y,r?r.originY:void 0)}function Af(e,t,n,r=0){e.min=(r?W(n.min,n.max,r):n.min)+t.min,e.max=e.min+J(t)}function jf(e,t,n,r){Af(e.x,t.x,n.x,r?.x),Af(e.y,t.y,n.y,r?.y)}function Mf(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+J(t)}function Nf(e,t,n,r){Mf(e.x,t.x,n.x,r?.x),Mf(e.y,t.y,n.y,r?.y)}function Pf(e,t,n,r,i){return e-=t,e=Td(e,1/n,r),i!==void 0&&(e=Td(e,1/i,r)),e}function Ff(e,t=0,n=1,r=.5,i,a=e,o=e){if(Ro.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=Pf(e.min,t,n,s,i),e.max=Pf(e.max,t,n,s,i)}function If(e,t,[n,r,i],a,o){Ff(e,t[n],t[r],t[i],t.scale,a,o)}var Lf=[`x`,`scaleX`,`originX`],Rf=[`y`,`scaleY`,`originY`];function zf(e,t,n,r){If(e.x,t,Lf,n?n.x:void 0,r?r.x:void 0),If(e.y,t,Rf,n?n.y:void 0,r?r.y:void 0)}function Bf(e){return e.translate===0&&e.scale===1}function Vf(e){return Bf(e.x)&&Bf(e.y)}function Hf(e,t){return e.min===t.min&&e.max===t.max}function Uf(e,t){return Hf(e.x,t.x)&&Hf(e.y,t.y)}function Wf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gf(e,t){return Wf(e.x,t.x)&&Wf(e.y,t.y)}function Kf(e){return J(e.x)/J(e.y)}function qf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Jf(e){return[e(`x`),e(`y`)]}function Yf(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 Xf=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],Zf=Xf.length,Qf=e=>typeof e==`string`?parseFloat(e):e,$f=e=>typeof e==`number`||H.test(e);function ep(e,t,n,r,i,a){i?(e.opacity=W(0,n.opacity??1,np(r)),e.opacityExit=W(t.opacity??1,0,rp(r))):a&&(e.opacity=W(t.opacity??1,n.opacity??1,r));for(let i=0;i<Zf;i++){let a=Xf[i],o=tp(t,a),s=tp(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||$f(o)===$f(s)?(e[a]=Math.max(W(Qf(o),Qf(s),r),0),(Ro.test(s)||Ro.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=W(t.rotate||0,n.rotate||0,r))}function tp(e,t){return e[t]===void 0?e.borderRadius:e[t]}var np=ip(0,.5,Ya),rp=ip(.5,.95,Oa);function ip(e,t,n){return r=>r<e?0:r>t?1:n(ja(e,t,r))}function ap(e,t,n){let r=K(e)?e:Dl(e);return r.start(vl(``,r,t,n)),r.animation}function op(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var sp=(e,t)=>e.depth-t.depth,cp=class{constructor(){this.children=[],this.isDirty=!1}add(e){_a(this.children,e),this.isDirty=!0}remove(e){va(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(sp),this.isDirty=!1,this.children.forEach(e)}};function lp(e,t){let n=V.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(uo(r),e(a-t))};return z.setup(r,!0),()=>uo(r)}function up(e){return K(e)?e.get():e}var dp=class{constructor(){this.members=[]}add(e){_a(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&&(va(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(va(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)}},fp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},pp={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},mp=[``,`X`,`Y`,`Z`],hp=1e3,gp=0;function _p(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function vp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Il(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,z,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&vp(r)}function yp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=gp++,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,oo.value&&(pp.nodes=pp.calculatedTargetDeltas=pp.calculatedProjections=0),this.nodes.forEach(Sp),this.nodes.forEach(jp),this.nodes.forEach(Mp),this.nodes.forEach(Cp),oo.addProjectionMetrics&&oo.addProjectionMetrics(pp)},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 cp)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ma),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=ju(t)&&!Ku(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;z.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=lp(i,250),fp.hasAnimatedSinceResize&&(fp.hasAnimatedSinceResize=!1,this.nodes.forEach(Ap)))})}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()||zp,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Gf(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={...hl(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||Ap(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(),uo(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(Np),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&&vp(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(Ep),this.nodes.forEach(Tp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Dp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Op),this.nodes.forEach(kp),this.nodes.forEach(bp),this.nodes.forEach(xp)):this.nodes.forEach(Dp),this.clearAllSnapshots();let e=V.now();B.delta=ya(0,1e3/60,e-B.timestamp),B.timestamp=e,B.isProcessing=!0,fo.update.process(B),fo.preRender.process(B),fo.render.process(B),B.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,uu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(wp),this.sharedNodes.forEach(Pp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,z.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){z.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!J(this.snapshot.measuredBox.x)&&!J(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&&!Vf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Sd(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)),Up(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(Gp))){let{scroll:e}=this.root;e&&(Md(t.x,e.offset.x),Md(t.y,e.offset.y))}return t}removeElementScroll(e){let t=q();if(yf(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&&yf(t,e),Md(t.x,i.offset.x),Md(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||q();yf(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&&(Md(r.x,-n.scroll.offset.x),Md(r.y,-n.scroll.offset.y)),Sd(n.latestValues)&&Fd(r,n.latestValues,n.layout?.layoutBox)}return Sd(this.latestValues)&&Fd(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=q();yf(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Sd(n.latestValues))continue;let r;n.instance&&(xd(n.latestValues)&&n.updateSnapshot(),r=q(),yf(r,n.measurePageBox())),zf(t,n.latestValues,n.snapshot?.layoutBox,r)}return Sd(this.latestValues)&&zf(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!==B.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=B.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(),jf(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):yf(this.target,this.layout.layoutBox),Od(this.target,this.targetDelta)):yf(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),oo.value&&pp.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||xd(this.parent.latestValues)||Cd(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(),Nf(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),yf(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===B.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;yf(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;jd(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():(bf(this.prevProjectionDelta.x,this.projectionDelta.x),bf(this.prevProjectionDelta.y,this.projectionDelta.y)),kf(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!qf(this.projectionDelta.x,this.prevProjectionDelta.x)||!qf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),oo.value&&pp.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=Xu(),this.projectionDelta=Xu(),this.projectionDeltaWithTransform=Xu()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=Xu();(!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(Rp));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;Fp(a.x,e.x,n),Fp(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Nf(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Lp(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Uf(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=q(),yf(d,this.relativeTarget)),s&&(this.animationValues=i,ep(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&&=(uo(this.pendingAnimation),void 0),this.pendingAnimation=z.update(()=>{fp.hasAnimatedSinceResize=!0,ho.layout++,this.motionValue||=Dl(0),this.motionValue.jump(0,!1),this.currentAnimation=ap(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{ho.layout--},onComplete:()=>{ho.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(hp),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&&Wp(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||q();let t=J(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=J(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}yf(t,n),Fd(t,i),kf(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new dp),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&&_p(`z`,e,r,this.animationValues);for(let t=0;t<mp.length;t++)_p(`rotate${mp[t]}`,e,r,this.animationValues),_p(`skew${mp[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=up(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=up(t?.pointerEvents)||``),this.hasProjected&&!Sd(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Yf(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 Kd){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Kd[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?up(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Tp),this.root.sharedNodes.clear()}}}function bp(e){e.updateLayout()}function xp(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`)Jf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=J(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;vf(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Wp(i,t.layoutBox,n)&&Jf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=J(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=Xu();kf(o,n,t.layoutBox);let s=Xu();a?kf(s,e.applyTransform(r,!0),t.measuredBox):kf(s,n,t.layoutBox);let c=!Vf(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();Nf(s,t.layoutBox,i.layoutBox,o);let c=q();Nf(c,n,a.layoutBox,o),Gf(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 Sp(e){oo.value&&pp.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 Cp(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function wp(e){e.clearSnapshot()}function Tp(e){e.clearMeasurements()}function Ep(e){e.isLayoutDirty=!0,e.updateLayout()}function Dp(e){e.isLayoutDirty=!1}function Op(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function kp(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Ap(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function jp(e){e.resolveTargetDelta()}function Mp(e){e.calcProjection()}function Np(e){e.resetSkewAndRotation()}function Pp(e){e.removeLeadSnapshot()}function Fp(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 Ip(e,t,n,r){e.min=W(t.min,n.min,r),e.max=W(t.max,n.max,r)}function Lp(e,t,n,r){Ip(e.x,t.x,n.x,r),Ip(e.y,t.y,n.y,r)}function Rp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var zp={duration:.45,ease:[.4,0,.1,1]},Bp=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vp=Bp(`applewebkit/`)&&!Bp(`chrome/`)?Math.round:Oa;function Hp(e){e.min=Vp(e.min),e.max=Vp(e.max)}function Up(e){Hp(e.x),Hp(e.y)}function Wp(e,t,n){return e===`position`||e===`preserve-aspect`&&!Df(Kf(t),Kf(n),.2)}function Gp(e){return e!==e.root&&e.scroll?.wasRoot}var Kp=yp({attachResizeListener:(e,t)=>op(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qp={current:void 0},Jp=yp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qp.current){let e=new Kp({});e.mount(window),e.setOptions({layoutScroll:!0}),qp.current=e}return qp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Yp=(0,i.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Xp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Zp(...e){return t=>{let n=!1,r=e.map(e=>{let r=Xp(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():Xp(e[t],null)}}}}function Qp(...e){return i.useCallback(Zp(...e),e)}var $p=class extends i.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(lu(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=lu(e)&&e.offsetWidth||0,r=lu(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 em({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)(Yp),f=Qp(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)($p,{isPresent:t,childRef:l,sizeRef:u,pop:s,children:s===!1?e:i.cloneElement(e,{ref:f})})}var tm=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=ma(nm),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)(em,{pop:c===`popLayout`,isPresent:n,anchorX:l,anchorY:u,root:d,children:e}),(0,a.jsx)(ga.Provider,{value:h,children:e})};function nm(){return new Map}function rm(e=!0){let t=(0,i.useContext)(ga);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 im=e=>e.key||``;function am(e){let t=[];return i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&t.push(e)}),t}var om=({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]=rm(c),m=(0,i.useMemo)(()=>am(e),[e]),h=c&&!f?[]:m.map(im),g=(0,i.useRef)(!0),_=(0,i.useRef)(m),v=ma(()=>new Map),y=(0,i.useRef)(new Set),[b,x]=(0,i.useState)(m),[S,C]=(0,i.useState)(m);ha(()=>{g.current=!1,_.current=m;for(let e=0;e<S.length;e++){let t=im(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=im(n);h.includes(r)||(e.splice(t,0,n),w.push(n))}return s===`wait`&&w.length&&(e=w),C(am(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)(pa);return(0,a.jsx)(a.Fragment,{children:S.map(e=>{let i=im(e),b=c&&!f?!1:m===S||h.includes(i);return(0,a.jsx)(tm,{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)})})},sm=(0,i.createContext)({strict:!1}),cm={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`]},lm=!1;function um(){if(lm)return;let e={};for(let t in cm)e[t]={isEnabled:e=>cm[t].some(t=>!!e[t])};fd(e),lm=!0}function dm(){return um(),pd()}function fm(e){let t=dm();for(let n in e)t[n]={...t[n],...e[n]};fd(t)}var pm=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 mm(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||pm.has(e)}var hm=e.r({default:()=>gm}),gm,_m=e.n((()=>{throw gm={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),vm=e=>!mm(e);function ym(e){typeof e==`function`&&(vm=t=>t.startsWith(`on`)?!mm(t):e(t))}try{ym((_m(),e.i(hm)).default)}catch{}function bm(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||K(e[i])||(vm(i)||n===!0&&mm(i)||!t&&!mm(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var xm=(0,i.createContext)({});function Sm(e,t){if(rd(e)){let{initial:t,animate:n}=e;return{initial:t===!1||ed(t)?t:void 0,animate:ed(n)?n:void 0}}return e.inherit===!1?{}:t}function Cm(e){let{initial:t,animate:n}=Sm(e,(0,i.useContext)(xm));return(0,i.useMemo)(()=>({initial:t,animate:n}),[wm(t),wm(n)])}function wm(e){return Array.isArray(e)?e.join(` `):e}var Tm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Em(e,t,n){for(let r in t)!K(t[r])&&!qd(r,n)&&(e[r]=t[r])}function Dm({transformTemplate:e},t){return(0,i.useMemo)(()=>{let n=Tm();return Vd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Om(e,t){let n=e.style||{},r={};return Em(r,n,e),Object.assign(r,Dm(e,t)),r}function km(e,t){let n={},r=Om(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 Am=()=>({...Tm(),attrs:{}});function jm(e,t,n,r){let a=(0,i.useMemo)(()=>{let n=Am();return tf(n,t,rf(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Em(t,e.style,e),a.style={...t,...a.style}}return a}var Mm=[`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 Nm(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Mm.indexOf(e)>-1||/[A-Z]/u.test(e))}function Pm(e,t,n,{latestValues:r},a,o=!1,s){let c=(s??Nm(e)?jm:km)(t,r,a,e),l=bm(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 Fm({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Im(n,r,i,e),renderState:t()}}function Im(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=up(a[e]);let{initial:o,animate:s}=e,c=rd(e),l=id(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`&&!$u(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=bl(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 Lm=e=>(t,n)=>{let r=(0,i.useContext)(xm),a=(0,i.useContext)(ga),o=()=>Fm(e,t,r,a);return n?o():ma(o)},Rm=Lm({scrapeMotionValuesFromProps:Jd,createRenderState:Tm}),zm=Lm({scrapeMotionValuesFromProps:of,createRenderState:Am}),Bm=Symbol.for(`motionComponentSymbol`);function Vm(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 Hm=(0,i.createContext)({});function Um(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Wm(e,t,n,r,a,o){let{visualElement:s}=(0,i.useContext)(xm),c=(0,i.useContext)(sm),l=(0,i.useContext)(ga),u=(0,i.useContext)(Yp),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)(Hm);h&&!h.projection&&a&&(h.type===`html`||h.type===`svg`)&&Gm(p.current,n,a,g);let _=(0,i.useRef)(!1);(0,i.useInsertionEffect)(()=>{h&&_.current&&h.update(n,l)});let v=n[Fl],y=(0,i.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return ha(()=>{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 Gm(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:Km(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Um(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Km(e){if(e)return e.options.allowProjection===!1?Km(e.parent):e.projection}function qm(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&fm(r);let s=n?n===`svg`:Nm(e),c=s?zm:Rm;function l(n,l){let u,d={...(0,i.useContext)(Yp),...n,layoutId:Jm(n)},{isStatic:f}=d,p=Cm(n),m=c(n,f);if(!f&&typeof window<`u`){Ym(d,r);let t=Xm(d);u=t.MeasureLayout,p.visualElement=Wm(e,m,d,o,t.ProjectionNode,s)}return(0,a.jsxs)(xm.Provider,{value:p,children:[u&&p.visualElement?(0,a.jsx)(u,{visualElement:p.visualElement,...d}):null,Pm(e,n,Vm(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[Bm]=e,u}function Jm({layoutId:e}){let t=(0,i.useContext)(pa).id;return t&&e!==void 0?t+`-`+e:e}function Ym(e,t){let n=(0,i.useContext)(sm).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?xa(!1,t,`lazy-strict-mode`):Sa(!1,t,`lazy-strict-mode`)}}function Xm(e){let{drag:t,layout:n}=dm();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Zm(e,t){if(typeof Proxy>`u`)return qm;let n=new Map,r=(n,r)=>qm(n,r,e,t);return new Proxy((e,t)=>(process.env.NODE_ENV!==`production`&&Ia(!1,`motion() is deprecated. Use motion.create() instead.`),r(e,t)),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,qm(a,void 0,e,t)),n.get(a))})}var Qm=(e,t)=>t.isSVG??Nm(e)?new sf(t):new Xd(t,{allowProjection:e!==i.Fragment}),$m=class extends gd{constructor(e){super(e),e.animationState||=mf(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();$u(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?.()}},eh=0,th={animation:{Feature:$m},exit:{Feature:class extends gd{constructor(){super(...arguments),this.id=eh++,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=xl(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 nh(e){return{point:{x:e.pageX,y:e.pageY}}}var rh=e=>t=>yu(t)&&e(t,nh(t));function ih(e,t,n,r){return op(e,t,rh(n),r)}var ah=({current:e})=>e?e.ownerDocument.defaultView:null,oh=(e,t)=>Math.abs(e-t);function sh(e,t){let n=oh(e.x,t.x),r=oh(e.y,t.y);return Math.sqrt(n**2+r**2)}var ch=new Set([`auto`,`scroll`]),lh=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=uh(this.lastRawMoveEventInfo,this.transformPagePoint));let e=fh(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=sh(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=B;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=uh(t,this.transformPagePoint),z.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=fh(e.type===`pointercancel`?this.lastMoveEventInfo:uh(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!yu(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=uh(nh(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=B;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,fh(s,this.history)),this.removeListeners=Aa(ih(this.contextWindow,`pointermove`,this.handlePointerMove),ih(this.contextWindow,`pointerup`,this.handlePointerUp),ih(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ch.has(e.overflowX)||ch.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),z.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),uo(this.updatePoint)}};function uh(e,t){return t?{point:t(e.point)}:e}function dh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fh({point:e},t){return{point:e,delta:dh(e,mh(t)),offset:dh(e,ph(t)),velocity:hh(t,.1)}}function ph(e){return e[0]}function mh(e){return e[e.length-1]}function hh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=mh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>R(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>R(t)*2&&(r=e[1]);let a=Na(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 gh(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 _h(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 vh(e,{top:t,left:n,bottom:r,right:i}){return{x:_h(e.x,n,i),y:_h(e.y,t,r)}}function yh(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 bh(e,t){return{x:yh(e.x,t.x),y:yh(e.y,t.y)}}function xh(e,t){let n=.5,r=J(e),i=J(t);return i>r?n=ja(t.min,t.max-r,e.min):r>i&&(n=ja(e.min,e.max-i,t.min)),ya(0,1,n)}function Sh(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 Ch=.35;function wh(e=Ch){return e===!1?e=0:e===!0&&(e=Ch),{x:Th(e,`left`,`right`),y:Th(e,`top`,`bottom`)}}function Th(e,t,n){return{min:Eh(e,t),max:Eh(e,n)}}function Eh(e,t){return typeof e==`number`?e:e[t]||0}var Dh=new WeakMap,Oh=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(nh(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=mu(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),Jf(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Ro.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=J(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&z.update(()=>i(e,t),!1,!0),Nl(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=Mh(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&&z.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 lh(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:ah(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&&z.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||!jh(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=gh(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&&Um(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=vh(n.layoutBox,e):this.constraints=!1,this.elastic=wh(t),r!==this.constraints&&!Um(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Jf(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Sh(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Um(e))return!1;let n=e.current;Sa(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=Ld(n,r.root,this.visualElement.getTransformPagePoint()),a=bh(r.layout.layoutBox,i);if(t){let e=t(vd(a));this.hasMutatedConstraints=!!e,e&&(a=_d(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Jf(o=>{if(!jh(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 Nl(this.visualElement,e),n.start(vl(e,n,0,t,this.visualElement,!1))}stopAnimation(){Jf(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){Jf(t=>{let{drag:n}=this.getProps();if(!jh(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(!Um(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Jf(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=xh({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(),Jf(t=>{if(!jh(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;Dh.set(this.visualElement,this);let e=this.visualElement.current,t=ih(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Cu(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Um(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Ah(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),z.read(r);let o=op(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Jf(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=Ch,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function kh(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Ah(e,t,n){let r=Gu(e,kh(n)),i=Gu(t,kh(n));return()=>{r(),i()}}function jh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Mh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Nh=class extends gd{constructor(e){super(e),this.removeGroupControls=Oa,this.removeListeners=Oa,this.controls=new Oh(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Oa}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()}},Ph=e=>(t,n)=>{e&&z.update(()=>e(t,n),!1,!0)},Fh=class extends gd{constructor(){super(...arguments),this.removePointerDownListener=Oa}onPointerDown(e){this.session=new lh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ah(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ph(e),onStart:Ph(t),onMove:Ph(n),onEnd:(e,t)=>{delete this.session,r&&z.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=ih(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Ih=!1,Lh=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),Ih&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),fp.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}),Ih=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||z.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(),uu.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ih=!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 Rh(e){let[t,n]=rm(),r=(0,i.useContext)(pa);return(0,a.jsx)(Lh,{...e,layoutGroup:r,switchLayoutGroup:(0,i.useContext)(Hm),isPresent:t,safeToRemove:n})}var zh={pan:{Feature:Fh},drag:{Feature:Nh,ProjectionNode:Jp,MeasureLayout:Rh}};function Bh(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&z.postRender(()=>i(t,nh(t)))}var Vh=class extends gd{mount(){let{current:e}=this.node;e&&(this.unmount=_u(e,(e,t)=>(Bh(this.node,t,`Start`),e=>Bh(this.node,e,`End`))))}unmount(){}},Hh=class extends gd{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=Aa(op(this.node.current,`focus`,()=>this.onFocus()),op(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Uh(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&&z.postRender(()=>i(t,nh(t)))}var Wh=class extends gd{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Au(e,(e,t)=>(Uh(this.node,t,`Start`),(e,{success:t})=>Uh(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Gh=new WeakMap,Kh=new WeakMap,qh=e=>{let t=Gh.get(e.target);t&&t(e)},Jh=e=>{e.forEach(qh)};function Yh({root:e,...t}){let n=e||document;Kh.has(n)||Kh.set(n,{});let r=Kh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Jh,{root:e,...t})),r[i]}function Xh(e,t,n){let r=Yh(t);return Gh.set(e,n),r.observe(e),()=>{Gh.delete(e),r.unobserve(e)}}var Zh={some:0,all:1},Qh=class extends gd{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:Zh[r]};this.stopObserver=Xh(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($h(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function $h({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var eg={inView:{Feature:Qh},tap:{Feature:Wh},focus:{Feature:Hh},hover:{Feature:Vh}},tg={layout:{ProjectionNode:Jp,MeasureLayout:Rh}},ng=Zm({...th,...eg,...zh,...tg},Qm);function rg(){!sd.current&&ld();let[e]=(0,i.useState)(od.current);return process.env.NODE_ENV!==`production`&&Ia(e!==!0,`You have Reduced Motion enabled on your device. Animations may not appear as expected.`,`reduced-motion-disabled`),e}var ig=`60dvh`,ag=(0,i.createContext)(!1);function og(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=og(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function sg(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=og(e))&&(r&&(r+=` `),r+=t);return r}var cg=(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},lg=(e,t)=>({classGroupId:e,validator:t}),ug=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),dg=`-`,fg=[],pg=`arbitrary..`,mg=e=>{let t=_g(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return gg(e);let n=e.split(dg);return hg(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?cg(i,t):t:i||fg}return n[e]||fg}}},hg=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=hg(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(dg):e.slice(t).join(dg),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},gg=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?pg+r:void 0})(),_g=e=>{let{theme:t,classGroups:n}=e;return vg(n,t)},vg=(e,t)=>{let n=ug();for(let r in e){let i=e[r];yg(i,n,r,t)}return n},yg=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];bg(i,t,n,r)}},bg=(e,t,n,r)=>{if(typeof e==`string`){xg(e,t,n);return}if(typeof e==`function`){Sg(e,t,n,r);return}Cg(e,t,n,r)},xg=(e,t,n)=>{let r=e===``?t:wg(t,e);r.classGroupId=n},Sg=(e,t,n,r)=>{if(Tg(e)){yg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(lg(n,e))},Cg=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];yg(o,wg(t,a),n,r)}},wg=(e,t)=>{let n=e,r=t.split(dg),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ug(),n.nextPart.set(t,i)),n=i}return n},Tg=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Eg=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)}}},Dg=`!`,Og=`:`,kg=[],Ag=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),jg=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===Og){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(Dg)?(c=s.slice(0,-1),l=!0):s.startsWith(Dg)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Ag(t,l,c,u)};if(t){let e=t+Og,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ag(kg,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Mg=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}},Ng=e=>({cache:Eg(e.cacheSize),parseClassName:jg(e),sortModifiers:Mg(e),...mg(e)}),Pg=/\s+/,Fg=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Pg),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+Dg: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},Ig=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Lg(n))&&(i&&(i+=` `),i+=r);return i},Lg=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Lg(e[r]))&&(n&&(n+=` `),n+=t);return n},Rg=(e,...t)=>{let n,r,i,a,o=o=>(n=Ng(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=Fg(e,n);return i(e,a),a};return a=o,(...e)=>a(Ig(...e))},zg=[],Y=e=>{let t=t=>t[e]||zg;return t.isThemeGetter=!0,t},Bg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Vg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Hg=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ug=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wg=/\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$/,Gg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Kg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jg=e=>Hg.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),Yg=e=>!!e&&Number.isInteger(Number(e)),Xg=e=>e.endsWith(`%`)&&X(e.slice(0,-1)),Zg=e=>Ug.test(e),Qg=()=>!0,$g=e=>Wg.test(e)&&!Gg.test(e),e_=()=>!1,t_=e=>Kg.test(e),n_=e=>qg.test(e),r_=e=>!Z(e)&&!Q(e),i_=e=>y_(e,C_,e_),Z=e=>Bg.test(e),a_=e=>y_(e,w_,$g),o_=e=>y_(e,T_,X),s_=e=>y_(e,D_,Qg),c_=e=>y_(e,E_,e_),l_=e=>y_(e,x_,e_),u_=e=>y_(e,S_,n_),d_=e=>y_(e,O_,t_),Q=e=>Vg.test(e),f_=e=>b_(e,w_),p_=e=>b_(e,E_),m_=e=>b_(e,x_),h_=e=>b_(e,C_),g_=e=>b_(e,S_),__=e=>b_(e,O_,!0),v_=e=>b_(e,D_,!0),y_=(e,t,n)=>{let r=Bg.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},b_=(e,t,n=!1)=>{let r=Vg.exec(e);return r?r[1]?t(r[1]):n:!1},x_=e=>e===`position`||e===`percentage`,S_=e=>e===`image`||e===`url`,C_=e=>e===`length`||e===`size`||e===`bg-size`,w_=e=>e===`length`,T_=e=>e===`number`,E_=e=>e===`family-name`,D_=e=>e===`number`||e===`weight`,O_=e=>e===`shadow`,k_=Rg(()=>{let e=Y(`color`),t=Y(`font`),n=Y(`text`),r=Y(`font-weight`),i=Y(`tracking`),a=Y(`leading`),o=Y(`breakpoint`),s=Y(`container`),c=Y(`spacing`),l=Y(`radius`),u=Y(`shadow`),d=Y(`inset-shadow`),f=Y(`text-shadow`),p=Y(`drop-shadow`),m=Y(`blur`),h=Y(`perspective`),g=Y(`aspect`),_=Y(`ease`),v=Y(`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(),Q,Z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Q,Z,c],T=()=>[Jg,`full`,`auto`,...w()],ee=()=>[Yg,`none`,`subgrid`,Q,Z],E=()=>[`auto`,{span:[`full`,Yg,Q,Z]},Yg,Q,Z],D=()=>[Yg,`auto`,Q,Z],te=()=>[`auto`,`min`,`max`,`fr`,Q,Z],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],O=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],k=()=>[`auto`,...w()],re=()=>[Jg,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ie=()=>[Jg,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ae=()=>[Jg,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],A=()=>[e,Q,Z],j=()=>[...b(),m_,l_,{position:[Q,Z]}],M=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,h_,i_,{size:[Q,Z]}],N=()=>[Xg,f_,a_],P=()=>[``,`none`,`full`,l,Q,Z],F=()=>[``,X,f_,a_],I=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],L=()=>[X,Xg,m_,l_],ce=()=>[``,`none`,m,Q,Z],le=()=>[`none`,X,Q,Z],ue=()=>[`none`,X,Q,Z],de=()=>[X,Q,Z],fe=()=>[Jg,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Zg],breakpoint:[Zg],color:[Qg],container:[Zg],"drop-shadow":[Zg],ease:[`in`,`out`,`in-out`],font:[r_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Zg],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Zg],shadow:[Zg],spacing:[`px`,X],text:[Zg],"text-shadow":[Zg],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Jg,Z,Q,g]}],container:[`container`],columns:[{columns:[X,Z,Q,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:[Yg,`auto`,Q,Z]}],basis:[{basis:[Jg,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[X,Jg,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,X,Q,Z]}],shrink:[{shrink:[``,X,Q,Z]}],order:[{order:[Yg,`first`,`last`,`none`,Q,Z]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...O(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...O()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...O(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...O(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...O(),`baseline`]}],"place-self":[{"place-self":[`auto`,...O()]}],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:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:re()}],"inline-size":[{inline:[`auto`,...ie()]}],"min-inline-size":[{"min-inline":[`auto`,...ie()]}],"max-inline-size":[{"max-inline":[`none`,...ie()]}],"block-size":[{block:[`auto`,...ae()]}],"min-block-size":[{"min-block":[`auto`,...ae()]}],"max-block-size":[{"max-block":[`none`,...ae()]}],w:[{w:[s,`screen`,...re()]}],"min-w":[{"min-w":[s,`screen`,`none`,...re()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...re()]}],h:[{h:[`screen`,`lh`,...re()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...re()]}],"max-h":[{"max-h":[`screen`,`lh`,...re()]}],"font-size":[{text:[`base`,n,f_,a_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,v_,s_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Xg,Z]}],"font-family":[{font:[p_,c_,t]}],"font-features":[{"font-features":[Z]}],"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,Q,Z]}],"line-clamp":[{"line-clamp":[X,`none`,Q,o_]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Q,Z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Q,Z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...I(),`wavy`]}],"text-decoration-thickness":[{decoration:[X,`from-font`,`auto`,Q,a_]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[X,`auto`,Q,Z]}],"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`,Q,Z]}],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`,Q,Z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Yg,Q,Z],radial:[``,Q,Z],conic:[Yg,Q,Z]},g_,u_]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":F()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...I(),`hidden`,`none`]}],"divide-style":[{divide:[...I(),`hidden`,`none`]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...I(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[X,Q,Z]}],"outline-w":[{outline:[``,X,f_,a_]}],"outline-color":[{outline:A()}],shadow:[{shadow:[``,`none`,u,__,d_]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":[`none`,d,__,d_]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:F()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[X,a_]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":[`none`,f,__,d_]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[X,Q,Z]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"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":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Q,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Q,Z]}],filter:[{filter:[``,`none`,Q,Z]}],blur:[{blur:ce()}],brightness:[{brightness:[X,Q,Z]}],contrast:[{contrast:[X,Q,Z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,__,d_]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:[``,X,Q,Z]}],"hue-rotate":[{"hue-rotate":[X,Q,Z]}],invert:[{invert:[``,X,Q,Z]}],saturate:[{saturate:[X,Q,Z]}],sepia:[{sepia:[``,X,Q,Z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Q,Z]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[X,Q,Z]}],"backdrop-contrast":[{"backdrop-contrast":[X,Q,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,X,Q,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,Q,Z]}],"backdrop-invert":[{"backdrop-invert":[``,X,Q,Z]}],"backdrop-opacity":[{"backdrop-opacity":[X,Q,Z]}],"backdrop-saturate":[{"backdrop-saturate":[X,Q,Z]}],"backdrop-sepia":[{"backdrop-sepia":[``,X,Q,Z]}],"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`,Q,Z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[X,`initial`,Q,Z]}],ease:[{ease:[`linear`,`initial`,_,Q,Z]}],delay:[{delay:[X,Q,Z]}],animate:[{animate:[`none`,v,Q,Z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Q,Z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[Q,Z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":[`translate-none`],accent:[{accent:A()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:A()}],"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`,Q,Z]}],"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`,Q,Z]}],fill:[{fill:[`none`,...A()]}],"stroke-w":[{stroke:[X,f_,a_,o_]}],stroke:[{stroke:[`none`,...A()]}],"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 A_(...e){return k_(sg(e))}var j_=i.default.forwardRef(function({className:e=``,onInput:t,...n},r){let o=(0,i.useRef)(null),{value:s,placeholder:c}=n,l=(0,i.useCallback)(e=>{o.current=e,typeof r==`function`?r(e):r&&(r.current=e)},[r]),u=(0,i.useCallback)(()=>{let e=o.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)(u,[u,s,c]),(0,i.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(u);return e.parentElement&&t.observe(e.parentElement),()=>t.disconnect()},[u]),(0,a.jsx)(`textarea`,{ref:l,...n,onInput:e=>{u(),t?.(e)},className:`${e} resize-none overflow-hidden`,rows:n.rows||1})}),M_=()=>typeof document>`u`?null:document.querySelector(`.firebase-os`)||document.body;function N_({value:e=``,options:t,onChange:r,label:o,disabled:s,variant:c=`default`,multiple:l=!1,values:d,placeholder:f,footer:p,compact:m=!1,dense:h=!1,direction:g,portal:_,empty:v=`Nothing to choose from yet`,ariaLabel:y,className:b=``}){let x=(0,i.useContext)(ag),S=g??(x?`auto`:`up`),C=_??x,[w,T]=(0,i.useState)(!1),[ee,E]=(0,i.useState)(S===`down`?`down`:`up`),[D,te]=(0,i.useState)(null),ne=(0,i.useRef)(null),O=(0,i.useRef)(null),k=(0,i.useRef)(null);(0,i.useEffect)(()=>{function e(e){let t=e.target;ne.current?.contains(t)||k.current?.contains(t)||T(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,i.useLayoutEffect)(()=>{if(!w)return;let e=()=>{let e=O.current;if(!e)return;let t=e.getBoundingClientRect();if(te({top:t.top,left:t.left,width:t.width,height:t.height}),S===`auto`){let e=(typeof window<`u`?window.innerHeight:0)-t.bottom;E(e<260&&t.top>e?`up`:`down`)}else E(S)};return e(),window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[w,S]);let re=l&&d||[],ie=t=>l?re.includes(t):e===t,ae=t.find(t=>t.value===e)||(f==null?t[0]:void 0),A=t.filter(e=>re.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:ae?.label??f,M=!s,oe=!t.some(e=>e.value!==``&&!e.disabled),N=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!w)return;let e=N.current,t=e?.querySelector(`[aria-selected="true"]`);!e||!t||(e.scrollTop=t.offsetTop-e.clientHeight/2+t.clientHeight/2)},[w]);let P=(0,a.jsx)(ng.div,{ref:k,role:`listbox`,"aria-label":y||o,"aria-multiselectable":l||void 0,initial:{opacity:0,y:ee===`up`?5:-5,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:ee===`up`?5:-5,scale:.98},transition:{duration:.15},className:`z-[99999] glass-popover overflow-hidden ${C?`fixed`:`absolute left-0 w-full ${ee===`up`?`bottom-[calc(100%+8px)]`:`top-[calc(100%+8px)]`}`}`,style:{borderRadius:`var(--input-radius, 0.75rem)`,...C&&D?(()=>{let e=Math.max(D.width,m?180:0),t=(typeof window<`u`?window.innerWidth:D.left+e)-e-8;return{left:Math.max(8,Math.min(D.left,t)),width:e,...ee===`up`?{bottom:(typeof window<`u`?window.innerHeight:0)-D.top+8}:{top:D.top+D.height+8}}})():{}},children:(0,a.jsxs)(`div`,{ref:N,className:`max-h-60 overflow-y-auto no-scrollbar p-1`,children:[t.map(e=>(0,a.jsxs)(`div`,{role:`option`,"aria-selected":ie(e.value),"aria-disabled":e.disabled||void 0,onClick:()=>{e.disabled||(r(e.value),l||T(!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`:ie(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}),ie(e.value)&&!e.disabled&&(0,a.jsx)(n.sn,{className:`w-3.5 h-3.5 shrink-0 text-accent`})]},e.value)),oe&&!p&&(0,a.jsx)(`div`,{className:`px-3 py-2.5 text-foreground/50 ${h?`text-[13.5px]`:`text-[13px]`}`,children:v}),p]})}),F=C?M_():null,I=(0,a.jsx)(om,{children:w&&P});return(0,a.jsxs)(`div`,{className:`flex flex-col relative ${m?`w-auto`:`w-full`} ${s?`opacity-50 pointer-events-none`:``} ${b}`,ref:ne,children:[o&&(0,a.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/70 select-none mb-2`,children:o}),(0,a.jsxs)(`div`,{className:`relative ${m?`w-auto`:`w-full`}`,children:[(0,a.jsxs)(`div`,{ref:O,role:`button`,tabIndex:s?-1:0,"aria-haspopup":`listbox`,"aria-expanded":w,"aria-label":y||o,"aria-disabled":s||void 0,onClick:()=>{M&&T(!w)},onKeyDown:e=>{M&&((e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(e=>!e)),e.key===`Escape`&&w&&(e.preventDefault(),T(!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]`} ${M?`cursor-pointer`:`cursor-default`} ${c===`ghost`?`hover:bg-foreground/5 bg-transparent`:`border glass-panel ${m?``:`shadow-sm`} ${w?`border-accent select-open`:`border-[var(--panel-border)]`}`}`,style:{borderRadius:`var(--input-radius, 0.75rem)`},children:[(0,a.jsx)(`span`,{className:`truncate`,children:j}),(0,a.jsx)(n.on,{className:`w-4 h-4 text-foreground/50 shrink-0 transition-transform duration-300 ${w?`rotate-180`:``}`})]}),!(C&&F)&&I]}),C&&F?(0,u.createPortal)(I,F):null]})}var P_=e=>!!(e.width||e.height||e.size||e.bg),F_=32,I_=32,L_=24;function R_(e,t){if(!e||e.length<t*t*4||t<3)return{};let n=(e,n)=>(n*t+e)*4,r=[];for(let e=0;e<t;e++)r.push(n(e,0),n(e,t-1));for(let e=1;e<t-1;e++)r.push(n(0,e),n(t-1,e));if(r.filter(t=>e[t+3]<I_).length>r.length/2)return{bg:`clear`};let i=r.filter(t=>e[t+3]>=I_);if(!i.length)return{};let a=[0,1,2].map(t=>i.reduce((n,r)=>n+e[r+t],0)/i.length);return Math.max(...i.map(t=>Math.max(...[0,1,2].map(n=>Math.abs(e[t+n]-a[n])))))>L_?{bg:`busy`}:{bg:`plain`,bgColour:z_(a[0],a[1],a[2])}}function z_(e,t,n){let r=Math.max(e,t,n),i=Math.min(e,t,n),a=(r+i)/2/255,o=(r-i)/255,s=o===0||a===0||a===1?0:o/(1-Math.abs(2*a-1));if(o<.08||s<.12)return a>.92?`white`:a>.72?`light grey`:a>.4?`grey`:a>.14?`dark grey`:`black`;let c=r-i,l=(60*(r===e?((t-n)/c+6)%6:r===t?(n-e)/c+2:(e-t)/c+4)+360)%360,u=l<15?`red`:l<45?`orange`:l<70?`yellow`:l<165?`green`:l<200?`teal`:l<255?`blue`:l<290?`purple`:l<335?`pink`:`red`;if(u===`orange`||u===`yellow`){if(a<.4)return`brown`;if(a>.82)return`cream`}return a>.78?`pale ${u}`:a<.3?`dark ${u}`:u}var B_=[[21,9],[16,9],[3,2],[5,4],[4,3],[1,1],[3,4],[4,5],[2,3],[9,16]];function V_(e,t){if(!e||!t)return``;let n=e/t,r=n>1.06?`wide`:n<.94?`tall`:`square`,i=B_.find(([e,t])=>e!==t&&Math.abs(n-e/t)<=e/t*.03);return i?`${r} ${i[0]}:${i[1]}`:r}function H_(e){if(!e||e<0)return``;if(e<1024)return`${Math.round(e)} bytes`;let t=e/1024;if(t<1024)return`${Math.round(t)} KB`;let n=t/1024;return`${n<10?Number(n.toFixed(1)):Math.round(n)} MB`}function U_(e){return e.bg===`clear`?`see-through background`:e.bg===`plain`?e.bgColour?`plain ${e.bgColour} background`:`plain background`:e.bg===`busy`?`picture to the edges`:``}function W_(e){return[e.width&&e.height?`${e.width} × ${e.height}`:``,V_(e.width,e.height),H_(e.size),U_(e)].filter(Boolean).join(`, `)}function G_(e){return[e.width&&e.height?`${e.width} × ${e.height}`:``,H_(e.size)].filter(Boolean).join(` · `)}var K_=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 q_(t);return{source:e,width:e.naturalWidth,height:e.naturalHeight,done:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}},q_=(e,t)=>new Promise((n,r)=>{let i=new Image;t&&(i.crossOrigin=t),i.onload=()=>n(i),i.onerror=()=>r(Error(`That picture could not be read.`)),i.src=e}),J_=e=>{try{if(typeof document>`u`)return{};let t=document.createElement(`canvas`);t.width=F_,t.height=F_;let n=t.getContext(`2d`,{willReadFrequently:!0});return!n||typeof n.getImageData!=`function`?{}:(n.drawImage(e,0,0,F_,F_),R_(n.getImageData(0,0,F_,F_).data,F_))}catch{return{}}},Y_=(e,t,n)=>t&&n?{width:t,height:n,...J_(e)}:{},X_=4e3,Z_={},Q_=(e,t)=>new Promise(n=>{let r=!1,i=e=>{r||(r=!0,n(e))},a=setTimeout(()=>i(t),X_),o=e=>{clearTimeout(a),i(e)};e.then(o,()=>o(t))}),$_=async e=>{let{source:t,width:n,height:r,done:i}=await K_(e);try{return Y_(t,n,r)}finally{i()}},ev=async(e,t)=>{let n=await q_(e,t);return Y_(n,n.naturalWidth,n.naturalHeight)};async function tv(e){let t=e?.size?{size:e.size}:{};return!e||!/^image\//i.test(e.type||``)?t:{...t,...await Q_($_(e),{})}}async function nv(e){return!e||!/^image\//i.test(e.type||``)||typeof createImageBitmap!=`function`?{}:Q_((async()=>{let t=await createImageBitmap(e),{width:n,height:r}=t;return t.close?.(),n&&r?{width:n,height:r}:{}})(),{})}async function rv(e){if(!e||typeof Image>`u`)return{};let t=await Q_(ev(e,`anonymous`),Z_);return t===Z_?{}:P_(t)?t:Q_(ev(e),{})}var iv=3600*24*365,av=3600,ov=/^user_avatars\//,sv=/^pub_/;function cv(e){let t=sv.test(e.replace(/^\/+/,``))?`public`:`private`;return ov.test(e.replace(/^\/+/,``))?`${t}, max-age=${av}`:`${t}, max-age=${iv}, immutable`}function lv(e,t){return{cacheControl:cv(e),...t?{customMetadata:t}:{}}}var uv=`pub_files`,dv=(e,t={})=>`${Date.now()}_${r.h(t.width,t.height)}${(e||`file`).replace(/[^a-zA-Z0-9.-]/g,`_`)}`;async function fv(e,t,n){let i=async(e,r)=>{try{if(!e)return``;let i=await r(t);if(!i)return``;let a=(0,l.ref)(_,e);return await(0,l.uploadBytes)(a,i,lv(e,n)),await(0,l.getDownloadURL)(a)}catch{return``}},a=await i(r.f(e),r.p),o=await i(r.v(e),r.y);return{...o?{small:o}:{},...a?{medium:a}:{}}}async function pv(e){e&&await Promise.all([r.v(e),r.f(e)].filter(Boolean).map(async e=>{try{await(0,l.deleteObject)((0,l.ref)(_,e))}catch{}}))}async function mv(e,t){if(!t)throw Error(`Sign in again before uploading.`);let n=await r.g(e),i=`${uv}/${dv(n.name,await nv(n))}`,a=(0,l.ref)(_,i);await(0,l.uploadBytes)(a,n,lv(i,{ownerId:t.uid}));let o=await(0,l.getDownloadURL)(a),s=await fv(i,n,{ownerId:t.uid});return await(0,c.addDoc)((0,c.collection)(g,uv),{fileName:n.name,fileType:n.type||`unknown`,fileSize:n.size,downloadURL:o,...s.small?{smallURL:s.small}:{},...s.medium?{mediumURL:s.medium}:{},storagePath:i,uid:t.uid,uploaderEmail:t.email||``,createdAt:(0,c.serverTimestamp)()}),{url:o,file:n,...s}}var hv=async(e,t)=>(await mv(e,t)).url,gv=`pub_form_uploads`;async function _v(e,t){let n=await r.g(e);if(n.size>=10485760)throw Error(`That file is over 10 MB. Try a smaller one.`);let i=Math.random().toString(36).slice(2,8),a=`${gv}/${Date.now()}_${i}_${(n.name||`file`).replace(/[^a-zA-Z0-9.-]/g,`_`)}`,o=(0,l.ref)(_,a);return await(0,l.uploadBytes)(o,n,lv(a,t?{ownerId:t.uid}:void 0)),(0,l.getDownloadURL)(o)}var vv=e=>typeof e==`string`?e.split(/\s+/).filter(Boolean):[],yv=e=>e.join(`
|
|
11
|
+
`),bv=e=>/^https?:\/\/\S+$/.test(e)&&RegExp(`(/|%2F)pub_form_uploads(/|%2F)`,`i`).test(e),xv=e=>{let t=vv(e);return t.length>0&&t.every(bv)};function Sv(e){try{let t=new URL(e);return r.b(decodeURIComponent(t.pathname.split(`/o/`)[1]||t.pathname).split(`/`).pop()||``).replace(/^\d+_[a-z0-9]+_/,``)||t.hostname||`Attached file`}catch{return`Attached file`}}var Cv=e=>e?.code===`storage/unauthorized`?`You do not have permission to upload here.`:Ce(e,`That upload did not work. Try again.`),wv=(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)},Tv=e=>Array.from(e.dataTransfer?.types||[]).includes(`Files`);function Ev({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||!Tv(e)||(e.preventDefault(),c.current+=1,s(!0))},onDragOver:e=>{a||!Tv(e)||e.preventDefault()},onDragLeave:e=>{Tv(e)&&(c.current=Math.max(0,c.current-1),c.current===0&&s(!1))},onDrop:i=>{if(c.current=0,s(!1),a||!Tv(i))return;i.preventDefault();let o=Array.from(i.dataTransfer.files||[]),l=o.filter(e=>wv(e,n)),u=o.filter(e=>!wv(e,n));u.length&&t?.(u);let d=r?l:l.slice(0,1);d.length&&e(d)}}}}var Dv=new Set,Ov=e=>!!e&&Dv.has(e),kv=e=>{e&&Dv.add(e)},Av=new Map,jv=e=>e?Av.get(e)||r.m(Nv(e)||e):void 0,Mv=(e,t,n)=>{e&&t>0&&n>0&&Av.set(e,{width:t,height:n})},Nv=e=>{try{let t=new URL(e).pathname.split(`/o/`)[1];return t?decodeURIComponent(t):``}catch{return``}},Pv=(e,t)=>{let n=Nv(e);if(!n)return``;let r=n.lastIndexOf(`/`);return`${r>=0?n.slice(0,r+1):``}${t(n.slice(r+1))}`},Fv=e=>Pv(e,r._),Iv=e=>Pv(e,r.d),Lv=(e,t)=>t===`sm`?Fv(e):t===`md`?Iv(e):Nv(e);function Rv(e,t){if(!e||t===`full`||!r.c(e))return``;let n=Nv(e);if(!n.startsWith(`pub_`))return``;let i=Lv(e,t);if(!i||i===n)return``;try{let t=new URL(e);return t.pathname=`${t.pathname.split(`/o/`)[0]}/o/${encodeURIComponent(i)}`,t.search=`?alt=media`,t.toString()}catch{return``}}var zv=`none`,Bv=new Map,Vv=new Map,Hv=`fbos_small_pictures`,Uv=()=>{try{let e=JSON.parse(sessionStorage.getItem(Hv)||`{}`)||{},t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`string`?{sm:r}:r||{};return t}catch{return{}}},Wv=e=>{let t=Bv.get(e);if(t)return t;let n=Uv()[e]||{};return Bv.set(e,n),n},Gv=(e,t,n)=>{if(t===`full`)return;let r={...Wv(e),[t]:n};Bv.set(e,r);try{let t=Uv();t[e]=r,sessionStorage.setItem(Hv,JSON.stringify(t))}catch{}};function Kv(e,t){if(!e||t===`full`)return``;let n=Wv(e)[t];return n===void 0?Rv(e,t):n===zv?``:n}var qv=(e,t)=>!!e&&t!==`full`&&Wv(e)[t]!==void 0,Jv=(e,t)=>qv(e,t)&&!Kv(e,t),Yv=(e,t)=>{e&&t!==`full`&&Gv(e,t,zv)};async function Xv(e,t){if(t===`full`)return e;if(!e||!r.c(e)||r.u(e))return``;if(qv(e,t))return Kv(e,t);let n=Rv(e,t);if(n)return n;let i=`${t}|${e}`,a=Vv.get(i);if(a)return a;let o=Lv(e,t);if(!o||!_)return``;let s;try{s=(0,l.getDownloadURL)((0,l.ref)(_,o)).then(n=>(Gv(e,t,n),n)).catch(()=>(Gv(e,t,zv),``)).finally(()=>{Vv.delete(i)})}catch{return Gv(e,t,zv),``}return Vv.set(i,s),s}var Zv=[],Qv=0,$v=()=>{for(;Qv<3&&Zv.length;){let e=Zv.shift();if(Ov(e))continue;Qv++;let t=new Image,n=()=>{Qv--,$v()};t.decoding=`async`,t.onload=()=>{kv(e),Mv(e,t.naturalWidth,t.naturalHeight),n()},t.onerror=n,t.src=e}};function ey(e){if(!(typeof Image>`u`)){for(let t of e)!t||Ov(t)||Zv.includes(t)||Zv.push(t);$v()}}var ty={sm:400,md:800,full:1/0},ny=[`sm`,`md`,`full`],ry=e=>ny[ny.indexOf(e)+1]??null,iy=e=>ny.indexOf(e)>0?ny[ny.indexOf(e)-1]:null,ay=(e,t)=>ny.indexOf(e)>=ny.indexOf(t)?e:t;function oy(e,t,n){let r=Math.max(0,e?.width||0),i=Math.max(0,e?.height||0),a=Math.min(2,Number.isFinite(n)&&n>0?n:1),o;if(t&&t.width>0&&t.height>0){let e=Math.max(r/t.width,i/t.height);o=Math.max(t.width,t.height)*e}else o=Math.max(r,i);return o*=a,ny.find(e=>ty[e]>=o)??`full`}var sy=e=>!!e&&e.complete&&e.naturalWidth>0;function cy({src:e,alt:t=``,small:n,medium:r,width:o,height:s,ratio:c,className:l=``,imgClassName:u=``,fit:d=`cover`,priority:f=!1,preload:p,tint:m,onClick:h,draggable:g,fallback:_,onError:v}){let y=(0,i.useRef)(null),b=(0,i.useRef)(null),[x,S]=(0,i.useState)(null),[C,w]=(0,i.useState)(``),T=(0,i.useContext)(ag),ee=(e,t)=>!e||!t?``:t===`full`?e:t===`sm`&&n?n:t===`md`&&r?r:Kv(e,t),E=typeof e!=`string`||!e.trim(),[D,te]=(0,i.useState)(()=>({src:e,rung:null,link:``,ready:!1,under:``,failed:E}));if(D.src!==e||D.rung!==x){let t=ee(e,x),n=!!t&&Ov(t);te({src:e,rung:x,link:t,ready:n,under:E||n?``:D.ready&&!D.failed?D.link:D.under,failed:E})}let ne=/(^|\s)w-auto(\s|$)/.test(l),O=/(^|\s)(aspect-|inset-0|absolute)/.test(l)||!ne&&/(^|\s)(h-|min-h-)(?!(auto|fit|min|max|0)(\s|$))/.test(l),k=(0,i.useCallback)(()=>{let t=y.current;if(!t)return;let n=t.getBoundingClientRect();O&&n.width>0&&n.height<1&&w(l);let r=jv(e)||(o&&s?{width:o,height:s}:void 0),i=typeof window>`u`?1:window.devicePixelRatio||1,a=n.width>0||n.height>0?oy({width:n.width,height:n.height},r,i):`full`;for(;Jv(e,a);){let e=ry(a);if(!e)break;a=e}S(e=>e?ay(e,a):a)},[e,o,s,O,l]),re=(0,i.useCallback)(e=>{if(y.current=e,b.current?.disconnect(),b.current=null,!e||(k(),typeof ResizeObserver>`u`))return;let t=new ResizeObserver(()=>k());t.observe(e),b.current=t},[k]),ie=(0,i.useCallback)(e=>{S(t=>ay(t??e,ry(e)??e))},[]);(0,i.useEffect)(()=>{if(!x||D.link||D.src!==e||D.rung!==x)return;let t=!0;return Xv(e,x).then(n=>{t&&(n?te(t=>t.src===e&&t.rung===x&&!t.link?{...t,link:n,ready:Ov(n)}:t):ie(x))}).catch(()=>{t&&ie(x)}),()=>{t=!1}},[e,x,D.link,D.src,D.rung,ie]);let ae=x?iy(x):null,A=`${x}|${e}`,[j,M]=(0,i.useState)({key:``,rung:null,link:``,ready:!1});if(j.key!==A){let t=ee(e,ae);M({key:A,rung:ae,link:t,ready:!!t&&Ov(t)})}(0,i.useEffect)(()=>{if(j.key!==A||!j.rung||j.link)return;let t=!0,n=j.rung;return Xv(e,n).then(e=>{!t||!e||M(t=>t.key===A&&!t.link?{...t,link:e,ready:Ov(e)}:t)}).catch(()=>{}),()=>{t=!1}},[e,A,j.key,j.rung,j.link]);let oe=(p||[]).filter(Boolean).join(`|`);(0,i.useEffect)(()=>{if(!oe||!x)return;let e=setTimeout(()=>{let e=oe.split(`|`);Promise.all(e.map(e=>Xv(e,x).catch(()=>``))).then(t=>ey(t.map((t,n)=>t||e[n]))).catch(()=>{})},250);return()=>clearTimeout(e)},[oe,x]);let N=jv(e)||(o&&s?{width:o,height:s}:void 0),P=O&&C!==l,F=P?0:c||(N?N.width/N.height:0),I=d===`contain`?`object-contain`:`object-cover`,se=`absolute inset-0 w-full h-full ${I} ${u}`,L=!O&&!ne&&!/(^|\s)max-h-/.test(l),ce=T&&L,le=ce?F?{maxWidth:`calc(${ig} * ${F})`,marginInline:`auto`}:{maxHeight:ig,marginInline:`auto`}:void 0,ue=ce&&!F?{maxHeight:ig,width:`auto`,marginInline:`auto`}:void 0,de=(t,n)=>{let r={width:n.naturalWidth,height:n.naturalHeight},i=()=>{kv(t),Mv(e,r.width,r.height),te(e=>e.link===t?{...e,ready:!0,under:``}:e)},a=n.decode?.();a&&typeof a.then==`function`?a.then(i,i):i()},fe=F||P?``:D.under||D.link,pe=D.failed,me=!D.ready&&!pe&&!D.under,he=me&&!!j.link&&j.key===A,ge=/(^|\s)(absolute|fixed|sticky)(\s|$)/.test(l);return(0,a.jsxs)(`span`,{ref:re,onClick:h,"data-picture":D.ready?`ready`:`loading`,"data-ratio":F?String(F):void 0,"data-rung":x||void 0,className:`${ge?``:`relative`} block overflow-hidden isolate ${l}`,style:F||le?{...F?{aspectRatio:String(F)}:null,...le}:void 0,children:[me&&!(he&&j.ready)&&(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`fbos-picture-tint absolute inset-0`,style:m?{background:m}:void 0}),he&&(0,a.jsx)(`img`,{src:j.link,alt:``,"aria-hidden":`true`,draggable:!1,decoding:`async`,loading:f?`eager`:`lazy`,fetchPriority:f?`high`:void 0,ref:e=>{sy(e)&&!j.ready&&M(e=>e.link===j.link?{...e,ready:!0}:e)},onLoad:()=>M(e=>e.link===j.link?{...e,ready:!0}:e),onError:()=>{let t=j.rung;t&&Yv(e,t),M(e=>e.key===A?{key:A,rung:t?iy(t):null,link:``,ready:!1}:e)},className:`fbos-picture-standin ${se} ${j.ready?`opacity-100`:`opacity-0`}`},`stand-${j.link}`),D.under&&D.under!==D.link&&(0,a.jsx)(`img`,{src:D.under,alt:``,"aria-hidden":`true`,draggable:!1,className:fe===D.under?`block w-full h-auto ${I} ${u}`:se,style:fe===D.under?ue:void 0},`under-${D.under}`),!pe&&!!D.link&&(0,a.jsx)(`img`,{ref:e=>{e&&sy(e)&&!D.ready&&de(D.link,e)},src:D.link,alt:t,draggable:g,loading:f?`eager`:`lazy`,fetchPriority:f?`high`:void 0,decoding:`async`,onLoad:e=>de(D.link,e.currentTarget),onError:()=>{if(D.rung&&D.rung!==`full`){Yv(e,D.rung),ie(D.rung);return}te(t=>t.src===e?{...t,failed:!0}:t),v?.()},className:`fbos-picture-img ${fe===D.link?`block w-full h-auto ${I} ${u}`:se} ${D.ready?`opacity-100`:`opacity-0`}`,style:fe===D.link?ue:void 0},D.link),pe&&!D.under&&(0,a.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center px-2 text-center text-[11px] font-semibold text-foreground/35`,children:_??(t||`Picture unavailable`)})]})}var ly=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],uy={mon:`Monday`,tue:`Tuesday`,wed:`Wednesday`,thu:`Thursday`,fri:`Friday`,sat:`Saturday`,sun:`Sunday`},dy={mon:`Mon`,tue:`Tue`,wed:`Wed`,thu:`Thu`,fri:`Fri`,sat:`Sat`,sun:`Sun`},fy=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`],py=[{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`}],my=new Set(py.map(e=>e.value)),hy={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`},gy=new Set(Object.values(hy).filter(Boolean)),_y=e=>e!==`date`&&e!==`checkbox`,vy=(e,t)=>{if(!_y(t))return``;let n=String(e.placeholder||``).trim();return!n||gy.has(n)?hy[t]:e.placeholder},yy=[{name:`name`,type:`text`,label:`Your name`,placeholder:`Jane Doe`},{name:`email`,type:`email`,label:`Your email`,placeholder:`jane@example.com`}],by=new Set(yy.map(e=>e.name)),xy=e=>by.has(e),Sy=e=>{let t=yy.find(t=>t.name===e);return{name:t.name,label:t.label,type:t.type,required:!0,placeholder:t.placeholder,options:[]}},Cy=(e,t)=>e.find(e=>e.name===t)||Sy(t),wy=()=>[Sy(`name`),Sy(`email`),{name:`note`,label:`Anything we should know?`,type:`textarea`,required:!1,placeholder:``,options:[]}],Ty=()=>({name:``,label:``,type:`text`,required:!1,placeholder:hy.text,options:[]}),Ey=e=>String(e||``).toLowerCase().trim().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).slice(0,60);function Dy(e,t,n){if(e.name&&e.name!==Ey(e.label))return e.name;let r=Ey(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 Oy=(e,t)=>{let n=String(e?.label||``),r=my.has(String(e?.type))?String(e.type):`text`;return{name:String(e?.name||``).trim()||Ey(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 ky(e){let t=Array.isArray(e)?e.map(Oy).filter(e=>e.name):wy();return[...yy.map(e=>{let n=t.find(t=>t.name===e.name),r=Sy(e.name);return n?{...r,label:n.label.trim()?n.label:r.label,placeholder:n.placeholder}:r}),...t.filter(e=>!xy(e.name))]}var Ay=e=>e.filter(e=>e.label.trim()&&!xy(e.name));function jy(e,t){let n={};for(let r of Ay(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 My(e,t){let n={};for(let r of Ay(e)){let e=String(t[r.name]||``).trim();e&&(n[r.name]=e)}return n}function Ny(e,t){let n={};for(let r of Ay(e)){let e=String(t[r.name]||``).trim();e&&(n[r.label.trim()]=e)}return n}var Py=`booking`,Fy=`sys_schedules`,Iy=`pub_bookings`,Ly=`mem_bookings`,Ry=[{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`}],zy=[{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`}],By=[{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`}],Vy=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}}),Hy=[...Vy.slice(1),{value:`24:00`,label:`Midnight`}],Uy={from:`09:00`,to:`17:00`},Wy=(e,t=e,n=``,r=nb())=>({id:e,memberId:t,memberName:n,name:``,description:``,questions:wy(),paymentId:``,notifyOwner:!0,confirmBooker:!0,enabled:!1,timeZone:r,slotMinutes:30,days:{mon:[Uy],tue:[Uy],wed:[Uy],thu:[Uy],fri:[Uy],sat:[],sun:[]},blocked:[],horizonDays:30,noticeHours:12}),Gy=/^([01]\d|2[0-3]):[0-5]\d$/,Ky=/^(([01]\d|2[0-3]):[0-5]\d|24:00)$/,qy=e=>{let t=String(e?.from||``),n=String(e?.to||``);return Gy.test(t)&&Ky.test(n)?{from:t,to:n}:null},$=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},Jy=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Yy=e=>{let t=String(e||``);if(!Jy.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 Xy(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(!Yy(e))continue;let r=Array.isArray(n?.windows)?n.windows.map(e=>qy(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 Zy(e,t){let n=e.blocked.find(e=>e.date===t);return n?n.windows.length?n.windows:[$y]:[]}var Qy=(e,t)=>e.blocked.some(e=>e.date===t&&e.windows.length===0),$y={from:`00:00`,to:`24:00`},eb=(e,t,n)=>{let r=typeof e==`number`?e:Number(e);return!Number.isFinite(r)||r<0||n&&!n.includes(r)?t:r},tb=(e,t)=>{let n=!String(t?.memberId||``).trim(),r=n?e:String(t.memberId),i=String((n?t?.name:t?.memberName)||``),a=Wy(e,r,i,`UTC`),o={...a.days};for(let e of ly){let n=t?.days?.[e];o[e]=Array.isArray(n)?n.map(qy).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:ky(t?.questions),paymentId:String(t?.paymentId||``),notifyOwner:t?.notifyOwner!==!1,confirmBooker:t?.confirmBooker!==!1,enabled:t?.enabled===!0,timeZone:ib(t?.timeZone)?String(t.timeZone):a.timeZone,slotMinutes:eb(t?.slotMinutes,30,Ry.map(e=>Number(e.value))),days:s?o:a.days,blocked:Xy(t?.blocked),horizonDays:eb(t?.horizonDays,30),noticeHours:eb(t?.noticeHours,12),createdAt:typeof t?.createdAt==`number`?t.createdAt:void 0,updatedAt:typeof t?.updatedAt==`number`?t.updatedAt:void 0}};function nb(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}}var rb=new Map;function ib(e){if(typeof e!=`string`||!e.trim())return!1;let t=rb.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 rb.set(e,n),n}function ab(){try{return Intl.supportedValuesOf?Intl.supportedValuesOf(`timeZone`):[`UTC`]}catch{return[`UTC`]}}function ob(e,t=12){let n=e.trim().toLowerCase().replace(/\s+/g,`_`),r=ab(),i=nb(),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 sb=new Map,cb=e=>{let t=sb.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`}),sb.set(e,t)),t};function lb(e,t){let n={};for(let r of cb(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 ub(e,t){let n=lb(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 db(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=ub(n,new Date(c)),u=c-l*6e4,d=ub(n,new Date(u));return d!==l&&(u=c-d*6e4,ub(n,new Date(u))!==d&&(u=c-Math.min(l,d)*6e4)),new Date(u)}function fb(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 pb(e){let[t,n,r]=e.split(`-`).map(Number);return fy[new Date(Date.UTC(t,n-1,r)).getUTCDay()]}function mb(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 hb(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 gb=(e,t)=>e.start<t.end&&t.start<e.end,_b=(e,t)=>`${e}__${t.replace(/[-:]/g,``).slice(0,15)}`,vb=[{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`}],yb=e=>(vb.find(t=>t.value===e)||vb[0]).hex,bb=(e,t)=>`color-mix(in srgb, ${yb(e)} ${t}%, transparent)`,xb=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}}),Sb=[...Ry,{value:`180`,label:`3 hours`},{value:`240`,label:`4 hours`}],Cb=e=>e.own?(e.title||``).trim()||`Busy`:(e.name||``).trim()||`Someone`;function wb(e,t){let{hour:n,minute:r}=lb(e,t),i=Math.ceil((n*60+r)/15);return i>=96?`23:45`:xb[i].value}function Tb(e,t){if(!nx(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=lb(n,i).dateKey,l=new Map;for(let t=0;t<s;t++){let n=fb(c,t);if(Qy(e,n))continue;let s=Zy(e,n).map(e=>({start:db(n,e.from,i).toISOString(),end:db(n,e.to,i).toISOString()})),u=(e.days[pb(n)]||[]).filter(e=>$(e.to)>$(e.from)).sort((e,t)=>$(e.from)-$(t.from));for(let t of u){let c=db(n,t.from,i).getTime(),u=db(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=>gb(e,n))||s.some(e=>gb(e,n))||l.set(t,n)}}}return[...l.keys()].sort((e,t)=>e-t).map(e=>l.get(e))}function Eb(e,t){return e.flatMap(e=>Tb(e,t)).sort((e,t)=>e.start.localeCompare(t.start)||e.memberId.localeCompare(t.memberId)||e.scheduleId.localeCompare(t.scheduleId))}function Db(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 Ob(e,t,n){let r=e.timeZone,i=lb(t,r).dateKey,a=[],o=[];for(let t=0;t<n;t++){let n=fb(i,t);if(!Qy(e,n)){for(let t of e.days[pb(n)]||[])$(t.to)<=$(t.from)||a.push({from:db(n,t.from,r).getTime(),to:db(n,t.to,r).getTime()});for(let t of Zy(e,n))o.push({from:db(n,t.from,r).getTime(),to:db(n,t.to,r).getTime()})}}return o.reduce((e,t)=>jb(e,t),kb(a))}function kb(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 Ab(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 jb(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 Mb(e,t){let n=Db(e.filter(nx));if(!n.length)return[];if(n.length===1)return Tb(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=Ob(n[0],r,o);for(let e of n.slice(1)){if(!c.length)break;c=Ab(c,Ob(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=jb(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 Nb=(e,t,n)=>n?Mb(e,t):Eb(e,t),Pb=(e,t)=>{let n=Db(t);return n.length?n.map(t=>({start:e.start,end:e.end,memberId:t.memberId,scheduleId:t.id})):[e]},Fb=e=>new Set(e.map(e=>e.memberId)).size>1,Ib=(e,t)=>t.find(t=>t.id===e.scheduleId)||t.find(t=>t.memberId===e.memberId),Lb=e=>`/book/${e}`,Rb=e=>`/pay/${e}`;function zb(e){let t=typeof window<`u`&&window.location?.origin?window.location.origin:``;return t?`${t}${e}`:e}function Bb(e,t,n){let r=new Map;for(let i of e){let e=new Date(i.start),{dateKey:a}=lb(e,t),o=r.get(a);o||(o={dateKey:a,label:Vb(e,t,n),slots:[]},r.set(a,o)),o.slots.push(i)}return[...r.values()].sort((e,t)=>e.dateKey.localeCompare(t.dateKey))}function Vb(e,t,n){return new Intl.DateTimeFormat(n,{timeZone:t,weekday:`short`,day:`numeric`,month:`short`,year:`numeric`}).format(e)}function Hb(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 Ub(e,t,n){let r=new Date(e.start),i=new Date(e.end);return`${Vb(r,t,n)}, ${Hb(r,t,n)}–${Hb(i,t,n)}`}function Wb(e,t,n){let r=new Date(e.start);return{day:Vb(r,t,n),time:`${Hb(r,t,n)} – ${Hb(new Date(e.end),t,n)}`}}var Gb=e=>e.replace(/_/g,` `).replace(/\//g,` / `);function Kb(e,t,n,r){let i=t.trim();return`${Ub(e,n,r)} (${Gb(n)})${i?` with ${i}`:``}`}var qb=(e,t=!1)=>`${e.start}|${e.end}|${e.memberId}|${e.scheduleId}${t?`|t`:``}`;function Jb(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 Yb=e=>typeof e==`string`&&e.split(`|`)[4]===`t`;function Xb(e,t,n,r,i){return{[e]:Kb(t,n,r,i),[`${e}Start`]:t.start,[`${e}End`]:t.end,[`${e}With`]:n,[`${e}TimeZone`]:r}}function Zb(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 Qb=e=>Object.keys(e||{}).some(t=>Zb(e,t)!==null);function $b(e){return e.memberName.trim()?e.memberId.trim()?ib(e.timeZone)?Ry.some(t=>Number(t.value)===e.slotMinutes)?ex(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 ex(e,t=0){if(!ib(e.timeZone))return`Pick a time zone we know, like Europe/Rome.`;let n=!1;for(let r of ly){let i=e.days[r]||[];for(let e of i){if(n=!0,$(e.to)<=$(e.from))return`On ${uy[r]}, the end must come after the start.`;if(t&&$(e.to)-$(e.from)<t)return`On ${uy[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 ${uy[r]}, the two stretches of hours overlap.`}return n?``:`Turn on at least one day.`}var tx=e=>ex(e)===``,nx=e=>e.enabled&&$b(e)===``,rx={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`},ix=e=>rx[e.slotMinutes]||`A meeting`,ax=e=>e.name.trim()||ix(e),ox=e=>{let t=ax(e),n=e.memberName.trim();return n?`${t} with ${n}`:t},sx=(e,t=Cx())=>!!e&&t.some(t=>t.id===e);function cx(e,t=``,n=Cx()){return e&&sx(e.id,n)?ax(e):t.trim()}var lx=e=>{let t=(e.scheduleName||``).trim(),n=(e.memberName||``).trim();return t&&n?`${t} with ${n}`:t||(n?`A meeting with ${n}`:`A meeting`)},ux=e=>Ry.find(t=>Number(t.value)===e)?.label||`${e} min`,dx=e=>{let t=e.memberName.trim();return`${ux(e.slotMinutes)}${t?` with ${t}`:``}. Pick a time that suits you.`},fx=e=>{let t=e.description.trim();return t&&t!==dx(e)?t:``},px=e=>{let[t,...n]=ux(e).split(` `),r=n.join(` `)||`min`;return{value:t,unit:r.startsWith(`minute`)?`min`:r}},mx=(e,t)=>e.length===t.length&&e.every((e,n)=>e.from===t[n].from&&e.to===t[n].to);function hx(e){let t=ly.filter(t=>(e.days[t]||[]).length);if(!t.length)return``;let n=e.days[t[0]],r=t.every(t=>mx(e.days[t],n)),i=t.map(e=>ly.indexOf(e)),a=i.every((e,t)=>t===0||e===i[t-1]+1)&&t.length>2?`${dy[t[0]]}–${dy[t[t.length-1]]}`:t.map(e=>dy[e]).join(`, `);return r?`${a} ${n.map(e=>`${e.from}–${e.to}`).join(`, `)}`:`${a}, hours vary`}function gx(e){let t=ox(e),n=hx(e);return n?`${t} — ${n} · ${ux(e.slotMinutes)} · ${Gb(e.timeZone)}`:`${t} — no hours yet`}var _x=(e=new Date)=>new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,10),vx=e=>e.name.trim()||`Working hours`,yx=e=>{let t=e.memberName.trim();return t?`${t} · ${vx(e)}`:vx(e)};function bx(e,t=_x()){let n=hx(e),r=vx(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} · ${Gb(e.timeZone)}${a}`}var xx=[],Sx=e=>{xx=e},Cx=()=>xx,wx=[],Tx=e=>{wx=e},Ex=()=>wx,Dx=()=>{let e=new Set(xx.map(e=>e.id));return[...xx,...wx.filter(t=>!e.has(t.id)&&nx(t))]},Ox=[{value:`calendar`,label:`A full calendar — the page is about booking`},{value:`compact`,label:`A compact time picker — one question among others`}],kx=[{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`}],Ax=new Set(kx.map(e=>e.value)),jx=e=>Ax.has(String(e?.party))?String(e.party):e?.together===!0?`all`:`each`,Mx=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 Nx(e){let t=e?.booking;if(!t||typeof t!=`object`)return null;let n=Mx(t);return n.length?{schedules:n,party:jx(t),ask:String(t.ask||``),how:String(t.how||``)}:null}var Px=(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},Fx=(e,t,n=[])=>{let r=[];for(let i of e){let e=Px(i,t,n),a=e?e.id:i;r.includes(a)||r.push(a)}return r},Ix=(e,t,n=[])=>{let r=[];for(let i of e.schedules){let e=Px(i,t,n);e&&!r.some(t=>t.id===e.id)&&r.push(e)}return r};function Lx(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 Rx=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]}`},zx=e=>{let t=e.map(ox);return t.length<=1?t.join(``):`${t.slice(0,-1).join(`, `)}, and ${t[t.length-1]}`};function Bx(e,t,n=t){let r=Nx(e);if(!r)return``;let i=Ix(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=>!tx(e));return a?`Finish ${yx(a)} on the Schedule screen first.`:r.how.trim()?``:`Say what this page should do with those hours.`}var Vx=`calls?|meetings?|times?|slots?|sessions?|appointments?|visits?|consultations?|chats?|demos?`,Hx=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*(?:${Vx})\\b`,`i`).test(e),Ux=/\b(calls?|meetings?|sessions?|appointments?|consultations?|chats?|demos?|visits?|interviews?|viewings?|classes|lessons?|slots?|times?|diar(?:y|ies)|calendars?)\b/i,Wx=e=>{let t=Nx(e);return[e?.brief,e?.pageChange,t?.how,t?.ask].map(e=>String(e||``).trim()).filter(Boolean).join(`
|
|
12
|
+
`)},Gx=e=>Hx(e)||Ux.test(e),Kx=(e,t=Nx(e))=>!!t&&(!!t.ask.trim()||t.party!==`each`||Gx(Wx(e))),qx=`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.`,Jx=(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} }`},Yx=`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.`,Xx=`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.`,Zx=()=>`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. ${Yx} If my words ask to let the visitor pick either — one of us or all of us — add party: 'choose' instead. ${Xx} 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.`,Qx=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.`,$x=`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.`,eS=`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.`,tS=`A person's OWN meetings are read with useMyBookings() from 'your-ai-workflow-firebase-os' — { loading, bookings, error }, the same shape useBookings() gives, and it needs no arguments: it answers about whoever is signed in, and finds what they booked as a guest before they had an account as well. NEVER useBookings() on a page like this and never mem_bookings by hand — both are my team's and everybody else is refused, which shows as an error and never as an empty list. Title each one with eventName(booking) from the same package, show the times in the reader's own zone, keep a cancelled one in the list greyed out with its cancelReason rather than dropping it, and mark one that is pending:true as still waiting. They call one off with cancelBooking(id, { ids: booking.copyIds, reason, side: 'booker' }) from the same package — always with a reason — and never accept or decline anything, because the meeting is not in their diary to agree to.`,nS=e=>{let t=Db(e).map(e=>`'${e.memberId}'`).join(`, `);return`This page is built on ${Rx(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.`},rS=(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. ${qx}`;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 iS(e,t,n,r=t){let i=Nx(e);if(!i)return[];let a=Ix(i,t,r);if(!a.length)return[];let o=i.how.trim(),s=i.ask.trim();if(!Kx(e,i))return[nS(a),...o?[`Here is what this page should do with those hours: ${o}`]:[]];let c=Db(a),l=Rx(c),u=[];if(n)u.push(`This page is where my team follows the times people book with ${l}. ${eS}`);else{let t=Fb(c),n=t?i.party:`each`;u.push(rS(l,n,t),`Add exactly this question to the page's form, copied as it is: ${Jx(c.map(e=>e.id),`time`,n)}`),n===`all`?u.push(Yx):n===`choose`?u.push(Xx):t&&u.push(Zx()),u.push($x),e?.pageType&&u.push(`If my words below also ask for the person reading to see what THEY have booked, that is a list and never a second picker. ${tS} If my words do not ask for it, put no such list on the page.`)}return s&&!n&&u.push(Qx(s)),o&&u.push(`Here is how booking should work on this page: ${o}`),u}function aS(e,t,n,r,i=n){let a=Nx(t);if(!a||!Kx(t,a))return``;let o=Db(Ix(a,n,i));if(!o.length)return``;let s=Rx(o);return r?`Times are booked with ${s} on the page at ${e}, which this page is linked to. Show those bookings here. ${eS}`:`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 oS=[.16,1,.3,1],sS={duration:.3,ease:oS},cS={opacity:0,y:24},lS={opacity:1,y:0},uS=`0px 0px -20% 0px`,dS=.98,fS=700;function pS(){let[e,t]=(0,i.useState)(null),[n,r]=(0,i.useState)(()=>typeof IntersectionObserver>`u`);return(0,i.useEffect)(()=>{if(!e||n)return;let t,i=()=>r(!0),a=(e,t)=>{try{return new IntersectionObserver(e,{root:document,...t})}catch{return new IntersectionObserver(e,t)}},o=a(e=>{e.some(e=>e.isIntersecting)&&i()},{rootMargin:uS}),s=a(e=>{let n=e[e.length-1];if(n){if(n.intersectionRatio>=dS)return i();clearTimeout(t),n.isIntersecting&&(t=setTimeout(i,fS))}},{threshold:[0,dS]});return o.observe(e),s.observe(e),()=>{o.disconnect(),s.disconnect(),clearTimeout(t)}},[e,n]),[t,n]}var mS=(0,i.createContext)(!1),hS=({children:e,as:t=`div`,delay:n=0,className:r,id:i})=>{let o=rg(),[s,c]=pS(),l=ng[t];return(0,a.jsx)(l,{ref:s,id:i,className:r,initial:o?!1:cS,animate:o||c?lS:cS,transition:{duration:.7,ease:oS,delay:Math.min(Math.max(n,0),.5)},children:(0,a.jsx)(mS.Provider,{value:!0,children:e})})};hS.displayName=`Reveal`;var gS=({children:e,className:t,itemClassName:n,as:r=`div`})=>(0,a.jsx)(r,{className:t,children:i.Children.toArray(e).map((e,t)=>(0,a.jsx)(_S,{li:r!==`div`,className:n,index:t,children:e},e?.key??t))});gS.displayName=`RevealList`;var _S=({children:e,li:t,className:n,index:r})=>{let o=rg(),s=(0,i.useContext)(mS),[c,l]=pS();return(0,a.jsx)(t?ng.li:ng.div,{ref:c,className:n,initial:o||s?!1:cS,animate:o||s||l?lS:cS,transition:{duration:.6,ease:oS,delay:r%8*.06},children:e})},vS=({show:e,children:t,className:n})=>rg()?(0,a.jsx)(`div`,{className:n,children:t}):(0,a.jsx)(om,{mode:`wait`,initial:!1,children:(0,a.jsx)(ng.div,{className:n,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2,ease:oS},children:t},String(e))});vS.displayName=`Swap`;var yS=`rounded-2xl border border-[var(--panel-border)] bg-[var(--panel-bg)] transition-colors hover:border-accent/40`,bS=`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`,xS=`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`,SS=`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`,CS=`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`,wS=`text-[12.5px] sm:text-[13px] font-medium text-foreground/50 select-none`,TS=`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug`;function ES({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 DS({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 OS({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 kS({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.ht,{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 AS({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:`${bS} ${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.ht,{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 jS({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:`${bS} 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.Ht,{className:`w-3.5 h-3.5 shrink-0`}),(0,a.jsx)(`span`,{className:`max-sm:hidden`,children:r})]})}var MS=`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 NS({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:MS,children:t===`up`?(0,a.jsx)(n._n,{className:`w-3 h-3`}):(0,a.jsx)(n.xn,{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 PS({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:`fbos-section 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.on,{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)(om,{initial:!1,children:f&&(0,a.jsx)(ng.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:sS,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 FS({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)(kS,{state:r.state,label:r.label})}),i!==null&&(0,a.jsx)(VS,{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 IS({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:wS,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 LS({label:e,hint:t,value:n,onChange:r,onBlur:i,placeholder:o,prefix:s,error:c,disabled:l,action:u}){return(0,a.jsx)(IS,{label:e,hint:t,error:c,action:u,children:s?(0,a.jsxs)(`div`,{className:`${SS} ${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:`${CS} 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:`${xS} ${c?`is-invalid border-red-500/60`:``}`})})}function RS({label:e,hint:t,value:n,onChange:r,onBlur:i,placeholder:o,rows:s,error:c}){return(0,a.jsx)(IS,{label:e,hint:t,error:c,children:(0,a.jsx)(j_,{value:n??``,placeholder:o,rows:s,onChange:e=>r(e.target.value),onBlur:i,"aria-label":e,className:`${xS.replace(`h-11 `,``)} min-h-11 py-2.5 leading-5 ${c?`is-invalid border-red-500/60`:``}`})})}function zS({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)(IS,{label:e,hint:t,children:(0,a.jsx)(N_,{ariaLabel:e,value:n??``,options:l,onChange:r,disabled:c,className:`console-select`,dense:!0,portal:!0,direction:`auto`})})}function BS({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)(VS,{enabled:n,onChange:r,disabled:i,label:e})]})}function VS({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 HS({saving:e,savedAt:t,error:n}){return n?(0,a.jsx)(kS,{state:`error`,label:n}):e?(0,a.jsx)(kS,{state:`saving`,label:`Saving`}):t?(0,a.jsx)(kS,{state:`saved`,label:`Saved`}):null}function US({label:e=`Time zone`,hint:t,value:r,onChange:o,compact:s}){let[c,l]=(0,i.useState)(``),u=nb(),d=(r||``).trim(),f=(0,i.useMemo)(()=>ob(c),[c]),p=c.trim().length>0,m=t??(d===u?`Detected from your browser.`:`Your browser is in ${Gb(u)}.`),h=(0,a.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,a.jsxs)(`div`,{className:SS,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.jt,{className:`w-4 h-4 shrink-0`}),(0,a.jsx)(`span`,{className:`text-[13px] font-semibold truncate`,children:Gb(d)}),(0,a.jsx)(n.sn,{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:`${CS} 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:[Gb(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)(IS,{label:e,hint:m,children:h})}Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return Cy}}),Object.defineProperty(exports,`$i`,{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,`$n`,{enumerable:!0,get:function(){return rv}}),Object.defineProperty(exports,`$r`,{enumerable:!0,get:function(){return Qr}}),Object.defineProperty(exports,`$t`,{enumerable:!0,get:function(){return Db}}),Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return Py}}),Object.defineProperty(exports,`Aa`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`Ai`,{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,`An`,{enumerable:!0,get:function(){return pb}}),Object.defineProperty(exports,`Ar`,{enumerable:!0,get:function(){return li}}),Object.defineProperty(exports,`At`,{enumerable:!0,get:function(){return yb}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return vb}}),Object.defineProperty(exports,`Bi`,{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,`Bn`,{enumerable:!0,get:function(){return pv}}),Object.defineProperty(exports,`Br`,{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,`Bt`,{enumerable:!0,get:function(){return tx}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return BS}}),Object.defineProperty(exports,`Ca`,{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,`Ci`,{enumerable:!0,get:function(){return rn}}),Object.defineProperty(exports,`Cn`,{enumerable:!0,get:function(){return jx}}),Object.defineProperty(exports,`Cr`,{enumerable:!0,get:function(){return vi}}),Object.defineProperty(exports,`Ct`,{enumerable:!0,get:function(){return hx}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return gS}}),Object.defineProperty(exports,`Da`,{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,`Di`,{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,`Dn`,{enumerable:!0,get:function(){return Zx}}),Object.defineProperty(exports,`Dr`,{enumerable:!0,get:function(){return fi}}),Object.defineProperty(exports,`Dt`,{enumerable:!0,get:function(){return nb}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return hS}}),Object.defineProperty(exports,`Ea`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`Ei`,{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,`En`,{enumerable:!0,get:function(){return _x}}),Object.defineProperty(exports,`Er`,{enumerable:!0,get:function(){return ui}}),Object.defineProperty(exports,`Et`,{enumerable:!0,get:function(){return wy}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return py}}),Object.defineProperty(exports,`Fi`,{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,`Fn`,{enumerable:!0,get:function(){return Ev}}),Object.defineProperty(exports,`Fr`,{enumerable:!0,get:function(){return ci}}),Object.defineProperty(exports,`Ft`,{enumerable:!0,get:function(){return Bb}}),Object.defineProperty(exports,`G`,{enumerable:!0,get:function(){return By}}),Object.defineProperty(exports,`Gi`,{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,`Gn`,{enumerable:!0,get:function(){return _v}}),Object.defineProperty(exports,`Gr`,{enumerable:!0,get:function(){return Rr}}),Object.defineProperty(exports,`Gt`,{enumerable:!0,get:function(){return Cx}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return Vy}}),Object.defineProperty(exports,`Hi`,{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(exports,`Hn`,{enumerable:!0,get:function(){return yv}}),Object.defineProperty(exports,`Hr`,{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,`Ht`,{enumerable:!0,get:function(){return xy}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return qx}}),Object.defineProperty(exports,`Ii`,{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,`In`,{enumerable:!0,get:function(){return gv}}),Object.defineProperty(exports,`Ir`,{enumerable:!0,get:function(){return ni}}),Object.defineProperty(exports,`It`,{enumerable:!0,get:function(){return Fx}}),Object.defineProperty(exports,`J`,{enumerable:!0,get:function(){return Ry}}),Object.defineProperty(exports,`Ji`,{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,`Jn`,{enumerable:!0,get:function(){return iv}}),Object.defineProperty(exports,`Jr`,{enumerable:!0,get:function(){return Lr}}),Object.defineProperty(exports,`Jt`,{enumerable:!0,get:function(){return cx}}),Object.defineProperty(exports,`K`,{enumerable:!0,get:function(){return xb}}),Object.defineProperty(exports,`Ki`,{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,`Kn`,{enumerable:!0,get:function(){return hv}}),Object.defineProperty(exports,`Kr`,{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(exports,`Kt`,{enumerable:!0,get:function(){return Ex}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return ly}}),Object.defineProperty(exports,`Li`,{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(exports,`Ln`,{enumerable:!0,get:function(){return uv}}),Object.defineProperty(exports,`Lr`,{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,`Lt`,{enumerable:!0,get:function(){return yx}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return $x}}),Object.defineProperty(exports,`Ma`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`Mi`,{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,`Mn`,{enumerable:!0,get:function(){return db}}),Object.defineProperty(exports,`Mr`,{enumerable:!0,get:function(){return mi}}),Object.defineProperty(exports,`Mt`,{enumerable:!0,get:function(){return bb}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return kx}}),Object.defineProperty(exports,`Na`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`Ni`,{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,`Nn`,{enumerable:!0,get:function(){return cy}}),Object.defineProperty(exports,`Nr`,{enumerable:!0,get:function(){return ri}}),Object.defineProperty(exports,`Nt`,{enumerable:!0,get:function(){return Vb}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return vS}}),Object.defineProperty(exports,`Oa`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`Oi`,{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,`On`,{enumerable:!0,get:function(){return Fb}}),Object.defineProperty(exports,`Or`,{enumerable:!0,get:function(){return di}}),Object.defineProperty(exports,`Ot`,{enumerable:!0,get:function(){return qb}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return hy}}),Object.defineProperty(exports,`Pi`,{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,`Pn`,{enumerable:!0,get:function(){return jv}}),Object.defineProperty(exports,`Pr`,{enumerable:!0,get:function(){return si}}),Object.defineProperty(exports,`Pt`,{enumerable:!0,get:function(){return Hb}}),Object.defineProperty(exports,`Q`,{enumerable:!0,get:function(){return fb}}),Object.defineProperty(exports,`Qi`,{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,`Qn`,{enumerable:!0,get:function(){return W_}}),Object.defineProperty(exports,`Qr`,{enumerable:!0,get:function(){return Br}}),Object.defineProperty(exports,`Qt`,{enumerable:!0,get:function(){return wb}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return uy}}),Object.defineProperty(exports,`Ri`,{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,`Rn`,{enumerable:!0,get:function(){return Sv}}),Object.defineProperty(exports,`Rr`,{enumerable:!0,get:function(){return br}}),Object.defineProperty(exports,`Rt`,{enumerable:!0,get:function(){return vx}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return VS}}),Object.defineProperty(exports,`Sa`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`Si`,{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,`Sn`,{enumerable:!0,get:function(){return Nb}}),Object.defineProperty(exports,`Sr`,{enumerable:!0,get:function(){return Ui}}),Object.defineProperty(exports,`St`,{enumerable:!0,get:function(){return Qy}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return sS}}),Object.defineProperty(exports,`Ta`,{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,`Ti`,{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,`Tn`,{enumerable:!0,get:function(){return Gb}}),Object.defineProperty(exports,`Tr`,{enumerable:!0,get:function(){return Di}}),Object.defineProperty(exports,`Tt`,{enumerable:!0,get:function(){return Yb}}),Object.defineProperty(exports,`U`,{enumerable:!0,get:function(){return zy}}),Object.defineProperty(exports,`Ui`,{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,`Un`,{enumerable:!0,get:function(){return fv}}),Object.defineProperty(exports,`Ur`,{enumerable:!0,get:function(){return Cr}}),Object.defineProperty(exports,`Ut`,{enumerable:!0,get:function(){return ib}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return Sb}}),Object.defineProperty(exports,`Vi`,{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,`Vn`,{enumerable:!0,get:function(){return xv}}),Object.defineProperty(exports,`Vr`,{enumerable:!0,get:function(){return wr}}),Object.defineProperty(exports,`Vt`,{enumerable:!0,get:function(){return bx}}),Object.defineProperty(exports,`W`,{enumerable:!0,get:function(){return tS}}),Object.defineProperty(exports,`Wi`,{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,`Wn`,{enumerable:!0,get:function(){return Cv}}),Object.defineProperty(exports,`Wr`,{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,`Wt`,{enumerable:!0,get:function(){return Dx}}),Object.defineProperty(exports,`X`,{enumerable:!0,get:function(){return eS}}),Object.defineProperty(exports,`Xi`,{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,`Xn`,{enumerable:!0,get:function(){return P_}}),Object.defineProperty(exports,`Xr`,{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(exports,`Xt`,{enumerable:!0,get:function(){return Hx}}),Object.defineProperty(exports,`Y`,{enumerable:!0,get:function(){return Iy}}),Object.defineProperty(exports,`Yi`,{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,`Yn`,{enumerable:!0,get:function(){return lv}}),Object.defineProperty(exports,`Yr`,{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(exports,`Yt`,{enumerable:!0,get:function(){return Rx}}),Object.defineProperty(exports,`Z`,{enumerable:!0,get:function(){return zb}}),Object.defineProperty(exports,`Zi`,{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,`Zn`,{enumerable:!0,get:function(){return tv}}),Object.defineProperty(exports,`Zr`,{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(exports,`Zt`,{enumerable:!0,get:function(){return mb}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return zS}}),Object.defineProperty(exports,`_a`,{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,`_i`,{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,`_n`,{enumerable:!0,get:function(){return hb}}),Object.defineProperty(exports,`_r`,{enumerable:!0,get:function(){return Ti}}),Object.defineProperty(exports,`_t`,{enumerable:!0,get:function(){return Lb}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return bS}}),Object.defineProperty(exports,`aa`,{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,`ai`,{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,`an`,{enumerable:!0,get:function(){return ky}}),Object.defineProperty(exports,`ar`,{enumerable:!0,get:function(){return ag}}),Object.defineProperty(exports,`at`,{enumerable:!0,get:function(){return Ty}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return RS}}),Object.defineProperty(exports,`ba`,{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,`bi`,{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,`bn`,{enumerable:!0,get:function(){return px}}),Object.defineProperty(exports,`br`,{enumerable:!0,get:function(){return xi}}),Object.defineProperty(exports,`bt`,{enumerable:!0,get:function(){return Dy}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return xS}}),Object.defineProperty(exports,`ca`,{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,`ci`,{enumerable:!0,get:function(){return On}}),Object.defineProperty(exports,`cn`,{enumerable:!0,get:function(){return ax}}),Object.defineProperty(exports,`cr`,{enumerable:!0,get:function(){return om}}),Object.defineProperty(exports,`ct`,{enumerable:!0,get:function(){return nx}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return OS}}),Object.defineProperty(exports,`da`,{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,`di`,{enumerable:!0,get:function(){return rr}}),Object.defineProperty(exports,`dn`,{enumerable:!0,get:function(){return Jx}}),Object.defineProperty(exports,`dr`,{enumerable:!0,get:function(){return fa}}),Object.defineProperty(exports,`dt`,{enumerable:!0,get:function(){return jy}}),Object.defineProperty(exports,`ea`,{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,`ei`,{enumerable:!0,get:function(){return vr}}),Object.defineProperty(exports,`en`,{enumerable:!0,get:function(){return gb}}),Object.defineProperty(exports,`er`,{enumerable:!0,get:function(){return nv}}),Object.defineProperty(exports,`et`,{enumerable:!0,get:function(){return Ay}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return NS}}),Object.defineProperty(exports,`fa`,{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,`fi`,{enumerable:!0,get:function(){return ir}}),Object.defineProperty(exports,`fn`,{enumerable:!0,get:function(){return gx}}),Object.defineProperty(exports,`fr`,{enumerable:!0,get:function(){return Ji}}),Object.defineProperty(exports,`ft`,{enumerable:!0,get:function(){return Bx}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return DS}}),Object.defineProperty(exports,`ga`,{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,`gi`,{enumerable:!0,get:function(){return dn}}),Object.defineProperty(exports,`gn`,{enumerable:!0,get:function(){return Tx}}),Object.defineProperty(exports,`gr`,{enumerable:!0,get:function(){return Si}}),Object.defineProperty(exports,`gt`,{enumerable:!0,get:function(){return Ix}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return PS}}),Object.defineProperty(exports,`ha`,{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,`hi`,{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(exports,`hn`,{enumerable:!0,get:function(){return Sx}}),Object.defineProperty(exports,`hr`,{enumerable:!0,get:function(){return Li}}),Object.defineProperty(exports,`ht`,{enumerable:!0,get:function(){return iS}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return IS}}),Object.defineProperty(exports,`ia`,{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(exports,`ii`,{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,`in`,{enumerable:!0,get:function(){return Lx}}),Object.defineProperty(exports,`ir`,{enumerable:!0,get:function(){return A_}}),Object.defineProperty(exports,`it`,{enumerable:!0,get:function(){return Eb}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return Ox}}),Object.defineProperty(exports,`ja`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`ji`,{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,`jn`,{enumerable:!0,get:function(){return lb}}),Object.defineProperty(exports,`jr`,{enumerable:!0,get:function(){return oi}}),Object.defineProperty(exports,`jt`,{enumerable:!0,get:function(){return Cb}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return Ly}}),Object.defineProperty(exports,`ka`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`ki`,{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,`kn`,{enumerable:!0,get:function(){return Mb}}),Object.defineProperty(exports,`kr`,{enumerable:!0,get:function(){return pi}}),Object.defineProperty(exports,`kt`,{enumerable:!0,get:function(){return Qb}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return SS}}),Object.defineProperty(exports,`la`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`li`,{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(exports,`ln`,{enumerable:!0,get:function(){return Ib}}),Object.defineProperty(exports,`lr`,{enumerable:!0,get:function(){return da}}),Object.defineProperty(exports,`lt`,{enumerable:!0,get:function(){return My}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return HS}}),Object.defineProperty(exports,`ma`,{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,`mi`,{enumerable:!0,get:function(){return ar}}),Object.defineProperty(exports,`mn`,{enumerable:!0,get:function(){return zx}}),Object.defineProperty(exports,`mr`,{enumerable:!0,get:function(){return Zi}}),Object.defineProperty(exports,`mt`,{enumerable:!0,get:function(){return lx}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return ES}}),Object.defineProperty(exports,`na`,{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,`ni`,{enumerable:!0,get:function(){return gr}}),Object.defineProperty(exports,`nn`,{enumerable:!0,get:function(){return Pb}}),Object.defineProperty(exports,`nr`,{enumerable:!0,get:function(){return N_}}),Object.defineProperty(exports,`nt`,{enumerable:!0,get:function(){return ix}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return AS}}),Object.defineProperty(exports,`oa`,{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,`oi`,{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,`on`,{enumerable:!0,get:function(){return tb}}),Object.defineProperty(exports,`or`,{enumerable:!0,get:function(){return rg}}),Object.defineProperty(exports,`ot`,{enumerable:!0,get:function(){return Wy}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return CS}}),Object.defineProperty(exports,`pa`,{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,`pi`,{enumerable:!0,get:function(){return qn}}),Object.defineProperty(exports,`pn`,{enumerable:!0,get:function(){return ox}}),Object.defineProperty(exports,`pr`,{enumerable:!0,get:function(){return Qi}}),Object.defineProperty(exports,`pt`,{enumerable:!0,get:function(){return Xb}}),Object.defineProperty(exports,`q`,{enumerable:!0,get:function(){return Fy}}),Object.defineProperty(exports,`qi`,{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,`qn`,{enumerable:!0,get:function(){return mv}}),Object.defineProperty(exports,`qr`,{enumerable:!0,get:function(){return zr}}),Object.defineProperty(exports,`qt`,{enumerable:!0,get:function(){return aS}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return yS}}),Object.defineProperty(exports,`ra`,{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,`ri`,{enumerable:!0,get:function(){return jn}}),Object.defineProperty(exports,`rn`,{enumerable:!0,get:function(){return Rb}}),Object.defineProperty(exports,`rr`,{enumerable:!0,get:function(){return j_}}),Object.defineProperty(exports,`rt`,{enumerable:!0,get:function(){return Tb}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return TS}}),Object.defineProperty(exports,`sa`,{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,`si`,{enumerable:!0,get:function(){return Un}}),Object.defineProperty(exports,`sn`,{enumerable:!0,get:function(){return fx}}),Object.defineProperty(exports,`sr`,{enumerable:!0,get:function(){return ng}}),Object.defineProperty(exports,`st`,{enumerable:!0,get:function(){return Zy}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return US}}),Object.defineProperty(exports,`ta`,{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,`ti`,{enumerable:!0,get:function(){return _r}}),Object.defineProperty(exports,`tn`,{enumerable:!0,get:function(){return Nx}}),Object.defineProperty(exports,`tr`,{enumerable:!0,get:function(){return G_}}),Object.defineProperty(exports,`tt`,{enumerable:!0,get:function(){return dx}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return wS}}),Object.defineProperty(exports,`ua`,{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,`ui`,{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,`un`,{enumerable:!0,get:function(){return $b}}),Object.defineProperty(exports,`ur`,{enumerable:!0,get:function(){return aa}}),Object.defineProperty(exports,`ut`,{enumerable:!0,get:function(){return Ny}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return kS}}),Object.defineProperty(exports,`va`,{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,`vi`,{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,`vn`,{enumerable:!0,get:function(){return _b}}),Object.defineProperty(exports,`vr`,{enumerable:!0,get:function(){return _i}}),Object.defineProperty(exports,`vt`,{enumerable:!0,get:function(){return vy}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return jS}}),Object.defineProperty(exports,`wa`,{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,`wi`,{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,`wn`,{enumerable:!0,get:function(){return Mx}}),Object.defineProperty(exports,`wr`,{enumerable:!0,get:function(){return zi}}),Object.defineProperty(exports,`wt`,{enumerable:!0,get:function(){return Jb}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return LS}}),Object.defineProperty(exports,`xa`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`xi`,{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,`xn`,{enumerable:!0,get:function(){return Wb}}),Object.defineProperty(exports,`xr`,{enumerable:!0,get:function(){return Ei}}),Object.defineProperty(exports,`xt`,{enumerable:!0,get:function(){return Kb}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return FS}}),Object.defineProperty(exports,`ya`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`yi`,{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,`yn`,{enumerable:!0,get:function(){return ux}}),Object.defineProperty(exports,`yr`,{enumerable:!0,get:function(){return wi}}),Object.defineProperty(exports,`yt`,{enumerable:!0,get:function(){return _y}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return Hy}}),Object.defineProperty(exports,`zi`,{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,`zn`,{enumerable:!0,get:function(){return vv}}),Object.defineProperty(exports,`zr`,{enumerable:!0,get:function(){return xr}}),Object.defineProperty(exports,`zt`,{enumerable:!0,get:function(){return ex}});
|