your-ai-workflow-firebase-os 1.14.64 → 1.14.65
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/App.d.ts +2 -0
- package/dist/{ContactPopup-BHKydpzz.cjs → ContactPopup-D51WT_JX.cjs} +1 -1
- package/dist/{ContactPopup-DaIF12rZ.js → ContactPopup-DeKjWUuc.js} +1 -1
- package/dist/components/AccessNotice.d.ts +28 -0
- package/dist/components/AddRoleFooter.d.ts +15 -0
- package/dist/components/AddressField.d.ts +14 -0
- package/dist/components/AddressFieldLoaded.d.ts +5 -0
- package/dist/components/AdminNotifications.d.ts +81 -0
- package/dist/components/AppCrash.d.ts +49 -0
- package/dist/components/ArrivalsFromLinks.d.ts +2 -0
- package/dist/components/Article.d.ts +9 -0
- package/dist/components/AttachmentField.d.ts +9 -0
- package/dist/components/AutoGrowTextArea.d.ts +3 -0
- package/dist/components/BackArrow.d.ts +12 -0
- package/dist/components/BuildChecksCard.d.ts +1 -0
- package/dist/components/Button.d.ts +8 -0
- package/dist/components/BuyerDetails.d.ts +54 -0
- package/dist/components/Card.d.ts +18 -0
- package/dist/components/Checkout.d.ts +30 -0
- package/dist/components/CheckoutReturn.d.ts +16 -0
- package/dist/components/ConfirmModal.d.ts +12 -0
- package/dist/components/ContactPopup.d.ts +67 -0
- package/dist/components/ContentSlot.d.ts +20 -0
- package/dist/components/CustomSelect.d.ts +67 -0
- package/dist/components/DashboardNav.d.ts +28 -0
- package/dist/components/DataTable.d.ts +43 -0
- package/dist/components/EnrolSecondFactor.d.ts +6 -0
- package/dist/components/FormNote.d.ts +9 -0
- package/dist/components/Input.d.ts +8 -0
- package/dist/components/JsonEditor.d.ts +5 -0
- package/dist/components/Lightbox.d.ts +22 -0
- package/dist/components/Loader.d.ts +17 -0
- package/dist/components/ManagePlanButton.d.ts +12 -0
- package/dist/components/Navbar.d.ts +22 -0
- package/dist/components/PageTitle.d.ts +19 -0
- package/dist/components/PasswordRules.d.ts +4 -0
- package/dist/components/PayButton.d.ts +27 -0
- package/dist/components/PaymentReturn.d.ts +3 -0
- package/dist/components/PhoneInputField.d.ts +20 -0
- package/dist/components/Pipeline.d.ts +36 -0
- package/dist/components/Popup.d.ts +25 -0
- package/dist/components/ProviderMark.d.ts +15 -0
- package/dist/components/RegistrationFields.d.ts +12 -0
- package/dist/components/RoadsKeeper.d.ts +4 -0
- package/dist/components/RouteGuards.d.ts +111 -0
- package/dist/components/Said.d.ts +18 -0
- package/dist/components/SecondStep.d.ts +37 -0
- package/dist/components/SectionHeading.d.ts +17 -0
- package/dist/components/SendTestEmail.d.ts +5 -0
- package/dist/components/SignInButtons.d.ts +52 -0
- package/dist/components/SigningIn.d.ts +37 -0
- package/dist/components/Sortable.d.ts +21 -0
- package/dist/components/StepBar.d.ts +15 -0
- package/dist/components/SupportBar.d.ts +7 -0
- package/dist/components/SystemTabContent.d.ts +41 -0
- package/dist/components/TextArea.d.ts +8 -0
- package/dist/components/Trouble.d.ts +67 -0
- package/dist/components/TwoStepCard.d.ts +1 -0
- package/dist/components/UploadBox.d.ts +26 -0
- package/dist/components/ViewingAs.d.ts +67 -0
- package/dist/components/YourDetailsCard.d.ts +1 -0
- package/dist/components/ai/ModelLogo.d.ts +30 -0
- package/dist/components/ai/ModelSelect.d.ts +34 -0
- package/dist/components/ai/PageAiField.d.ts +42 -0
- package/dist/components/chat/Avatar.d.ts +11 -0
- package/dist/components/chat/ChatIcon.d.ts +18 -0
- package/dist/components/chat/ChatPanel.d.ts +12 -0
- package/dist/components/chat/ChatThread.d.ts +24 -0
- package/dist/components/chat/Composer.d.ts +26 -0
- package/dist/components/chat/GroupDetails.d.ts +8 -0
- package/dist/components/chat/MentionBox.d.ts +10 -0
- package/dist/components/chat/NewThread.d.ts +8 -0
- package/dist/components/chat/PageChatField.d.ts +23 -0
- package/dist/components/chat/ThreadList.d.ts +13 -0
- package/dist/components/chat/ThreadView.d.ts +41 -0
- package/dist/components/fields/Fields.d.ts +263 -0
- package/dist/components/fields/IconPicker.d.ts +56 -0
- package/dist/components/fields/MediaField.d.ts +37 -0
- package/dist/components/fields/PromptCard.d.ts +14 -0
- package/dist/components/fields/TimeZoneField.d.ts +8 -0
- package/dist/components/fields/UploadField.d.ts +26 -0
- package/dist/components/fields/index.d.ts +5 -0
- package/dist/components/media/AssetPicker.d.ts +17 -0
- package/dist/components/media/DrawLayer.d.ts +23 -0
- package/dist/components/media/FileViewer.d.ts +27 -0
- package/dist/components/media/FileViewerPopup.d.ts +6 -0
- package/dist/components/media/KindIcon.d.ts +9 -0
- package/dist/components/media/LocalPicture.d.ts +5 -0
- package/dist/components/media/PdfPages.d.ts +18 -0
- package/dist/components/media/Picture.d.ts +51 -0
- package/dist/components/media/VideoPlayer.d.ts +22 -0
- package/dist/components/media/bake.d.ts +3 -0
- package/dist/components/media/fileBytes.d.ts +5 -0
- package/dist/components/media/mediaKind.d.ts +27 -0
- package/dist/components/media/pdfEngine.d.ts +21 -0
- package/dist/components/navOverflow.d.ts +35 -0
- package/dist/components/schedule/BlockedDatesField.d.ts +19 -0
- package/dist/components/schedule/BookingAnswers.d.ts +14 -0
- package/dist/components/schedule/BookingCalendar.d.ts +23 -0
- package/dist/components/schedule/BookingLinksCard.d.ts +90 -0
- package/dist/components/schedule/BookingPagesCard.d.ts +30 -0
- package/dist/components/schedule/BookingQuestionsField.d.ts +5 -0
- package/dist/components/schedule/CalendarCard.d.ts +36 -0
- package/dist/components/schedule/CalendarView.d.ts +111 -0
- package/dist/components/schedule/CopyLink.d.ts +5 -0
- package/dist/components/schedule/EventCard.d.ts +84 -0
- package/dist/components/schedule/EventDetail.d.ts +117 -0
- package/dist/components/schedule/PickedTime.d.ts +10 -0
- package/dist/components/schedule/SchedulePicker.d.ts +16 -0
- package/dist/components/schedule/SlotPicker.d.ts +31 -0
- package/dist/components/schedule/TimeChips.d.ts +31 -0
- package/dist/components/tabIconForLink.d.ts +18 -0
- package/dist/configs/forms/contactForm.config.d.ts +15 -0
- package/dist/configs/forms/index.d.ts +59 -0
- package/dist/configs/forms/registry.d.ts +11 -0
- package/dist/configs/forms/supportForm.config.d.ts +15 -0
- package/dist/configs/pages/admin.config.d.ts +8 -0
- package/dist/configs/pages/contact.config.d.ts +6 -0
- package/dist/configs/pages/internal.config.d.ts +17 -0
- package/dist/configs/pages/mem.config.d.ts +1 -0
- package/dist/configs/pages/menuOrders.config.d.ts +17 -0
- package/dist/configs/pages/pub.config.d.ts +7 -0
- package/dist/configs/pages/registry.d.ts +14 -0
- package/dist/configs/pages/support.config.d.ts +7 -0
- package/dist/configs/pages/tabOrders.config.d.ts +32 -0
- package/dist/configs/pages/templates.d.ts +38 -0
- package/dist/configs/pages/user.config.d.ts +8 -0
- package/dist/configs/theme.config.d.ts +75 -0
- package/dist/contract/aiRules.d.ts +2 -0
- package/dist/contract/fakeUploadTask.d.ts +33 -0
- package/dist/contract/rulesCheckedFirestore.d.ts +115 -0
- package/dist/contract/rulesCheckedStorage.d.ts +62 -0
- package/dist/contract/rulesEngine.d.ts +125 -0
- package/dist/index.d.ts +5 -0
- package/dist/lib/access.d.ts +430 -0
- package/dist/lib/address.d.ts +126 -0
- package/dist/lib/addressLink.d.ts +81 -0
- package/dist/lib/addressLookup.d.ts +60 -0
- package/dist/lib/ai.d.ts +102 -0
- package/dist/lib/aiModels.d.ts +79 -0
- package/dist/lib/aiPageLines.d.ts +38 -0
- package/dist/lib/aiStatus.d.ts +31 -0
- package/dist/lib/arrivalRoads.d.ts +31 -0
- package/dist/lib/assetList.d.ts +30 -0
- package/dist/lib/assetUpload.d.ts +129 -0
- package/dist/lib/attachedLinks.d.ts +53 -0
- package/dist/lib/authMethods.d.ts +299 -0
- package/dist/lib/bareImgWatch.d.ts +42 -0
- package/dist/lib/bookingLinks.d.ts +133 -0
- package/dist/lib/bookingPageShape.d.ts +80 -0
- package/dist/lib/bookingPages.d.ts +28 -0
- package/dist/lib/bookingState.d.ts +83 -0
- package/dist/lib/buildChecks.d.ts +61 -0
- package/dist/lib/buildTarget.d.ts +40 -0
- package/dist/lib/buyerBasics.d.ts +24 -0
- package/dist/lib/cases.d.ts +125 -0
- package/dist/lib/casesFromForm.d.ts +117 -0
- package/dist/lib/chat.d.ts +475 -0
- package/dist/lib/chatAlerts.d.ts +52 -0
- package/dist/lib/chatPageLines.d.ts +57 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/contentFallback.d.ts +20 -0
- package/dist/lib/contentKey.d.ts +38 -0
- package/dist/lib/countryList.d.ts +17 -0
- package/dist/lib/creator.d.ts +36 -0
- package/dist/lib/customPayments.d.ts +54 -0
- package/dist/lib/email.d.ts +84 -0
- package/dist/lib/emailBrand.d.ts +31 -0
- package/dist/lib/emailTested.d.ts +11 -0
- package/dist/lib/errorWatch.d.ts +70 -0
- package/dist/lib/fileCache.d.ts +68 -0
- package/dist/lib/fileDrop.d.ts +20 -0
- package/dist/lib/firebase.d.ts +5 -0
- package/dist/lib/fitToLine.d.ts +25 -0
- package/dist/lib/groups.d.ts +42 -0
- package/dist/lib/heldSaves.d.ts +23 -0
- package/dist/lib/iconSearch.d.ts +20 -0
- package/dist/lib/knownRoles.d.ts +83 -0
- package/dist/lib/lazyChunk.d.ts +34 -0
- package/dist/lib/localSetup.d.ts +40 -0
- package/dist/lib/mediaFacts.d.ts +119 -0
- package/dist/lib/menuIcon.d.ts +7 -0
- package/dist/lib/menuVisibility.d.ts +27 -0
- package/dist/lib/mfa.d.ts +95 -0
- package/dist/lib/money.d.ts +24 -0
- package/dist/lib/nextStop.d.ts +29 -0
- package/dist/lib/notFoundHelp.d.ts +31 -0
- package/dist/lib/notices.d.ts +16 -0
- package/dist/lib/notify.d.ts +22 -0
- package/dist/lib/orderEntry.d.ts +73 -0
- package/dist/lib/pageDesignLines.d.ts +106 -0
- package/dist/lib/pageErasure.d.ts +90 -0
- package/dist/lib/pageFiles.d.ts +69 -0
- package/dist/lib/pageGutter.d.ts +42 -0
- package/dist/lib/pageRegistry.d.ts +15 -0
- package/dist/lib/pageRows.d.ts +21 -0
- package/dist/lib/pageUpload.d.ts +115 -0
- package/dist/lib/pascalCase.d.ts +7 -0
- package/dist/lib/password.d.ts +36 -0
- package/dist/lib/paymentNews.d.ts +50 -0
- package/dist/lib/paymentProducts.d.ts +374 -0
- package/dist/lib/payments.d.ts +219 -0
- package/dist/lib/people.d.ts +58 -0
- package/dist/lib/personName.d.ts +58 -0
- package/dist/lib/phoneClaims.d.ts +53 -0
- package/dist/lib/pictureCache.d.ts +111 -0
- package/dist/lib/pictureRefresh.d.ts +32 -0
- package/dist/lib/pictureSizes.d.ts +77 -0
- package/dist/lib/planRoles.d.ts +65 -0
- package/dist/lib/pointerDrag.d.ts +39 -0
- package/dist/lib/publishSteps.d.ts +105 -0
- package/dist/lib/recordsCache.d.ts +5 -0
- package/dist/lib/recordsKey.d.ts +21 -0
- package/dist/lib/registrationFields.d.ts +269 -0
- package/dist/lib/removedAccount.d.ts +23 -0
- package/dist/lib/reservedAddresses.d.ts +24 -0
- package/dist/lib/reveal.d.ts +46 -0
- package/dist/lib/roleIcon.d.ts +5 -0
- package/dist/lib/roleRequests.d.ts +60 -0
- package/dist/lib/roles.d.ts +111 -0
- package/dist/lib/rulesArriving.d.ts +72 -0
- package/dist/lib/schedule.d.ts +970 -0
- package/dist/lib/scheduleData.d.ts +475 -0
- package/dist/lib/serviceStatus.d.ts +46 -0
- package/dist/lib/serviceSwitches.d.ts +34 -0
- package/dist/lib/setupDone.d.ts +56 -0
- package/dist/lib/sharedSnapshot.d.ts +12 -0
- package/dist/lib/shellWidth.d.ts +12 -0
- package/dist/lib/shrinkImage.d.ts +149 -0
- package/dist/lib/signIn.d.ts +199 -0
- package/dist/lib/startAgain.d.ts +31 -0
- package/dist/lib/steps.d.ts +28 -0
- package/dist/lib/tabAccess.d.ts +25 -0
- package/dist/lib/tabAudience.d.ts +49 -0
- package/dist/lib/tabIcons.d.ts +15 -0
- package/dist/lib/transactions.d.ts +133 -0
- package/dist/lib/trouble.d.ts +130 -0
- package/dist/lib/uploadQueue.d.ts +145 -0
- package/dist/lib/useIsPhone.d.ts +3 -0
- package/dist/lib/verifiedAccount.d.ts +59 -0
- package/dist/lib/verifyMail.d.ts +28 -0
- package/dist/lib/version.d.ts +1 -0
- package/dist/lib/visitorState.d.ts +7 -0
- package/dist/lib/waiting.d.ts +25 -0
- package/dist/microcomponents/registry.d.ts +14 -0
- package/dist/pages/AiModelsAdmin.d.ts +30 -0
- package/dist/pages/Assets.d.ts +6 -0
- package/dist/pages/Billing.d.ts +45 -0
- package/dist/pages/BookingPage.d.ts +11 -0
- package/dist/pages/ConfirmEmail.d.ts +24 -0
- package/dist/pages/Dashboard.d.ts +10 -0
- package/dist/pages/DynamicPage.d.ts +1 -0
- package/dist/pages/EmailAdmin.d.ts +31 -0
- package/dist/pages/FormsAdmin.d.ts +23 -0
- package/dist/pages/Guide.d.ts +25 -0
- package/dist/pages/Home.d.ts +1 -0
- package/dist/pages/Inbox.d.ts +9 -0
- package/dist/pages/Login.d.ts +1 -0
- package/dist/pages/MeetPage.d.ts +31 -0
- package/dist/pages/MyBookings.d.ts +3 -0
- package/dist/pages/PagePayments.d.ts +40 -0
- package/dist/pages/PagesAdmin.d.ts +1291 -0
- package/dist/pages/PayPage.d.ts +1 -0
- package/dist/pages/PaymentComplete.d.ts +3 -0
- package/dist/pages/PaymentItemRow.d.ts +14 -0
- package/dist/pages/PaymentLinks.d.ts +24 -0
- package/dist/pages/PaymentsAdmin.d.ts +48 -0
- package/dist/pages/PaymentsGoLive.d.ts +15 -0
- package/dist/pages/PaymentsProducts.d.ts +13 -0
- package/dist/pages/PaymentsWiring.d.ts +32 -0
- package/dist/pages/Profile.d.ts +1 -0
- package/dist/pages/PublishApp.d.ts +1 -0
- package/dist/pages/Register.d.ts +11 -0
- package/dist/pages/RegisterAs.d.ts +12 -0
- package/dist/pages/RegistrationQuestions.d.ts +59 -0
- package/dist/pages/ResetPassword.d.ts +1 -0
- package/dist/pages/ScheduleAdmin.d.ts +77 -0
- package/dist/pages/Setup.d.ts +62 -0
- package/dist/pages/SetupPayments.d.ts +116 -0
- package/dist/pages/SignInAdmin.d.ts +34 -0
- package/dist/pages/SystemTabsSection.d.ts +115 -0
- package/dist/pages/ThemeAdmin.d.ts +73 -0
- package/dist/pages/TransactionsAdmin.d.ts +25 -0
- package/dist/pages/TwoStep.d.ts +1 -0
- package/dist/pages/Users.d.ts +85 -0
- package/dist/pages/Verify.d.ts +1 -0
- package/dist/pages/YourDetails.d.ts +1 -0
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.es.js +1 -1
- package/dist/server/ai.d.ts +254 -0
- package/dist/server/auth.d.ts +55 -0
- package/dist/server/checks.d.ts +9 -0
- package/dist/server/email.d.ts +277 -0
- package/dist/server/firestore.d.ts +44 -0
- package/dist/server/ownPayments.d.ts +75 -0
- package/dist/server/paymentWords.d.ts +10 -0
- package/dist/server/planRoles.d.ts +52 -0
- package/dist/server/recent.d.ts +28 -0
- package/dist/server/selftest.d.ts +14 -0
- package/dist/server/stripeClient.d.ts +60 -0
- package/dist/server.cjs.js +5 -5
- package/dist/server.es.js +341 -327
- package/dist/templates/AdminPageTemplate.d.ts +5 -0
- package/dist/templates/InternalPageTemplate.d.ts +7 -0
- package/dist/templates/PublicPageTemplate.d.ts +29 -0
- package/dist/templates/TemplateBoard.d.ts +10 -0
- package/dist/templates/TemplateCalendar.d.ts +10 -0
- package/dist/templates/TemplateDrive.d.ts +41 -0
- package/dist/templates/TemplateInlineForm.d.ts +1 -0
- package/dist/templates/TemplatePopupForm.d.ts +1 -0
- package/dist/templates/TemplateTable.d.ts +9 -0
- package/dist/templates/UserPageTemplate.d.ts +7 -0
- package/dist/templates/caseMode.d.ts +64 -0
- package/dist/{validate-DsjbnxQw.js → validate-4d7Du1h4.js} +298 -206
- package/dist/validate-S9GIZ4p8.cjs +103 -0
- package/dist/vite/aiCode.d.ts +24 -0
- package/dist/vite/canonical.d.ts +72 -0
- package/dist/vite/discover.d.ts +77 -0
- package/dist/vite/plugin.d.ts +31 -0
- package/dist/vite/validate.d.ts +39 -0
- package/dist/vite.cjs.js +1 -1
- package/dist/vite.es.js +1 -1
- package/dist/your-ai-workflow-firebase-os.cjs.js +40 -40
- package/dist/your-ai-workflow-firebase-os.es.js +9849 -9493
- package/package.json +1 -1
- package/dist/validate-Dw3SUMiG.cjs +0 -103
package/dist/App.d.ts
ADDED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./verifiedAccount-COYkSEid.cjs`),n=require(`./lucide-react-CWbDYh_b.cjs`),r=require(`./shrinkImage-C_4Lixmb.cjs`),i=require(`./address-B2E5LmUz.cjs`);let a=require(`react`);a=e.a(a,1);let o=require(`react/jsx-runtime`),s=require(`firebase/app`),c=require(`firebase/auth`),l=require(`firebase/firestore`),u=require(`firebase/storage`),d=require(`react-router-dom`),f=require(`react-dom`);var p=e.r({contactFormConfig:()=>m}),m={systemName:`contact`,formType:`public`,redirectTo:`/`,title:`Get in Touch`,buttonName:`Contact Us`,submitText:`Send Message`,fields:[{name:`name`,type:`text`,label:`Full Name`,placeholder:`John Doe`,required:!0},{name:`email`,type:`email`,label:`Email Address`,placeholder:`john@example.com`,required:!0},{name:`phone`,type:`tel`,label:`Phone Number`,placeholder:`+1 (555) 000-0000`,required:!1},{name:`questions`,type:`textarea`,label:`Your Questions`,placeholder:`How can we help you?`,required:!0}]},h=e.r({supportFormConfig:()=>g}),g={systemName:`support`,formType:`private`,redirectTo:`/dashboard`,title:`Request Assistance`,buttonName:`Get Assistance`,submitText:`Submit Request`,fields:[{name:`topic`,type:`text`,label:`Topic`,placeholder:`E.g. Password reset issue`,required:!0},{name:`contactEmail`,type:`email`,label:`Contact Email`,placeholder:`your@email.com`,required:!0},{name:`description`,type:`textarea`,label:`Description`,placeholder:`Please describe your issue in detail...`,required:!0}]},_={appName:`Your AI Firebase`,defaultTheme:`light`,showThemeToggle:!0,logoUrl:`https://firebasestorage.googleapis.com/v0/b/fir-os-47863.firebasestorage.app/o/pub_files%2F1776321238933_favicon_smaller.png?alt=media&token=efecb55c-2456-4cbe-a20a-b86db54a1e55`,faviconUrl:`https://firebasestorage.googleapis.com/v0/b/fir-os-47863.firebasestorage.app/o/pub_files%2F1776321238933_favicon_smaller.png?alt=media&token=efecb55c-2456-4cbe-a20a-b86db54a1e55`,colors:{dark:{background:`#07070f`,backgroundSecondary:`#0a0a18`,foreground:`#f0eeff`,accent:`#a78bfa`,buttonText:`#ffffff`},light:{background:`#fcfaff`,backgroundSecondary:`#f7f3ff`,foreground:`#1e1b4b`,accent:`#7c3aed`,buttonText:`#ffffff`}},cornerRounding:`default`,cornerRadii:{buttonRadius:.75,inputRadius:.75,cardRadius:1.5,modalRadius:2.5}},v=(0,a.createContext)({});function y({config:e,children:t}){return(0,o.jsx)(v.Provider,{value:e,children:t})}var b=()=>(0,a.useContext)(v),x=`1.14.64`,S=typeof window<`u`?a.useLayoutEffect:a.useEffect,C=(0,a.createContext)(void 0),w=e=>{let t=e?.defaultTheme;return t!==`light`&&t!==`dark`||e?.showThemeToggle?null:t};function T({children:e,scopeSelector:t}){let n=b(),r=(0,a.useMemo)(()=>n?.themeConfig||_,[n?.themeConfig]),i=w(r),s=!!r.showThemeToggle;(0,a.useEffect)(()=>{try{localStorage.removeItem(`theme_config_cache`),localStorage.removeItem(`theme_saved_cache`)}catch{}console.info(`Your AI Firebase ${x} · colours from theme.config.ts`)},[]);let[c,l]=(0,a.useState)(()=>{if(i)return i;if(typeof window>`u`)return r.defaultTheme||`system`;let e=localStorage.getItem(`theme-mode`),t=localStorage.getItem(`last-seen-default-theme`);return r.defaultTheme&&r.defaultTheme!==t?(localStorage.setItem(`last-seen-default-theme`,r.defaultTheme),localStorage.removeItem(`theme-mode`),r.defaultTheme):e||r.defaultTheme||`system`}),[u,d]=(0,a.useState)(()=>{if(i)return i;if(typeof window>`u`)return r.defaultTheme===`light`?`light`:`dark`;let e=localStorage.getItem(`theme-mode`),t=localStorage.getItem(`last-seen-default-theme`),n=e||r.defaultTheme||`system`;return r.defaultTheme&&r.defaultTheme!==t&&(n=r.defaultTheme),n===`system`?window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`:n});return(0,a.useEffect)(()=>{let e=r.defaultTheme;e&&(i&&l(i),e!==localStorage.getItem(`last-seen-default-theme`)&&(localStorage.setItem(`last-seen-default-theme`,e),localStorage.removeItem(`theme-mode`),l(e)))},[r.defaultTheme,i]),(0,a.useEffect)(()=>{let e=e=>{c===`system`&&d(e.matches?`light`:`dark`)},t=window.matchMedia(`(prefers-color-scheme: light)`);return c===`system`?(d(t.matches?`light`:`dark`),t.addEventListener(`change`,e)):d(c),()=>t.removeEventListener(`change`,e)},[c]),S(()=>{let e=(t?document.querySelector(t):document.documentElement)||document.documentElement,n=u===`dark`?r.colors.dark:r.colors.light;e.style.setProperty(`--bg-color`,n.background),e.style.setProperty(`--bg-secondary-color`,n.backgroundSecondary||n.background),e.style.setProperty(`--fg-color`,n.foreground),e.style.setProperty(`--accent-color`,n.accent);let i=u===`dark`;e.style.setProperty(`--panel-bg`,n.panelBg||`color-mix(in srgb, ${n.accent} ${i?`5%`:`4%`}, transparent)`),e.style.setProperty(`--panel-border`,n.panelBorder||`color-mix(in srgb, ${n.accent} 15%, transparent)`);let a=(e,t,n)=>{if(!e||e.length===0)return t||`transparent`;if(e.length===1)return e[0];let r=e.map((t,n)=>`${t} ${Math.round(n/(e.length-1)*100)}%`).join(`, `);return n===`conic`?`conic-gradient(from 180deg at 50% 100%, ${r})`:`linear-gradient(135deg, ${r})`},o=`linear-gradient(135deg, color-mix(in oklab, ${n.accent} ${i?`70%`:`78%`}, black) 0%, ${n.accent} 100%)`,s=`linear-gradient(135deg, color-mix(in oklab, ${n.accent} ${i?`80%`:`85%`}, black) 0%, color-mix(in oklab, ${n.accent} 72%, white) 100%)`;e.style.setProperty(`--button-bg`,a(n.buttonGradient,o,n.buttonGradientShape)),e.style.setProperty(`--button-fg`,n.buttonText||`#ffffff`),e.style.setProperty(`--button-hover-bg`,a(n.buttonHoverGradient||n.buttonGradient,s,n.buttonGradientShape)),e.style.setProperty(`--text-gradient`,a(n.textGradient,`linear-gradient(135deg, ${n.foreground} 0%, ${n.accent} 100%)`)),e.style.setProperty(`--glow-color`,n.glowColor||`color-mix(in srgb, ${n.accent} ${i?`40%`:`30%`}, transparent)`),e.style.setProperty(`--notification-icon-color`,n.notificationIconColor||n.accent);let l=n.secondaryButton?.bg||(u===`dark`?`rgba(255, 255, 255, 0.05)`:`rgba(0, 0, 0, 0.03)`),d=n.secondaryButton?.border||(u===`dark`?`rgba(255, 255, 255, 0.1)`:`rgba(0, 0, 0, 0.06)`),f=n.secondaryButton?.text||n.foreground;if(e.style.setProperty(`--btn-sec-bg`,l),e.style.setProperty(`--btn-sec-border`,d),e.style.setProperty(`--btn-sec-text`,f),e.style.setProperty(`--selection-bg`,n.selectionBg||`color-mix(in srgb, var(--accent-color) 40%, transparent)`),e.style.setProperty(`--selection-text`,n.selectionText||`#ffffff`),e.setAttribute(`data-theme`,u),localStorage.setItem(`theme-mode`,c),r.cornerRounding===`custom`&&r.cornerRadii?(e.style.setProperty(`--btn-radius`,`${parseFloat(String(r.cornerRadii.buttonRadius))||0}rem`),e.style.setProperty(`--card-radius`,`${parseFloat(String(r.cornerRadii.cardRadius))||0}rem`),e.style.setProperty(`--input-radius`,`${parseFloat(String(r.cornerRadii.inputRadius))||0}rem`),e.style.setProperty(`--modal-radius`,`${parseFloat(String(r.cornerRadii.modalRadius))||0}rem`)):(e.style.setProperty(`--btn-radius`,`0.75rem`),e.style.setProperty(`--card-radius`,`1.5rem`),e.style.setProperty(`--input-radius`,`0.75rem`),e.style.setProperty(`--modal-radius`,`1.5rem`)),!document.getElementById(`inter-font`)){let e=document.createElement(`link`);e.id=`inter-font`,e.rel=`stylesheet`,e.href=`https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap`,document.head.appendChild(e)}e.style.fontSize=`16px`,e.style.setProperty(`--weight-h1`,`800`),e.style.setProperty(`--weight-h2`,`700`),e.style.setProperty(`--weight-h3`,`700`),e.style.setProperty(`--leading-normal`,`1.5`);let p=document.querySelector(`link[rel*='icon']`);p||(p=document.createElement(`link`),p.rel=`icon`,document.head.appendChild(p)),r.faviconUrl&&(p.href=r.faviconUrl),r.appName&&(document.title=r.appName)},[u,c,r]),(0,o.jsx)(C.Provider,{value:{theme:u,setTheme:e=>{i||l(e)},toggleTheme:()=>{i||l(u===`light`?`dark`:`light`)},isSystem:c===`system`,setIsSystem:e=>{i||l(e?`system`:u)},config:r,activeConfig:r,canSwitchTheme:s},children:e})}var ee=()=>{let e=(0,a.useContext)(C);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e},E=null,D=null,O=null,k=null,A=null,j=`https://firebasestorage.googleapis.com`;function M(){if(typeof document>`u`||!document.head||document.head.querySelector(`link[rel="preconnect"][href="${j}"]`))return;let e=document.createElement(`link`);e.rel=`preconnect`,e.href=j,document.head.appendChild(e)}function te(e){M();let t=e.projectId||``;if((0,s.getApps)().length&&A===t){E=(0,s.getApp)(),D=(0,c.getAuth)(E);try{O=(0,l.initializeFirestore)(E,{localCache:(0,l.persistentLocalCache)({tabManager:(0,l.persistentMultipleTabManager)()})})}catch{O=(0,l.getFirestore)(E)}k=(0,u.getStorage)(E);return}if((0,s.getApps)().length&&A!==t)try{(0,s.deleteApp)((0,s.getApp)())}catch{}E=(0,s.initializeApp)(e),A=t,D=(0,c.getAuth)(E);try{O=(0,l.initializeFirestore)(E,{localCache:(0,l.persistentLocalCache)({tabManager:(0,l.persistentMultipleTabManager)()})})}catch{O=(0,l.getFirestore)(E)}k=(0,u.getStorage)(E)}function ne(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 N=[`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`],re={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 ie(){let e={};for(let t of N){let n=ne(t);if(!n)return null;e[re[t]]=n}return e}var P=ie();P&&!(0,s.getApps)().length&&te(P);var F=`firebase-os:chunk-reloaded`,I=400,L=()=>{try{return sessionStorage.getItem(F)===`1`}catch{return!0}},ae=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`)},oe=e=>new Promise(t=>setTimeout(t,e));function R(e,t={}){let n=t.pause??I,r=t.reload??(()=>{typeof window<`u`&&window.location.reload()});return(0,a.lazy)(async()=>{try{return await e()}catch(t){if(!ae(t))throw t;await oe(n);try{return await e()}catch(e){if(!ae(e))throw e;if(!L()){try{sessionStorage.setItem(F,`1`)}catch{}r(),await new Promise(()=>{})}throw e}}})}var z=`Part of the app did not load`,se=`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.`,ce=e=>{let t=e?.code??e?.error?.code??``;return typeof t==`string`?t.toLowerCase():``},le=e=>{let t=e?.message??e??``;return String(t).toLowerCase()},ue=()=>typeof navigator<`u`&&navigator.onLine===!1,de=`A picture here is drawn the slow way`,fe=`A picture on this page is drawn by hand. Paste the message to your assistant.`,pe=`firebaseOsHandDrawn`;function me(e){return Object.assign(Error(e),{[pe]:!0})}var he=`firebaseOsSaid`;function ge(e,t=`again`){return Object.assign(Error(e),{[he]:!0,firebaseOsNext:t})}var _e=e=>e?.[he]===!0,ve=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},ye=(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`),be={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`},xe={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`},Se={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`},Ce={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`},we={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`},Te={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`},Ee={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`},De={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`},Oe={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`},ke={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`},Ae={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`},je={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 Me(e){let t=ce(e),n=le(e);if(e?.[pe]===!0)return{kind:`drawnByHand`,title:de,message:String(e?.message||``),short:fe,next:`none`};if(_e(e)){let t=String(e?.message||``);return{kind:`said`,title:`That did not work`,message:t,short:t,next:e?.firebaseOsNext??`again`}}if(ae(e))return{kind:`missingPart`,title:z,message:se,short:`Part of this page did not load. Reload the page.`,next:`reload`};let r=ve(e);return r?{kind:`said`,title:`That did not work`,message:r,short:r,next:`again`}:ue()||ye(t,n)?be: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`?xe:t===`permission-denied`||t===`storage/unauthorized`||t===`storage/unauthenticated`||n.includes(`missing or insufficient permissions`)?Se:t===`deadline-exceeded`||n.includes(`timeout`)||n.includes(`timed out`)?we:t===`resource-exhausted`||t===`auth/too-many-requests`||t===`storage/quota-exceeded`||n.includes(`too many requests`)?t===`storage/quota-exceeded`?De:Te:t===`not-found`||t===`storage/object-not-found`?Ee:t===`failed-precondition`||n.includes(`requires an index`)?Oe:t===`cancelled`||t===`aborted`||t===`storage/canceled`||n.includes(`aborted`)?ke:n.includes(`exceeds the maximum`)||n.includes(`file is too large`)||n.includes(`payload too large`)?Ae:t===`internal`||t===`unknown`||t===`storage/unknown`||t===`data-loss`?Ce:je}function Ne(e,t){let n=Me(e);return t&&n.kind===`unknown`?t:n.short}var Pe={again:`Try again`,reload:`Reload the page`,signin:`Sign in again`,none:`Reload the page`},Fe=new Map;function Ie(e,t,n,r){let i=Fe.get(e);if(!i){let n={subscribers:new Set,stop:()=>{},last:null,refused:void 0};Fe.set(e,n),n.stop=(0,l.onSnapshot)(t(),e=>{n.last=e,n.refused=void 0,n.subscribers.forEach(t=>Le(()=>t.next(e)))},e=>{n.refused=e,n.subscribers.forEach(t=>Le(()=>t.fail(e)))}),i=n}let a={next:n,fail:r};return i.subscribers.add(a),i.last?Le(()=>n(i.last)):i.refused!==void 0&&Le(()=>r(i.refused)),()=>{let t=Fe.get(e);!t||!t.subscribers.delete(a)||t.subscribers.size===0&&(t.stop(),Fe.delete(e))}}function Le(e){try{e()}catch(e){console.error(`A screen could not take a shared Firestore answer`,e)}}var Re=[`user`,`internal`,`admin`],ze=e=>Re.includes(e),Be={user:`Members`,internal:`Your team`,admin:`Admins`},Ve={user:`user-round`,internal:`users`,admin:`shield`},He=`id-card`,Ue=[],We={},Ge={},Ke=e=>{Ue=e},qe=()=>Ue,Je=e=>{We=e},Ye=e=>{Ge=e},Xe=e=>ze(e)&&String(Ge[e]||``).trim()||``,Ze=e=>ze(e)&&String(We[e]||``).trim()||``,Qe=(e,t=qe())=>t.find(t=>t.id===e)?.name||Ze(e)||(ze(e)?Be[e]:``)||e,$e=(e=qe())=>[...Re.map(t=>({id:t,name:Qe(t,e)})),...e.map(e=>({id:e.id,name:e.name}))],et=`sys_payments`,tt=`_settings`,nt=()=>({on:!1,amount:``,priceId:``,livePriceId:``}),rt=()=>({name:``,description:``,monthly:{...nt(),on:!0},yearly:nt(),roleId:``}),it=()=>({name:``,amount:``}),at=e=>({id:e,name:``,description:``,kind:``,amount:``,items:[],plans:[],how:``,emailReceipt:!0,notifyOwner:!0,pageIds:[],customNote:``,customPath:``,createdAt:Date.now()}),ot=e=>e.kind===`once`?e.items.length?e.items:e.name.trim()||e.amount.trim()?[{name:e.name,amount:e.amount}]:[]:[],st=e=>{let t=Number(String(e||``).trim().replace(/[^0-9.]/g,``));return Number.isFinite(t)&&t>0?t:null},ct=e=>({on:!!e?.on,amount:String(e?.amount||``),priceId:String(e?.priceId||``),livePriceId:String(e?.livePriceId||``)}),lt=e=>/^(no|none|nothing|n\/?a|nothing needed|nothing else|-)[.!]*$/i.test(e.trim()),ut=e=>/[.!?]$/.test(e)?e:`${e}.`,dt=e=>{let t=[],n=String(e?.how||``),r=String(e?.collect||``).trim();r&&!lt(r)&&t.push(`Before paying, the buyer tells me: ${ut(r)}`);let i=String(e?.after||``).trim();if(i&&t.push(`After they pay: ${ut(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: ${ut(r)}`),i&&t.push(`Someone on ${e} sees: ${ut(i)}`)}return t.length?[...n.trim()?[ut(n.trim())]:[],...t].join(` `):n},ft=(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:ct(e?.monthly),yearly:ct(e?.yearly),roleId:t._(e?.roleId)?String(e.roleId):``})):[],how:dt(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}},pt=e=>/^price_[A-Za-z0-9]+$/.test(e.trim()),mt=(e,t=Yt())=>t?e.livePriceId:e.priceId;function ht(e,t=Yt()){if(!e.kind)return`Say how it is paid — once, or a subscription.`;if(e.kind===`once`){let t=ot(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(st(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(st(i.amount)===null)return`Give ${e} its ${r} price — just a number.`;if(!pt(mt(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 gt=(e,t=Yt())=>ht(e,t)===``,_t=e=>e.kind===`subscription`&&e.plans.length>0&&e.plans.every(e=>e.name.trim()!==``&&(e.monthly.on||e.yearly.on)&&(!e.monthly.on||st(e.monthly.amount)!==null)&&(!e.yearly.on||st(e.yearly.amount)!==null));function vt(e){let t=e.name.trim();if(t)return t;let n=ot(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 yt(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=ot(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 bt(e,t,n=Yt()){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 xt=e=>e.includes(`'`)?`"${e}"`:`'${e}'`,St=`Every payment goes through the app's own <PayButton> — never build a checkout, a card form or Stripe code of your own. The button's words, colour and place on the page are yours to design.`,Ct=(e,t=Yt())=>{let n=e.name.trim()||`this product`,r=e.description.trim();if(e.kind===`once`){let t=ot(e),r=e=>`<PayButton amount={${st(e.amount)??0}} productName=${xt(e.name.trim())}>`;if(t.length<=1){let i=t[0]||{name:e.name,amount:e.amount};return[`It sells ${i.name.trim()||n} for ${i.amount.trim()}, paid once: ${r(i)}.`]}let i=e.name.trim();return[`It sells ${t.length} things${i?` under ${i}`:``}, each paid once with its own button:`,...t.map(e=>`${e.name.trim()||`Something`} for ${e.amount.trim()}: ${r(e)}.`)]}let i=[`It sells ${n}${r?` (${r})`:``} as a subscription. Lay its plans out as one pricing section — each plan is bought with its own button, and where a plan has monthly and yearly, offer a monthly/yearly switch:`];for(let n of e.plans){let e=n.name.trim()||`Plan`,r=n.description.trim(),a=[];n.monthly.on&&a.push(`${n.monthly.amount.trim()} per month: <PayButton priceId='${mt(n.monthly,t).trim()}' mode='subscription'>`),n.yearly.on&&a.push(`${n.yearly.amount.trim()} per year: <PayButton priceId='${mt(n.yearly,t).trim()}' mode='subscription'>`);let o=n.roleId?` Buying it makes the buyer my ${Qe(n.roleId)} role — userRole '${n.roleId}'.`:``;i.push(`${e}${r?` (${r})`:``} — ${a.join(`; `)}.${o}`)}return i},wt=`Before the button, ask who is paying with <BuyerDetails onReady={setBuyer} /> from 'your-ai-workflow-firebase-os' — never a form, never a *Form.config.ts, never inputs you build by hand. 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 (true to require it, 'optional' to offer it — pass them when my words ask for them, and address whenever something is delivered); Continue makes them an account there and then, signed in on this device, with the answers on their profile. It draws every one of those boxes itself — never a name, email, phone or <AddressField> of your own beside it, and no delivery step of your own: that asks the buyer twice (the address is buyer.address and buyer.addressParts after onReady). A signed-in buyer is prefilled and asked only for what is missing; when nothing is, it draws one line saying who is paying and fires onReady at once. Keep the buyer in state and show the <PayButton> only once onReady has fired, with buyer.metadata spread into the button's metadata ({ ...buyer.metadata, items, total }) so what they told you reads beside the payment 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 that same metadata as a plain string. Never ask for their email twice, never make a form for any of this, and never build a backend of your own for it: the app tells them and me in the bell when the payment happens.`,Tt=`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.`,Et=`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.`,Dt=`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().`,Ot=`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 kt(e,t=``,n=Yt()){let r=[...Ct(e,n)],i=e.how.trim();return i&&r.push(`Here is how this payment should work, start to finish: ${i}`),r.push(wt,Tt),e.kind===`subscription`&&(e.plans.some(e=>e.roleId)&&r.push(Dt),e.plans.some(e=>!e.roleId)&&r.push(Et)),r.push(...jt(t,e)),r}var At=`Back on the page, read session_id from the web address and ask confirmPayment(sessionId) from the same package; only when it answers paid: true say the order is placed and put a link to /billing beside it, where their order is (the built-in page, never one of your own). They are signed in on this device already; on another device they sign in with the same email — the emailed link, or Reset password. Never send them to /login or /register after paying, and never build an order-confirmation, receipt or notification of your own: the bell tells them their order is placed and tells me a payment came in.`;function jt(e,t){let n=[`Set each button's successPath to ${e||`the page the button is on`} so the buyer lands back where they paid and finds what my words say happens after.`,At],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 Mt=e=>e===`internal`||e===`admin`,Nt=e=>Array.isArray(e?.links)?e.links.map(e=>({pageId:String(e?.pageId||``),how:String(e?.how||``)})):[],Pt=(e,t)=>t.find(t=>t.id===e)||t.find(t=>String(t.config?.contentKey||``).trim()===e),Ft=(e,t)=>e===t.id||e===String(t.config?.contentKey||``).trim();function It(e){return e.how.trim()?``:`Describe how this payment will work.`}var Lt=(e,t)=>e.pageIds.some(e=>Ft(e,t)),Rt=(e,t)=>Lt(e,t)?e.pageIds.filter(e=>!Ft(e,t)):[...e.pageIds,t.id],zt=`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.`,Bt="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.",Vt=e=>`/payments?new=subscription&page=${encodeURIComponent(e)}`,Ht=(e,t)=>`/payments?open=${encodeURIComponent(e)}&page=${encodeURIComponent(t)}`,Ut=(e,t)=>`/pages/${encodeURIComponent(e)}?addPayment=${encodeURIComponent(t)}`,Wt=[],Gt=!1,Kt=e=>{Wt=e},qt=()=>Wt,Jt=e=>{Gt=e},Yt=()=>Gt;function Xt(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();pt(o)&&pt(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 Zt(e=qt()){let t=Xt(e),n=[`My Stripe account has switched from test mode to live mode. I have already replaced the keys in Secrets — do not touch any keys or write any Stripe code of your own.`];return t.length?n.push(`In my pages, every <PayButton> with a priceId still carries a test price id. Swap each one for its live id and change nothing else about the button:`,...t.map(e=>`For ${e.product}, ${e.plan} (${e.word}): replace '${e.from}' with '${e.to}'.`),`Buttons that use amount={…} instead of a priceId need no change.`):n.push(`No price id in my pages needs to change — buttons that use amount={…} never had one.`),n.push(`Then rebuild the app so it runs with the live keys and ids.`),n.join(`
|
|
1
|
+
const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./verifiedAccount-COYkSEid.cjs`),n=require(`./lucide-react-CWbDYh_b.cjs`),r=require(`./shrinkImage-C_4Lixmb.cjs`),i=require(`./address-B2E5LmUz.cjs`);let a=require(`react`);a=e.a(a,1);let o=require(`react/jsx-runtime`),s=require(`firebase/app`),c=require(`firebase/auth`),l=require(`firebase/firestore`),u=require(`firebase/storage`),d=require(`react-router-dom`),f=require(`react-dom`);var p=e.r({contactFormConfig:()=>m}),m={systemName:`contact`,formType:`public`,redirectTo:`/`,title:`Get in Touch`,buttonName:`Contact Us`,submitText:`Send Message`,fields:[{name:`name`,type:`text`,label:`Full Name`,placeholder:`John Doe`,required:!0},{name:`email`,type:`email`,label:`Email Address`,placeholder:`john@example.com`,required:!0},{name:`phone`,type:`tel`,label:`Phone Number`,placeholder:`+1 (555) 000-0000`,required:!1},{name:`questions`,type:`textarea`,label:`Your Questions`,placeholder:`How can we help you?`,required:!0}]},h=e.r({supportFormConfig:()=>g}),g={systemName:`support`,formType:`private`,redirectTo:`/dashboard`,title:`Request Assistance`,buttonName:`Get Assistance`,submitText:`Submit Request`,fields:[{name:`topic`,type:`text`,label:`Topic`,placeholder:`E.g. Password reset issue`,required:!0},{name:`contactEmail`,type:`email`,label:`Contact Email`,placeholder:`your@email.com`,required:!0},{name:`description`,type:`textarea`,label:`Description`,placeholder:`Please describe your issue in detail...`,required:!0}]},_={appName:`Your AI Firebase`,defaultTheme:`light`,showThemeToggle:!0,logoUrl:`https://firebasestorage.googleapis.com/v0/b/fir-os-47863.firebasestorage.app/o/pub_files%2F1776321238933_favicon_smaller.png?alt=media&token=efecb55c-2456-4cbe-a20a-b86db54a1e55`,faviconUrl:`https://firebasestorage.googleapis.com/v0/b/fir-os-47863.firebasestorage.app/o/pub_files%2F1776321238933_favicon_smaller.png?alt=media&token=efecb55c-2456-4cbe-a20a-b86db54a1e55`,colors:{dark:{background:`#07070f`,backgroundSecondary:`#0a0a18`,foreground:`#f0eeff`,accent:`#a78bfa`,buttonText:`#ffffff`},light:{background:`#fcfaff`,backgroundSecondary:`#f7f3ff`,foreground:`#1e1b4b`,accent:`#7c3aed`,buttonText:`#ffffff`}},cornerRounding:`default`,cornerRadii:{buttonRadius:.75,inputRadius:.75,cardRadius:1.5,modalRadius:2.5}},v=(0,a.createContext)({});function y({config:e,children:t}){return(0,o.jsx)(v.Provider,{value:e,children:t})}var b=()=>(0,a.useContext)(v),x=`1.14.65`,S=typeof window<`u`?a.useLayoutEffect:a.useEffect,C=(0,a.createContext)(void 0),w=e=>{let t=e?.defaultTheme;return t!==`light`&&t!==`dark`||e?.showThemeToggle?null:t};function T({children:e,scopeSelector:t}){let n=b(),r=(0,a.useMemo)(()=>n?.themeConfig||_,[n?.themeConfig]),i=w(r),s=!!r.showThemeToggle;(0,a.useEffect)(()=>{try{localStorage.removeItem(`theme_config_cache`),localStorage.removeItem(`theme_saved_cache`)}catch{}console.info(`Your AI Firebase ${x} · colours from theme.config.ts`)},[]);let[c,l]=(0,a.useState)(()=>{if(i)return i;if(typeof window>`u`)return r.defaultTheme||`system`;let e=localStorage.getItem(`theme-mode`),t=localStorage.getItem(`last-seen-default-theme`);return r.defaultTheme&&r.defaultTheme!==t?(localStorage.setItem(`last-seen-default-theme`,r.defaultTheme),localStorage.removeItem(`theme-mode`),r.defaultTheme):e||r.defaultTheme||`system`}),[u,d]=(0,a.useState)(()=>{if(i)return i;if(typeof window>`u`)return r.defaultTheme===`light`?`light`:`dark`;let e=localStorage.getItem(`theme-mode`),t=localStorage.getItem(`last-seen-default-theme`),n=e||r.defaultTheme||`system`;return r.defaultTheme&&r.defaultTheme!==t&&(n=r.defaultTheme),n===`system`?window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`:n});return(0,a.useEffect)(()=>{let e=r.defaultTheme;e&&(i&&l(i),e!==localStorage.getItem(`last-seen-default-theme`)&&(localStorage.setItem(`last-seen-default-theme`,e),localStorage.removeItem(`theme-mode`),l(e)))},[r.defaultTheme,i]),(0,a.useEffect)(()=>{let e=e=>{c===`system`&&d(e.matches?`light`:`dark`)},t=window.matchMedia(`(prefers-color-scheme: light)`);return c===`system`?(d(t.matches?`light`:`dark`),t.addEventListener(`change`,e)):d(c),()=>t.removeEventListener(`change`,e)},[c]),S(()=>{let e=(t?document.querySelector(t):document.documentElement)||document.documentElement,n=u===`dark`?r.colors.dark:r.colors.light;e.style.setProperty(`--bg-color`,n.background),e.style.setProperty(`--bg-secondary-color`,n.backgroundSecondary||n.background),e.style.setProperty(`--fg-color`,n.foreground),e.style.setProperty(`--accent-color`,n.accent);let i=u===`dark`;e.style.setProperty(`--panel-bg`,n.panelBg||`color-mix(in srgb, ${n.accent} ${i?`5%`:`4%`}, transparent)`),e.style.setProperty(`--panel-border`,n.panelBorder||`color-mix(in srgb, ${n.accent} 15%, transparent)`);let a=(e,t,n)=>{if(!e||e.length===0)return t||`transparent`;if(e.length===1)return e[0];let r=e.map((t,n)=>`${t} ${Math.round(n/(e.length-1)*100)}%`).join(`, `);return n===`conic`?`conic-gradient(from 180deg at 50% 100%, ${r})`:`linear-gradient(135deg, ${r})`},o=`linear-gradient(135deg, color-mix(in oklab, ${n.accent} ${i?`70%`:`78%`}, black) 0%, ${n.accent} 100%)`,s=`linear-gradient(135deg, color-mix(in oklab, ${n.accent} ${i?`80%`:`85%`}, black) 0%, color-mix(in oklab, ${n.accent} 72%, white) 100%)`;e.style.setProperty(`--button-bg`,a(n.buttonGradient,o,n.buttonGradientShape)),e.style.setProperty(`--button-fg`,n.buttonText||`#ffffff`),e.style.setProperty(`--button-hover-bg`,a(n.buttonHoverGradient||n.buttonGradient,s,n.buttonGradientShape)),e.style.setProperty(`--text-gradient`,a(n.textGradient,`linear-gradient(135deg, ${n.foreground} 0%, ${n.accent} 100%)`)),e.style.setProperty(`--glow-color`,n.glowColor||`color-mix(in srgb, ${n.accent} ${i?`40%`:`30%`}, transparent)`),e.style.setProperty(`--notification-icon-color`,n.notificationIconColor||n.accent);let l=n.secondaryButton?.bg||(u===`dark`?`rgba(255, 255, 255, 0.05)`:`rgba(0, 0, 0, 0.03)`),d=n.secondaryButton?.border||(u===`dark`?`rgba(255, 255, 255, 0.1)`:`rgba(0, 0, 0, 0.06)`),f=n.secondaryButton?.text||n.foreground;if(e.style.setProperty(`--btn-sec-bg`,l),e.style.setProperty(`--btn-sec-border`,d),e.style.setProperty(`--btn-sec-text`,f),e.style.setProperty(`--selection-bg`,n.selectionBg||`color-mix(in srgb, var(--accent-color) 40%, transparent)`),e.style.setProperty(`--selection-text`,n.selectionText||`#ffffff`),e.setAttribute(`data-theme`,u),localStorage.setItem(`theme-mode`,c),r.cornerRounding===`custom`&&r.cornerRadii?(e.style.setProperty(`--btn-radius`,`${parseFloat(String(r.cornerRadii.buttonRadius))||0}rem`),e.style.setProperty(`--card-radius`,`${parseFloat(String(r.cornerRadii.cardRadius))||0}rem`),e.style.setProperty(`--input-radius`,`${parseFloat(String(r.cornerRadii.inputRadius))||0}rem`),e.style.setProperty(`--modal-radius`,`${parseFloat(String(r.cornerRadii.modalRadius))||0}rem`)):(e.style.setProperty(`--btn-radius`,`0.75rem`),e.style.setProperty(`--card-radius`,`1.5rem`),e.style.setProperty(`--input-radius`,`0.75rem`),e.style.setProperty(`--modal-radius`,`1.5rem`)),!document.getElementById(`inter-font`)){let e=document.createElement(`link`);e.id=`inter-font`,e.rel=`stylesheet`,e.href=`https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap`,document.head.appendChild(e)}e.style.fontSize=`16px`,e.style.setProperty(`--weight-h1`,`800`),e.style.setProperty(`--weight-h2`,`700`),e.style.setProperty(`--weight-h3`,`700`),e.style.setProperty(`--leading-normal`,`1.5`);let p=document.querySelector(`link[rel*='icon']`);p||(p=document.createElement(`link`),p.rel=`icon`,document.head.appendChild(p)),r.faviconUrl&&(p.href=r.faviconUrl),r.appName&&(document.title=r.appName)},[u,c,r]),(0,o.jsx)(C.Provider,{value:{theme:u,setTheme:e=>{i||l(e)},toggleTheme:()=>{i||l(u===`light`?`dark`:`light`)},isSystem:c===`system`,setIsSystem:e=>{i||l(e?`system`:u)},config:r,activeConfig:r,canSwitchTheme:s},children:e})}var ee=()=>{let e=(0,a.useContext)(C);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e},E=null,D=null,O=null,k=null,A=null,j=`https://firebasestorage.googleapis.com`;function M(){if(typeof document>`u`||!document.head||document.head.querySelector(`link[rel="preconnect"][href="${j}"]`))return;let e=document.createElement(`link`);e.rel=`preconnect`,e.href=j,document.head.appendChild(e)}function te(e){M();let t=e.projectId||``;if((0,s.getApps)().length&&A===t){E=(0,s.getApp)(),D=(0,c.getAuth)(E);try{O=(0,l.initializeFirestore)(E,{localCache:(0,l.persistentLocalCache)({tabManager:(0,l.persistentMultipleTabManager)()})})}catch{O=(0,l.getFirestore)(E)}k=(0,u.getStorage)(E);return}if((0,s.getApps)().length&&A!==t)try{(0,s.deleteApp)((0,s.getApp)())}catch{}E=(0,s.initializeApp)(e),A=t,D=(0,c.getAuth)(E);try{O=(0,l.initializeFirestore)(E,{localCache:(0,l.persistentLocalCache)({tabManager:(0,l.persistentMultipleTabManager)()})})}catch{O=(0,l.getFirestore)(E)}k=(0,u.getStorage)(E)}function ne(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 N=[`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`],re={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 ie(){let e={};for(let t of N){let n=ne(t);if(!n)return null;e[re[t]]=n}return e}var P=ie();P&&!(0,s.getApps)().length&&te(P);var F=`firebase-os:chunk-reloaded`,I=400,L=()=>{try{return sessionStorage.getItem(F)===`1`}catch{return!0}},ae=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`)},oe=e=>new Promise(t=>setTimeout(t,e));function R(e,t={}){let n=t.pause??I,r=t.reload??(()=>{typeof window<`u`&&window.location.reload()});return(0,a.lazy)(async()=>{try{return await e()}catch(t){if(!ae(t))throw t;await oe(n);try{return await e()}catch(e){if(!ae(e))throw e;if(!L()){try{sessionStorage.setItem(F,`1`)}catch{}r(),await new Promise(()=>{})}throw e}}})}var z=`Part of the app did not load`,se=`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.`,ce=e=>{let t=e?.code??e?.error?.code??``;return typeof t==`string`?t.toLowerCase():``},le=e=>{let t=e?.message??e??``;return String(t).toLowerCase()},ue=()=>typeof navigator<`u`&&navigator.onLine===!1,de=`A picture here is drawn the slow way`,fe=`A picture on this page is drawn by hand. Paste the message to your assistant.`,pe=`firebaseOsHandDrawn`;function me(e){return Object.assign(Error(e),{[pe]:!0})}var he=`firebaseOsSaid`;function ge(e,t=`again`){return Object.assign(Error(e),{[he]:!0,firebaseOsNext:t})}var _e=e=>e?.[he]===!0,ve=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},ye=(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`),be={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`},xe={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`},Se={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`},Ce={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`},we={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`},Te={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`},Ee={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`},De={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`},Oe={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`},ke={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`},Ae={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`},je={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 Me(e){let t=ce(e),n=le(e);if(e?.[pe]===!0)return{kind:`drawnByHand`,title:de,message:String(e?.message||``),short:fe,next:`none`};if(_e(e)){let t=String(e?.message||``);return{kind:`said`,title:`That did not work`,message:t,short:t,next:e?.firebaseOsNext??`again`}}if(ae(e))return{kind:`missingPart`,title:z,message:se,short:`Part of this page did not load. Reload the page.`,next:`reload`};let r=ve(e);return r?{kind:`said`,title:`That did not work`,message:r,short:r,next:`again`}:ue()||ye(t,n)?be: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`?xe:t===`permission-denied`||t===`storage/unauthorized`||t===`storage/unauthenticated`||n.includes(`missing or insufficient permissions`)?Se:t===`deadline-exceeded`||n.includes(`timeout`)||n.includes(`timed out`)?we:t===`resource-exhausted`||t===`auth/too-many-requests`||t===`storage/quota-exceeded`||n.includes(`too many requests`)?t===`storage/quota-exceeded`?De:Te:t===`not-found`||t===`storage/object-not-found`?Ee:t===`failed-precondition`||n.includes(`requires an index`)?Oe:t===`cancelled`||t===`aborted`||t===`storage/canceled`||n.includes(`aborted`)?ke:n.includes(`exceeds the maximum`)||n.includes(`file is too large`)||n.includes(`payload too large`)?Ae:t===`internal`||t===`unknown`||t===`storage/unknown`||t===`data-loss`?Ce:je}function Ne(e,t){let n=Me(e);return t&&n.kind===`unknown`?t:n.short}var Pe={again:`Try again`,reload:`Reload the page`,signin:`Sign in again`,none:`Reload the page`},Fe=new Map;function Ie(e,t,n,r){let i=Fe.get(e);if(!i){let n={subscribers:new Set,stop:()=>{},last:null,refused:void 0};Fe.set(e,n),n.stop=(0,l.onSnapshot)(t(),e=>{n.last=e,n.refused=void 0,n.subscribers.forEach(t=>Le(()=>t.next(e)))},e=>{n.refused=e,n.subscribers.forEach(t=>Le(()=>t.fail(e)))}),i=n}let a={next:n,fail:r};return i.subscribers.add(a),i.last?Le(()=>n(i.last)):i.refused!==void 0&&Le(()=>r(i.refused)),()=>{let t=Fe.get(e);!t||!t.subscribers.delete(a)||t.subscribers.size===0&&(t.stop(),Fe.delete(e))}}function Le(e){try{e()}catch(e){console.error(`A screen could not take a shared Firestore answer`,e)}}var Re=[`user`,`internal`,`admin`],ze=e=>Re.includes(e),Be={user:`Members`,internal:`Your team`,admin:`Admins`},Ve={user:`user-round`,internal:`users`,admin:`shield`},He=`id-card`,Ue=[],We={},Ge={},Ke=e=>{Ue=e},qe=()=>Ue,Je=e=>{We=e},Ye=e=>{Ge=e},Xe=e=>ze(e)&&String(Ge[e]||``).trim()||``,Ze=e=>ze(e)&&String(We[e]||``).trim()||``,Qe=(e,t=qe())=>t.find(t=>t.id===e)?.name||Ze(e)||(ze(e)?Be[e]:``)||e,$e=(e=qe())=>[...Re.map(t=>({id:t,name:Qe(t,e)})),...e.map(e=>({id:e.id,name:e.name}))],et=`sys_payments`,tt=`_settings`,nt=()=>({on:!1,amount:``,priceId:``,livePriceId:``}),rt=()=>({name:``,description:``,monthly:{...nt(),on:!0},yearly:nt(),roleId:``}),it=()=>({name:``,amount:``}),at=e=>({id:e,name:``,description:``,kind:``,amount:``,items:[],plans:[],how:``,emailReceipt:!0,notifyOwner:!0,pageIds:[],customNote:``,customPath:``,createdAt:Date.now()}),ot=e=>e.kind===`once`?e.items.length?e.items:e.name.trim()||e.amount.trim()?[{name:e.name,amount:e.amount}]:[]:[],st=e=>{let t=Number(String(e||``).trim().replace(/[^0-9.]/g,``));return Number.isFinite(t)&&t>0?t:null},ct=e=>({on:!!e?.on,amount:String(e?.amount||``),priceId:String(e?.priceId||``),livePriceId:String(e?.livePriceId||``)}),lt=e=>/^(no|none|nothing|n\/?a|nothing needed|nothing else|-)[.!]*$/i.test(e.trim()),ut=e=>/[.!?]$/.test(e)?e:`${e}.`,dt=e=>{let t=[],n=String(e?.how||``),r=String(e?.collect||``).trim();r&&!lt(r)&&t.push(`Before paying, the buyer tells me: ${ut(r)}`);let i=String(e?.after||``).trim();if(i&&t.push(`After they pay: ${ut(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: ${ut(r)}`),i&&t.push(`Someone on ${e} sees: ${ut(i)}`)}return t.length?[...n.trim()?[ut(n.trim())]:[],...t].join(` `):n},ft=(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:ct(e?.monthly),yearly:ct(e?.yearly),roleId:t._(e?.roleId)?String(e.roleId):``})):[],how:dt(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}},pt=e=>/^price_[A-Za-z0-9]+$/.test(e.trim()),mt=(e,t=Yt())=>t?e.livePriceId:e.priceId;function ht(e,t=Yt()){if(!e.kind)return`Say how it is paid — once, or a subscription.`;if(e.kind===`once`){let t=ot(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(st(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(st(i.amount)===null)return`Give ${e} its ${r} price — just a number.`;if(!pt(mt(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 gt=(e,t=Yt())=>ht(e,t)===``,_t=e=>e.kind===`subscription`&&e.plans.length>0&&e.plans.every(e=>e.name.trim()!==``&&(e.monthly.on||e.yearly.on)&&(!e.monthly.on||st(e.monthly.amount)!==null)&&(!e.yearly.on||st(e.yearly.amount)!==null));function vt(e){let t=e.name.trim();if(t)return t;let n=ot(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 yt(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=ot(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 bt(e,t,n=Yt()){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 xt=e=>e.includes(`'`)?`"${e}"`:`'${e}'`,St=`Every payment goes through the app's own <PayButton> — never build a checkout, a card form or Stripe code of your own. The button's words, colour and place on the page are yours to design.`,Ct=(e,t=Yt())=>{let n=e.name.trim()||`this product`,r=e.description.trim();if(e.kind===`once`){let t=ot(e),r=e=>`<PayButton amount={${st(e.amount)??0}} productName=${xt(e.name.trim())}>`;if(t.length<=1){let i=t[0]||{name:e.name,amount:e.amount};return[`It sells ${i.name.trim()||n} for ${i.amount.trim()}, paid once: ${r(i)}.`]}let i=e.name.trim();return[`It sells ${t.length} things${i?` under ${i}`:``}, each paid once with its own button:`,...t.map(e=>`${e.name.trim()||`Something`} for ${e.amount.trim()}: ${r(e)}.`)]}let i=[`It sells ${n}${r?` (${r})`:``} as a subscription. Lay its plans out as one pricing section — each plan is bought with its own button, and where a plan has monthly and yearly, offer a monthly/yearly switch:`];for(let n of e.plans){let e=n.name.trim()||`Plan`,r=n.description.trim(),a=[];n.monthly.on&&a.push(`${n.monthly.amount.trim()} per month: <PayButton priceId='${mt(n.monthly,t).trim()}' mode='subscription'>`),n.yearly.on&&a.push(`${n.yearly.amount.trim()} per year: <PayButton priceId='${mt(n.yearly,t).trim()}' mode='subscription'>`);let o=n.roleId?` Buying it makes the buyer my ${Qe(n.roleId)} role — userRole '${n.roleId}'.`:``;i.push(`${e}${r?` (${r})`:``} — ${a.join(`; `)}.${o}`)}return i},wt=`Before the button, ask who is paying with <BuyerDetails onReady={setBuyer} /> from 'your-ai-workflow-firebase-os' — never a form, never a *Form.config.ts, never inputs you build by hand. 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 (true to require it, 'optional' to offer it — pass them when my words ask for them, and address whenever something is delivered); Continue makes them an account there and then, signed in on this device, with the answers on their profile. It draws every one of those boxes itself — never a name, email, phone or <AddressField> of your own beside it, and no delivery step of your own: that asks the buyer twice (the address is buyer.address and buyer.addressParts after onReady). A signed-in buyer is prefilled and asked only for what is missing; when nothing is, it draws one line saying who is paying and fires onReady at once. Keep the buyer in state and show the <PayButton> only once onReady has fired, with buyer.metadata spread into the button's metadata ({ ...buyer.metadata, items, total }) so what they told you reads beside the payment 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 that same metadata as a plain string. Never ask for their email twice, never make a form for any of this, and never build a backend of your own for it: the app tells them and me in the bell when the payment happens.`,Tt=`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.`,Et=`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.`,Dt=`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().`,Ot=`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 kt(e,t=``,n=Yt()){let r=[...Ct(e,n)],i=e.how.trim();return i&&r.push(`Here is how this payment should work, start to finish: ${i}`),r.push(wt,Tt),e.kind===`subscription`&&(e.plans.some(e=>e.roleId)&&r.push(Dt),e.plans.some(e=>!e.roleId)&&r.push(Et)),r.push(...jt(t,e)),r}var At=`Back on the page, read session_id from the web address and ask confirmPayment(sessionId) from the same package; only when it answers paid: true say the order is placed and put a link to /billing beside it, where their order is (the built-in page, never one of your own). They are signed in on this device already; on another device they sign in with the same email — the emailed link, or Reset password. Never send them to /login or /register after paying, and never build an order-confirmation, receipt or notification of your own: the bell tells them their order is placed and tells me a payment came in.`;function jt(e,t){let n=[`Set each button's successPath to ${e||`the page the button is on`} so the buyer lands back where they paid and finds what my words say happens after.`,At],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 Mt=e=>e===`internal`||e===`admin`,Nt=e=>Array.isArray(e?.links)?e.links.map(e=>({pageId:String(e?.pageId||``),how:String(e?.how||``)})):[],Pt=(e,t)=>t.find(t=>t.id===e)||t.find(t=>String(t.config?.contentKey||``).trim()===e),Ft=(e,t)=>e===t.id||e===String(t.config?.contentKey||``).trim();function It(e){return e.how.trim()?``:`Describe how this payment will work.`}var Lt=(e,t)=>e.pageIds.some(e=>Ft(e,t)),Rt=(e,t)=>Lt(e,t)?e.pageIds.filter(e=>!Ft(e,t)):[...e.pageIds,t.id],zt=`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.`,Bt="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.",Vt=e=>`/payments?new=subscription&page=${encodeURIComponent(e)}`,Ht=(e,t)=>`/payments?open=${encodeURIComponent(e)}&page=${encodeURIComponent(t)}`,Ut=(e,t)=>`/pages/${encodeURIComponent(e)}?addPayment=${encodeURIComponent(t)}`,Wt=[],Gt=!1,Kt=e=>{Wt=e},qt=()=>Wt,Jt=e=>{Gt=e},Yt=()=>Gt;function Xt(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();pt(o)&&pt(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 Zt(e=qt()){let t=Xt(e),n=[`My Stripe account has switched from test mode to live mode. I have already replaced the keys in Secrets — do not touch any keys or write any Stripe code of your own.`];return t.length?n.push(`In my pages, every <PayButton> with a priceId still carries a test price id. Swap each one for its live id and change nothing else about the button:`,...t.map(e=>`For ${e.product}, ${e.plan} (${e.word}): replace '${e.from}' with '${e.to}'.`),`Buttons that use amount={…} instead of a priceId need no change.`):n.push(`No price id in my pages needs to change — buttons that use amount={…} never had one.`),n.push(`Then rebuild the app so it runs with the live keys and ids.`),n.join(`
|
|
2
2
|
`)}var Qt=`admin_keys`,$t=`plans`,en=()=>({planUntil:(0,l.deleteField)(),planPass:(0,l.deleteField)()}),tn=e=>typeof e?.planUntil==`number`&&e.planUntil>0?e.planUntil:0,nn=e=>tn(e)>0,rn=e=>tn(e);function an(e){if(!e)return!1;if(nn(e))return!0;let t=e.role;return t==null||t===`user`||t===`free`}function on(e,t=Date.now()){let n=e?.role?String(e.role):`user`,r=tn(e);return r&&t>=r?`user`:n}function sn(e,n){if(!an(e))return null;let r=String(n?.role||``);return r?!t._(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}:nn(e)?{role:`user`,...en()}:null}async function cn(e,n){try{let r=D?.currentUser;if(!r||r.uid!==e||!t.t(r)||typeof fetch!=`function`)return;let i=(0,l.doc)(O,`user_profiles`,e),a=n??(await(0,l.getDoc)(i)).data();if(!an(a))return;let o=await r.getIdToken(),s=await fetch(`/api/payments/plan-role`,{headers:{Authorization:`Bearer ${o}`}});if(!s.ok)return;let c=sn(a,await s.json());c&&await(0,l.updateDoc)(i,c)}catch{}}function ln(e){(0,a.useEffect)(()=>{let e=!1;return(async()=>{let t=D?.currentUser;if(!t||typeof fetch!=`function`)return;let n=await fetch(`/api/payments/plan-key`,{headers:{Authorization:`Bearer ${await t.getIdToken()}`}});if(!n.ok||e)return;let r=String((await n.json())?.key||``);if(!r)return;let i=(0,l.doc)(O,Qt,$t),a=await(0,l.getDoc)(i);!e&&a.data()?.key!==r&&await(0,l.setDoc)(i,{key:r})})().catch(()=>{}),()=>{e=!0}},[e])}function un(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 dn(){let[e,t]=(0,a.useState)({});return(0,a.useEffect)(()=>Ie(et,()=>(0,l.collection)(O,et),e=>{let n=[];e.forEach(e=>{e.id!==`_settings`&&n.push(ft(e.id,e.data()))}),t(un(n))},()=>{}),[]),e}var fn=`Could not reach the server. Check your connection and try again.`,pn={goTo(e){window.location.href=e}},mn=`/api/payments/webhook`,hn=e=>e?`${e.replace(/\/$/,``)}${mn}`:``;async function gn(){try{let e=D?.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 _n(e){return e?{Authorization:`Bearer ${e}`}:{}}async function vn(e,t){try{let t=await e.json();if(t&&typeof t.error==`string`&&t.error)return t.error}catch{}return t}async function yn(e){let t=await bn(e);return typeof t==`string`?t:(pn.goTo(t.url),null)}async function bn(e){try{let t=await gn(),n=await fetch(`/api/payments/checkout`,{method:`POST`,headers:{"Content-Type":`application/json`,..._n(t)},body:JSON.stringify({...e,origin:window.location.origin})});if(!n.ok)return await vn(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 fn}}async function xn(){let e=await gn();if(!e)return`Sign in to manage your plan.`;try{let t=await fetch(`/api/payments/portal`,{method:`POST`,headers:{"Content-Type":`application/json`,..._n(e)},body:JSON.stringify({origin:window.location.origin})});if(!t.ok)return await vn(t,`The billing portal could not be opened.`);let n=await t.json();return n?.url?(pn.goTo(String(n.url)),null):`The billing portal could not be opened.`}catch{return fn}}async function Sn(e){let t={paid:!1,paymentStatus:null,amountTotal:null,currency:null,customerEmail:null,metadata:{},error:null};if(!e)return{...t,error:`No payment session to confirm.`};try{let n=await fetch(`/api/payments/session/${encodeURIComponent(e)}`);if(!n.ok)return{...t,error:await vn(n,`That payment could not be found.`)};let r=await n.json();return r?.paid===!0&&Mn(),{paid:r?.paid===!0,paymentStatus:r?.paymentStatus??null,amountTotal:r?.amountTotal??null,currency:r?.currency??null,customerEmail:r?.customerEmail??null,metadata:r?.metadata||{},error:null}}catch{return{...t,error:fn}}}var Cn=null;function wn(){return Cn||=fetch(`/api/payments/status`).then(e=>e.json()).then(e=>({configured:e?.configured===!0&&e?.enabled!==!1,mode:e?.mode??null})).catch(()=>(Cn=null,{configured:!1,mode:null})),Cn}function Tn(){Cn=null}function En(){let[e,t]=(0,a.useState)({loading:!0,configured:!1,mode:null});return(0,a.useEffect)(()=>{let e=!1;return wn().then(n=>{e||t({loading:!1,...n})}),()=>{e=!0}},[]),e}var Dn=e=>String(e??``).trim(),On=e=>{let t={name:Dn(e?.name),phone:Dn(e?.phone),address:Dn(e?.address)};return t.name||t.phone||t.address?t:null};async function kn(){let e={active:!1,subscriptions:[],payments:[],buyer:null},t=await gn();if(!t)return{...e,error:null};try{let n=await fetch(`/api/payments/me`,{headers:_n(t)});if(!n.ok)return{...e,error:await vn(n,`Your payments could not be loaded.`)};let r=await n.json();return{active:r?.active===!0,subscriptions:r?.subscriptions||[],payments:r?.payments||[],buyer:On(r?.buyer),error:null}}catch{return{...e,error:fn}}}var An=null,jn=e=>e.subscriptions.length>0||e.payments.length>0;function Mn(){An=null}function Nn(e){return(!An||An.uid!==e)&&(An={uid:e,promise:kn().then(e=>(e.error&&(An=null),{bought:jn(e),buyer:e.buyer,failed:!!e.error}))}),An.promise}var Pn=e=>Nn(e).then(e=>e.bought);async function Fn(e){if(!e||!(await wn()).configured)return null;let t=await Nn(e);if(t.failed)throw Error(`The payments could not be read.`);return t.buyer}function In(e){let[t,n]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;let t=!1;return Pn(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 Ln(){let[e,t]=(0,a.useState)({loading:!0,active:!1,subscriptions:[],payments:[],error:null});return(0,a.useEffect)(()=>{let e=!1,n=D?.currentUser?.uid||``;return kn().then(r=>{n&&!r.error&&(An={uid:n,promise:Promise.resolve({bought:jn(r),buyer:r.buyer,failed:!1})}),e||t({loading:!1,...r})}),()=>{e=!0}},[]),e}function Rn(){let[e,t]=(0,a.useState)({loading:!0,charges:[],subscriptions:[],error:null});return(0,a.useEffect)(()=>{let e=!1,n=n=>{e||t({loading:!1,...n})};return(async()=>{let e=await gn();if(!e)return n({charges:[],subscriptions:[],error:`Please sign in first.`});try{let t=await fetch(`/api/payments/sales`,{headers:_n(e)});if(!t.ok)return n({charges:[],subscriptions:[],error:await vn(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:fn})}})(),()=>{e=!0}},[]),e}var zn=4e3,Bn=e=>String(e??``).trim();function Vn(e,t){return!t?.email||t.emailVerified!==!0||e?.removed===!0?!1:!Bn(e?.displayName)&&!Bn(t.displayName)}function Hn(e,t){if(!t||e?.removed===!0)return null;let n={};return t.name&&!Bn(e?.displayName)&&(n.displayName=t.name),t.phone&&!Bn(e?.phone)&&(n.phone=t.phone),t.address&&!Bn(e?.address)&&(n.address=t.address),Object.keys(n).length?n:null}var Un=`firebase-os:buyer-basics-asked`,Wn=e=>{try{return sessionStorage.getItem(`${Un}:${e}`)===`1`}catch{return!1}},Gn=e=>{try{sessionStorage.setItem(`${Un}:${e}`,`1`)}catch{}};async function Kn(e,t){if(Wn(e))return!1;let n=(async()=>{let n=D?.currentUser;if(!n||n.uid!==e||typeof fetch!=`function`)return!1;let r=Hn(t,await Fn(e));return Gn(e),r?(await(0,l.setDoc)((0,l.doc)(O,`user_profiles`,e),r,{merge:!0}),r.displayName&&D.currentUser?.uid===e&&(0,c.updateProfile)(D.currentUser,{displayName:r.displayName}).catch(()=>{}),!!r.displayName):!1})().catch(()=>!1),r=new Promise(e=>setTimeout(()=>e(!1),zn));return Promise.race([n,r])}var qn=e=>`fbos_verify_sent_${e}`,Jn=e=>{if(!e)return!1;try{return localStorage.getItem(qn(e))===`1`}catch{return!1}},Yn=e=>{if(e)try{localStorage.setItem(qn(e),`1`)}catch{}},Xn=e=>{if(e)try{localStorage.removeItem(qn(e))}catch{}};async function Zn(e){if(!e?.uid||!e.email)return`failed`;if(Jn(e.uid))return`already`;try{return await(0,c.sendEmailVerification)(e),Yn(e.uid),`sent`}catch{return`failed`}}var Qn={collection:`sys_configs`,doc:`auth_methods`},$n=[`Open console.firebase.google.com and pick your project.`,`In the menu on the left open Authentication, then the Sign-in method tab.`],er=`https://console.firebase.google.com/`;function tr(){try{let e=D;return String(e?.app?.options?.authDomain||e?.config?.authDomain||``)}catch{return``}}var nr=e=>e?`https://${e}/__/auth/handler`:``,rr=()=>{try{let e=typeof window<`u`?String(window.location?.origin||``):``;return/^https?:\/\//.test(e)?e:``}catch{return``}},ir=`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.`,ar=`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.`,or=[{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.`,ar,`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:ir}},{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:ir}},{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.`,ar]}],sr=e=>or.find(t=>t.id===e),cr=or.filter(e=>e.kind===`signIn`),lr=e=>e===`internal`||t._(e);function ur(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=String(n??``).trim();lr(e)&&!t.includes(e)&&t.push(e)}return t}var dr=()=>{let e={};for(let t of or)e[t.id]=t.defaultOn;return{on:e,registerAs:{on:!1,roles:[]},twoStepOptional:!1,finishRegistration:{skippable:!0,perRole:!1}}};function fr(e){let t=dr(),n=e?.methods&&typeof e.methods==`object`?e.methods:{};for(let e of or)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:ur(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:Qe(`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 mr=(e,t,n)=>pr(e,n).find(e=>e.id===String(t??``))??null;function hr(e,t){let n=String(t||e).trim()||e;return e===`internal`?n===Be.internal?`one of our team`:`one of ${n}`:`${/^[aeiou]/i.test(n)?`an`:`a`} ${n}`}function gr(e){let t=e.map(e=>hr(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 _r(e){let t=cr.filter(t=>e.on[t.id]);return t.length>0?t:cr.filter(e=>e.id===`password`)}var vr=e=>_r(e).some(e=>e.id===`password`);function yr(e){let t=_r(e).map(e=>e.inSentence);return t.length===1?t[0]:`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`}function br(e,t){let n=sr(t);return!n||n.kind!==`signIn`||cr.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 xr=e=>`${sr(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.`,Sr=null,Cr=null,wr=null,Tr=null;function Er(e){wr=e,Sr?.forEach(t=>t(e))}var Dr=6e3,Or=null;function kr(e){Or&&=(clearTimeout(Or),null),Tr=e,Er(e)}function Ar(e){let t=!Sr;return Sr||=new Set,Sr.add(e),t?(Tr||(Or=setTimeout(()=>{Or=null,Tr||kr(dr())},Dr)),Cr=(0,l.onSnapshot)((0,l.doc)(O,Qn.collection,Qn.doc),e=>kr(fr(e.exists()?e.data():null)),()=>{Tr||kr(dr())})):wr&&e(wr),()=>{Sr?.delete(e),!Sr?.size&&(Or&&=(clearTimeout(Or),null),Cr?.(),Sr=null,Cr=null)}}function jr(){let[e,t]=(0,a.useState)(()=>wr?{loading:!1,settings:wr}:{loading:!0,settings:dr()});(0,a.useEffect)(()=>Ar(e=>t({loading:!1,settings:e})),[]);let n=()=>wr??e.settings,r=e=>(0,l.setDoc)((0,l.doc)(O,Qn.collection,Qn.doc),e,{merge:!0}),i=`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=br(n(),e);if(t)return t}let a=n().on[e];Er({...n(),on:{...n().on,[e]:t}});try{return await r({methods:{[e]:t}}),null}catch{let t=n(),r=Tr?Tr.on[e]:a;return Er({...t,on:{...t.on,[e]:r}}),i}},s=async e=>{let t=n().registerAs,a={on:e.on??t.on,roles:ur(e.roles??t.roles)};Er({...n(),registerAs:a});try{return await r({registerAs:a}),null}catch{return Er({...n(),registerAs:Tr?Tr.registerAs:t}),i}},c=async e=>{let t=n().twoStepOptional;Er({...n(),twoStepOptional:e});try{return await r({twoStepOptional:e}),null}catch{return Er({...n(),twoStepOptional:Tr?Tr.twoStepOptional:t}),i}},u=async e=>{let t=n().finishRegistration,a={skippable:e.skippable??t.skippable,perRole:e.perRole??t.perRole};Er({...n(),finishRegistration:a});try{return await r({finishRegistration:{required:!a.skippable,perRole:a.perRole}}),null}catch{return Er({...n(),finishRegistration:Tr?Tr.finishRegistration:t}),i}};return{...e.settings,loading:e.loading,set:o,setRegisterAs:s,setTwoStepOptional:c,setFinishRegistration:u}}var Mr=`fbos_register_as`,Nr=[`/register`,`/login`],Pr=()=>{try{return typeof window<`u`?window.sessionStorage:null}catch{return null}};function Fr(e,t=Date.now()){if(lr(e))try{Pr()?.setItem(Mr,JSON.stringify({id:e,at:t}))}catch{}}function Ir(){try{Pr()?.removeItem(Mr)}catch{}}function Lr(e,t=Date.now()){let n=Pr();if(!n)return``;let r=null;try{r=n.getItem(Mr),r!==null&&n.removeItem(Mr)}catch{return``}if(!r||!Nr.includes(String(e||``).replace(/\/+$/,``)||`/`))return``;try{let{id:e,at:n}=JSON.parse(r);return typeof n!=`number`||t-n>36e5||t<n?``:lr(e)?String(e):``}catch{return``}}function Rr(e,t,n=Date.now()){if(!t||!lr(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 zr=()=>({requestedRole:(0,l.deleteField)(),requestedRoleAt:(0,l.deleteField)()});function Br(e){let t=e?.requestedRole;return lr(t)?{role:String(t),at:typeof e?.requestedRoleAt==`string`?e.requestedRoleAt:``}:null}var Vr=(e,t)=>`Register as ${hr(e,t)}`,Hr=(e,t)=>`Asked to be ${hr(e,t)}`,Ur=`Your registration goes to an admin for approval. Until then everything works as usual.`,Wr=`Your registration is pending approval`,Gr=`We'll let you know as soon as it's approved. Everything else works as usual.`,Kr=()=>({title:`Your registration has been approved`,body:`Everything that was waiting on it is open to you now.`,link:`/dashboard`}),qr=()=>({title:`Your registration was not approved`,body:`You still have your account, and everything works as usual.`,link:`/dashboard`}),Jr=()=>{if(!D)throw Error(`Firebase is not initialized. Check your configuration.`);return D};function Yr(e){switch(sr(e)?.providerId){case`google.com`:return new c.GoogleAuthProvider;case`github.com`:return new c.GithubAuthProvider;case`twitter.com`:return new c.TwitterAuthProvider;default:return null}}var Xr=e=>Yr(e)!==null;async function Zr(e){let t=Yr(e);if(!t)throw Error(`${sr(e)?.label??e} is not a one-button sign-in.`);try{return await(0,c.signInWithPopup)(Jr(),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(li,e)}catch{}return await n(Jr(),t),`redirecting`}throw n}}var Qr=`firebase-os:sign-in-link-email`,$r=`email`;async function ei(e,t=`/login`){let n=new URL(t,window.location.origin);n.searchParams.set($r,e),await(0,c.sendSignInLinkToEmail)(Jr(),e,{url:n.toString(),handleCodeInApp:!0});try{localStorage.setItem(Qr,e)}catch{}}function ti(e=window.location.href){try{return(0,c.isSignInWithEmailLink)(Jr(),e)}catch{return!1}}function ni(){try{return localStorage.getItem(`firebase-os:sign-in-link-email`)||``}catch{return``}}function ri(e=window.location.href){let t=ni();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 ii(e,t=window.location.href){let{user:n}=await(0,c.signInWithEmailLink)(Jr(),e,t);try{await n.getIdToken(!0)}catch{}try{localStorage.removeItem(Qr)}catch{}}async function ai(e,t){return oi(t,t=>(0,c.signInWithPhoneNumber)(Jr(),e,t))}async function oi(e,t){let n=new c.RecaptchaVerifier(Jr(),e,{size:`invisible`});try{return await t(n)}finally{try{n.clear()}catch{}}}function si(e,t){let n=sr(t)?.providerId;try{switch(n){case`google.com`:return c.GoogleAuthProvider.credentialFromError(e);case`github.com`:return c.GithubAuthProvider.credentialFromError(e);case`twitter.com`:return c.TwitterAuthProvider.credentialFromError(e);default:return null}}catch{return null}}var ci=`firebase-os:refused-credential`,li=`firebase-os:redirecting-with`,ui=`firebase-os:redirect-failure`,di=null;function fi(e,t){if(!e)return;let n=String(t||``).trim().toLowerCase();di={credential:e,email:n};try{let t=typeof e.toJSON==`function`?e.toJSON():null;t&&sessionStorage.setItem(ci,JSON.stringify({email:n,json:t}))}catch{}}var pi=()=>{if(di)return!0;try{return!!sessionStorage.getItem(ci)}catch{return!1}};function mi(){di=null;try{sessionStorage.removeItem(ci)}catch{}}async function hi(){if(di){let e=di;return mi(),e}let e=null;try{e=sessionStorage.getItem(ci)}catch{return null}if(mi(),!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 gi(){let e=await hi(),t=D?.currentUser;if(!e||!t)return;let n=String(t.email||``).trim().toLowerCase();e.email&&n&&e.email!==n||await yi(e.credential)}function _i(e){let t=null;try{t=sessionStorage.getItem(li)||null,sessionStorage.removeItem(li)}catch{}let n=String(e?.code||``);if(!n)return;let r=String(e?.customData?.email||e?.email||``);t&&fi(si(e,t),r);try{sessionStorage.setItem(ui,JSON.stringify({id:t||`google`,code:n,email:r}))}catch{}}function vi(){let e=null;try{e=sessionStorage.getItem(ui),e&&sessionStorage.removeItem(ui)}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 yi(e){let t=D?.currentUser;if(!(!e||!t))try{await(0,c.linkWithCredential)(t,e)}catch(e){console.warn(`That way in could not be added to the account. The sign-in itself stands.`,e)}}var bi=e=>or.find(t=>t.providerId===e)?.id;async function xi(e){if(e)try{let t=await(0,c.fetchSignInMethodsForEmail)(Jr(),e);for(let e of t){let t=bi(e);if(t)return t}}catch{}}async function Si(e,t,n,r={}){let i=e?.code||``,a=String(e?.message||``);if(i===`auth/operation-not-allowed`)return{text:xr(t)};if(i===`auth/account-exists-with-different-credential`){let n=String(e?.customData?.email||e?.email||r.email||``),i=await xi(n),a=i?sr(i)?.label:``,o=si(e,t)??void 0;o&&fi(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 xi(String(r.email||e?.customData?.email||``)),n=t?sr(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/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 Ci=[3e3,6e3,12e3,2e4,3e4,6e4],wi=900*1e3,Ti=`fbos_rules_copied`,Ei=e=>{let t=e?.code;return t===`permission-denied`||t===`not-found`};function Di(e,t=Date.now()){try{localStorage.setItem(Ti,JSON.stringify({emails:e.map(e=>e.trim().toLowerCase()).filter(Boolean),at:t}))}catch{}}function Oi(e,t=Date.now()){if(!e)return!1;try{let n=JSON.parse(localStorage.getItem(Ti)||`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 ki=`fbos_rules_typed`;function Ai(){try{return localStorage.getItem(ki)||``}catch{return``}}function ji(e){try{localStorage.setItem(ki,e)}catch{}}function Mi(e=Ci,t=wi){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 Ni=(0,a.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 Pi(e){try{return await(0,c.deleteUser)(e),`deleted`}catch{}try{return await(0,c.signOut)(D),`signed-out`}catch{return`failed`}}var Fi=e=>`fbos_role2_${e}`,Ii=e=>{try{return localStorage.getItem(Fi(e))}catch{return null}},Li=(e,t)=>{try{localStorage.setItem(Fi(e),t)}catch{}},Ri=e=>{try{localStorage.removeItem(Fi(e))}catch{}},zi=e=>{try{localStorage.removeItem(`fbos_role_${e}`)}catch{}};function Bi(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 Vi({children:e,onSignedOut:n,onRemoved:r}){let[i,s]=(0,a.useState)(null),[u,d]=(0,a.useState)(null),[f,p]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!0),[g,_]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[b,x]=(0,a.useState)(null),[S,C]=(0,a.useState)(null),[w,T]=(0,a.useState)(!1),ee=a.default.useRef(null),E=a.default.useRef(null),k=a.default.useRef(null),A=a.default.useRef(``),j=a.default.useRef(null),M=a.default.useRef(n);M.current=n;let te=a.default.useRef(r);te.current=r;let ne=a.default.useRef(null),N=a.default.useRef(null),re=a.default.useRef(null),ie=a.default.useRef(null),P=a.default.useRef(null),F=a.default.useRef(null),I=a.default.useRef(Mi()),L=a.default.useRef(null),ae=a.default.useRef(null),oe=a.default.useRef(null),R=(e,{certain:t=!1}={})=>{if(j.current!==e)return;if(t)L.current=e;else if(L.current!==e&&!Oi(D.currentUser?.email))return;let n=oe.current;n?.uid===e&&I.current.later(n.run)},z=a.default.useRef(new Set),se=e=>(0,l.updateDoc)((0,l.doc)(O,`user_profiles`,e),{role:`admin`}),ce=async(e,{again:t=!1}={})=>{if(!(z.current.has(e)&&!t)){z.current.add(e);try{await se(e)}catch(t){if(t?.code!==`permission-denied`){console.error(`Error claiming the admin role:`,t);return}try{if(!D.currentUser)return;await D.currentUser.getIdToken(!0),await se(e)}catch(t){if(t?.code!==`permission-denied`){console.error(`Error claiming the admin role:`,t);return}R(e)}}}};return(0,a.useEffect)(()=>{let e,n=I.current;if(!D){h(!1),_(!0),T(!0);return}(0,c.getRedirectResult)(D).then(e=>{e?.user&&gi()}).catch(e=>{e?.code&&_i(e)});let r=(0,c.onAuthStateChanged)(D,async n=>{if(n?.uid===j.current&&g){s(n);return}let r=j.current;if(j.current=n?.uid||null,n){A.current=Lr(typeof window<`u`?window.location.pathname:``),y(!1),n.uid!==r&&(re.current=null,I.current.stop(),L.current=null,ae.current=null),r!==n.uid&&T(!1),zi(n.uid);let i=Ii(n.uid);i?(d(i),_(!0),h(!1)):_(!1),s(n);try{let r=(0,l.doc)(O,`user_profiles`,n.uid),i=e=>{console.error(`[AuthContext] the profile could not be read to the end:`,e),P.current=null,F.current=null,_(!0),y(!0),T(!0),h(!1)},a=e=>{try{let i=e.exists()?e.data():null,a=e.metadata?.hasPendingWrites===!0;if(a||(ae.current={uid:n.uid,data:i},(i?.role||i?.removed)&&I.current.stop()),i?.removed===!0){ne.current=n.uid,N.current!==n.uid&&(N.current=n.uid,Pi(n).then(e=>{e!==`deleted`&&(N.current=null)})),d(null),re.current=null,Ri(n.uid),p(!0),x(null),C(i),_(!0),y(!0),T(!0),h(!1);return}let o=null;if(k.current!==n.uid){k.current=n.uid;let e=Bi(i,{uid:n.uid,email:n.email,displayName:n.displayName,phone:n.phoneNumber});i&&e&&(o=e);let t=Rr(i,A.current);A.current=``,(e||t)&&(i||(P.current=n.uid),(0,l.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.`),R(n.uid)):console.error(`Failed to sync profile:`,e)}).finally(()=>{P.current===n.uid&&(P.current=null,F.current!==n.uid&&T(!0))}));let a={...i||{},...e||{}};Vn(a,n)&&(F.current=n.uid,Kn(n.uid,a).finally(()=>{F.current===n.uid&&(F.current=null,P.current!==n.uid&&T(!0))}))}if(i){let e=on(i);a?e=re.current??`user`:re.current=e,!a&&E.current!==n.uid&&an(i)&&t.t(D.currentUser)&&(E.current=n.uid,cn(n.uid,i)),!a&&!i.role&&!i.removed&&D.currentUser?.emailVerified&&ce(n.uid),ee.current===null&&(ee.current=e),d(e),Li(n.uid,e),p(i.inactive===!0),x(Br(i)?.role??null),C(o?{...i,...o}:i)}else d(null),a||(re.current=null),Ri(n.uid),p(!1),x(null),C(null);_(!0),y(!0),(i||P.current!==n.uid)&&F.current!==n.uid&&T(!0),h(!1)}catch(e){i(e)}},o=e=>{_(!0),P.current=null,F.current=null,T(!0),h(!1),Ei(e)&&R(n.uid,{certain:!0})},s=()=>{e&&e(),e=(0,l.onSnapshot)(r,{includeMetadataChanges:!0},a,o)};oe.current={uid:n.uid,run:()=>{j.current===n.uid&&(k.current=null,z.current.delete(n.uid),s())}},s()}catch(e){console.error(`[AuthContext] ERROR in auth resolution:`,e),_(!0),P.current=null,F.current=null,T(!0),h(!1)}}else{if(r){let e=ne.current===r;e&&(ne.current=null),(e&&te.current||M.current)?.()}s(null),d(null),p(!1),x(null),C(null),_(!0),y(!1),T(!1),h(!1),ee.current=null,re.current=null,ie.current=null,A.current=``,E.current=null,k.current=null,P.current=null,F.current=null,I.current.stop(),L.current=null,ae.current=null,oe.current=null,e&&e()}});return()=>{r(),n.stop(),e&&e()}},[]),(0,a.useEffect)(()=>{if(typeof window>`u`)return;let e=0,t=()=>{if(typeof document<`u`&&document.visibilityState===`hidden`)return;let t=j.current;if(!t||Date.now()-e<2e3)return;let n=I.current;if(n.waiting){e=Date.now(),n.now();return}let r=ae.current,i=r?.uid===t&&!r.data?.role&&!r.data?.removed,a=oe.current;i&&a?.uid===t&&Oi(D.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,a.useEffect)(()=>{let e=i?.uid??null,t=i?.emailVerified===!0,n=ie.current,r=!!e&&!!n&&n.uid===e&&!n.verified&&t;if(ie.current=e?{uid:e,verified:t}:null,!r||u===`admin`)return;let a=!1;return(0,l.getDoc)((0,l.doc)(O,`user_profiles`,i.uid)).then(e=>{!a&&e.exists()&&!e.data().role&&!e.data().removed&&ce(i.uid,{again:!0})}).catch(()=>{}),()=>{a=!0}},[i?.uid,i?.emailVerified,u]),(0,o.jsx)(Ni.Provider,{value:{user:i,userRole:u,accessLevel:t.y(u),isInternal:t.p(u),isAdmin:t.h(u),loading:m,signOut:async()=>{await(0,c.signOut)(D),s(null)},registerUser:async(e,t,n,r)=>{let{createUserWithEmailAndPassword:i}=await import(`firebase/auth`),{user:a}=await i(D,e,t),o=`${n} ${r}`.trim();await(0,c.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,l.setDoc)((0,l.doc)(O,`user_profiles`,a.uid),{uid:a.uid,email:a.email,displayName:o,createdAt:new Date().toISOString()},{merge:!0})}catch(e){console.warn(`Could not write public profile on registration.`,e)}try{await(0,c.sendEmailVerification)(a),Yn(a.uid)}catch(e){console.warn(`The verification mail could not be sent at registration; /verify sends it.`,e)}},refreshUser:async()=>{D.currentUser&&(await D.currentUser.reload(),s(Object.assign(Object.create(D.currentUser),{photoURL:D.currentUser.photoURL,displayName:D.currentUser.displayName,email:D.currentUser.email,emailVerified:D.currentUser.emailVerified})))},userInactive:f,roleResolved:g,roleConfirmed:v,requestedRole:b,profile:S,profileReady:w},children:e})}var Hi=()=>(0,a.useContext)(Ni),Ui=(0,a.createContext)({});function Wi(e){let t=(0,a.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Gi=typeof window<`u`?a.useLayoutEffect:a.useEffect,Ki=(0,a.createContext)(null);function qi(e,t){e.indexOf(t)===-1&&e.push(t)}function Ji(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Yi=(e,t,n)=>n>t?t:n<e?e:n;function Xi(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var Zi=()=>{},Qi=()=>{};typeof process<`u`&&process.env.NODE_ENV!==`production`&&(Zi=(e,t,n)=>{!e&&typeof console<`u`&&console.warn(Xi(t,n))},Qi=(e,t,n)=>{if(!e)throw Error(Xi(t,n))});var $i={},ea=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ta(e){return typeof e==`object`&&!!e}var na=e=>/^0[^.\s]+$/u.test(e);function ra(e){let t;return()=>(t===void 0&&(t=e()),t)}var ia=e=>e,aa=(e,t)=>n=>t(e(n)),oa=(...e)=>e.reduce(aa),sa=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},ca=class{constructor(){this.subscriptions=[]}add(e){return qi(this.subscriptions,e),()=>Ji(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}},la=e=>e*1e3,ua=e=>e/1e3;function da(e,t){return t?1e3/t*e:0}var fa=new Set;function pa(e,t,n){e||fa.has(t)||(console.warn(Xi(t,n)),fa.add(t))}var ma=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ha=1e-7,ga=12;function _a(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=ma(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>ha&&++s<ga);return o}function va(e,t,n,r){if(e===t&&n===r)return ia;let i=t=>_a(t,0,1,e,n);return e=>e===0||e===1?e:ma(i(e),t,r)}var ya=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ba=e=>t=>1-e(1-t),xa=va(.33,1.53,.69,.99),Sa=ba(xa),Ca=ya(Sa),wa=e=>e>=1?1:(e*=2)<1?.5*Sa(e):.5*(2-2**(-10*(e-1))),Ta=e=>1-Math.sin(Math.acos(e)),Ea=ba(Ta),Da=ya(Ta),Oa=va(.42,0,1,1),ka=va(0,0,.58,1),Aa=va(.42,0,.58,1),ja=e=>Array.isArray(e)&&typeof e[0]!=`number`,Ma=e=>Array.isArray(e)&&typeof e[0]==`number`,Na={linear:ia,easeIn:Oa,easeInOut:Aa,easeOut:ka,circIn:Ta,circInOut:Da,circOut:Ea,backIn:Sa,backInOut:Ca,backOut:xa,anticipate:wa},Pa=e=>typeof e==`string`,Fa=e=>{if(Ma(e)){Qi(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(Pa(e))return Qi(Na[e]!==void 0,`Invalid easing type '${e}'`,`invalid-easing-type`),Na[e];return e},Ia=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],La={value:null,addProjectionMetrics:null};function Ra(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&&La.value&&La.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var za=40;function Ba(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ia.reduce((e,n)=>(e[n]=Ra(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=$i.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,za),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:Ia.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<Ia.length;t++)o[Ia[t]].cancel(e)},state:i,steps:o}}var{schedule:B,cancel:Va,state:V,steps:Ha}=Ba(typeof requestAnimationFrame<`u`?requestAnimationFrame:ia,!0),Ua;function Wa(){Ua=void 0}var Ga={now:()=>(Ua===void 0&&Ga.set(V.isProcessing||$i.useManualTiming?V.timestamp:performance.now()),Ua),set:e=>{Ua=e,queueMicrotask(Wa)}},Ka={layout:0,mainThread:0,waapi:0},qa=e=>t=>typeof t==`string`&&t.startsWith(e),Ja=qa(`--`),Ya=qa(`var(--`),Xa=e=>Ya(e)?Za.test(e.split(`/*`)[0].trim()):!1,Za=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Qa(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var $a={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},eo={...$a,transform:e=>Yi(0,1,e)},to={...$a,default:1},no=e=>Math.round(e*1e5)/1e5,ro=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function io(e){return e==null}var ao=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,oo=(e,t)=>n=>!!(typeof n==`string`&&ao.test(n)&&n.startsWith(e)||t&&!io(n)&&Object.prototype.hasOwnProperty.call(n,t)),so=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ro);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},co=e=>Yi(0,255,e),lo={...$a,transform:e=>Math.round(co(e))},uo={test:oo(`rgb`,`red`),parse:so(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+lo.transform(e)+`, `+lo.transform(t)+`, `+lo.transform(n)+`, `+no(eo.transform(r))+`)`};function fo(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 po={test:oo(`#`),parse:fo,transform:uo.transform},mo=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ho=mo(`deg`),go=mo(`%`),H=mo(`px`),_o=mo(`vh`),vo=mo(`vw`),yo={...go,parse:e=>go.parse(e)/100,transform:e=>go.transform(e*100)},bo={test:oo(`hsl`,`hue`),parse:so(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+go.transform(no(t))+`, `+go.transform(no(n))+`, `+no(eo.transform(r))+`)`},U={test:e=>uo.test(e)||po.test(e)||bo.test(e),parse:e=>uo.test(e)?uo.parse(e):bo.test(e)?bo.parse(e):po.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?uo.transform(e):bo.transform(e),getAnimatableNone:e=>{let t=U.parse(e);return t.alpha=0,U.transform(t)}},xo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function So(e){return isNaN(e)&&typeof e==`string`&&(e.match(ro)?.length||0)+(e.match(xo)?.length||0)>0}var Co=`number`,wo=`color`,To=`var`,Eo=`var(`,Do="${}",Oo=/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 ko(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Oo,e=>(U.test(e)?(r.color.push(a),i.push(wo),n.push(U.parse(e))):e.startsWith(Eo)?(r.var.push(a),i.push(To),n.push(e)):(r.number.push(a),i.push(Co),n.push(parseFloat(e))),++a,Do)).split(Do),indexes:r,types:i}}function Ao(e){return ko(e).values}function jo({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===Co?i+=no(r[a]):e===wo?i+=U.transform(r[a]):i+=r[a]}return i}}function Mo(e){return jo(ko(e))}var No=e=>typeof e==`number`?0:U.test(e)?U.getAnimatableNone(e):e,Po=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:No(e);function Fo(e){let t=ko(e);return jo(t)(t.values.map((e,n)=>Po(e,t.split[n])))}var Io={test:So,parse:Ao,createTransformer:Mo,getAnimatableNone:Fo};function Lo(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 Ro({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=Lo(s,r,e+1/3),a=Lo(s,r,e),o=Lo(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function zo(e,t){return n=>n>0?t:e}var W=(e,t,n)=>e+(t-e)*n,Bo=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Vo=[po,uo,bo],Ho=e=>Vo.find(t=>t.test(e));function Uo(e){let t=Ho(e);if(Zi(!!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===bo&&(n=Ro(n)),n}var Wo=(e,t)=>{let n=Uo(e),r=Uo(t);if(!n||!r)return zo(e,t);let i={...n};return e=>(i.red=Bo(n.red,r.red,e),i.green=Bo(n.green,r.green,e),i.blue=Bo(n.blue,r.blue,e),i.alpha=W(n.alpha,r.alpha,e),uo.transform(i))},Go=new Set([`none`,`hidden`]);function Ko(e,t){return Go.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qo(e,t){return n=>W(e,t,n)}function Jo(e){return typeof e==`number`?qo:typeof e==`string`?Xa(e)?zo:U.test(e)?Wo:Qo:Array.isArray(e)?Yo:typeof e==`object`?U.test(e)?Wo:Xo:zo}function Yo(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Jo(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Xo(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Jo(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Zo(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 Qo=(e,t)=>{let n=Io.createTransformer(t),r=ko(e),i=ko(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?Go.has(e)&&!i.values.length||Go.has(t)&&!r.values.length?Ko(e,t):oa(Yo(Zo(r,i),i.values),n):(Zi(!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`),zo(e,t))};function $o(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?W(e,t,n):Jo(e)(e,t)}var es=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>B.update(t,e),stop:()=>Va(t),now:()=>V.isProcessing?V.timestamp:Ga.now()}},ts=(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)})`},ns=2e4;function rs(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 is(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(rs(r),ns);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:ua(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 as(e,t){return e*Math.sqrt(1-t*t)}var os=12;function ss(e,t,n){let r=n;for(let n=1;n<os;n++)r-=e(r)/t(r);return r}var cs=.001;function ls({duration:e=G.duration,bounce:t=G.bounce,velocity:n=G.velocity,mass:r=G.mass}){let i,a;Zi(e<=la(G.maxDuration),`Spring duration must be 10 seconds or less`,`spring-duration-limit`);let o=1-t;o=Yi(G.minDamping,G.maxDamping,o),e=Yi(G.minDuration,G.maxDuration,ua(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=as(t,o),c=Math.exp(-i);return cs-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=as(t**2,o);return(-i(t)+cs>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-cs+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=ss(i,a,s);if(e=la(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 us=[`duration`,`bounce`],ds=[`stiffness`,`damping`,`mass`];function fs(e,t){return t.some(t=>e[t]!==void 0)}function ps(e){let t={velocity:G.velocity,stiffness:G.stiffness,damping:G.damping,mass:G.mass,isResolvedFromDuration:!1,...e};if(!fs(e,ds)&&fs(e,us))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Yi(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:G.mass,stiffness:i,damping:a}}else{let n=ls({...e,velocity:0});t={...t,...n,mass:G.mass},t.isResolvedFromDuration=!0}return t}function ms(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}=ps({...n,velocity:-ua(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=ua(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=as(_,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=>la(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=la(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=la(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(rs(T),ns),t=ts(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}ms.applyToOptions=e=>{let t=is(e,100,ms);return e.ease=t.ease,e.duration=la(t.duration),e.type=`keyframes`,e};var hs=5;function gs(e,t,n){let r=Math.max(t-hs,0);return da(n-e(r),t-r)}function _s({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=ms({keyframes:[f.value,m(f.value)],velocity:gs(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 vs(e,t,n){let r=[],i=n||$i.mix||$o,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=oa(Array.isArray(t)?t[n]||ia:t,a)),r.push(a)}return r}function ys(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(Qi(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=vs(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=sa(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Yi(e[0],e[a-1],t)):l}function bs(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=sa(0,t,r);e.push(W(n,1,i))}}function xs(e){let t=[0];return bs(t,e.length-1),t}function Ss(e,t){return e.map(e=>e*t)}function Cs(e,t){return e.map(()=>t||Aa).splice(0,e.length-1)}function ws({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=ja(r)?r.map(Fa):Fa(r),a={done:!1,value:t[0]},o=ys(Ss(n&&n.length===t.length?n:xs(t),e),t,{ease:Array.isArray(i)?i:Cs(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Ts=e=>e!==null;function Es(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Ts),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Ds={decay:_s,inertia:_s,tween:ws,keyframes:ws,spring:ms};function Os(e){typeof e.type==`string`&&(e.type=Ds[e.type])}var ks=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)}},As=e=>e/100,js=class extends ks{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!==Ga.now()&&this.tick(Ga.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},Ka.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Os(e);let{type:t=ws,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||ws;process.env.NODE_ENV!==`production`&&s!==ws&&Qi(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`,`spring-two-frames`),s!==ws&&typeof o[0]!=`number`&&(this.mixKeyframes=oa(As,$o(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=rs(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=Yi(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!==_s&&(b.value=Es(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 ua(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ua(e)}get time(){return ua(this.currentTime)}set time(e){e=la(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 gs(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(Ga.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=ua(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=es,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(Ga.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,Ka.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 Ms(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Ns=e=>e*180/Math.PI,Ps=e=>Is(Ns(Math.atan2(e[1],e[0]))),Fs={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ps,rotateZ:Ps,skewX:e=>Ns(Math.atan(e[1])),skewY:e=>Ns(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Is=e=>(e%=360,e<0&&(e+=360),e),Ls=Ps,Rs=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),zs=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Bs={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Rs,scaleY:zs,scale:e=>(Rs(e)+zs(e))/2,rotateX:e=>Is(Ns(Math.atan2(e[6],e[5]))),rotateY:e=>Is(Ns(Math.atan2(-e[2],e[0]))),rotateZ:Ls,rotate:Ls,skewX:e=>Ns(Math.atan(e[4])),skewY:e=>Ns(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Vs(e){return+!!e.includes(`scale`)}function Hs(e,t){if(!e||e===`none`)return Vs(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Bs,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Fs,i=t}if(!i)return Vs(t);let a=r[t],o=i[1].split(`,`).map(Ws);return typeof a==`function`?a(o):o[a]}var Us=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Hs(n,t)};function Ws(e){return parseFloat(e.trim())}var Gs=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Ks=new Set(Gs),qs=e=>e===$a||e===H,Js=new Set([`x`,`y`,`z`]),Ys=Gs.filter(e=>!Js.has(e));function Xs(e){let t=[];return Ys.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var Zs={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})=>Hs(t,`x`),y:(e,{transform:t})=>Hs(t,`y`)};Zs.translateX=Zs.x,Zs.translateY=Zs.y;var Qs=new Set,$s=!1,ec=!1,tc=!1;function nc(){if(ec){let e=Array.from(Qs).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Xs(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)})}ec=!1,$s=!1,Qs.forEach(e=>e.complete(tc)),Qs.clear()}function rc(){Qs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ec=!0)})}function ic(){tc=!0,rc(),nc(),tc=!1}var ac=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?(Qs.add(this),$s||($s=!0,B.read(rc),B.resolveKeyframes(nc))):(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])}Ms(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Qs.delete(this)}cancel(){this.state===`scheduled`&&(Qs.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},oc=e=>e.startsWith(`--`);function sc(e,t,n){oc(t)?e.style.setProperty(t,n):e.style[t]=n}var cc={};function lc(e,t){let n=ra(e);return()=>cc[t]??n()}var uc=lc(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),dc=lc(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),fc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,pc={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:fc([0,.65,.55,1]),circOut:fc([.55,0,1,.45]),backIn:fc([.31,.01,.66,-.59]),backOut:fc([.33,1.53,.69,.99])};function mc(e,t){if(e)return typeof e==`function`?dc()?ts(e,t):`ease-out`:Ma(e)?fc(e):Array.isArray(e)?e.map(e=>mc(e,t)||pc.easeOut):pc[e]}function hc(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=mc(s,i);Array.isArray(d)&&(u.easing=d),La.value&&Ka.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 La.value&&p.finished.finally(()=>{Ka.waapi--}),p}function gc(e){return typeof e==`function`&&`applyToOptions`in e}function _c({type:e,...t}){return gc(e)&&dc()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var vc=class extends ks{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,Qi(typeof e.type!=`string`,`Mini animate() doesn't support "type" as a string.`,`mini-spring`);let c=_c(e);this.animation=hc(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Es(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),sc(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 ua(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ua(e)}get time(){return ua(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=la(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&&uc()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),ia):r(this)}},yc={anticipate:wa,backInOut:Ca,circInOut:Da};function bc(e){return e in yc}function xc(e){typeof e.ease==`string`&&bc(e.ease)&&(e.ease=yc[e.ease])}var Sc=10,Cc=class extends vc{constructor(e){xc(e),Os(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 js({...a,autoplay:!1}),s=Math.max(Sc,Ga.now()-this.startTime),c=Yi(0,Sc,s-Sc),l=o.sample(s).value,{name:u}=this.options;i&&u&&sc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},wc=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Io.test(e)||e===`0`)&&!e.startsWith(`url(`));function Tc(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 Ec(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=wc(i,t),s=wc(a,t);return Zi(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:Tc(e)||(n===`spring`||gc(n))&&r}function Dc(e){e.duration=0,e.type=`keyframes`}var Oc=new Set([`opacity`,`clipPath`,`filter`,`transform`]),kc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Ac(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&kc.test(e[t]))return!0;return!1}var jc=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Mc=ra(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Nc(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 Mc()&&n&&(Oc.has(n)||jc.has(n)&&Ac(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Pc=40,Fc=class extends ks{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=Ga.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||ac)(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=Ga.now();let u=!0;Ec(e,i,a,o)||(u=!1,($i.instantAnimations||!s)&&l?.(Es(e,n,t)),e[0]=e[e.length-1],Dc(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Pc?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Nc(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Cc({...d,element:p})}catch{m=new js(d)}else m=new js(d);m.finished.then(()=>{this.notifyFinished()}).catch(ia),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(),ic()),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 Ic(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 Lc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Rc(e){let t=Lc.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}var zc=4;function Bc(e,t,n=1){Qi(n<=zc,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,`max-css-var-depth`);let[r,i]=Rc(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ea(e)?parseFloat(e):e}return Xa(i)?Bc(i,t,n+1):i}var Vc={type:`spring`,stiffness:500,damping:25,restSpeed:10},Hc=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Uc={type:`keyframes`,duration:.8},Wc={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Gc=(e,{keyframes:t})=>t.length>2?Uc:Ks.has(e)?e.startsWith(`scale`)?Hc(t[1]):Vc:Wc;function Kc(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function qc(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Kc(n,e)}var Jc=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Yc(e){for(let t in e)if(!Jc.has(t))return!0;return!1}var Xc=(e,t,n,r={},i,a)=>o=>{let s=qc(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=la(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};Yc(s)||Object.assign(u,Gc(e,u)),u.duration&&=la(u.duration),u.repeatDelay&&=la(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Dc(u),u.delay===0&&(d=!0)),($i.instantAnimations||$i.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,Dc(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Es(u.keyframes,s);if(e!==void 0){B.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new js(u):new Fc(u)};function Zc(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Qc(e,t,n,r){if(typeof t==`function`){let[i,a]=Zc(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]=Zc(r);t=t(n===void 0?e.custom:n,i,a)}return t}function $c(e,t,n){let r=e.getProps();return Qc(r,t,n===void 0?r.custom:n,e)}var el=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Gs]),tl=30,nl=e=>!isNaN(parseFloat(e)),rl={current:void 0},il=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Ga.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=Ga.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=nl(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!==`production`&&pa(!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 ca);let n=this.events[e].add(t);return e===`change`?()=>{n(),B.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return rl.current&&rl.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Ga.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>tl)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,tl);return da(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 al(e,t){return new il(e,t)}var ol=e=>Array.isArray(e);function sl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,al(n))}function cl(e){return ol(e)?e[e.length-1]||0:e}function ll(e,t){let{transitionEnd:n={},transition:r={},...i}=$c(e,t)||{};i={...i,...n};for(let t in i)sl(e,t,cl(i[t]))}var K=e=>!!(e&&e.getVelocity);function ul(e){return!!(K(e)&&e.add)}function dl(e,t){let n=e.getValue(`willChange`);if(ul(n))return n.add(t);if(!n&&$i.WillChange){let n=new $i.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function fl(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var pl=`data-`+fl(`framerAppearId`);function ml(e){return e.props[pl]}function hl({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function gl(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Kc(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&&hl(d,t))continue;let o={delay:n,...qc(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){B.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=ml(e);if(n){let e=window.MotionHandoffAnimation(n,t,B);e!==null&&(o.startTime=e,f=!0)}}dl(e,t);let p=l??e.shouldReduceMotion;r.start(Xc(t,r,i,p&&el.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>B.update(()=>{o&&ll(e,o)});u.length?Promise.all(u).then(t):t()}return u}function _l(e,t,n={}){let r=$c(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(gl(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return vl(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 vl(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(_l(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Ic(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function yl(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>_l(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=_l(e,t,n);else{let i=typeof t==`function`?$c(e,t,n.custom):t;r=Promise.all(gl(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var bl={test:e=>e===`auto`,parse:e=>e},xl=e=>t=>t.test(e),Sl=[$a,H,go,ho,vo,_o,bl],Cl=e=>Sl.find(xl(e));function wl(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||na(e)}var Tl=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function El(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ro)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Tl.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Dl=/\b([a-z-]*)\(.*?\)/gu,Ol={...Io,getAnimatableNone:e=>{let t=e.match(Dl);return t?t.map(El).join(` `):e}},kl={...Io,getAnimatableNone:e=>{let t=Io.parse(e);return Io.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Al={...$a,transform:Math.round},jl={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:ho,rotateX:ho,rotateY:ho,rotateZ:ho,scale:to,scaleX:to,scaleY:to,scaleZ:to,skew:ho,skewX:ho,skewY:ho,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:eo,originX:yo,originY:yo,originZ:H,zIndex:Al,fillOpacity:eo,strokeOpacity:eo,numOctaves:Al},Ml={...jl,color:U,backgroundColor:U,outlineColor:U,fill:U,stroke:U,borderColor:U,borderTopColor:U,borderRightColor:U,borderBottomColor:U,borderLeftColor:U,filter:Ol,WebkitFilter:Ol,mask:kl,WebkitMask:kl},Nl=e=>Ml[e],Pl=new Set([Ol,kl]);function Fl(e,t){let n=Nl(e);return Pl.has(n)||(n=Io),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Il=new Set([`auto`,`none`,`0`]);function Ll(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Il.has(t)&&ko(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Fl(n,i)}var Rl=class extends ac{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(),Xa(r))){let i=Bc(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!el.has(n)||e.length!==2)return;let[r,i]=e,a=Cl(r),o=Cl(i);if(Qa(r)!==Qa(i)&&Zs[n]){this.needsMeasurement=!0;return}if(a!==o)if(qs(a)&&qs(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Zs[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||wl(e[t]))&&n.push(t);n.length&&Ll(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=Zs[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]=Zs[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 zl(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 Bl=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Vl(e){return ta(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:Hl,cancel:Ul}=Ba(queueMicrotask,!1),Wl={x:!1,y:!1};function Gl(){return Wl.x||Wl.y}function Kl(e){return e===`x`||e===`y`?Wl[e]?null:(Wl[e]=!0,()=>{Wl[e]=!1}):Wl.x||Wl.y?null:(Wl.x=Wl.y=!0,()=>{Wl.x=Wl.y=!1})}function ql(e,t){let n=zl(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Jl(e){return!(e.pointerType===`touch`||Gl())}function Yl(e,t,n={}){let[r,i,a]=ql(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(!Jl(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 Xl=(e,t)=>t?e===t?!0:Xl(e,t.parentElement):!1,Zl=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Ql=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function $l(e){return Ql.has(e.tagName)||e.isContentEditable===!0}var eu=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function tu(e){return eu.has(e.tagName)||e.isContentEditable===!0}var nu=new WeakSet;function ru(e){return t=>{t.key===`Enter`&&e(t)}}function iu(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var au=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ru(()=>{if(nu.has(n))return;iu(n,`down`);let e=ru(()=>{iu(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>iu(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function ou(e){return Zl(e)&&!Gl()}var su=new WeakSet;function cu(e,t,n={}){let[r,i,a]=ql(e,n),o=e=>{let r=e.currentTarget;if(!ou(e)||su.has(e))return;nu.add(r),n.stopPropagation&&su.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),nu.has(r)&&nu.delete(r),ou(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Xl(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),Vl(e)&&(e.addEventListener(`focus`,e=>au(e,i)),!$l(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function lu(e){return ta(e)&&`ownerSVGElement`in e}var uu=new WeakMap,du,fu=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:lu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],pu=fu(`inline`,`width`,`offsetWidth`),mu=fu(`block`,`height`,`offsetHeight`);function hu({target:e,borderBoxSize:t}){uu.get(e)?.forEach(n=>{n(e,{get width(){return pu(e,t)},get height(){return mu(e,t)}})})}function gu(e){e.forEach(hu)}function _u(){typeof ResizeObserver>`u`||(du=new ResizeObserver(gu))}function vu(e,t){du||_u();let n=zl(e);return n.forEach(e=>{let n=uu.get(e);n||(n=new Set,uu.set(e,n)),n.add(t),du?.observe(e)}),()=>{n.forEach(e=>{let n=uu.get(e);n?.delete(t),n?.size||du?.unobserve(e)})}}var yu=new Set,bu;function xu(){bu=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};yu.forEach(t=>t(e))},window.addEventListener(`resize`,bu)}function Su(e){return yu.add(e),bu||xu(),()=>{yu.delete(e),!yu.size&&typeof bu==`function`&&(window.removeEventListener(`resize`,bu),bu=void 0)}}function Cu(e,t){return typeof e==`function`?Su(e):vu(e,t)}function wu(e){return lu(e)&&e.tagName===`svg`}var Tu=[...Sl,U,Io],Eu=e=>Tu.find(xl(e)),Du=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ou=()=>({x:Du(),y:Du()}),ku=()=>({min:0,max:0}),q=()=>({x:ku(),y:ku()}),Au=new WeakMap;function ju(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Mu(e){return typeof e==`string`||Array.isArray(e)}var Nu=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Pu=[`initial`,...Nu];function Fu(e){return ju(e.animate)||Pu.some(t=>Mu(e[t]))}function Iu(e){return!!(Fu(e)||e.variants)}function Lu(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,al(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,al(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Ru={current:null},zu={current:!1},Bu=typeof window<`u`;function Vu(){if(zu.current=!0,Bu)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Ru.current=e.matches;e.addEventListener(`change`,t),t()}else Ru.current=!1}var Hu=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Uu={};function Wu(e){Uu=e}function Gu(){return Uu}var Ku=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=ac,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=Ga.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,B.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Fu(t),this.isVariantNode=Iu(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,Au.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:(zu.current||Vu(),this.shouldReduceMotion=Ru.current),process.env.NODE_ENV!==`production`&&pa(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(),Va(this.notifyUpdate),Va(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&&Oc.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new vc({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:la(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Ks.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&B.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Uu){let t=Uu[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<Hu.length;t++){let n=Hu[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=Lu(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=al(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`&&(ea(n)||na(n))?n=parseFloat(n):!Eu(n)&&Io.test(t)&&(n=Fl(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=Qc(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 ca),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Hl.render(this.render)}},qu=class extends Ku{constructor(){super(...arguments),this.KeyframeResolver=Rl}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}`)}))}},Ju=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Yu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Xu({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Zu(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 Qu(e){return e===void 0||e===1}function $u({scale:e,scaleX:t,scaleY:n}){return!Qu(e)||!Qu(t)||!Qu(n)}function ed(e){return $u(e)||td(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function td(e){return nd(e.x)||nd(e.y)}function nd(e){return e&&e!==`0%`}function rd(e,t,n){return n+t*(e-n)}function id(e,t,n,r,i){return i!==void 0&&(e=rd(e,i,r)),rd(e,n,r)+t}function ad(e,t=0,n=1,r,i){e.min=id(e.min,t,n,r,i),e.max=id(e.max,t,n,r,i)}function od(e,{x:t,y:n}){ad(e.x,t.translate,t.scale,t.originPoint),ad(e.y,n.translate,n.scale,n.originPoint)}var sd=.999999999999,cd=1.0000000000001;function ld(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&&(ud(e.x,-a.scroll.offset.x),ud(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,od(e,o)),r&&ed(a.latestValues)&&pd(e,a.latestValues,a.layout?.layoutBox))}t.x<cd&&t.x>sd&&(t.x=1),t.y<cd&&t.y>sd&&(t.y=1)}function ud(e,t){e.min+=t,e.max+=t}function dd(e,t,n,r,i=.5){ad(e,t,n,W(e.min,e.max,i),r)}function fd(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function pd(e,t,n){let r=n??e;dd(e.x,fd(t.x,r.x),t.scaleX,t.scale,t.originX),dd(e.y,fd(t.y,r.y),t.scaleY,t.scale,t.originY)}function md(e,t){return Yu(Zu(e.getBoundingClientRect(),t))}function hd(e,t,n){let r=md(e,n),{scroll:i}=t;return i&&(ud(r.x,i.offset.x),ud(r.y,i.offset.y)),r}var gd={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},_d=Gs.length;function vd(e,t,n){let r=``,i=!0;for(let a=0;a<_d;a++){let o=Gs[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=Bl(s,jl[o]);if(!c){i=!1;let t=gd[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function yd(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(Ks.has(e)){o=!0;continue}else if(Ja(e)){i[e]=n;continue}else{let t=Bl(n,jl[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=vd(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 bd(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 xd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Sd={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(H.test(e))e=parseFloat(e);else return e;return`${xd(e,t.target.x)}% ${xd(e,t.target.y)}%`}},Cd={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Io.parse(e);if(i.length>5)return r;let a=Io.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)}},wd={borderRadius:{...Sd,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Sd,borderTopRightRadius:Sd,borderBottomLeftRadius:Sd,borderBottomRightRadius:Sd,boxShadow:Cd};function Td(e,{layout:t,layoutId:n}){return Ks.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!wd[e]||e===`opacity`)}function Ed(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])||Td(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Dd(e){return window.getComputedStyle(e)}var Od=class extends qu{constructor(){super(...arguments),this.type=`html`,this.renderInstance=bd}readValueFromInstance(e,t){if(Ks.has(t))return this.projection?.isProjecting?Vs(t):Us(e,t);{let n=Dd(e),r=(Ja(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return md(e,t)}build(e,t,n){yd(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ed(e,t,n)}},kd={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Ad={offset:`strokeDashoffset`,array:`strokeDasharray`};function jd(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?kd:Ad;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Md=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Nd(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(yd(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 Md)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&&jd(d,i,a,o,!1)}var Pd=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`]),Fd=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Id(e,t,n,r){bd(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Pd.has(n)?n:fl(n),t.attrs[n])}function Ld(e,t,n){let r=Ed(e,t,n);for(let n in e)if(K(e[n])||K(t[n])){let t=Gs.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Rd=class extends qu{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=q}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Ks.has(t)){let e=Nl(t);return e&&e.default||0}return t=Pd.has(t)?t:fl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ld(e,t,n)}build(e,t,n){Nd(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Id(e,t,n,r)}mount(e){this.isSVGTag=Fd(e.tagName),super.mount(e)}},zd=Pu.length;function Bd(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Bd(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<zd;n++){let r=Pu[n],i=e.props[r];(Mu(i)||i===!1)&&(t[r]=i)}return t}function Vd(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 Hd=[...Nu].reverse(),Ud=Nu.length;function Wd(e){return t=>Promise.all(t.map(({animation:t,options:n})=>yl(e,t,n)))}function Gd(e){let t=Wd(e),n=Jd(),r=!0,i=!1,a=t=>(n,r)=>{let i=$c(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=Bd(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Ud;t++){let p=Hd[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Mu(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||ju(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Kd(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)?!Vd(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=$c(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Ic(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=$c(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=Jd(),i=!0}}}function Kd(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Vd(t,e):!1}function qd(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Jd(){return{animate:qd(!0),whileInView:qd(),whileHover:qd(),whileTap:qd(),whileDrag:qd(),whileFocus:qd(),exit:qd()}}function Yd(e,t){e.min=t.min,e.max=t.max}function Xd(e,t){Yd(e.x,t.x),Yd(e.y,t.y)}function Zd(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Qd=1e-4,$d=1-Qd,ef=1+Qd,tf=.01,nf=0-tf,rf=0+tf;function af(e){return e.max-e.min}function of(e,t,n){return Math.abs(e-t)<=n}function sf(e,t,n,r=.5){e.origin=r,e.originPoint=W(t.min,t.max,e.origin),e.scale=af(n)/af(t),e.translate=W(n.min,n.max,e.origin)-e.originPoint,(e.scale>=$d&&e.scale<=ef||isNaN(e.scale))&&(e.scale=1),(e.translate>=nf&&e.translate<=rf||isNaN(e.translate))&&(e.translate=0)}function cf(e,t,n,r){sf(e.x,t.x,n.x,r?r.originX:void 0),sf(e.y,t.y,n.y,r?r.originY:void 0)}function lf(e,t,n,r=0){e.min=(r?W(n.min,n.max,r):n.min)+t.min,e.max=e.min+af(t)}function uf(e,t,n,r){lf(e.x,t.x,n.x,r?.x),lf(e.y,t.y,n.y,r?.y)}function df(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+af(t)}function ff(e,t,n,r){df(e.x,t.x,n.x,r?.x),df(e.y,t.y,n.y,r?.y)}function pf(e,t,n,r,i){return e-=t,e=rd(e,1/n,r),i!==void 0&&(e=rd(e,1/i,r)),e}function mf(e,t=0,n=1,r=.5,i,a=e,o=e){if(go.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 hf(e,t,[n,r,i],a,o){mf(e,t[n],t[r],t[i],t.scale,a,o)}var gf=[`x`,`scaleX`,`originX`],_f=[`y`,`scaleY`,`originY`];function vf(e,t,n,r){hf(e.x,t,gf,n?n.x:void 0,r?r.x:void 0),hf(e.y,t,_f,n?n.y:void 0,r?r.y:void 0)}function yf(e){return e.translate===0&&e.scale===1}function bf(e){return yf(e.x)&&yf(e.y)}function xf(e,t){return e.min===t.min&&e.max===t.max}function Sf(e,t){return xf(e.x,t.x)&&xf(e.y,t.y)}function Cf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wf(e,t){return Cf(e.x,t.x)&&Cf(e.y,t.y)}function Tf(e){return af(e.x)/af(e.y)}function Ef(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Df(e){return[e(`x`),e(`y`)]}function Of(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 kf=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],Af=kf.length,jf=e=>typeof e==`string`?parseFloat(e):e,Mf=e=>typeof e==`number`||H.test(e);function Nf(e,t,n,r,i,a){i?(e.opacity=W(0,n.opacity??1,Ff(r)),e.opacityExit=W(t.opacity??1,0,If(r))):a&&(e.opacity=W(t.opacity??1,n.opacity??1,r));for(let i=0;i<Af;i++){let a=kf[i],o=Pf(t,a),s=Pf(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||Mf(o)===Mf(s)?(e[a]=Math.max(W(jf(o),jf(s),r),0),(go.test(s)||go.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=W(t.rotate||0,n.rotate||0,r))}function Pf(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Ff=Lf(0,.5,Ea),If=Lf(.5,.95,ia);function Lf(e,t,n){return r=>r<e?0:r>t?1:n(sa(e,t,r))}function Rf(e,t,n){let r=K(e)?e:al(e);return r.start(Xc(``,r,t,n)),r.animation}function zf(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var Bf=(e,t)=>e.depth-t.depth,Vf=class{constructor(){this.children=[],this.isDirty=!1}add(e){qi(this.children,e),this.isDirty=!0}remove(e){Ji(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Bf),this.isDirty=!1,this.children.forEach(e)}};function Hf(e,t){let n=Ga.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Va(r),e(a-t))};return B.setup(r,!0),()=>Va(r)}function Uf(e){return K(e)?e.get():e}var Wf=class{constructor(){this.members=[]}add(e){qi(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&&(Ji(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Ji(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)}},Gf={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Kf={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},qf=[``,`X`,`Y`,`Z`],Jf=1e3,Yf=0;function Xf(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Zf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=ml(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,B,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Zf(r)}function Qf({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Yf++,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,La.value&&(Kf.nodes=Kf.calculatedTargetDeltas=Kf.calculatedProjections=0),this.nodes.forEach(tp),this.nodes.forEach(up),this.nodes.forEach(dp),this.nodes.forEach(np),La.addProjectionMetrics&&La.addProjectionMetrics(Kf)},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 Vf)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ca),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=lu(t)&&!wu(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;B.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Hf(i,250),Gf.hasAnimatedSinceResize&&(Gf.hasAnimatedSinceResize=!1,this.nodes.forEach(lp)))})}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()||vp,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!wf(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={...qc(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||lp(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(),Va(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(fp),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&&Zf(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(ap),this.nodes.forEach(ip);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(op);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(sp),this.nodes.forEach(cp),this.nodes.forEach($f),this.nodes.forEach(ep)):this.nodes.forEach(op),this.clearAllSnapshots();let e=Ga.now();V.delta=Yi(0,1e3/60,e-V.timestamp),V.timestamp=e,V.isProcessing=!0,Ha.update.process(V),Ha.preRender.process(V),Ha.render.process(V),V.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Hl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rp),this.sharedNodes.forEach(pp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,B.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){B.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!af(this.snapshot.measuredBox.x)&&!af(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&&!bf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ed(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)),Sp(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(wp))){let{scroll:e}=this.root;e&&(ud(t.x,e.offset.x),ud(t.y,e.offset.y))}return t}removeElementScroll(e){let t=q();if(Xd(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&&Xd(t,e),ud(t.x,i.offset.x),ud(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||q();Xd(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&&(ud(r.x,-n.scroll.offset.x),ud(r.y,-n.scroll.offset.y)),ed(n.latestValues)&&pd(r,n.latestValues,n.layout?.layoutBox)}return ed(this.latestValues)&&pd(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=q();Xd(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!ed(n.latestValues))continue;let r;n.instance&&($u(n.latestValues)&&n.updateSnapshot(),r=q(),Xd(r,n.measurePageBox())),vf(t,n.latestValues,n.snapshot?.layoutBox,r)}return ed(this.latestValues)&&vf(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==V.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=V.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=q(),this.targetWithTransforms=q()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),uf(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Xd(this.target,this.layout.layoutBox),od(this.target,this.targetDelta)):Xd(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),La.value&&Kf.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||$u(this.parent.latestValues)||td(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(),ff(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Xd(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===V.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Xd(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;ld(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():(Zd(this.prevProjectionDelta.x,this.projectionDelta.x),Zd(this.prevProjectionDelta.y,this.projectionDelta.y)),cf(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Ef(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ef(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),La.value&&Kf.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=Ou(),this.projectionDelta=Ou(),this.projectionDeltaWithTransform=Ou()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=Ou();(!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(_p));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;mp(a.x,e.x,n),mp(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ff(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),gp(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Sf(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=q(),Xd(d,this.relativeTarget)),s&&(this.animationValues=i,Nf(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&&=(Va(this.pendingAnimation),void 0),this.pendingAnimation=B.update(()=>{Gf.hasAnimatedSinceResize=!0,Ka.layout++,this.motionValue||=al(0),this.motionValue.jump(0,!1),this.currentAnimation=Rf(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{Ka.layout--},onComplete:()=>{Ka.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(Jf),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&&Cp(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||q();let t=af(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=af(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Xd(t,n),pd(t,i),cf(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Wf),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&&Xf(`z`,e,r,this.animationValues);for(let t=0;t<qf.length;t++)Xf(`rotate${qf[t]}`,e,r,this.animationValues),Xf(`skew${qf[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=Uf(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=Uf(t?.pointerEvents)||``),this.hasProjected&&!ed(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Of(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 wd){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=wd[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?Uf(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ip),this.root.sharedNodes.clear()}}}function $f(e){e.updateLayout()}function ep(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`)Df(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=af(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Yd(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Cp(i,t.layoutBox,n)&&Df(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=af(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=Ou();cf(o,n,t.layoutBox);let s=Ou();a?cf(s,e.applyTransform(r,!0),t.measuredBox):cf(s,n,t.layoutBox);let c=!bf(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();ff(s,t.layoutBox,i.layoutBox,o);let c=q();ff(c,n,a.layoutBox,o),wf(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 tp(e){La.value&&Kf.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 np(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rp(e){e.clearSnapshot()}function ip(e){e.clearMeasurements()}function ap(e){e.isLayoutDirty=!0,e.updateLayout()}function op(e){e.isLayoutDirty=!1}function sp(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function cp(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function lp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function up(e){e.resolveTargetDelta()}function dp(e){e.calcProjection()}function fp(e){e.resetSkewAndRotation()}function pp(e){e.removeLeadSnapshot()}function mp(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 hp(e,t,n,r){e.min=W(t.min,n.min,r),e.max=W(t.max,n.max,r)}function gp(e,t,n,r){hp(e.x,t.x,n.x,r),hp(e.y,t.y,n.y,r)}function _p(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var vp={duration:.45,ease:[.4,0,.1,1]},yp=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),bp=yp(`applewebkit/`)&&!yp(`chrome/`)?Math.round:ia;function xp(e){e.min=bp(e.min),e.max=bp(e.max)}function Sp(e){xp(e.x),xp(e.y)}function Cp(e,t,n){return e===`position`||e===`preserve-aspect`&&!of(Tf(t),Tf(n),.2)}function wp(e){return e!==e.root&&e.scroll?.wasRoot}var Tp=Qf({attachResizeListener:(e,t)=>zf(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ep={current:void 0},Dp=Qf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ep.current){let e=new Tp({});e.mount(window),e.setOptions({layoutScroll:!0}),Ep.current=e}return Ep.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Op=(0,a.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function kp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ap(...e){return t=>{let n=!1,r=e.map(e=>{let r=kp(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():kp(e[t],null)}}}}function jp(...e){return a.useCallback(Ap(...e),e)}var Mp=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Vl(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Vl(e)&&e.offsetWidth||0,r=Vl(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 Np({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:s}){let c=(0,a.useId)(),l=(0,a.useRef)(null),u=(0,a.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=(0,a.useContext)(Op),f=jp(l,e.props?.ref??e?.ref);return(0,a.useInsertionEffect)(()=>{let{width:e,height:a,top:o,left:f,right:p,bottom:m}=u.current;if(t||s===!1||!l.current||!e||!a)return;let h=n===`left`?`left: ${f}`:`right: ${p}`,g=r===`bottom`?`bottom: ${m}`:`top: ${o}`;l.current.dataset.motionPopId=c;let _=document.createElement(`style`);d&&(_.nonce=d);let v=i??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
|
|
3
3
|
[data-motion-pop-id="${c}"] {
|
|
4
4
|
position: absolute !important;
|
|
@@ -116,7 +116,7 @@ function bt({ config: e, children: t }) {
|
|
|
116
116
|
children: t
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
var xt = () => N(yt), St = "1.14.
|
|
119
|
+
var xt = () => N(yt), St = "1.14.65", Ct = typeof window < "u" ? ye : P, wt = j(void 0), Tt = (e) => {
|
|
120
120
|
let t = e?.defaultTheme;
|
|
121
121
|
return t !== "light" && t !== "dark" || e?.showThemeToggle ? null : t;
|
|
122
122
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* One panel for every "you cannot open this" answer — deactivated accounts,
|
|
4
|
+
* admin-only pages and team pages — so they all read alike.
|
|
5
|
+
*/
|
|
6
|
+
export declare function AccessNotice({ tone, title, message, action }: {
|
|
7
|
+
tone: 'red' | 'amber';
|
|
8
|
+
title: string;
|
|
9
|
+
message: string;
|
|
10
|
+
action: React.ReactNode;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const accessNoticeButton = "w-full block py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors";
|
|
13
|
+
/**
|
|
14
|
+
* The one thing a person is told when a page is not theirs to open.
|
|
15
|
+
*
|
|
16
|
+
* It deliberately does NOT name the level that would have let them in.
|
|
17
|
+
* "Admins only" and "Team page" read as a door with a label on it — the
|
|
18
|
+
* visitor learns what they are not, and the app sounds like it is telling
|
|
19
|
+
* them off. What they can actually act on is the same either way: ask
|
|
20
|
+
* whoever runs the app.
|
|
21
|
+
*/
|
|
22
|
+
export declare const NO_ACCESS_TITLE = "No access";
|
|
23
|
+
export declare const NO_ACCESS_MESSAGE = "You do not have access to view this page. If you think you should, ask whoever runs this app.";
|
|
24
|
+
export declare const NoAccessNotice: () => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
/** Shown when a team page is opened by someone who is still a free user. */
|
|
26
|
+
export declare const InternalOnlyNotice: () => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
/** Shown when an admin page is opened by someone who is not an admin. */
|
|
28
|
+
export declare const AdminOnlyNotice: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CustomRole } from '../lib/roles';
|
|
2
|
+
export declare function AddRoleFooter({ roles, onCreated, placeholder, onPending, }: {
|
|
3
|
+
/** Every role there is, so a name already taken is refused before it is written. */
|
|
4
|
+
roles: CustomRole[];
|
|
5
|
+
/** The role, written and back from Firestore — the list decides what to do with it. */
|
|
6
|
+
onCreated: (role: CustomRole) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The name being written right now, '' when nothing is. A roles listener can
|
|
10
|
+
* hear the new role before `createRole` returns, and the list then showed it
|
|
11
|
+
* twice — once as an option, once in the line it was typed into. A caller
|
|
12
|
+
* drawing the options keeps the pending one out of them until it lands.
|
|
13
|
+
*/
|
|
14
|
+
onPending?: (name: string) => void;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AddressParts } from '../lib/address';
|
|
2
|
+
export declare function AddressField({ id, label, value, onChange, required, disabled, placeholder, error, }: {
|
|
3
|
+
/** What the street box hangs its label off — one per address on a screen. */
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
value: AddressParts;
|
|
7
|
+
onChange: (parts: AddressParts) => void;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** The owner's own example, where their file gives one. */
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default AddressField;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { AddressField as AddressFieldType } from './AddressField';
|
|
3
|
+
type AddressFieldProps = ComponentProps<typeof AddressFieldType>;
|
|
4
|
+
export declare function AddressField(props: AddressFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default AddressField;
|