1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/audit-BpqB_Evy.js","assets/client-BEtK2P9H.js","assets/client-MUfdoZuW.js","assets/chunk-CMxvf4Kt.js","assets/preload-helper-zJ_50EbN.js","assets/active-slug-2KIRuGus.js","assets/routes-DiZXXVnk.js","assets/x-DCi5c9ew.js","assets/createLucideIcon-DsQZXInX.js","assets/react-cS1o3OVs.js","assets/jsx-runtime-sLPvdpSW.js","assets/Sections-jDjWwxBP.js","assets/link-B8zX2HDQ.js","assets/useSelector-Duii6Y4y.js","assets/useRouter-BiHDD-zA.js","assets/activity-CYj4WGbL.js","assets/check-q0LEF6v1.js","assets/message-circle-D7JHeLiC.js","assets/sparkles-BTDoYNRp.js","assets/use-eligibility-BsjNPB78.js","assets/useQuery-l0naPdev.js","assets/useBaseQuery-DzWpWiBh.js","assets/removable-C0_UNwhc.js","assets/QueryClientProvider-CFCf7M9N.js","assets/trial-CR93b_T5.js","assets/WaitlistSection-Cgc8WD48.js","assets/download-B13b3Cvb.js","assets/share-2-j3U8uUme.js","assets/WaitlistProgressTracker-Ctu60c1s.js","assets/clock-CNlKIrn5.js","assets/route-B0BNlrZL.js","assets/dist-CoNeOCsk.js","assets/dist-BGOBqpW8.js","assets/react-dom-Dvxju874.js","assets/dropdown-menu-G6q_D98P.js","assets/dist-Bw18quL3.js","assets/es2015-CkEFegcd.js","assets/dist-DSdBMn5s.js","assets/dist-CgZtaiZk.js","assets/dist-CDyPVmmq.js","assets/dist-CNhpwddR.js","assets/chevron-right-CWO9YJb7.js","assets/circle-D4lvtW8i.js","assets/utils-DJF9gtYK.js","assets/bundle-mjs-ry-q0ArR.js","assets/dist-DfKZ7Xol.js","assets/tooltip-BOdhfEXR.js","assets/useMutation-YnhhD4PL.js","assets/dist-DGFCZd-W.js","assets/badge-percent-D-t7aWY1.js","assets/shield-Dty1--vi.js","assets/building-2-BR721N3P.js","assets/calendar-clock-C_FD8rd6.js","assets/calendar-DCOQa-eG.js","assets/circle-question-mark-BjdqD6Wj.js","assets/clipboard-check-C4ScoIbZ.js","assets/coins-CyTiqmhd.js","assets/credit-card-RgGzX_DX.js","assets/ellipsis-BsCuoJ60.js","assets/external-link-DFD25vUe.js","assets/file-text-CnJobDZz.js","assets/inbox-BqOnlUgu.js","assets/settings-BqKgZSS0.js","assets/map-pin-CSegfPep.js","assets/message-square-BRfLfS6w.js","assets/search-rrILv6pg.js","assets/shield-check-Z7sKm0eD.js","assets/user-6iogZ5MK.js","assets/users-9Z88kXKr.js","assets/ClinicBrandingTheme-DD_7thFt.js","assets/apply-brand-zfFcsPTN.js","assets/button-vDE_Hf8K.js","assets/sheet-0XA5LKZI.js","assets/dist-CHVoI3qU.js","assets/skeleton-i-EykaTM.js","assets/use-entitlements-CjnaJmS1.js","assets/stripe-oyqAjVQM.js","assets/plans-Bzp3wvnC.js","assets/notifications-BnzaQxlx.js","assets/payments.edge-Bqc-DaCg.js","assets/subscription-messaging-CHd3N_fh.js","assets/accessibility-COX4-oJK.js","assets/LegalDocumentPage-C-WfhESJ.js","assets/lib-D_LBRHew.js","assets/ai-privacy-h33ps5U7.js","assets/ai-terms-DBi5POgt.js","assets/auth-B-JqqChD.js","assets/dist-C3XUiKIY.js","assets/dist-Bl6PH_hF.js","assets/useNavigate-CcbeBUZw.js","assets/useSearch-NkSVrmFt.js","assets/useMatch-CY6m9Len.js","assets/matchContext-mhdgg9Wq.js","assets/invariant-DEEwAagU.js","assets/loader-circle-Hqo3eoAi.js","assets/PasswordStrengthMeter-C2PqcV6C.js","assets/validation-CuPl-nbh.js","assets/mail-provider-DyQw660v.js","assets/cancellation-C1ZyYy7k.js","assets/LegalPlaceholder-DfYBXGRU.js","assets/clinics-CxMnjUSP.js","assets/useSuspenseQuery--BI_kPav.js","assets/SeoInternalLinks-BRZ9HIqE.js","assets/page-copy-n152bkjw.js","assets/contact-legal-USW_vQXY.js","assets/cookie-policy-pzOXMSS-.js","assets/cookies-B9A8kFsa.js","assets/demo-_cOXgf1l.js","assets/earnings-disclaimer-t--J8xRW.js","assets/for-spas-CvpbAIo9.js","assets/accordion-TWw0FcbL.js","assets/chevron-down-Dz6eUukY.js","assets/forgot-password-BAkWk7Rv.js","assets/how-it-works-CoTQUu5k.js","assets/medical-disclaimer-DKjrVnwN.js","assets/pricing-BIyR5w-1.js","assets/privacy-CYeneF2e.js","assets/purchase-terms-DmTF4Gn_.js","assets/reset-password-B39OO_V9.js","assets/start-consultation-Cx9mj0FZ.js","assets/ConsultationWizard-SEitoBtc.js","assets/photo-consent-DuvFCYlf.js","assets/checkbox-SjPpObu0.js","assets/triangle-alert-C7G1EvW1.js","assets/card--goJ0L10.js","assets/StripeEmbeddedCheckout-BhYY_irU.js","assets/prop-types-DvSo7_9_.js","assets/MembershipUpsellModal-BOE1kcOB.js","assets/phone-XjuU4y0a.js","assets/shield-alert-DY20_FtK.js","assets/types-CarXcgOP.js","assets/ConsultationReportView-BKo7oxn0.js","assets/camera-BjQlb35B.js","assets/PlanGate-DaUb03fq.js","assets/TestPaymentNotice-BrheE9tK.js","assets/BeautyScoreCard-C5r69wBi.js","assets/report-sections-2o7b4hHw.js","assets/use-trial-eligibility-DPTWWn0r.js","assets/member-upsell-CbAeVnQu.js","assets/geo.edge-DcvhM_Qi.js","assets/rotate-ccw-BBhoZaiZ.js","assets/AutoTreatmentPreview-BwVobJjU.js","assets/BeforeAfterSlider-DfVdiqxo.js","assets/useNoChangeCheck-DqVl_vYX.js","assets/change-score-Bq6aX7uW.js","assets/PanelErrorBoundary-Dk6H10xZ.js","assets/confirm-dialog-vS0j4887.js","assets/alert-dialog-BfK7AUd6.js","assets/circle-alert-EmFZZt7j.js","assets/circle-check-DJMuKTck.js","assets/info-D60NL1-X.js","assets/account-CulNlxw3.js","assets/consultations.edge-wD5RNW_t.js","assets/applicability-U9oeH6y6.js","assets/terms-BvTpllb8.js","assets/testimonial-disclosure-BRtUgZlT.js","assets/_clinic-admin-UUL5nwDx.js","assets/_seo-DwhmY9O-.js","assets/_seo-BMZ2Qq1h.js","assets/_super-admin-DwhmY9O-.js","assets/_super-admin-C335Vcr-.js","assets/ClinicalReviewBanner-BlEwopJq.js","assets/auth-middleware-fSRrIRDW.js","assets/redirect-DmtLUW0N.js","assets/complete-profile-BC8peVsS.js","assets/dashboard-BMZ2Qq1h.js","assets/onboarding-zR4BUDHP.js","assets/BrandingEditor-hPvMRKbA.js","assets/auth.callback-BFu2pqpr.js","assets/auth.check-email-yoD8gR3K.js","assets/auth.choose-role-_RlknaI7.js","assets/booking.confirm-Be80-2mG.js","assets/booking-apJQOJqY.js","assets/checkout.index-DvKQM1xP.js","assets/PaymentTestModeBanner-DNk3Y6la.js","assets/checkout.return-CjxbNwHc.js","assets/clinic._clinicSlug.route-Dj3ImZPS.js","assets/clinic._clinicSlug.route-DTwZ6pjZ.js","assets/clinic._clinicSlug.route-CTfDRY0F.js","assets/context-_PXXllUr.js","assets/invite.accept-C0T3nDSh.js","assets/invitations-DEQ7KMGr.js","assets/client-5tZflHFr.js","assets/waitlists-CyNnENAC.js","assets/site-url-Bgwqksm-.js","assets/join.spa-owner-DbBbFCv3.js","assets/_seo.seo-C7W5W2TX.js","assets/PageIntro-BywObE8e.js","assets/seo-CZVAGX1t.js","assets/dashboard.index-9nZMBEq_.js","assets/arrow-right-iV652F4X.js","assets/plus-BOsqPBqJ.js","assets/EntitlementsPanel-D9nCJ4gs.js","assets/LocationsPanel-yxOoguhm.js","assets/browser-env-DYHCyCfj.js","assets/dashboard.account-DFIJMoQ-.js","assets/dashboard.annual-reports-BMZ2Qq1h.js","assets/dashboard.appointments-ULQiAQvm.js","assets/appointments-Dy9SrLu2.js","assets/dashboard.billing-D7Z7MSID.js","assets/circle-x-Dcd2C8w6.js","assets/dashboard.blueprint-Xu0hmt-X.js","assets/dashboard.clinics-eLQZrClR.js","assets/dashboard.coach-eSL8ozi7.js","assets/ai-conversations-BK_9RElf.js","assets/dashboard.consultations-BMZ2Qq1h.js","assets/dashboard.issues-BMZ2Qq1h.js","assets/dashboard.monthly-reports-BMZ2Qq1h.js","assets/dashboard.reports-BMZ2Qq1h.js","assets/dashboard.vip-discount-DFu9hyqr.js","assets/copy-DlEkHo0L.js","assets/early-access-BXgaWAxJ.js","assets/vip-core-BzH4YSK3.js","assets/clinic._clinicSlug.index-DFQSjSLH.js","assets/route-BMn__Yk4.js","assets/useParams-BkbFcPFb.js","assets/not-found-i5RsCZif.js","assets/root-DLTE-HSj.js","assets/mail-iHieg0M-.js","assets/clinic._clinicSlug._members-BMZ2Qq1h.js","assets/clinic._clinicSlug.book-BaI2EhFT.js","assets/clinic._clinicSlug.consultation-BaYt0deS.js","assets/client-identity-BxcoGlpA.js","assets/clinic._clinicSlug.locations-fKOuMiTm.js","assets/clinic._clinicSlug.report-BfBJQx_x.js","assets/CareGuidancePanel-BwzRmSJf.js","assets/CanonicalConsultationReport--V9U2dmP.js","assets/clinic._clinicSlug.simulate-CAfzGAvR.js","assets/TreatmentSimulator-C-hfiogC.js","assets/_clinic-admin.dashboard.audit-BGzbKXHc.js","assets/table-BuNoua92.js","assets/_clinic-admin.dashboard.blueprint-365-CmlnVc01.js","assets/calendar-range-GGBnbTiY.js","assets/_clinic-admin.dashboard.booking-requests-DNdqYj8r.js","assets/_clinic-admin.dashboard.branding-Cj_TIxLu.js","assets/SharedContentBanner
1-50gdIiZS.js","assets/shared-content-DzAIOl50.js","assets/_clinic-admin.dashboard.clients-BMZ2Qq1h.js","assets/_clinic-admin.dashboard.domains-CzZm-SZu.js","assets/_clinic-admin.dashboard.leads-Ca4CNgdG.js","assets/user-plus-CTh_69Xi.js","assets/platform-lead-Cql3yBKE.js","assets/staff-members-BQegzb-9.js","assets/_clinic-admin.dashboard.locations-Cgf6rZgX.js","assets/_clinic-admin.dashboard.notifications-CzK9s5vw.js","assets/_clinic-5q7V7XCo.js","assets/_clinic-admin.dashboard.profile-D4kcMPbN.js","assets/_clinic-admin.dashboard.questions-gCt8dva8.js","assets/QuestionLibrary-f0B6UCk4.js","assets/chevron-up-Cc7SHrHp.js","assets/_clinic-admin.dashboard.revenue-split-DchAI0Tl.js","assets/_clinic-admin.dashboard.roles-BJUUwXBA.js","assets/_clinic-admin.dashboard.staff-CtAdfqIS.js","assets/badge-D7uoO_IW.js","assets/_clinic-admin.dashboard.treatments-BZcGkhnb.js","assets/_clinic-admin.dashboard.vip-benefits-C9Uk8fTL.js","assets/_seo.seo_._routeId-Zz8A3Sf9.js","assets/arrow-left-XS-cBgJR.js","assets/history-B4X-xBYy.js","assets/_super-admin.super-admin.index-CCYbVXVz.js","assets/generateCategoricalChart-PBRwSHqS.js","assets/linear-BJWzVAVE.js","assets/step-BudVE2GU.js","assets/defaultLocale-C8Fc0cco.js","assets/init-Cs1-1e_z.js","assets/time-BFiCeQ_5.js","assets/band-CcbG6rPL.js","assets/ordinal-BeZAVUpG.js","assets/_super-admin.super-admin.ai-guidance-DZV_xUit.js","assets/_super-admin.super-admin.ai-providers-CJHGVYFW.js","assets/_super-admin.super-admin.ai-router-BN8kula7.js","assets/arrow-down-D4DiHTN3.js","assets/arrow-up-Cv7xuOKN.js","assets/save-DUgC8mF_.js","assets/ai-router-Br7mPWKg.js","assets/_super-admin.super-admin.ai-usage-WCY2gB07.js","assets/_super-admin.super-admin.atlas-entitlement-DFVJ2LxY.js","assets/_super-admin.super-admin.catalog-audit-Dd1v38s5.js","assets/_super-admin.super-admin.clinical-approvals-DNZzvUa6.js","assets/_super-admin.super-admin.clinics-Bci5CStd.js","assets/bulk.edge-BqcL6TUN.js","assets/_super-admin.super-admin.default-questions-fqek68V8.js","assets/_super-admin.super-admin.default-treatments-DbErzIXx.js","assets/_super-admin.super-admin.early-access-FzK6ZlpM.js","assets/_super-admin.super-admin.founding-936JT2cu.js","assets/_super-admin.super-admin.issues-BMZ2Qq1h.js","assets/_super-admin.super-admin.question-preview-Vwa7PJ6j.js","assets/effective-treatments-yg7ydG4r.js","assets/_super-admin.super-admin.report-prompts-kWYihXig.js","assets/rotate-cw-CXGbtCJZ.js","assets/member-progress-DNnlnEkU.js","assets/_super-admin.super-admin.sim-prompts-BGnES-5E.js","assets/_super-admin.super-admin.simulations-DcO_3KXq.js","assets/_super-admin.super-admin.subscription-pricing-DPj_1wr3.js","assets/_super-admin.super-admin.subscriptions-Cq8xetBy.js","assets/_super-admin.super-admin.system-B0InAjc7.js","assets/_super-admin.super-admin.users-CrYmH8VY.js","assets/_super-admin.super-admin.waitlist-C3SUU9Yx.js","assets/dashboard.account.index-UZ354iIa.js","assets/dashboard.account.preferences-CHCyUSp1.js","assets/dashboard.account.profile-By11DV2-.js","assets/dashboard.account.security-COUwH--r.js","assets/dashboard.annual-reports.index-BFta2ytO.js","assets/ProgressTabs-mMOBvi-J.js","assets/member-annual-reports-BoRlyX6J.js","assets/dashboard.annual-reports._reportId-tQ8cLDQI.js","assets/dashboard.consultations.index-DrYz0-wC.js","assets/MemberContentGate-DmDbyX3t.js","assets/dashboard.issues.index-CyMqalgZ.js","assets/IssueTable-DINf-Z8A.js","assets/issue-meta-BISF7Crq.js","assets/dashboard.issues._id-CwD5AEds.js","assets/IssueThread-ole8aVAh.js","assets/paperclip-CKCbPdqG.js","assets/dashboard.issues.new-CCrRTasE.js","assets/dashboard.monthly-reports.index-DAqpBLK7.js","assets/clock-3-RONKXbdA.js","assets/member-reports-dG5JJlLR.js","assets/dashboard.reports.index-B0iomxXj.js","assets/progress-photos-D1FHJRjd.js","assets/dashboard.reports._reportId-DQu3PHYT.js","assets/_clinic-admin.dashboard.analytics.index-CdxL-KpT.js","assets/clinic-metrics-DYFpMG83.js","assets/clinic-analytics-C-hvkKzI.js","assets/_clinic-admin.dashboard.analytics._reportId-CKcyNCxm.js","assets/_clinic-admin.dashboard.analytics.locations-BogJDIsV.js","assets/_clinic-admin.dashboard.blueprints.index-CixesaLx.js","assets/StaffBlueprintList-8VeZzV5P.js","assets/_clinic-admin.dashboard.blueprints._id-B5fUBZS2.js","assets/_clinic-admin.dashboard.clients.index-qdQHkkmA.js","assets/clinic-consultations-Cnq2HJn8.js","assets/_clinic-admin.dashboard.clients._consultationId-C5jgJDwf.js","assets/_clinic-admin.dashboard.leads._id-C2Azt3DB.js","assets/_clinic-admin.dashboard.leads._id-BLZf3tHn.js","assets/_super-admin.super-admin.blueprints.index-DX0xWcBr.js","assets/_super-admin.super-admin.blueprints._id-DHbQBdZt.js","assets/_super-admin.super-admin.issues.index-CCvmSEum.js","assets/_super-admin.super-admin.issues._id-Cs-8v9GW.js","assets/dashboard.consultations._id.index-LX36cVKp.js","assets/dashboard.consultations._id.index-DuzAK6vD.js","assets/dashboard.consultations._id.blueprint-Cjb3cHBP.js","assets/dashboard.consultations._id.chat-CYOMXZXE.js","assets/chunk-HOUHSVGY-BJmNpQr2.js","assets/src-Btlnk6Ko.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/chunk-WYO6CB5R-BlkYmfMi.js","assets/chunk-ICXQ74PX-BhVlNR9J.js","assets/dist-Dt2rhXkS.js","assets/chunk-BO2N2NFS-BHY915mw.js","assets/chunk-52WLFC77-DZJDr26b.js","assets/chunk-7BUUIJ7U-Bb538aSH.js","assets/chunk-C7G6YPKG-hIJxmf0I.js","assets/chunk-OGEWGWER-BgVKx0Qy.js","assets/chunk-Q4XR5HBZ-zh_Nneg-.js","assets/chunk-ZGVPDNZ5-BKBiI6Hg.js","assets/rough.esm-CSKSodPl.js","assets/chunk-FWX5IMBZ-CoDXoNDQ.js","assets/chunk-VAUOI2AC-CGVoVIw9.js","assets/chunk-ZIRB5QZD-H-kepumB.js","assets/dashboard.consultations._id.chat-Dl_-WFLI.js","assets/dashboard.reports.treatment._treatmentId-Ble0glFo.js","assets/esm-Bmgevw16.js","assets/noop-C-4xg4FV.js"])))=>i.map(i=>d[i]); 2import{o as e,t}from"./chunk-CMxvf4Kt.js";import{t as n}from"./react-cS1o3OVs.js";import{t as r}from"./react-dom-Dvxju874.js";import{n as i,t as a}from"./not-found-i5RsCZif.js";import{n as o,r as s,t as c}from"./redirect-DmtLUW0N.js";import{C as l,S as u,T as d,_ as f,a as p,b as m,c as h,d as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,t as D,u as O,v as k,w as A,x as ee,y as te}from"./link-B8zX2HDQ.js";import{t as ne}from"./invariant-DEEwAagU.js";import{t as re}from"./root-DLTE-HSj.js";import{n as j,t as M}from"./route-BMn__Yk4.js";import{i as ie,n as ae,r as oe}from"./useNavigate-CcbeBUZw.js";import{t as se}from"./jsx-runtime-sLPvdpSW.js";import{i as ce,r as le,t as ue}from"./useSelector-Duii6Y4y.js";import{n as de,t as fe}from"./useRouter-BiHDD-zA.js";import{n as pe}from"./matchContext-mhdgg9Wq.js";import{n as me}from"./useMatch-CY6m9Len.js";import{n as N}from"./client-MUfdoZuW.js";import{t as P}from"./preload-helper-zJ_50EbN.js";import{n as he,r as ge,t as _e}from"./active-slug-2KIRuGus.js";import{a as ve,n as F}from"./client-BEtK2P9H.js";import{n as ye,t as be}from"./resolver-BhF7inS2.js";import{A as xe,D as Se,a as Ce,b as we,d as Te,f as Ee,h as De,j as Oe,l as ke,m as Ae,o as je,p as Me,u as Ne,v as Pe,w as Fe,x as Ie,y as Le}from"./removable-C0_UNwhc.js";import{i as Re}from"./useBaseQuery-DzWpWiBh.js";import{n as ze,t as Be}from"./useMutation-YnhhD4PL.js";import{n as Ve,t as He}from"./QueryClientProvider-CFCf7M9N.js";import{t as Ue}from"./useQuery-l0naPdev.js";import{t as We}from"./queryOptions-Dfvzj6n2.js";import{t as Ge}from"./createLucideIcon-DsQZXInX.js";import{t as Ke}from"./arrow-down-D4DiHTN3.js";import{t as qe}from"./arrow-left-XS-cBgJR.js";import{t as Je}from"./arrow-right-iV652F4X.js";import{t as Ye}from"./arrow-up-Cv7xuOKN.js";import{t as Xe}from"./check-q0LEF6v1.js";import{t as Ze}from"./chevron-down-Dz6eUukY.js";import{t as Qe}from"./chevron-right-CWO9YJb7.js";import{t as $e}from"./chevron-up-Cc7SHrHp.js";import{t as et}from"./loader-circle-Hqo3eoAi.js";import{t as tt}
vendor: 107,418 bytes, lines 2-9
2from"./map-pin-CSegfPep.js";import{t as nt}from"./plus-BOsqPBqJ.js";import{t as rt}from"./rotate-ccw-BBhoZaiZ.js";import{t as it}from"./sparkles-BTDoYNRp.js";import{t as at}from"./x-DCi5c9ew.js";import{n as ot,t as st}from"./trial-CR93b_T5.js";import{n as ct,t as lt}from"./browser-env-DYHCyCfj.js";import{i as ut,o as dt,r as ft,s as pt,t as mt}from"./dist-CoNeOCsk.js";import{n as ht,t as gt}from"./dist-BGOBqpW8.js";import{t as _t}from"./dist-CgZtaiZk.js";import{t as vt}from"./dist-DSdBMn5s.js";import{a as yt,i as bt,n as xt,o as St,r as Ct,t as wt}from"./es2015-CkEFegcd.js";import{t as Tt}from"./dist-CDyPVmmq.js";import{a as Et,c as Dt,i as Ot,n as kt,o as At,r as jt,s as Mt,t as Nt}from"./dist-CHVoI3qU.js";import{t as Pt}from"./utils-DJF9gtYK.js";import{n as Ft}from"./dist-DfKZ7Xol.js";import{t as It}from"./dist-DGFCZd-W.js";import{t as I}from"./button-vDE_Hf8K.js";import{t as Lt}from"./confirm-dialog-vS0j4887.js";import{a as Rt,c as zt,n as Bt,o as Vt}from"./plans-Bzp3wvnC.js";import{a as Ht,i as Ut,o as Wt,r as Gt}from"./site-url-Bgwqksm-.js";import{a as Kt,c as L,f as qt,i as Jt,l as Yt,n as Xt,r as Zt,s as Qt,u as R}from"./types-CarXcgOP.js";import{t as $t}from"./_clinic-5q7V7XCo.js";import{r as en}from"./geo.edge-DcvhM_Qi.js";import{n as tn,t as nn}from"./effective-treatments-yg7ydG4r.js";import{t as rn}from"./dist-C3XUiKIY.js";import{t as an}from"./dist-Bl6PH_hF.js";import{n as on,t as sn}from"./dist-Bw18quL3.js";import{t as cn}from"./shared-content-DzAIOl50.js";import{t as ln}from"./applicability-U9oeH6y6.js";import{n as un,r as dn,t as fn}from"./dist-CNhpwddR.js";import{t as pn}from"./notifications-BnzaQxlx.js";var mn=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),hn=t(((e,t)=>{t.exports=mn()})),gn=t((e=>{var t=hn(),i=n(),a=r();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function ee(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function ne(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?ne(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var re=Array.isArray,j=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ae=[],oe=-1;function se(e){return{current:e}}function ce(e){0>oe||(e.current=ae[oe],ae[oe]=null,oe--)}function le(e,t){oe++,ae[oe]=e.current,e.current=t}var ue=se(null),de=se(null),fe=se(null),pe=se(null);function me(e,t){switch(le(fe,t),le(de,e),le(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wd(t),e=Gd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ce(ue),le(ue,e)}function N(){ce(ue),ce(de),ce(fe)}function P(e){e.memoizedState!==null&&le(pe,e);var t=ue.current,n=Gd(t,e.type);t!==n&&(le(de,e),le(ue,n))}function he(e){de.current===e&&(ce(ue),ce(de)),pe.current===e&&(ce(pe),ep._currentValue=ie)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(` 3 at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return` 4`+ge+e+_e}var F=!1;function ye(e,t){if(!e||F)return``;F=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(` 5`),l=s.split(` 6`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=` 7`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{F=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return ve(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return` 8Error generating stack: `+e.message+` 9`+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=M.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function ot(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,mt=`__reactResources$`+st,ht=`__reactMarker$`+st;function gt(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function _t(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[ct])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[ht]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Dt={},Ot={};function kt(e){return Se.call(Ot,e)?!0:Se.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Mt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function I(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Nt(n)):Ht(e,o,Nt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Nt(s):e.removeAttribute(`name`)}function Vt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),It(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Wt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(re(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var L=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function qt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||L.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&qt(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&qt(e,a,t[a])}function Yt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Xt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function R(){}var $t=null;function en(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tn=null,nn=null;function rn(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[lt]||null;if(!i)throw Error(o(90));Bt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&I(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var an=!1;function on(e,t,n){if(an)return e(t,n);an=!0;try{return e(t)}finally{if(an=!1,(tn!==null||nn!==null)&&(Su(),tn&&(t=tn,e=nn,nn=tn=null,rn(t),e)))for(t=0;t<e.length;t++)rn(e[t])}}function sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var cn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),ln=!1;if(cn)try{var un={};Object.defineProperty(un,"passive",{get:function(){ln=!0}}),window.addEventListener(`test`,un,un),window.removeEventListener(`test`,un,un)}catch{ln=!1}var dn=null,fn=null,pn=null;function mn(){if(pn)return pn;var e,t=fn,n=t.length,r,i=`value`in dn?dn.value:dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return pn=i.slice(e,1<r?1-r:void 0)}function gn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _n(){return!0}function vn(){return!1}function yn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?_n:vn,this.isPropagationStopped=vn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=m({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,Dn=m({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),On=yn(Dn),kn=yn(m({},Dn,{dataTransfer:0})),An=yn(m({},Sn,{relatedTarget:0})),jn=yn(m({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=yn(m({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=yn(m({},bn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=yn(m({},Sn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=yn(m({},Dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=yn(m({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=yn(m({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=yn(m({},Dn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Wn=yn(m({},bn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=cn&&`CompositionEvent`in window,qn=null;cn&&`documentMode`in document&&(qn=document.documentMode);var Jn=cn&&`TextEvent`in window&&!qn,Yn=cn&&(!Kn||qn&&8<qn&&11>=qn),Xn=` `,Zn=!1;function Qn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function $n(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var er=!1;function tr(e,t){switch(e){case`compositionend`:return $n(t);case`keypress`:return t.which===32?(Zn=!0,Xn):null;case`textInput`:return e=t.data,e===Xn&&Zn?null:e;default:return null}}function nr(e,t){if(er)return e===`compositionend`||!Kn&&Qn(e,t)?(e=mn(),pn=fn=dn=null,er=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Yn&&t.locale!==`ko`?null:t.data;default:return null}}var rr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!rr[e.type]:t===`textarea`}function ar(e,t,n,r){tn?nn?nn.push(r):nn=[r]:tn=r,t=kd(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var or=null,sr=null;function cr(e){Sd(e,0)}function lr(e){if(I(yt(e)))return e}function ur(e,t){if(e===`change`)return t}var dr=!1;if(cn){var fr;if(cn){var pr=`oninput`in document;if(!pr){var mr=document.createElement(`div`);mr.setAttribute(`oninput`,`return;`),pr=typeof mr.oninput==`function`}fr=pr}else fr=!1;dr=fr&&(!document.documentMode||9<document.documentMode)}function hr(){or&&(or.detachEvent(`onpropertychange`,gr),sr=or=null)}function gr(e){if(e.propertyName===`value`&&lr(sr)){var t=[];ar(t,sr,e,en(e)),on(cr,t)}}function _r(e,t,n){e===`focusin`?(hr(),or=t,sr=n,or.attachEvent(`onpropertychange`,gr)):e===`focusout`&&hr()}function vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(sr)}function yr(e,t){if(e===`click`)return lr(t)}function br(e,t){if(e===`input`||e===`change`)return lr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Se.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var kr=cn&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==Lt(r)||(r=Ar,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mr&&Cr(Mr,r)||(Mr=r,r=kd(jr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ir={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Lr={},Rr={};cn&&(Rr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),`TransitionEvent`in window||delete Ir.transitionend.transition);function zr(e){if(Lr[e])return Lr[e];if(!Ir[e])return e;var t=Ir[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rr)return Lr[e]=t[n];return e}var Br=zr(`animationend`),Vr=zr(`animationiteration`),Hr=zr(`animationstart`),Ur=zr(`transitionrun`),Wr=zr(`transitionstart`),Gr=zr(`transitioncancel`),Kr=zr(`transitionend`),qr=new Map,Jr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Jr.push(`scrollEnd`);function Yr(e,t){qr.set(e,t),wt(t,[e])}var Xr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Zr=[],Qr=0,$r=0;function ei(){for(var e=Qr,t=$r=Qr=0;t<e;){var n=Zr[t];Zr[t++]=null;var r=Zr[t];Zr[t++]=null;var i=Zr[t];Zr[t++]=null;var a=Zr[t];if(Zr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ii(n,i,a)}}function ti(e,t,n,r){Zr[Qr++]=e,Zr[Qr++]=t,Zr[Qr++]=n,Zr[Qr++]=r,$r|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return ti(e,t,n,r),ai(e)}function ri(e,t){return ti(e,null,null,t),ai(e)}function ii(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ai(e){if(50<pu)throw pu=0,mu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function di(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fi(e,t,n,r,i,a){var s=0;if(r=e,typeof e==`function`)li(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,ue.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=ci(31,n,t,i),e.elementType=O,e.lanes=a,e;case v:return pi(n.children,i,a,t);case y:s=8,i|=24;break;case b:return e=ci(12,n,t,i|2),e.elementType=b,e.lanes=a,e;case w:return e=ci(13,n,t,i),e.elementType=w,e.lanes=a,e;case T:return e=ci(19,n,t,i),e.elementType=T,e.lanes=a,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case C:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=ci(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function pi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function mi(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function hi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function gi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _i=new WeakMap;function vi(e,t){if(typeof e==`object`&&e){var n=_i.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},_i.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var yi=[],bi=0,xi=null,Si=0,Ci=[],wi=0,Ti=null,Ei=1,Di=``;function Oi(e,t){yi[bi++]=Si,yi[bi++]=xi,xi=e,Si=t}function ki(e,t,n){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ti=e;var r=Ei;e=Di;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ei=1<<32-ze(t)+i|n<<i|r,Di=a+e}else Ei=1<<a|n<<i|r,Di=e}function Ai(e){e.return!==null&&(Oi(e,1),ki(e,1,0))}function ji(e){for(;e===xi;)xi=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null;for(;e===Ti;)Ti=Ci[--wi],Ci[wi]=null,Di=Ci[--wi],Ci[wi]=null,Ei=Ci[--wi],Ci[wi]=null}function Mi(e,t){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ei=t.id,Di=t.overflow,Ti=e}var Ni=null,Pi=null,z=!1,Fi=null,Ii=!1,Li=Error(o(519));function Ri(e){throw Wi(vi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:Y(`cancel`,t),Y(`close`,t);break;case`iframe`:case`object`:case`embed`:Y(`load`,t);break;case`video`:case`audio`:for(n=0;n<bd.length;n++)Y(bd[n],t);break;case`source`:Y(`error`,t);break;case`img`:case`image`:case`link`:Y(`error`,t),Y(`load`,t);break;case`details`:Y(`toggle`,t);break;case`input`:Y(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Y(`invalid`,t);break;case`textarea`:Y(`invalid`,t),Gt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Fd(t.textContent,n)?(r.popover!=null&&(Y(`beforetoggle`,t),Y(`toggle`,t)),r.onScroll!=null&&Y(`scroll`,t),r.onScrollEnd!=null&&Y(`scrollend`,t),r.onClick!=null&&(t.onclick=R),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Ni=e.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Ni=Ni.return}}function Vi(e){if(e!==Ni)return!1;if(!z)return Bi(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Kd(e.type,e.memoizedProps)),n=!n),n&&Pi&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));Pi=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));Pi=pf(e)}else t===27?(t=Pi,ef(e.type)?(e=ff,ff=null,Pi=e):Pi=t):Pi=Ni?df(e.stateNode.nextSibling):null;return!0}function Hi(){Pi=Ni=null,z=!1}function Ui(){var e=Fi;return e!==null&&(tu===null?tu=e:tu.push.apply(tu,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=se(null),Ki=null,qi=null;function Ji(e,t,n){le(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,ce(Gi)}function Xi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Zi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Xi(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Xi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Qi(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;Sr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===pe.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}i=i.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!Sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(o(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=md(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var _a=j.S;j.S=function(e,t){q=De(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=se(null);function ya(){var e=va.current;return e===null?Vl.pooledCache:e}function ba(e,t){t===null?le(va,va.current):le(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(o(460)),Ca=Error(o(474)),wa=Error(o(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(R,R),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(R,R);else{if(e=Vl,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(o(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(o(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(e,t){throw t.$$typeof===h?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=ui(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=mi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===D&&Oa(a)===t.type)?(t=i(t,n.props),Fa(t,n),t.return=e,t):(t=fi(n.type,n.key,n.props,null,e.mode,r),Fa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=gi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=pi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=fi(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case _:return t=gi(t,e.mode,n),t.return=e,t;case D:return t=Oa(t),f(e,t,n)}if(re(t)||ee(t))return t=pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===S)return f(e,na(e,t),n);Ia(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case D:return n=Oa(n),p(e,t,n,r)}if(re(n)||ee(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===S)return p(e,t,na(e,n),r);Ia(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Oa(r),m(e,t,n,r,i)}if(re(r)||ee(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===S)return m(e,t,n,na(t,r),i);Ia(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&Oi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return z&&Oi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),z&&Oi(i,h),l}function y(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),z&&Oi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&Oi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),z&&Oi(i,g),u}function b(e,r,a,c){if(typeof a==`object`&&a&&a.type===v&&a.key===null&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case g:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Oa(l)===r.type){n(e,r.sibling),c=i(r,a.props),Fa(c,a),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}a.type===v?(c=pi(a.props.children,e.mode,c,a.key),c.return=e,e=c):(c=fi(a.type,a.key,a.props,null,e.mode,c),Fa(c,a),c.return=e,e=c)}return s(e);case _:a:{for(l=a.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=gi(a,e.mode,c),c.return=e,e=c}return s(e);case D:return a=Oa(a),b(e,r,a,c)}if(re(a))return h(e,r,a,c);if(ee(a)){if(l=ee(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),y(e,r,a,c)}if(typeof a.then==`function`)return b(e,r,Pa(a),c);if(a.$$typeof===S)return b(e,r,na(e,a),c);Ia(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=mi(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(K&f)===f:(r&f)===f){f!==0&&f===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ba=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Yl|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=se(null),$a=se(0);function eo(e,t){e=ql,le($a,e),le(Qa,t),ql=e|t.baseLanes}function to(){le($a,ql),le(Qa,Qa.current)}function no(){ql=$a.current,ce(Qa),ce($a)}var ro=se(null),io=null;function ao(e){var t=e.alternate;le(uo,uo.current&1),le(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){le(uo,uo.current),le(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(le(uo,uo.current),le(ro,e),io===null&&(io=e)):co(e)}function co(){le(uo,uo.current),le(ro,ro.current)}function lo(e){ce(ro),io===e&&(io=null),ce(uo)}var uo=se(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cf(n)||lf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var po=0,B=null,mo=null,ho=null,go=!1,_o=!1,vo=!1,yo=0,bo=0,xo=null,So=0;function Co(){throw Error(o(321))}function wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function To(e,t,n,r,i,a){return po=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Vs:Hs,vo=!1,a=n(r,i),vo=!1,_o&&(a=Do(t,n,r,i)),Eo(e),a}function Eo(e){j.H=Bs;var t=mo!==null&&mo.next!==null;if(po=0,ho=mo=B=null,go=!1,bo=0,xo=null,t)throw Error(o(300));e===null||ac||(e=e.dependencies,e!==null&&$i(e)&&(ac=!0))}function Do(e,t,n,r){B=e;var i=0;do{if(_o&&(xo=null),bo=0,_o=!1,25<=i)throw Error(o(301));if(i+=1,ho=mo=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}j.H=Us,a=t(n,r)}while(_o);return a}function Oo(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?Fo(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(B.flags|=1024),t}function ko(){var e=yo!==0;return yo=0,e}function Ao(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}po=0,ho=mo=B=null,_o=!1,bo=yo=0,xo=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?B.memoizedState=ho=e:ho=ho.next=e,ho}function No(){if(mo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?B.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw B.alternate===null?Error(o(467)):Error(o(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?B.memoizedState=ho=e:ho=ho.next=e}return ho}function Po(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=bo;return bo+=1,xo===null&&(xo=[]),e=Da(xo,e,t),t=B,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Vs:Hs),e}function Io(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Fo(e);if(e.$$typeof===S)return ta(e)}throw Error(o(438,String(e)))}function Lo(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Po(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function V(e,t){return typeof t==`function`?t(e):t}function Ro(e){return zo(No(),mo,e)}function zo(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(po&f)===f:(K&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((po&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,B.lanes|=p,Yl|=p;f=u.action,vo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,B.lanes|=f,Yl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!Sr(a,e.memoizedState)&&(ac=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Bo(e){var t=No(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Sr(a,t.memoizedState)||(ac=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Vo(e,t,n){var r=B,i=No(),a=z;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!Sr((mo||i).memoizedState,n);if(s&&(i.memoizedState=n,ac=!0),i=i.queue,fs(Wo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,i,n,t),null),Vl===null)throw Error(o(349));a||po&127||Ho(r,t,n)}return n}function Ho(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=Po(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uo(e,t,n,r){t.value=n,t.getSnapshot=r,Go(t)&&Ko(e)}function Wo(e,t,n){return n(function(){Go(t)&&Ko(e)})}function Go(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function Ko(e){var t=ri(e,2);t!==null&&_u(t,e,2)}function qo(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),vo){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:V,lastRenderedState:e},t}function Jo(e,t,n,r){return e.baseState=n,zo(e,mo,typeof r==`function`?r:V)}function Yo(e,t,n,r,i){if(Ls(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};j.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Xo(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Xo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),Zo(e,t,s)}catch(n){$o(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),Zo(e,t,a)}catch(n){$o(e,t,n)}}function Zo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Qo(e,t,n)},function(n){return $o(e,t,n)}):Qo(e,t,n)}function Qo(e,t,n){t.status=`fulfilled`,t.value=n,es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Xo(e,n)))}function $o(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,es(t),t=t.next;while(t!==r)}e.action=null}function es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ts(e,t){return t}function ns(e,t){if(z){var n=Vl.formState;if(n!==null){a:{var r=B;if(z){if(Pi){b:{for(var i=Pi,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=df(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Pi=df(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:t},n.queue=r,n=Ps.bind(null,B,r),r.dispatch=n,r=qo(!1),a=Is.bind(null,B,!1,r.queue),r=Mo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Yo.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function rs(e){return is(No(),mo,e)}function is(e,t,n){if(t=zo(e,t,ts)[0],e=Ro(V)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Fo(t)}catch(e){throw e===Sa?wa:e}else r=t;t=No();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,ss(9,{destroy:void 0},as.bind(null,i,n),null)),[r,a,e]}function as(e,t){e.action=t}function os(e){var t=No(),n=mo;if(n!==null)return is(t,n,e);No(),t=t.memoizedState,n=No();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ss(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=Po(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function cs(){return No().memoizedState}function ls(e,t,n,r){var i=Mo();B.flags|=e,i.memoizedState=ss(1|t,{destroy:void 0},n,r===void 0?null:r)}function us(e,t,n,r){var i=No();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&wo(r,mo.memoizedState.deps)?i.memoizedState=ss(t,a,n,r):(B.flags|=e,i.memoizedState=ss(1|t,a,n,r))}function ds(e,t){ls(8390656,8,e,t)}function fs(e,t){us(2048,8,e,t)}function ps(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=Po(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ms(e){var t=No().memoizedState;return ps({ref:t,nextImpl:e}),function(){if(W&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function hs(e,t){return us(4,2,e,t)}function gs(e,t){return us(4,4,e,t)}function _s(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vs(e,t,n){n=n==null?null:n.concat([e]),us(4,4,_s.bind(null,t,e),n)}function ys(){}function bs(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xs(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&wo(t,r[1]))return r[0];if(r=e(),vo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function Ss(e,t,n){return n===void 0||po&1073741824&&!(K&261930)?e.memoizedState=t:(e.memoizedState=n,e=gu(),B.lanes|=e,Yl|=e,n)}function Cs(e,t,n,r){return Sr(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(K&261930)?(ac=!0,e.memoizedState=n):(e=gu(),B.lanes|=e,Yl|=e,t):(e=Ss(e,n,r),Sr(e,t)||(ac=!0),e)}function ws(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Is(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,ga(c,r),hu(e)):Fs(e,t,r,hu(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},hu())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function Ts(){}function Es(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=Ds(e).queue;ws(e,i,t,ie,n===null?Ts:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:V,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:V,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},hu())}function ks(){return ta(ep)}function As(){return No().memoizedState}function js(){return No().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=hu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(_u(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=hu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=ni(e,t,n,r),n!==null&&(_u(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,hu())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Sr(s,o))return ti(e,t,i,0),Vl===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return _u(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(o(479))}else t=ni(e,n,r,2),t!==null&&_u(t,e,2)}function Ls(e){var t=e.alternate;return e===B||t!==null&&t===B}function Rs(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Bs={readContext:ta,use:Io,useCallback:Co,useContext:Co,useEffect:Co,useImperativeHandle:Co,useLayoutEffect:Co,useInsertionEffect:Co,useMemo:Co,useReducer:Co,useRef:Co,useState:Co,useDebugValue:Co,useDeferredValue:Co,useTransition:Co,useSyncExternalStore:Co,useId:Co,useHostTransitionStatus:Co,useFormState:Co,useActionState:Co,useOptimistic:Co,useMemoCache:Co,useCacheRefresh:Co};Bs.useEffectEvent=Co;var Vs={readContext:ta,use:Io,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(vo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(vo){Re(!0);try{n(t)}finally{Re(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ps.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(Mo(),e,t)},useTransition:function(){var e=qo(!1);return e=ws.bind(null,B,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,i=Mo();if(z){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Vl===null)throw Error(o(349));K&127||Ho(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,ds(Wo.bind(null,r,a,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,a,n,t),null),n},useId:function(){var e=Mo(),t=Vl.identifierPrefix;if(z){var n=Di,r=Ei;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=So++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ks,useFormState:ns,useActionState:ns,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Is.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Mo().memoizedState=Ms.bind(null,B)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(W&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Hs={readContext:ta,use:Io,useCallback:bs,useContext:ta,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Ro,useRef:cs,useState:function(){return Ro(V)},useDebugValue:ys,useDeferredValue:function(e,t){return Cs(No(),mo.memoizedState,e,t)},useTransition:function(){var e=Ro(V)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){return Jo(No(),mo,e,t)},useMemoCache:Lo,useCacheRefresh:js};Hs.useEffectEvent=ms;var Us={readContext:ta,use:Io,useCallback:bs,useContext:ta,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Bo,useRef:cs,useState:function(){return Bo(V)},useDebugValue:ys,useDeferredValue:function(e,t){var n=No();return mo===null?Ss(n,e,t):Cs(n,mo.memoizedState,e,t)},useTransition:function(){var e=Bo(V)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:os,useActionState:os,useOptimistic:function(e,t){var n=No();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):Jo(n,mo,e,t)},useMemoCache:Lo,useCacheRefresh:js};Us.useEffectEvent=ms;function Ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(_u(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(_u(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hu(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(_u(t,e,n),Ga(t,e,n))}};function Ks(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Cr(n,r)||!Cr(i,a):!0}function qs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gs.enqueueReplaceState(t,t.state,null)}function Js(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ys(e){Xr(e)}function Xs(e){console.error(e)}function Zs(e){Xr(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=Ua(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,i,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?ku():n.alternate===null&&Jl===0&&(Jl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ju(e,r,i)),!1;case 22:return n.flags|=65536,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ju(e,r,i)),!1}throw Error(o(435,n.tag))}return Ju(e,r,i),ku(),!1}if(z)return t=ro.current,t===null?(r!==Li&&(t=Error(o(423),{cause:r}),Wi(vi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=vi(r,n),i=ec(e.stateNode,r,i),Ka(e,i),Jl!==4&&(Jl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Li&&(e=Error(o(422),{cause:r}),Wi(vi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=vi(a,n),eu===null?eu=[a]:eu.push(a),Jl!==4&&(Jl=2),t===null)return!0;r=vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=ec(n.stateNode,r,e),Ka(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(au===null||!au.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=tc(i),nc(i,e,n,r),Ka(n,i),!1}n=n.return}while(n!==null);return!1}var ic=Error(o(461)),ac=!1;function oc(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=To(e,t,n,o,a,i),s=ko(),e!==null&&!ac?(Ao(e,t,i),jc(e,t,i)):(z&&s&&Ai(t),t.flags|=1,oc(e,t,r,i),t.child)}function cc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,lc(e,t,a,r,i)):(e=fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Mc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return jc(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(ac=!1,t.pendingProps=r=a,Mc(e,i))e.flags&131072&&(ac=!0);else return t.lanes=e.lanes,jc(e,t,i)}return _c(e,t,n,r,i)}function uc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),to(),co(t)):(ba(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return oc(e,t,i,n),t.child}function dc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),to(),so(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function pc(e,t){return t=Ec({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mc(e,t,n){return Ra(t,e.child,null,n),e=pc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function hc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=pc(t,r),t.lanes=536870912,dc(null,e);if(oo(t),(e=Pi)?(e=sf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return pc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(oo(t),i)if(t.flags&256)t.flags&=-257,t=mc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(ac||Qi(e,t,n,!1),i=(n&e.childLanes)!==0,ac||i){if(r=Vl,r!==null&&(s=nt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,ri(e,s),_u(r,e,s),ic;ku(),t=mc(e,t,n)}else e=a.treeContext,Pi=df(s.nextSibling),Ni=t,z=!0,Fi=null,Ii=!1,e!==null&&Mi(t,e),t=pc(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function _c(e,t,n,r,i){return ea(t),n=To(e,t,n,r,void 0,i),r=ko(),e!==null&&!ac?(Ao(e,t,i),jc(e,t,i)):(z&&r&&Ai(t),t.flags|=1,oc(e,t,n,i),t.child)}function vc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=Do(t,r,n,i),Eo(e),r=ko(),e!==null&&!ac?(Ao(e,t,a),jc(e,t,a)):(z&&r&&Ai(t),t.flags|=1,oc(e,t,n,a),t.child)}function yc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Gs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ws(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Gs.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&qs(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Ws(t,n,d,r),l=t.memoizedState),(c=Ba||Ks(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ha(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&qs(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Ws(t,n,s,r),p=t.memoizedState),(u=Ba||Ks(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,gc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=jc(e,t,i),e}function bc(e,t,n,r){return Hi(),t.flags|=256,oc(e,t,n,r),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sc(e){return{baseLanes:e,cachePool:xa()}}function Cc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Ql),e}function wc(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!=0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(uo.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(z){if(i?ao(t):co(t),(e=Pi)?(e=sf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw Ri(t);return lf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(co(t),i=t.mode,c=Ec({mode:`hidden`,children:c},i),r=pi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(null,r)):(ao(t),Tc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(a)t.flags&256?(ao(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,i=t.mode,r=Ec({mode:`visible`,children:r.children},i),c=pi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,t=dc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),lf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(o(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Dc(e,t,n)}else if(ac||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,ac||s){if(s=Vl,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),_u(s,e,r),ic;cf(c)||ku(),t=Dc(e,t,n)}else cf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Pi=df(c.nextSibling),Ni=t,z=!0,Fi=null,Ii=!1,e!==null&&Mi(t,e),t=Tc(t,r.children),t.flags|=4096);return t}return i?(co(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=pi(c,i,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,dc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Sc(n):(i=c.cachePool,i===null?i=xa():(l=sa._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=ui(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Tc(e,t){return t=Ec({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return Ra(t,e.child,null,n),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function kc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ac(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,le(uo,o),oc(e,t,r,n),r=z?Si:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oc(e,n,t);else if(e.tag===19)Oc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kc(t,!0,n,null,a,r);break;case`together`:kc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function jc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Mc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&$i(e))):!0}function Nc(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:P(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=jc(e,t,n),e===null?null:e.sibling):wc(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ac(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(uo,uo.current),r)break;return null;case 22:return t.lanes=0,uc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return jc(e,t,n)}function Pc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ac=!0;else{if(!Mc(e,n)&&!(t.flags&128))return ac=!1,Nc(e,t,n);ac=!!(e.flags&131072)}else ac=!1,z&&t.flags&1048576&&ki(t,Si,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Js(e,r),t.tag=1,t=yc(null,t,e,r,n)):(t.tag=0,t=_c(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===C){t.tag=11,t=sc(null,t,e,r,n);break a}else if(i===E){t.tag=14,t=cc(null,t,e,r,n);break a}}throw t=ne(e)||e,Error(o(306,t,``))}}return t;case 0:return _c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Js(r,t.pendingProps),yc(e,t,r,i,n);case 3:a:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0),Ja(),r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=bc(e,t,r,n);break a}else if(r!==i){i=vi(Error(o(424)),t),Wi(i),t=bc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Pi=df(e.firstChild),Ni=t,z=!0,Fi=null,Ii=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===i){t=jc(e,t,n);break a}oc(e,t,r,n)}t=t.child}return t;case 26:return gc(e,t),e===null?(n=jf(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(n=t.type,e=t.pendingProps,r=Ud(fe.current).createElement(n),r[ct]=t,r[lt]=e,Rd(r,n,e),xt(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return P(t),e===null&&z&&(r=t.stateNode=hf(t.type,t.pendingProps,fe.current),Ni=t,Ii=!0,i=Pi,ef(t.type)?(ff=i,Pi=df(r.firstChild)):Pi=i),oc(e,t,t.pendingProps.children,n),gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((i=r=Pi)&&(r=af(r,t.type,t.pendingProps,Ii),r===null?i=!1:(t.stateNode=r,Ni=t,Pi=df(r.firstChild),Ii=!1,i=!0)),i||Ri(t)),P(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,Kd(i,a)?r=null:s!==null&&Kd(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=To(e,t,Oo,null,null,n),ep._currentValue=i),gc(e,t),oc(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=Pi)&&(n=of(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Ni=t,Pi=null,e=!0)),e||Ri(t)),null;case 13:return wc(e,t,n);case 4:return me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):oc(e,t,r,n),t.child;case 11:return sc(e,t,t.type,t.pendingProps,n);case 7:return oc(e,t,t.pendingProps,n),t.child;case 8:return oc(e,t,t.pendingProps.children,n),t.child;case 12:return oc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),oc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,ea(t),i=ta(i),r=r(i),t.flags|=1,oc(e,t,r,n),t.child;case 14:return cc(e,t,t.type,t.pendingProps,n);case 15:return lc(e,t,t.type,t.pendingProps,n);case 19:return Ac(e,t,n);case 31:return hc(e,t,n);case 22:return uc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(i=ya(),i===null&&(i=Vl,a=ca(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},Va(t),Ji(t,sa,i)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,Ji(t,sa,r),r!==i.cache&&Zi(t,[sa],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ji(t,sa,r))),oc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Fc(e){e.flags|=4}function Ic(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Eu())e.flags|=8192;else throw ka=Ta,Ca}else e.flags&=-16777217}function Lc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t))if(Eu())e.flags|=8192;else throw ka=Ta,Ca}function Rc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,$l|=t)}function zc(e,t){if(!z)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Vc(e,t,n){var r=t.pendingProps;switch(ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bc(t),null;case 1:return Bc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),N(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Fc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Bc(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(Fc(t),a===null?(Bc(t),Ic(t,i,null,r,n)):(Bc(t),Lc(t,a))):a?a===e.memoizedState?(Bc(t),t.flags&=-16777217):(Fc(t),Bc(t),Lc(t,a)):(e=e.memoizedProps,e!==r&&Fc(t),Bc(t),Ic(t,i,e,r,n)),null;case 27:if(he(t),n=fe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Bc(t),null}e=ue.current,Vi(t)?zi(t,e):(e=hf(i,r,n),t.stateNode=e,Fc(t))}return Bc(t),null;case 5:if(he(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Bc(t),null}if(a=ue.current,Vi(t))zi(t,a);else{var s=Ud(fe.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[ct]=t,a[lt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(Rd(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Fc(t)}}return Bc(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=fe.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Ni,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||Ri(t,!0)}else e=Ud(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Bc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[ct]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(o(558))}return Bc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[ct]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),i=!1}else i=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rc(t,t.updateQueue),Bc(t),null);case 4:return N(),e===null&&Td(t.stateNode.containerInfo),Bc(t),null;case 10:return Yi(t.type),Bc(t),null;case 19:if(ce(uo),r=t.memoizedState,r===null)return Bc(t),null;if(i=(t.flags&128)!=0,a=r.rendering,a===null)if(i)zc(r,!1);else{if(Jl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=fo(e),a!==null){for(t.flags|=128,zc(r,!1),e=a.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return le(uo,uo.current&1|2),z&&Oi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>J&&(t.flags|=128,i=!0,zc(r,!1),t.lanes=4194304)}else{if(!i)if(e=fo(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!a.alternate&&!z)return Bc(t),null}else 2*De()-r.renderingStartTime>J&&n!==536870912&&(t.flags|=128,i=!0,zc(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}return r.tail===null?(Bc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=uo.current,le(uo,i?n&1|2:n&1),z&&Oi(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Bc(t),t.subtreeFlags&6&&(t.flags|=8192)):Bc(t),n=t.updateQueue,n!==null&&Rc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ce(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Bc(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Hc(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),N(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(o(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(uo),null;case 4:return N(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&ce(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Uc(e,t){switch(ji(t),t.tag){case 3:Yi(sa),N();break;case 26:case 27:case 5:he(t);break;case 4:N();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:ce(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&ce(va);break;case 24:Yi(sa)}}function Wc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){qu(t,t.return,e)}}function Gc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){qu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){qu(t,t.return,e)}}function Kc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){qu(e,e.return,t)}}}function qc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){qu(e,t,n)}}function Jc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){qu(e,t,n)}}function Yc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){qu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){qu(e,t,n)}else n.current=null}function Xc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){qu(e,e.return,t)}}function Zc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[lt]=t}catch(t){qu(e,e.return,t)}}function Qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ef(e.type)||e.tag===4}function $c(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ef(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=R));else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[ct]=e,t[lt]=n}catch(t){qu(e,e.return,t)}}var rl=!1,il=!1,al=!1,ol=typeof WeakSet==`function`?WeakSet:Set,sl=null;function cl(e,t){if(e=e.containerInfo,Hd=lp,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==a||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===a&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(X={focusedElem:e,selectionRange:n},lp=!1,sl=t;sl!==null;)if(t=sl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,sl=e;else for(;sl!==null;){switch(t=sl,a=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;
vendor: 6,134 bytes, line 9
9try{var h=Js(n.type,i);e=r.getSnapshotBeforeUpdate(h,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){qu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:rf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,sl=e;break}sl=t.return}}function ll(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:wl(e,n),r&4&&Wc(5,n);break;case 1:if(wl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){qu(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){qu(n,n.return,e)}}r&64&&Kc(n),r&512&&Jc(n,n.return);break;case 3:if(wl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Za(e,t)}catch(e){qu(n,n.return,e)}}break;case 27:t===null&&r&4&&nl(n);case 26:case 5:wl(e,n),t===null&&r&4&&Xc(n),r&512&&Jc(n,n.return);break;case 12:wl(e,n);break;case 31:wl(e,n),r&4&&hl(e,n);break;case 13:wl(e,n),r&4&&gl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zu.bind(null,n),uf(e,n))));break;case 22:if(r=n.memoizedState!==null||rl,!r){t=t!==null&&t.memoizedState!==null||il,i=rl;var a=il;rl=r,(il=t)&&!a?El(e,n,(n.subtreeFlags&8772)!=0):wl(e,n),rl=i,il=a}break;case 30:break;default:wl(e,n)}}function ul(e){var t=e.alternate;t!==null&&(e.alternate=null,ul(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&>(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dl=null,fl=!1;function pl(e,t,n){for(n=n.child;n!==null;)ml(e,t,n),n=n.sibling}function ml(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:il||Yc(n,t),pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:il||Yc(n,t);var r=dl,i=fl;ef(n.type)&&(dl=n.stateNode,fl=!1),pl(e,t,n),gf(n.stateNode),dl=r,fl=i;break;case 5:il||Yc(n,t);case 6:if(r=dl,i=fl,dl=null,pl(e,t,n),dl=r,fl=i,dl!==null)if(fl)try{(dl.nodeType===9?dl.body:dl.nodeName===`HTML`?dl.ownerDocument.body:dl).removeChild(n.stateNode)}catch(e){qu(n,t,e)}else try{dl.removeChild(n.stateNode)}catch(e){qu(n,t,e)}break;case 18:dl!==null&&(fl?(e=dl,tf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):tf(dl,n.stateNode));break;case 4:r=dl,i=fl,dl=n.stateNode.containerInfo,fl=!0,pl(e,t,n),dl=r,fl=i;break;case 0:case 11:case 14:case 15:Gc(2,n,t),il||Gc(4,n,t),pl(e,t,n);break;case 1:il||(Yc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&qc(n,t,r)),pl(e,t,n);break;case 21:pl(e,t,n);break;case 22:il=(r=il)||n.memoizedState!==null,pl(e,t,n),il=r;break;default:pl(e,t,n)}}function hl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){qu(t,t.return,e)}}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){qu(t,t.return,e)}}function _l(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ol),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ol),t;default:throw Error(o(435,e.tag))}}function vl(e,t){var n=_l(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Qu.bind(null,e,t);t.then(r,r)}})}function yl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(ef(c.type)){dl=c.stateNode,fl=!1;break a}break;case 5:dl=c.stateNode,fl=!1;break a;case 3:case 4:dl=c.stateNode.containerInfo,fl=!0;break a}c=c.return}if(dl===null)throw Error(o(160));ml(a,s,i),dl=null,fl=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xl(t,e),t=t.sibling}var bl=null;function xl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:yl(t,e),Sl(e),r&4&&(Gc(3,e,e.return),Wc(3,e),Gc(5,e,e.return));break;case 1:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&64&&rl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=bl;if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&4){var a=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:a=i.getElementsByTagName(`title`)[0],(!a||a[ht]||a[ct]||a.namespaceURI===`http://www.w3.org/2000/svg`||a.hasAttribute(`itemprop`))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector(`head > title`))),Rd(a,r,n),a[ct]=e,xt(a),r=a;break a;case`link`:var s=Uf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&a.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&a.getAttribute(`title`)===(n.title==null?null:n.title)&&a.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}a=i.createElement(r),Rd(a,r,n),i.head.appendChild(a);break;case`meta`:if(s=Uf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`content`)===(n.content==null?null:``+n.content)&&a.getAttribute(`name`)===(n.name==null?null:n.name)&&a.getAttribute(`property`)===(n.property==null?null:n.property)&&a.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}a=i.createElement(r),Rd(a,r,n),i.head.appendChild(a);break;default:throw Error(o(468,r))}a[ct]=e,xt(a),r=a}e.stateNode=r}else Wf(i,e.type,e.stateNode);else e.stateNode=Rf(i,r,e.memoizedProps);
vendor: 40,544 bytes, lines 9-10
9else a===r?r===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps):(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?Wf(i,e.type,e.stateNode):Rf(i,r,e.memoizedProps))}break;case 27:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),n!==null&&r&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),e.flags&32){i=e.stateNode;try{Kt(i,``)}catch(t){qu(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Zc(e,i,n===null?i:n.memoizedProps)),r&1024&&(al=!0);break;case 6:if(yl(t,e),Sl(e),r&4){if(e.stateNode===null)throw Error(o(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){qu(e,e.return,t)}}break;case 3:if(Hf=null,i=bl,bl=yf(t.containerInfo),yl(t,e),bl=i,Sl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){qu(e,e.return,t)}al&&(al=!1,Cl(e));break;case 4:r=bl,bl=yf(e.stateNode.containerInfo),yl(t,e),Sl(e),bl=r;break;case 12:yl(t,e),Sl(e);break;case 31:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 13:yl(t,e),Sl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ru=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=rl,d=il;if(rl=u||i,il=d||l,yl(t,e),il=d,rl=u,Sl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||rl||il||Tl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)s=a.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){qu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){qu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?nf(m,!0):nf(l.stateNode,!1)}catch(e){qu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,vl(e,n))));break;case 19:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 30:break;case 21:break;default:yl(t,e),Sl(e)}}function Sl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Qc(r)){n=r;break}r=r.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode;tl(e,$c(e),i);break;case 5:var a=n.stateNode;n.flags&32&&(Kt(a,``),n.flags&=-33),tl(e,$c(e),a);break;case 3:case 4:var s=n.stateNode.containerInfo;el(e,$c(e),s);break;default:throw Error(o(161))}}catch(t){qu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ll(e,t.alternate,t),t=t.sibling}function Tl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gc(4,t,t.return),Tl(t);break;case 1:Yc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&qc(t,t.return,n),Tl(t);break;case 27:gf(t.stateNode);case 26:case 5:Yc(t,t.return),Tl(t);break;case 22:t.memoizedState===null&&Tl(t);break;case 30:Tl(t);break;default:Tl(t)}e=e.sibling}}function El(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:El(i,a,n),Wc(4,a);break;case 1:if(El(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){qu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Xa(c[i],s)}catch(e){qu(r,r.return,e)}}n&&o&64&&Kc(a),Jc(a,a.return);break;case 27:nl(a);case 26:case 5:El(i,a,n),n&&r===null&&o&4&&Xc(a),Jc(a,a.return);break;case 12:El(i,a,n);break;case 31:El(i,a,n),n&&o&4&&hl(i,a);break;case 13:El(i,a,n),n&&o&4&&gl(i,a);break;case 22:a.memoizedState===null&&El(i,a,n),Jc(a,a.return);break;case 30:break;default:El(i,a,n)}t=t.sibling}}function Dl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&la(n))}function Ol(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function kl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Al(e,t,n,r),t=t.sibling}function Al(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:kl(e,t,n,r),i&2048&&Wc(9,t);break;case 1:kl(e,t,n,r);break;case 3:kl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){kl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){qu(t,t.return,e)}}else kl(e,t,n,r);break;case 31:kl(e,t,n,r);break;case 13:kl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?kl(e,t,n,r):(a._visibility|=2,jl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?kl(e,t,n,r):Ml(e,t),i&2048&&Dl(o,t);break;case 24:kl(e,t,n,r),i&2048&&Ol(t.alternate,t);break;default:kl(e,t,n,r)}}function jl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:jl(a,o,s,c,i),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,jl(a,o,s,c,i)):u._visibility&2?jl(a,o,s,c,i):Ml(a,o),i&&l&2048&&Dl(o.alternate,o);break;case 24:jl(a,o,s,c,i),i&&l&2048&&Ol(o.alternate,o);break;default:jl(a,o,s,c,i)}t=t.sibling}}function Ml(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ml(n,r),i&2048&&Dl(r.alternate,r);break;case 24:Ml(n,r),i&2048&&Ol(r.alternate,r);break;default:Ml(n,r)}t=t.sibling}}var Nl=8192;function Pl(e,t,n){if(e.subtreeFlags&Nl)for(e=e.child;e!==null;)Fl(e,t,n),e=e.sibling}function Fl(e,t,n){switch(e.tag){case 26:Pl(e,t,n),e.flags&Nl&&e.memoizedState!==null&&qf(n,bl,e.memoizedState,e.memoizedProps);break;case 5:Pl(e,t,n);break;case 3:case 4:var r=bl;bl=yf(e.stateNode.containerInfo),Pl(e,t,n),bl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Nl,Nl=16777216,Pl(e,t,n),Nl=r):Pl(e,t,n));break;default:Pl(e,t,n)}}function Il(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Rl(r,e)}Il(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)H(e),e=e.sibling}function H(e){switch(e.tag){case 0:case 11:case 15:Ll(e),e.flags&2048&&Gc(9,e,e.return);break;case 3:Ll(e);break;case 12:Ll(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,U(e)):Ll(e);break;default:Ll(e)}}function U(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Rl(r,e)}Il(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gc(8,t,t.return),U(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,U(t));break;default:U(t)}e=e.sibling}}function Rl(e,t){for(;sl!==null;){var n=sl;switch(n.tag){case 0:case 11:case 15:Gc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,sl=r;else a:for(n=e;sl!==null;){r=sl;var i=r.sibling,a=r.return;if(ul(r),r===n){sl=null;break a}if(i!==null){i.return=a,sl=i;break a}sl=a}}}var zl={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Bl=typeof WeakMap==`function`?WeakMap:Map,W=0,Vl=null,G=null,K=0,Hl=0,Ul=null,Wl=!1,Gl=!1,Kl=!1,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=null,tu=null,nu=!1,ru=0,q=0,J=1/0,iu=null,au=null,ou=0,su=null,cu=null,lu=0,uu=0,du=null,fu=null,pu=0,mu=null;function hu(){return W&2&&K!==0?K&-K:j.T===null?at():md()}function gu(){if(Ql===0)if(!(K&536870912)||z){var e=We;We<<=1,!(We&3932160)&&(We=262144),Ql=e}else Ql=536870912;return e=ro.current,e!==null&&(e.flags|=32),Ql}function _u(e,t,n){(e===Vl&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)&&(wu(e,0),xu(e,K,Ql,!1)),Qe(e,n),(!(W&2)||e!==Vl)&&(e===Vl&&(!(W&2)&&(Xl|=n),Jl===4&&xu(e,K,Ql,!1)),od(e))}function vu(e,t,n){if(W&6)throw Error(o(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Je(e,t),i=r?Mu(e,t):Au(e,t,!0),a=r;do{if(i===0){Gl&&!r&&xu(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!bu(n)){i=Au(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=eu;var l=c.current.memoizedState.isDehydrated;if(l&&(wu(c,s).flags|=256),s=Au(c,s,!1),s!==2){if(Kl&&!l){c.errorRecoveryDisabledLanes|=a,Xl|=a,i=4;break a}a=tu,tu=i,a!==null&&(tu===null?tu=a:tu.push.apply(tu,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){wu(e,0),xu(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:xu(r,t,Ql,!Wl);break a;case 2:tu=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=ru+300-De(),10<i)){if(xu(r,t,Ql,!Wl),qe(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=Yd(yu.bind(null,r,n,tu,iu,nu,t,Ql,Xl,$l,Wl,a,`Throttled`,-0,0),i);break a}yu(r,n,tu,iu,nu,t,Ql,Xl,$l,Wl,a,null,-0,0)}}break}while(1);od(e)}function yu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:R},Fl(t,a,d);var m=(a&62914560)===a?ru-De():(a&4194048)===a?q-De():0;if(m=Yf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(zu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),xu(e,a,o,!l);return}}zu(e,t,a,n,r,i,o,s,c)}function bu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Sr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xu(e,t,n,r){t&=~Zl,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function Su(){return W&6?!0:(sd(0,!1),!1)}function Cu(){if(G!==null){if(Hl===0)var e=G.return;else e=G,qi=Ki=null,jo(e),Ma=null,Na=0,e=G;for(;e!==null;)Uc(e.alternate,e),e=e.return;G=null}}function wu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Xd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Cu(),Vl=e,G=n=ui(e.current,null),K=t,Hl=0,Ul=null,Wl=!1,Gl=Je(e,t),Kl=!1,$l=Ql=Zl=Xl=Yl=Jl=0,tu=eu=null,nu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ze(r),a=1<<i;t|=e[i],r&=~a}return ql=t,ei(),n}function Tu(e,t){B=null,j.H=Bs,t===Sa||t===wa?(t=Aa(),Hl=3):t===Ca?(t=Aa(),Hl=4):Hl=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ul=t,G===null&&(Jl=1,Qs(e,vi(t,e.current)))}function Eu(){var e=ro.current;return e===null?!0:(K&4194048)===K?io===null:(K&62914560)===K||K&536870912?e===io:!1}function Du(){var e=j.H;return j.H=Bs,e===null?Bs:e}function Ou(){var e=j.A;return j.A=zl,e}function ku(){Jl=4,Wl||(K&4194048)!==K&&ro.current!==null||(Gl=!0),!(Yl&134217727)&&!(Xl&134217727)||Vl===null||xu(Vl,K,Ql,!1)}function Au(e,t,n){var r=W;W|=2;var i=Du(),a=Ou();(Vl!==e||K!==t)&&(iu=null,wu(e,t)),t=!1;var o=Jl;a:do try{if(Hl!==0&&G!==null){var s=G,c=Ul;switch(Hl){case 8:Cu(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=Hl;if(Hl=0,Ul=null,Iu(e,s,c,l),n&&Gl){o=0;break a}break;default:l=Hl,Hl=0,Ul=null,Iu(e,s,c,l)}}ju(),o=Jl;break}catch(t){Tu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,W=r,j.H=i,j.A=a,G===null&&(Vl=null,K=0,ei()),o}function ju(){for(;G!==null;)Pu(G)}function Mu(e,t){var n=W;W|=2;var r=Du(),i=Ou();Vl!==e||K!==t?(iu=null,J=De()+500,wu(e,t)):Gl=Je(e,t);a:do try{if(Hl!==0&&G!==null){t=G;var a=Ul;b:switch(Hl){case 1:Hl=0,Ul=null,Iu(e,t,a,1);break;case 2:case 9:if(Ea(a)){Hl=0,Ul=null,Fu(t);break}t=function(){Hl!==2&&Hl!==9||Vl!==e||(Hl=7),od(e)},a.then(t,t);break a;case 3:Hl=7;break a;case 4:Hl=5;break a;case 7:Ea(a)?(Hl=0,Ul=null,Fu(t)):(Hl=0,Ul=null,Iu(e,t,a,7));break;case 5:var s=null;switch(G.tag){case 26:s=G.memoizedState;case 5:case 27:var c=G;if(s?Kf(s):c.stateNode.complete){Hl=0,Ul=null;var l=c.sibling;if(l!==null)G=l;else{var u=c.return;u===null?G=null:(G=u,Lu(u))}break b}}Hl=0,Ul=null,Iu(e,t,a,5);break;case 6:Hl=0,Ul=null,Iu(e,t,a,6);break;case 8:Cu(),Jl=6;break a;default:throw Error(o(462))}}Nu();break}catch(t){Tu(e,t)}while(1);return qi=Ki=null,j.H=r,j.A=i,W=n,G===null?(Vl=null,K=0,ei(),Jl):0}function Nu(){for(;G!==null&&!Te();)Pu(G)}function Pu(e){var t=Pc(e.alternate,e,ql);e.memoizedProps=e.pendingProps,t===null?Lu(e):G=t}function Fu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=vc(n,t,t.pendingProps,t.type,void 0,K);break;case 11:t=vc(n,t,t.pendingProps,t.type.render,t.ref,K);break;case 5:jo(t);default:Uc(n,t),t=G=di(t,ql),t=Pc(n,t,ql)}e.memoizedProps=e.pendingProps,t===null?Lu(e):G=t}function Iu(e,t,n,r){qi=Ki=null,jo(t),Ma=null,Na=0;var i=t.return;try{if(rc(e,i,t,n,K)){Jl=1,Qs(e,vi(n,e.current)),G=null;return}}catch(t){if(i!==null)throw G=i,t;Jl=1,Qs(e,vi(n,e.current)),G=null;return}t.flags&32768?(z||r===1?e=!0:Gl||K&536870912?e=!1:(Wl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ru(t,e)):Lu(t)}function Lu(e){var t=e;do{if(t.flags&32768){Ru(t,Wl);return}e=t.return;var n=Vc(t.alternate,t,ql);if(n!==null){G=n;return}if(t=t.sibling,t!==null){G=t;return}G=t=e}while(t!==null);Jl===0&&(Jl=5)}function Ru(e,t){do{var n=Hc(e.alternate,e);if(n!==null){n.flags&=32767,G=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){G=e;return}G=e=n}while(e!==null);Jl=6,G=null}function zu(e,t,n,r,i,a,s,c,l){e.cancelPendingCommit=null;do Wu();while(ou!==0);if(W&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(a=t.lanes|t.childLanes,a|=$r,$e(e,n,a,s,c,l),e===Vl&&(G=Vl=null,K=0),cu=t,su=e,lu=n,uu=a,du=i,fu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,$u(je,function(){return Gu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,i=M.p,M.p=2,s=W,W|=4;try{cl(e,t,n)}finally{W=s,M.p=i,j.T=r}}ou=1,Bu(),Vu(),Hu()}}function Bu(){if(ou===1){ou=0;var e=su,t=cu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=W;W|=4;try{xl(t,e);var a=X,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Tr(s,h),v=Tr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}lp=!!Hd,X=Hd=null}finally{W=i,M.p=r,j.T=n}}e.current=t,ou=2}}function Vu(){if(ou===2){ou=0;var e=su,t=cu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=W;W|=4;try{ll(e,t.alternate,t)}finally{W=i,M.p=r,j.T=n}}ou=3}}function Hu(){if(ou===4||ou===3){ou=0,Ee();var e=su,t=cu,n=lu,r=fu;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Uu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),it(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=M.p,M.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,M.p=i}}lu&3&&Wu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===mu?pu++:(pu=0,mu=e):pu=0,sd(0,!1)}}function Uu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Wu(){return Bu(),Vu(),Hu(),Gu()}function Gu(){if(ou!==5)return!1;var e=su,t=uu;uu=0;var n=it(lu),r=j.T,i=M.p;try{M.p=32>n?32:n,j.T=null,n=du,du=null;var a=su,s=lu;if(ou=0,cu=su=null,lu=0,W&6)throw Error(o(331));var c=W;if(W|=4,H(a.current),Al(a,a.current,s,n),W=c,sd(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,a)}catch{}return!0}finally{M.p=i,j.T=r,Uu(e,t)}}function Ku(e,t,n){t=vi(n,t),t=ec(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(Qe(e,2),od(e))}function qu(e,t,n){if(e.tag===3)Ku(e,e,n);else for(;t!==null;){if(t.tag===3){Ku(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=vi(n,e),n=tc(2),r=Wa(t,n,2),r!==null&&(nc(n,r,t,e),Qe(r,2),od(r));break}}t=t.return}}function Ju(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Kl=!0,i.add(n),e=Yu.bind(null,e,t,n),t.then(e,e))}function Yu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Vl===e&&(K&n)===n&&(Jl===4||Jl===3&&(K&62914560)===K&&300>De()-ru?!(W&2)&&wu(e,0):Zl|=n,$l===K&&($l=0)),od(e)}function Xu(e,t){t===0&&(t=Xe()),e=ri(e,t),e!==null&&(Qe(e,t),od(e))}function Zu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xu(e,n)}function Qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),Xu(e,n)}function $u(e,t){return Ce(e,t)}var ed=null,td=null,nd=!1,rd=!1,id=!1,ad=0;function od(e){e!==td&&e.next===null&&(td===null?ed=td=e:td=td.next=e),rd=!0,nd||(nd=!0,pd())}function sd(e,t){if(!id&&rd){id=!0;do for(var n=!1,r=ed;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=K,a=qe(r,r===Vl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,fd(r,a));r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){rd=nd=!1;var e=0;ad!==0&&Jd()&&(e=ad);for(var t=De(),n=null,r=ed;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?ed=i:n.next=i,i===null&&(td=n)):(n=r,(e!==0||a&3)&&(rd=!0)),r=i}ou!==0&&ou!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Vl,n=K,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),it(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=dd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var r=K;return r=qe(e,e===Vl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vu(e,r,t),ud(e,De()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Wu())return null;vu(e,t,!0)}function pd(){Qd(function(){W&6?Ce(ke,cd):ld()})}function md(){if(ad===0){var e=fa;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),ad=e}return ad}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function gd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);Es(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),Es(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Jr.length;vd++){var yd=Jr[vd];Yr(yd.toLowerCase(),`on`+(yd[0].toUpperCase()+yd.slice(1)))}Yr(Br,`onAnimationEnd`),Yr(Vr,`onAnimationIteration`),Yr(Hr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Ur,`onTransitionRun`),Yr(Wr,`onTransitionStart`),Yr(Gr,`onTransitionCancel`),Yr(Kr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var bd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),xd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(bd));function Sd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,a=c}}}}function Y(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Ed(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var wd=`_reactListening`+Math.random().toString(36).slice(2);function Td(e){if(!e[wd]){e[wd]=!0,St.forEach(function(t){t!==`selectionchange`&&(xd.has(t)||Cd(t,!1,e),Cd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,Cd(`selectionchange`,!1,t))}}function Ed(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!ln||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Dd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=_t(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}on(function(){var r=a,i=en(n),o=[];a:{var s=qr.get(e);if(s!==void 0){var l=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:l=zn;break;case`focusin`:u=`focus`,l=An;break;case`focusout`:u=`blur`,l=An;break;case`beforeblur`:case`afterblur`:l=An;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=On;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Vn;break;case Br:case Vr:case Hr:l=jn;break;case Kr:l=Hn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=Wn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=sn(m,p),g!=null&&d.push(Od(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==$t&&(u=n.relatedTarget||n.fromElement)&&(_t(u)||u[ut]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?_t(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=On,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:yt(l),h=u==null?s:yt(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,_t(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ad,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&jd(o,s,l,d,!1),u!==null&&f!==null&&jd(o,f,u,d,!0)}}a:{if(s=r?yt(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=ur;else if(ir(s))if(dr)v=br;else{v=vr;var y=_r}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Yt(r.elementType)&&(v=ur):v=yr;if(v&&=v(e,r)){ar(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Ht(s,`number`,s.value)}switch(y=r?yt(r):window,e){case`focusin`:(ir(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(o,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(o,n,i)}var b;if(Kn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else er?Qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Yn&&n.locale!==`ko`&&(er||x!==`onCompositionStart`?x===`onCompositionEnd`&&er&&(b=mn()):(dn=i,fn=`value`in dn?dn.value:dn.textContent,er=!0)),y=kd(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=$n(n),b!==null&&(x.data=b)))),(b=Jn?tr(e,n):nr(e,n))&&(x=kd(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),_d(o,e,r,n,i)}Sd(o,t)})}function Od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=sn(e,n),i!=null&&r.unshift(Od(e,i,a)),i=sn(e,t),i!=null&&r.push(Od(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ad(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=sn(n,a),l!=null&&o.unshift(Od(n,l,c))):i||(l=sn(n,a),l!=null&&o.push(Od(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Md=/\r\n?/g,Nd=/\u0000|\uFFFD/g;function Pd(e){return(typeof e==`string`?e:``+e).replace(Md,` 10`).replace(Nd,``)}function Fd(e,t){return t=Pd(t),Pd(e)===t}function Id(e,t,n,r,i,a){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Jt(e,r,a);break;case`data`:if(t!==`object`){jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof a==`function`&&(n===`formAction`?(t!==`input`&&Id(e,t,`name`,i.name,i,null),Id(e,t,`formEncType`,i.formEncType,i,null),Id(e,t,`formMethod`,i.formMethod,i,null),Id(e,t,`formTarget`,i.formTarget,i,null)):(Id(e,t,`encType`,i.encType,i,null),Id(e,t,`method`,i.method,i,null),Id(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=R);break;case`onScroll`:r!=null&&Y(`scroll`,e);break;case`onScrollEnd`:r!=null&&Y(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Y(`beforetoggle`,e),Y(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Xt.get(n)||n,At(e,n,r))}}function Ld(e,t,n,r,i,a){switch(n){case`style`:Jt(e,r,a);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&Y(`scroll`,e);break;case`onScrollEnd`:r!=null&&Y(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=R);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),a=e[lt]||null,a=a==null?null:a[n],typeof a==`function`&&e.removeEventListener(t,a,i),typeof r==`function`)){typeof a!=`function`&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Rd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Y(`error`,e),Y(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:Id(e,t,a,s,n,null)}}i&&Id(e,t,`srcSet`,n.srcSet,n,null),r&&Id(e,t,`src`,n.src,n,null);return;case`input`:Y(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:Id(e,t,r,d,n,null)}}Vt(e,a,c,l,u,s,i,!1);return;case`select`:for(i in Y(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Id(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in Y(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:Id(e,t,s,c,n,null)}Gt(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Id(e,t,l,r,n,null)}return;case`dialog`:Y(`beforetoggle`,e),Y(`toggle`,e),Y(`cancel`,e),Y(`close`,e);break;case`iframe`:case`object`:Y(`load`,e);break;case`video`:case`audio`:for(r=0;r<bd.length;r++)Y(bd[r],e);break;case`image`:Y(`error`,e),Y(`load`,e);break;case`details`:Y(`toggle`,e);break;case`embed`:case`source`:case`link`:Y(`error`,e),Y(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:Id(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Id(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:a=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&Id(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||Id(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:p=a;break;case`defaultValue`:c=a;break;case`multiple`:s=a;default:a!==l&&Id(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Id(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&Id(e,t,s,i,r,a)}Wt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Id(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Id(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Id(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:Id(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(e,t,_,void 0,r,p);
vendor: 4,462 bytes, line 10
10for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Vd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Bd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Bd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Hd=null,X=null;function Ud(e){return e.nodeType===9?e:e.ownerDocument}function Wd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Gd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Kd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qd=null;function Jd(){var e=window.event;return e&&e.type===`popstate`?e===qd?!1:(qd=e,!0):(qd=null,!1)}var Yd=typeof setTimeout==`function`?setTimeout:void 0,Xd=typeof clearTimeout==`function`?clearTimeout:void 0,Zd=typeof Promise==`function`?Promise:void 0,Qd=typeof queueMicrotask==`function`?queueMicrotask:Zd===void 0?Yd:function(e){return Zd.resolve(null).then(e).catch($d)};function $d(e){setTimeout(function(){throw e})}function ef(e){return e===`head`}function tf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)gf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&gf(e.ownerDocument.body);n=i}while(n);Fp(t)}function nf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function rf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:rf(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function af(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=df(e.nextSibling),e===null)break}return null}function of(e,t,n){if(t===``)return null;for(;
vendor: 20,211 bytes, line 10
10e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function sf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function cf(e){return e.data===`$?`||e.data===`$~`}function lf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function uf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function df(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return df(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function hf(e,t,n){switch(t=Ud(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var _f=new Map,vf=new Set;function yf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bf=M.d;M.d={f:xf,r:Z,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function xf(){var e=bf.f(),t=Su();return e||t}function Z(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?Os(t):bf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function wf(e){bf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){bf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){bf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}_f.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Df(e,t){bf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!_f.has(a)&&(e=m({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Of(e,t,n){bf.S(e,t,n);var r=Sf;if(r&&e){var i=bt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);xt(c),Rd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){bf.X(e,t);var n=Sf;if(n&&e){var r=bt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),xt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){bf.M(e,t);var n=Sf;if(n&&e){var r=bt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),xt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var i=(i=fe.current)?yf(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=bt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Mf(n.href);var a=bt(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Nf(e)))&&!a._p&&(s.instance=a,s.state.loading=5),_f.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),a||Ff(i,e,n,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=bt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Mf(e){return`href="`+zt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Rd(t,`link`,n),xt(t),e.head.appendChild(t))}function If(e){return`[src="`+zt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Rd(r,`style`,i),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Mf(n.href);var a=e.querySelector(Nf(i));if(a)return t.state.loading|=4,t.instance=a,xt(a),a;r=Pf(n),(i=_f.get(i))&&Bf(r,i),a=(e.ownerDocument||e).createElement(`link`),xt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(a,`link`,r),t.state.loading|=4,zf(a,n.precedence,e),t.instance=a;case`script`:return a=If(n.src),(i=e.querySelector(Lf(a)))?(t.instance=i,xt(i),i):(r=n,(i=_f.get(a))&&(r=m({},n),Vf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),xt(i),Rd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ht]||a[ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Pf(r),(i=_f.get(i))&&Bf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Xf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ep={$$typeof:S,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function tp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function rp(e){return e?(e=oi,e):oi}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(_u(n,e,t),Ga(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&_u(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=hu();t=rt(t);var n=ri(e,t);n!==null&&_u(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,fp(e,t,n,r)}finally{M.p=a,j.T=i}}function dp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,fp(e,t,n,r)}finally{M.p=a,j.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Dd(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}od(a),!(W&6)&&(J=De()+500,sd(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&_u(s,a,2),Su(),op(a,2)}if(a=pp(r),a===null&&Dd(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Dd(e,t,r,null,n)}}function pp(e){return e=en(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=_t(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return mp=e,null}function gp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=_t(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,ot(e.priority,function(){cp(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,ot(e.priority,function(){cp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$t=r,n.target.dispatchEvent(r),$t=null}else return t=vt(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(hp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,Es(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[lt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;ip(n,hu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;
10ip(e.current,2,null,e,null,null),Su(),t[ut]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=i.version;if(zp!==`19.2.5`)throw Error(o(527,zp,`19.2.5`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{Ie=Vp.inject(Bp),Le=Vp}catch{}}e.hydrateRoot=function(e,t,n){if(!s(e))throw Error(o(299));var r=!1,i=``,a=Ys,c=Xs,l=Zs,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=np(e,1,!0,t,n??null,r,i,u,a,c,l,Ip),t.context=rp(null),n=t.current,r=hu(),r=rt(r),i=Ua(r),i.callback=null,Wa(n,i,r),n=r,t.current.lanes=n,Qe(t,n),od(t),e[ut]=t.current,Td(e),new Rp(t)}})),_n=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=gn()})),vn=`__TSS_CONTEXT`,yn=Symbol.for(`TSS_SERVER_FUNCTION`),bn=Symbol.for(`TSS_SERVER_FUNCTION_FACTORY`),xn=`application/x-tss-framed`;`${xn}`;var Sn=()=>window.__TSS_START_OPTIONS__;function Cn(e){return e.replaceAll(`\0`,`/`).replaceAll(`�`,`/`).replace(/~([~0r])/g,(e,t)=>t===`0`?`\0`:t===`r`?`�`:t)}function wn(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Tn=4,En=5;function Dn(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function On(e,t,n){let r=e.substring(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.substring(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.substring(s,a);return[o?3:c?1:2,c||`_splat`,r.substring(0,i),e.substring(t+a+1,c?n:e.length)]}}return r}function kn(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,d=s.endsWith(`/`)?l-1:l,f=c?.caseSensitive??e,p=c?.params?.parse??c?.parseParams,m,h=a?n-1:0;if(!r||s.includes(`$`)){m=a?.slice()??[];let e=u(m);e&&typeof e!=`string`&&e[0]===2&&(m[m.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),d)],h=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=On(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;f?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=jn(r);c=n,t.set(e,n)}}else{let t=a[0],u=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),m&&h<n&&(h<e-1&&m.push(s.substring(h,e-1)),a[2]=`/`+u,t===2&&a[3]!==void 0&&d<l&&(a[3]=g.slice(0,-1)),m.push(a),h=n),!r)continue;let _=f&&!!(u||g);f||(u=u.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!p&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===u&&e.suffix===g);if(y)c=y;else{let e=jn(r,t,_,u,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}m&&h<d&&m.push(s.substring(h,d));let g=m?.slice();if(!r)return g;
10if(p&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=jn(r,En);(r.pathless??=[]).push(e),r=e}let _=(t.path||!t.children)&&!t.isRoot;if(_&&d<l){let e=jn(r,Tn);r.index=e,r=e}return r.parse=p??null,r.priority=c?.params?.priority??0,r.route||(r.data=g,_&&(r.route=t)),[r,o,g]}function An(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function jn(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Mn(e,t){let n=jn(),r=[];function i(e,t,n,a){let[o,s,c]=kn(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(An);t.masksTree=n,t.flatCache=wn(1e3)}function Nn(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Ln(e,t.masksTree);return t.flatCache.set(e,r),r}function Pn(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=jn(),kn(t,{from:e},1,o),i.singleCache.set(a,o)),Ln(r,o,n)}function Fn(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Ln(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=zn(a.route)),t.matchCache.set(r,a),a}function In(e,t=!1){let n=jn(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&ne(),i[e.id]=e,o!==0&&e.path){let t=h(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=kn(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(An);return{processedTree:{segmentTree:n,singleCache:wn(1e3),matchCache:wn(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Ln(e,t,n=!1){let r=e.split(`/`),i=Vn(e,r,t,n);if(!i)return null;let[a]=Rn(e,r,i);return{route:i.node.route,rawParams:a}}function Rn(e,t,n){let r=Bn(n.node),i=n.node.data&&Dn(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===Tn)break;if(u.kind===En){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function zn(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Bn(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Vn(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!u(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Gn(l,n))continue;if(i.parse){if(!Wn(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Tn&&Gn(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Tn||i.kind===2)&&Gn(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;
10if(i.index.parse&&(Wn(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Un(f,o))return n;Gn(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(_||!(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)))){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+Hn(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+Hn(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+Hn(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+Hn(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function Hn(e,t){return 2**(e-t-1)}function Un(e,t){return e===2**(t-1)-1}function Wn(e,t,n){let r,i;try{[r,i]=Rn(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Gn(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Tn)>(e.node.kind===Tn)||t.node.kind===Tn==(e.node.kind===Tn)&&t.node.depth>e.node.depth))):!0}function Kn(){try{return sessionStorage}catch{return}}var qn=`tsr-scroll-restoration-v1_3`,Jn=Kn();function Yn(){try{return JSON.parse(Jn?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Xn=Yn(),Zn=`data-scroll-restoration-id`,Qn=e=>e.state.__TSR_key||e.href;function $n(e){let t=e.getAttribute(Zn);if(t)return`[${Zn}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var er=!1,tr=`window`;function nr(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function rr(e){let t=new Set;for(let n of e){if(n===tr)continue;let e=nr(n);e&&t.add(e)}return t}function ir(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Qn,a=new Set,o=e=>{let t=Xn[e]||={};for(let e of a)e===document?t[tr]={scrollX,scrollY}:e.isConnected&&(t[$n(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,er=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{er||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{Jn?.setItem(qn,JSON.stringify(Xn))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;
10if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=Xn[d];if(e){let t=Xn[u];for(let n in e){if(n===tr){if(s)continue}else{let e=nr(n);if(!e||s&&o&&(l??=rr(o),l.has(e)))continue}t||=Xn[u]={},t[n]??=e[n]}}}er=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=rr(o));let t=e&&i&&c,s=r.e?Xn[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===tr){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=nr(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{er=!1}}))}function ar(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function or(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function sr(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=or(r):Array.isArray(t)?t.push(or(r)):n[e]=[t,or(r)]}return n}var cr=/^(?:\s|["[{\d-]|fa|nu|tr)/,lr=dr(JSON.parse),ur=fr(JSON.stringify,JSON.parse);function dr(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=sr(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!cr.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function fr(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!cr.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=ar(e,r);return t?`?${t}`:``}}function pr(e,t,n){let r=w(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=C(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>mr(n,s.input({url:e})),output:({url:e})=>s.output({url:hr(n,e)})}:s}function mr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function hr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function gr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{O(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var _r=`__TSR_index`,vr=`popstate`,yr=`beforeunload`,br=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function xr(e){let t=br.exec(e);return t?`/`+e.slice(t[0].length):e}function Sr(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>` 11\r`.includes(e)?``:encodeURIComponent(e))),xr(e)}function Cr(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Er(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[_r];i=wr(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[_r];i=wr(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[_r]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function wr(e,t){let n=Dr();return{...t,key:n,__TSR_key:n,[_r]:e}}function Tr(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>Sr(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>Er(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Dr();t.history.replaceState({[_r]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=Er(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>
11{if(m=!1,f){f=!1;return}let e=c(),n=e.state[_r]-l.state[_r],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Cr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(yr,x,{capture:!0}),t.removeEventListener(vr,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(yr,x,{capture:!0}),t.addEventListener(vr,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function Er(e,t){let n=Sr(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=Dr();t={[_r]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function Dr(){return(Math.random()+1).toString(36).substring(7)}function Or(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function kr(e){return e.pathname+e.search+e.hash}function Ar(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function jr(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function Mr(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Nr({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Pr(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Fr(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Ir=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Tr()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`);let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&w(n)?pr(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=gr(this.latestLocation,e),ir(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=In(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Mn(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:wn(1e3)}},this.subscribe=(e,t)=>
11{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:_(e),external:!1,searchStr:o,search:l(t?.search,i),hash:_(r.slice(1)),state:d(t?.state,a)}}let o=mr(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:_(xr(o.pathname)),external:!!this.rewrite&&Or(o,this.origin),searchStr:c,search:l(t?.search,s),hash:_(o.hash.slice(1)),state:d(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Fn(h(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=Er(n.href,{});n={...n,to:mr(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=n._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>(t=!0,i??=this.matchRoutesLightweight(r)),s=n.to?`${n.to}`:`.`,c=p(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[h(c)],u=c.includes(`$`),d;if(l)d=l._branch??=zn(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??kn(!1,{fullPath:c},0):void 0,m;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(m??=Vr(n.params,e),!k(m))break;m===e&&(m=Object.assign(g(),m));try{Object.assign(m,t(m))}catch{}}}m??=Vr(n.params,Hr(n.params,f)?o()[3]:Ur);let v=e.leaveParams?c:xr(_(f?b(c,f,m,this.pathParamsDecoder):c)),y=Wr(d,e._includeValidateSearch),x=()=>
11{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Br(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},C=y.length?Gr(y,x(),n):n.search===!0?x():typeof n.search==`function`?n.search(x()):n.search||Ur,w=this.options.stringifySearch(C),T=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,E=T?`#${T}`:``,D=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Ur,O=`${v}${w}${E}`,A,ee,te=!1;if(this.rewrite){let e=new URL(O,this.origin),t=e.origin,n=hr(this.rewrite,e);A=kr(e),Or(n,t)?(ee=n.href,te=!0):ee=xr(kr(n))}else A=S(O),ee=A;return{publicHref:ee,href:A,pathname:v,search:C,searchStr:w,state:D,hash:T??``,external:te,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Nn(r.pathname,this.processedTree);if(t){let i=Object.assign(g(),t.rawParams),{from:a,params:o,...s}=t.route,c=Vr(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&!r.maskedLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return Lr(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=h(this.latestLocation.href)===h(n.href)&&T(Nr(n.state),Nr(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?f(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return Lr(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Li(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Mr(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Ar(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(A.test(n)||(r=f(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:Or(e,this.origin)||(n=kr(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Xr,this.preloadRoute=e=>Ri(this,e),this.matchRoute=(e,t)=>
11{let n={...e,to:e.to?p(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Pn(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!T(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?T(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=E(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??ur,parseSearch:e.parseSearch??lr,protocolAllowlist:e.protocolAllowlist??x}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=kn(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),o=n,s=!1;(i?i.path!==`/`&&r[`**`]:h(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let u=s?Kr(this.options.notFoundMode,o):void 0,f=Array(o.length),p=this._committed,m=(e,t)=>
11{let n=p[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?p.find(t=>t.routeId===e.id):void 0},_;for(let n=0;n<o.length;n++){let i=o[n],s=f[n-1],p,h,v;{let n=s?.search??e.search,r=s?._strictSearch??void 0;try{let e=Br(i.options.validateSearch,{...n})??void 0;p={...n,...e},h={...r,...e}}catch(e){let r=e;if(e instanceof Rr||(r=new Rr(e.message,{cause:e})),t?.throwOnError)throw r;p=n,h={},v=r}}let y=``,x=``;try{y=i.options.loaderDeps?.({search:p})??``,x=y&&JSON.stringify(y)||``}catch(e){if(t?.throwOnError)throw e;v??=e}let S=g(),C=i._interpolation?b(i.fullPath,i._interpolation,r,this.pathParamsDecoder,S):i.fullPath,w=i.id+C+x,T=m(i,n),E=this._cache.get(w)??(T?.id===w?T:void 0);_=E?._strictParams??Object.assign(S,_);let D;if(!E)try{qr(i,_)}catch(e){if(D=a(e)||c(e)?e:new zr(e.message,{cause:e}),t?.throwOnError)throw D}let O=T?`stay`:`enter`,k;if(E)k={...E,cause:O,search:l(T?T.search:E.search,p),_strictSearch:h,searchError:v};else{let e=Ar(i)?`pending`:`success`;k={id:w,ssr:i.options.ssr,index:n,routeId:i.id,params:T?.params??_,_strictParams:_,pathname:C,updatedAt:Date.now(),search:T?l(T.search,p):p,_strictSearch:h,searchError:v,status:e,isFetching:!1,error:void 0,paramsError:D,context:{},abortController:t?._controller??new AbortController,cause:O,loaderDeps:T?d(T.loaderDeps,y):y,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let A=u===i.id;k._notFound&&!A&&(k.error=void 0),k._notFound=A,f[n]=k}for(let e=0;e<f.length;e++){let n=f[e];n.params=n.cause===`stay`?l(n.params,_):_,t?._controller&&(n.context={})}return f}matchRoutesLightweight(e){let t=u(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=u(a),c={...e.search};for(let e of a)try{Object.assign(c,Br(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,d;if(l)d=n.params;else{let e=o;for(let t of a)try{qr(t,e)}catch{}d=e}let f=[a,s.fullPath,c,d];return this.lightweightCache.set(e,[r,f]),f}};async function Lr(e,t,{replace:n,ignoreBlocker:r}){if(!m(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var Rr=class extends Error{},zr=class extends Error{};function Br(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Rr(`Async validation not supported`);if(n.issues)throw new Rr(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Vr(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Hr(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!te.call(e,t[1]))}var Ur=Object.freeze({});function Wr(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Br(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Gr(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=v(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function Kr(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return re}function qr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Jr(e,t){return e.options[t]?.preload?.()}function Yr(e,t){let n=Jr(e,`component`),r=Jr(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Xr(e,t,n){let r=()=>t===!1?void 0:t?Jr(e,t):Yr(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Zr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Qr(e){let t=e.length;for(let n=0;n<t;n++){let r=e[n];if(r._assetEnd!==void 0){t=Math.min(t,Math.max(n+1,r._assetEnd));continue}if(r.status!==`success`||r._notFound){t=n+1;break}}return t<e.length?e.slice(0,t):e}var $r=0,ei=1,ti=2,ni=3,ri=[4];
11function ii(e){return typeof e[0]==`number`}function ai(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function oi(e,t){return e.routesById[t.routeId]}function si(e,t,n){return c(e)?[ni,e]:a(e)?(e.routeId||=n,[ti,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[ei,e]):[$r,e]}function ci(e,t){let n=si(t,!0,e.id);if(n[0]!==ei)return n;try{e.options.onError?.(n[1])}catch(t){n=si(t,!0,e.id)}return n}function li(e,t,n,r,i){return i[0].signal.aborted?ri:Ti(e,t,n,ci(n,r),i)}async function ui(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=oi(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return fi(e,r),[i,li(e,t,u,a,n)]}if(c.aborted)return[i,ri];let p=r.paramsError??r.searchError;if(p!==void 0)return fi(e,r),[i,li(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{hi(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?ai(a,c):a);if(c.aborted)return[i,ri];let s=Ti(e,t,u,si(o,!1,u.id),n);if(s[0]!==$r)return fi(e,r),[i,s];r.context={...r.context,...o}}catch(a){return fi(e,r),[i,li(e,t,u,a,n)]}finally{r.status=h,hi(e,r,!1,n[0])}}i()}function di(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function fi(e,t){let n=t._flight;t._flight=void 0,di(e,t,n)?.abort()}function pi(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=di(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function mi(e){for(let t of e){let e=t._flight;e&&e[2]++}}function hi(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function gi(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function _i(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return ri;if(!i)return[$r,void 0];let l=n._flight;hi(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(gi(e,t,n,r,s,a,!!o[3]))).then(e=>si(e,!1,r.id),e=>si(e,!0,r.id)).then(t=>(t[0]!==$r&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===ei&&l[2]?ci(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Ti(e,t,r,await ai(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return fi(e,n),ri}finally{hi(e,n,!1,s)}}function vi(e,t,n){t[0]!==ni&&(e.status=`success`,e.error=void 0,t[0]===$r?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function yi(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&fi(e,r)}function bi(e,t){return t[0]===ei||t[0]===ti?{...e,status:t[0]===ei?`error`:`notFound`,error:t[1],_flight:void 0}:e}function xi(e,t,n,r,i,a,o){let s=t[1][n],c=oi(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(gi(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=ri)),!p)if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>
11e.routeId===s.routeId&&e.id!==s.id)))}}catch(n){s.invalid=!0,fi(e,s),p=li(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!!(m&&f&&s.status===`success`&&!l&&!a[4]&&((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)!==`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,di(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?_i(e,t,s,c,g,i,a).then(t=>(vi(s,t,l),t[0]===$r&&(m&&!a[0].signal.aborted&&yi(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[$r,s.loaderData]),T=(async()=>{try{let e=Xr(c,void 0,C);e&&await ai(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,li(e,t,c,r,a)]}let r=await w;x&&r[0]===$r&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>bi(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=_i(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,vi(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>bi(E,e))}async function Si(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=oi(e,t[n]);try{let e=Xr(i,!1);e&&await ai(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Ci(e,t){t[2]&&=(pi(e,t[2].map(e=>e[3])),void 0)}async function wi(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=ni)throw[a,t];!i&&t[0]!==$r&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===ni)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Ti(e,t,n,r,i,a){for(;r[0]===ni;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[ni,t]:[ni,t,a]}return[ni,o,n]}catch(e){r=a?[ei,e]:ci(n,e),a=!0}}return r}async function Ei(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===ti?Si(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=ni)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==$r&&t[0]<ni&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=ni){let n=s[1];if(n[0]!==ni||n[1].options.reloadDocument||n[2])return Ci(e,t),n;c=!0,s=[0,[ei,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>
11{i&&(u._notFound=void 0,l===ei?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=oi(e,u);try{await ai(i?Promise.resolve().then(()=>Xr(m,l===ei?`errorComponent`:`notFoundComponent`)):Promise.all([Xr(m),Xr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Ci(e,t),ri}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Ci(e,t),pi(e,o),p()):u.status=`success`}return t}async function Di(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=oi(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await ai(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Oi(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Si(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=xi(e,i,t,u,f,r,l)},m=await ui(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===ti){let t=await Si(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=ni&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Ei(e,i,u,r[0],wi(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=wi(i[2],void 0,void 0,h.then(e=>ii(e)?0:Zr(n).length,()=>0))),o=await h}catch(t){if(Ci(e,i),t===a&&a.aborted)return ri;throw t}return ii(o)?o:Di(e,o,a,r[6]===n.length?r[6]:0)}function ki(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=oi(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>ki(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Ai(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function ji(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Zr(t[3]).some(e=>e.id===n[1]))return;let i;try{await ai(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Mi(e,t){e._committed=t,e.stores.setMatches(t)}function Ni(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Zr(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=oi(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Pr(n);Mi(e,n),pi(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Fr(e,i,n,a,l,t)}async function Pi(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function z(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Fi(e,t,n,r,i){let a=n.map(e=>({...e}));mi(a);for(let t of r)fi(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Ei(e,o,r,t[0],i)}catch(t){throw pi(e,a),t}if(ii(s)){pi(e,a),s[0]===ni&&e._tx===t&&e._committed===n&&await z(e,t,s);return}if(await Di(e,s,t[0].signal),e._tx!==t||e._committed!==n){pi(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),fi(e,n))}Mi(e,a),pi(e,n,a)}async function Ii(e,t,n,r,i,a){let o=await Oi(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(ii(o)){let n=o[0]===ni&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Ai(e,t),pi(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Ai(e,t);return}await z(e,t,o);return}let s=o[1];if(e._tx===t&&await ji(e,t),e._tx!==t){Ai(e,t),pi(e,s),Ci(e,o);return}let c=t[2],l=Mr(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>
11{if(e._tx===t&&await ji(e,t),e._tx!==t){Ai(e,t),pi(e,s),Ci(e,o);return}let n=await e.startTransition(()=>{Ai(e,t),Ni(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){Ci(e,o);return}u?.length&&Fi(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function Li(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Mr(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Pi(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});mi(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){pi(e,m),await Pi(e,n);return}e._preflight=void 0;let g,_=()=>Ii(e,y,f,()=>ki(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>Pi(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&hi(e,t,!1)}n[0].abort(),pi(e,n[3],y[3],!0)}if(e._tx!==y){pi(e,y[3]),y[3]=[],g?.(),await Pi(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&ki(e,y),g?.(_()),await y[5]}async function Ri(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,o,s,c;try{try{o=e.matchRoutes(n,{_controller:i}),mi(o),s=(e._preloads??=new Map).set(i,o),c=await Oi(e,n,o,[i,t,r,!0])}finally{s&&(s=s.delete(i),pi(e,o)),i.abort()}if(!ii(c))return c[1];if(!s||c.length<3)return;n=c[2]}catch(e){a(e)||console.error(e);return}}}async function zi(e){let t=window.$_TSR,n=e.options.serializationAdapters;n?.length&&(t.t=new Map(n.map(e=>[e.key,e.fromSerializable])),t.buffer.forEach(e=>e())),t.initialized=!0;let r=t.router;e.ssr={manifest:r.manifest},e.options.ssr={nonce:document.querySelector(`meta[property="csp-nonce"]`)?.content};let i=r.matches,a=new AbortController,o=e._preflight;e._preflight=a,o?.abort();let s=()=>e._preflight===a,c,l,u,d;try{if(await ai(e.options.hydrate?.(r.dehydratedData),a.signal),!s())return;let t=e.history.location;u=t.href,d=t.state,e.updateLatestLocation(),c=e.latestLocation,e.stores.location.set(c),l=e.matchRoutes(c,{_controller:a})}catch(t){if(s()&&(e._preflight=void 0),a.abort(t),t!==a.signal)throw t}if(!s())return;let f=[],p,m=0,h=t=>{m=Math.min(m,t+1);let n=f.splice(t);for(let t of n)oi(e,t).options.loader&&(t.status===`success`||!t.invalid&&`loaderData`in t)&&yi(e,{...t,status:`success`,error:void 0,preload:!0},e._cache.get(t.id));pi(e,n)},g=i.length>l.length?l.findIndex(e=>e._notFound)+1:i.length,_=!1;for(let t=0;t<g;t++){let n=l[t],r=i[t];if(typeof r.i!=`string`||Cn(r.i)!==n.id){p??=t;break}m=t+1;let a=oi(e,n);if((`l`in r||r.s===`success`&&r.e===void 0&&a.options.loader)&&(n.loaderData=r.l),n.status=r.s,n.ssr=r.ssr,a.options.ssr=n.ssr,n.updatedAt=r.u,n.error=r.e,n._notFound||=r.g,n.status===`error`||n.status===`notFound`||n._notFound){_=!0,f.push(n),(n.ssr===!1||n.ssr===`data-only`)&&(p??=t);break}if(n.status===`pending`){p??=t;break}f.push(n),n.ssr===`data-only`&&(p??=t)}!_&&f.length===g&&g<l.length&&(p=g);let v=f.map(async t=>{try{let n=oi(e,t);return await(t._notFound?Promise.all([Xr(n),Xr(n,`notFoundComponent`)]):Xr(n,t.status===`error`?`errorComponent`:t.status===`notFound`?`notFoundComponent`:void 0)),!0}catch{return!1}}),y=0;try{for(;y<v.length&&await ai(v[y],a.signal);)y++}catch{return}if(!s())return;y<f.length&&h(y);let b=Math.max(p===f.length?f.length+1:f.length,y<v.length?y:m);for(let t=0;t<b;t++){let n=l[t],r=oi(e,n),o=l[t-1]?.context??e.options.context??{},u;if(r.options.context){try{u=n._ctx=r.options.context({deps:n.loaderDeps,params:n.params,context:o,location:c,navigate:t=>e.navigate({...t,_fromLocation:c}),buildLocation:e.buildLocation,cause:n.cause,abortController:a,preload:!1,matches:l,routeId:r.id})||{}}catch{if(!s())return;if(n.status!==`error`&&n.status!==`notFound`&&!n._notFound){p=Math.min(p??t,t),h(t);break}}if(!s())return}n.context={...o,...u,...f[t]&&i[t].b}}if(await Di(e,[c,l],a.signal,0,m),!s())return;let x=p!==void 0||f.length<g,S=_&&f.length===g?l:f,C=x?l:S,w;if(x&&p!==void 0){let e=C[p];w=e.ssr===`data-only`&&m>p+1?m:void 0,C=C.slice(),C[p]={...e,status:`pending`,ssr:e.ssr===`data-only`?`data-only`:!1,_assetEnd:w}}let T=()=>{let t=e.history.location;return x&&!e._tx&&t.href===u&&t.state===d&&e._committed===S&&S.length&&!a.signal.aborted?a:void 0},E=[T,t=>{if(e._handoff!==E)return;e._handoff=void 0;let n=S.length;if(!t||!T()||S.some((e,n)=>e.id!==t[n]?.id)){a.abort();return}let r=w;if(r!==void 0){for(let e=n;e<r;e++)if(l[e]?.id!==t[e]?.id){r=e>p+1?e:void 0;break}}let i=S.map(e=>({...e}));r!==void 0&&(i[p]._assetEnd=r),pi(e,t.splice(0,n,...i));for(let e=n;e<t.length;e++){let n=t[e],r=l[e];r?.id===n.id&&r._ctx&&(n._ctx=r._ctx),n.abortController=a}return n}];e._committed=S,e._lifecycleEnd=Pr(S),e._handoff=E,e._preflight=void 0,e.batch(()=>{e.stores.setMatches(C),e.stores.status.set(`idle`),x||e.stores.resolvedLocation.set(e.stores.location.get())})}var Bi=Symbol.asyncIterator,Vi=Symbol.hasInstance,Hi=Symbol.isConcatSpreadable,Ui=Symbol.iterator,Wi=Symbol.match,Gi=Symbol.matchAll,Ki=Symbol.replace,qi=Symbol.search,Ji=Symbol.species,Yi=Symbol.split,Xi=Symbol.toPrimitive,Zi=Symbol.toStringTag,Qi=Symbol.unscopables,$i={[Bi]:0,[Vi]:1,[Hi]:2,[Ui]:3,[Wi]:4,[Gi]:5,[Ki]:6,[qi]:7,[Ji]:8,[Yi]:9,[Xi]:10,[Zi]:11,[Qi]:12}
11,ea={0:Bi,1:Vi,2:Hi,3:Ui,4:Wi,5:Gi,6:Ki,7:qi,8:Ji,9:Yi,10:Xi,11:Zi,12:Qi},ta={2:!0,3:!1,1:void 0,0:null,4:-0,5:1/0,6:-1/0,7:NaN},na={0:`Error`,1:`EvalError`,2:`RangeError`,3:`ReferenceError`,4:`SyntaxError`,5:`TypeError`,6:`URIError`},ra={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function ia(e,t,n,r,i,a,o,s,c,l,u,d){return{t:e,i:t,s:n,c:r,m:i,p:a,e:o,a:s,f:c,b:l,o:u,l:d}}function aa(e){return ia(2,void 0,e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}var oa=aa(2),sa=aa(3),ca=aa(1),la=aa(0),ua=aa(4),da=aa(5),fa=aa(6),pa=aa(7),ma=64,ha=/[\x00-\x07\x0b\x0e-\x1f<\u2028\u2029\ud800-\udfff]/;function ga(e){switch(e){case`"`:return`\\"`;case`\\`:return`\\\\`;case` 12`:return`\\n`;case`\r`:return`\\r`;case`\b`:return`\\b`;case` `:return`\\t`;case`\f`:return`\\f`;case`<`:return`\\x3C`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:return}}function _a(e){if(e.length>=ma&&!ha.test(e))return JSON.stringify(e).slice(1,-1);let t=``,n=0,r;for(let i=0,a=e.length;i<a;i++)r=ga(e[i]),r&&(t+=e.slice(n,i)+r,n=i+1);return n===0?t=e:t+=e.slice(n),t}function va(e){switch(e){case`\\\\`:return`\\`;case`\\"`:return`"`;case`\\n`:return` 13`;case`\\r`:return`\r`;case`\\b`:return`\b`;case`\\t`:return` `;case`\\f`:return`\f`;case`\\x3C`:return`<`;case`\\u2028`:return`\u2028`;case`\\u2029`:return`\u2029`;default:return e}}function ya(e){return typeof e==`string`&&!e.includes(`\\`)?e:e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,va)}var{toString:ba}=Object.prototype,xa={parsing:1,serialization:2,deserialization:3};function Sa(e){return`Seroval Error (step: ${xa[e]})`}var Ca=(e,t)=>Sa(e),wa=class extends Error{constructor(e,t){super(Ca(e,t)),this.cause=t}},Ta=class extends wa{constructor(e){super(`parsing`,e)}},Ea=class extends wa{constructor(e){super(`deserialization`,e)}};function Da(e){return`Seroval Error (specific: ${e})`}var Oa=class extends Error{constructor(e){super(Da(1)),this.value=e}},ka=class extends Error{constructor(e){super(Da(2))}},Aa=class extends Error{constructor(e){super(Da(3))}},ja=class extends Error{constructor(e){super(Da(4))}},Ma=class extends Error{constructor(e){super(Da(5)),this.value=e}},Na=class extends Error{constructor(e){super(Da(6))}},Pa=class extends Error{constructor(e){super(Da(7))}},Fa=class extends Error{constructor(e){super(Da(8))}},Ia=class extends Error{constructor(e){super(Da(9))}},La=`__SEROVAL_REFS__`,Ra=new Map,za=new Map;function Ba(e){return Ra.has(e)}function Va(e){return za.has(e)}function Ha(e){if(Ba(e))return Ra.get(e);throw new Ma(e)}function Ua(e){if(Va(e))return za.get(e);throw new Na(e)}typeof globalThis<`u`?Object.defineProperty(globalThis,La,{value:za,configurable:!0,writable:!1,enumerable:!1}):typeof window<`u`?Object.defineProperty(window,La,{value:za,configurable:!0,writable:!1,enumerable:!1}):typeof self<`u`?Object.defineProperty(self,La,{value:za,configurable:!0,writable:!1,enumerable:!1}):typeof global<`u`&&Object.defineProperty(global,La,{value:za,configurable:!0,writable:!1,enumerable:!1});function Wa(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function Ga(e){let t=na[Wa(e)];return e.name===t?e.constructor.name===t?{}:{name:e.constructor.name}:{name:e.name}}function Ka(e,t){let n=Ga(e),r=Object.getOwnPropertyNames(e);for(let i=0,a=r.length,o;i<a;i++)o=r[i],o!==`name`&&o!==`message`&&(o===`stack`?t&4&&(n||={},n[o]=e[o]):(n||={},n[o]=e[o]));return n}function qa(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:+!Object.isExtensible(e)}function Ja(e){switch(e){case 1/0:return da;case-1/0:return fa}return e===e?Object.is(e,-0)?ua:ia(0,void 0,e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0):pa}function Ya(e){return ia(1,void 0,_a(e),void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function Xa(e){return ia(3,void 0,``+e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function Za(e){return ia(4,e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function Qa(e,t){let n=t.valueOf();return ia(5,e,n===n?t.toISOString():``,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function $a(e,t,n){return ia(36,e,n.toString(),t,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function eo(e,t){return ia(6,e,void 0,_a(t.source),t.flags,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function to(e,t){return ia(17,e,$i[t],void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function no(e,t){return ia(18,e,_a(Ha(t)),void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function ro(e,t,n){return ia(25,e,n,_a(t),void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function io(e,t,n){return ia(9,e,void 0,void 0,void 0,void 0,void 0,n,void 0,void 0,qa(t),void 0)}function ao(e,t){return ia(21,e,void 0,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0)}var oo=1e6;function so(e,t,n){if(t.length>
13oo)throw new Oa(t);return ia(15,e,void 0,t.constructor.name,void 0,void 0,void 0,void 0,n,t.byteOffset,void 0,t.length)}function co(e,t,n){if(t.length>oo)throw new Oa(t);return ia(16,e,void 0,t.constructor.name,void 0,void 0,void 0,void 0,n,t.byteOffset,void 0,t.length)}function lo(e,t,n){if(t.byteLength>oo)throw new Oa(t);return ia(20,e,void 0,void 0,void 0,void 0,void 0,void 0,n,t.byteOffset,void 0,t.byteLength)}function uo(e,t,n){return ia(13,e,Wa(t),void 0,_a(t.message),n,void 0,void 0,void 0,void 0,void 0,void 0)}function fo(e,t,n){return ia(14,e,Wa(t),void 0,_a(t.message),n,void 0,void 0,void 0,void 0,void 0,void 0)}function po(e,t){return ia(7,e,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0,void 0)}function B(e,t){return ia(28,void 0,void 0,void 0,void 0,void 0,void 0,[e,t],void 0,void 0,void 0,void 0)}function mo(e,t){return ia(30,void 0,void 0,void 0,void 0,void 0,void 0,[e,t],void 0,void 0,void 0,void 0)}function ho(e,t,n){return ia(31,e,void 0,void 0,void 0,void 0,void 0,n,t,void 0,void 0,void 0)}function go(e,t){return ia(32,e,void 0,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0)}function _o(e,t){return ia(33,e,void 0,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0)}function vo(e,t){return ia(34,e,void 0,void 0,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0)}function yo(e,t,n,r){return ia(35,e,n,void 0,void 0,void 0,void 0,t,void 0,void 0,void 0,r)}var bo=class{constructor(e,t){this.value=e,this.replacement=t}},xo=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,n)=>{e.s=t,e.f=n}),e},So=e=>t=>()=>{let n=0,r={[e](){return r},next(){if(n>t.d)return{done:!0,value:void 0};let e=n++,r=t.v[e];if(e===t.t)throw r;return{done:e===t.d,value:r}}};return r},Co=(e,t)=>n=>()=>{let r=0,i=-1,a=!1,o=[],s=[],c={finalize(e=0,t=s.length){for(;e<t;e++)s[e].s({done:!0,value:void 0})}};n.on({next(e){let t=s.shift();t&&t.s({done:!1,value:e}),o.push(e)},throw(e){let t=s.shift();t&&t.f(e),c.finalize(),i=o.length,a=!0,o.push(e)},return(e){let t=s.shift();t&&t.s({done:!0,value:e}),c.finalize(),i=o.length,o.push(e)}});let l={[e](){return l},next(){if(i===-1){let e=r++;if(e>=o.length){let e=t();return s.push(e),e.p}return{done:!1,value:o[e]}}if(r>i)return{done:!0,value:void 0};let e=r++,n=o[e];if(e!==i)return{done:!1,value:n};if(a)throw n;return{done:!0,value:n}}};return l},wo=e=>{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer},To=class{constructor(e,t,n){this.v=e,this.t=t,this.d=n}};function Eo(e){return e instanceof To}function Do(e,t,n){return new To(e,t,n)}function Oo(e){let t=[],n=-1,r=-1,i=e[Ui]();for(;;)try{let e=i.next();if(t.push(e.value),e.done){r=t.length-1;break}}catch(e){n=t.length,r=n,t.push(e);break}return Do(t,n,r)}var ko=So(Ui);function Ao(e){return ko(e)}var jo={},Mo={},No={0:{},1:{},2:{},3:{},4:{},5:{}};function Po(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function Fo(e,t){Po(e,t),t.add(e)}function Io(e,t,n){Po(e,t),t.set(e,n)}function Lo(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function V(e,t){return e.get(Lo(e,t))}function Ro(e,t,n){return e.set(Lo(e,t),n),n}var zo=new WeakMap,Bo=new WeakMap,Vo=new WeakMap,Ho=new WeakMap,Uo=new WeakMap,Wo=new WeakSet,Go=class{constructor(){Fo(this,Wo),Io(this,zo,[]),Io(this,Bo,[]),Io(this,Vo,!0),Io(this,Ho,!1),Io(this,Uo,0)}on(e){let t=V(Vo,this),n=0;if(t){for(;n<V(Uo,this)&&V(Bo,this)[n];n++);if(n===V(Uo,this)){var r;Ro(Uo,this,(r=V(Uo,this),r++,r))}V(Bo,this)[n]=e}return Lo(Wo,this,qo).call(this,e),()=>{if(V(Vo,this)&&t){for(t=!1,V(Bo,this)[n]=void 0;V(Uo,this)>0&&!V(Bo,this)[V(Uo,this)-1];){var e;Ro(Uo,this,(e=V(Uo,this),e--,e))}V(Bo,this).length=V(Uo,this)}}}next(e){V(Vo,this)&&(V(zo,this).push(e),Lo(Wo,this,Ko).call(this,e,`next`))}throw(e){V(Vo,this)&&(V(zo,this).push(e),Lo(Wo,this,Ko).call(this,e,`throw`),Ro(Vo,this,!1),Ro(Ho,this,!1),V(Bo,this).length=0)}return(e){V(Vo,this)&&(V(zo,this).push(e),Lo(Wo,this,Ko).call(this,e,`return`),Ro(Vo,this,!1),Ro(Ho,this,!0),V(Bo,this).length=0)}};function Ko(e,t){for(let r=0;r<V(Uo,this);r++){var n;(n=V(Bo,this)[r])==null||n[t](e)}}function qo(e){for(let t=0,n=V(zo,this).length;t<n;t++){let r=V(zo,this)[t];
13!V(Vo,this)&&t===n-1?e[V(Ho,this)?`return`:`throw`](r):e.next(r)}}function Jo(e){return e instanceof Go}function Yo(){return new Go}function Xo(e,t){let n=Yo(),r=e[Bi](),i=!1,a=!1;t?.push(()=>{a||i||(i=!0,Promise.resolve().then(()=>r.return?.call(r)).catch(()=>{}))});async function o(){try{for(;!i;){let e=await r.next();if(i)return;if(e.done){a=!0,n.return(e.value);break}n.next(e.value)}}catch(e){a=!0,i||n.throw(e)}}return o().catch(()=>{}),n}var Zo=Co(Bi,xo);function Qo(e){return Zo(e)}async function $o(e){try{return[1,await e]}catch(e){return[0,e]}}function es(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:127^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3,compactArrayBufferViews:t.compactArrayBufferViews??!1}}function ts(e,t){e.marked.add(t)}function ns(e,t){let n=e.refs.size;return e.refs.set(t,n),n}function rs(e,t){let n=e.refs.get(t);return n==null?{type:0,value:ns(e,t)}:(ts(e,n),{type:1,value:Za(n)})}function is(e,t){let n=rs(e,t);return n.type===1?n:Ba(t)?{type:2,value:no(n.value,t)}:n}function as(e,t){let n=is(e,t);if(n.type!==0)return n.value;if(t in $i)return to(n.value,t);throw new Oa(t)}function os(e,t){let n=rs(e,No[t]);return n.type===1?n.value:ia(26,n.value,t,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function ss(e){let t=rs(e,jo);return t.type===1?t.value:ia(27,t.value,void 0,void 0,void 0,void 0,void 0,void 0,as(e,Ui),void 0,void 0,void 0)}function cs(e){let t=rs(e,Mo);return t.type===1?t.value:ia(29,t.value,void 0,void 0,void 0,void 0,void 0,[os(e,1),as(e,Bi)],void 0,void 0,void 0,void 0)}function ls(e,t,n,r){return ia(n?11:10,e,void 0,void 0,void 0,r,void 0,void 0,void 0,void 0,qa(t),void 0)}function us(e,t,n,r){return ia(8,t,void 0,void 0,void 0,void 0,{k:n,v:r},void 0,os(e,0),void 0,void 0,void 0)}function ds(e,t){if(!e.compactArrayBufferViews)return t;let n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength).slice().buffer,r=t.constructor;return new r(n)}function fs(e){if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=new Uint8Array(e);if(typeof t.toBase64==`function`)return t.toBase64();let n=``;for(let e=0,r=t.length;e<r;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function ps(e,t,n){return ia(19,t,fs(n),void 0,void 0,void 0,void 0,void 0,os(e,5),void 0,void 0,void 0)}function ms(e,t){return{base:es(e,t),child:void 0}}var hs=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return Fs(this._p,this.depth,e)}};async function gs(e,t,n){let r=[];for(let i=0,a=n.length;i<a;i++)i in n?r[i]=await Fs(e,t,n[i]):r[i]=0;return r}async function _s(e,t,n,r){return io(n,r,await gs(e,t,r))}async function vs(e,t,n){let r=Object.entries(n),i=[],a=[];for(let n=0,o=r.length;n<o;n++)i.push(_a(r[n][0])),a.push(await Fs(e,t,r[n][1]));return Ui in n&&(i.push(as(e.base,Ui)),a.push(B(ss(e.base),await Fs(e,t,Oo(n))))),Bi in n&&(i.push(as(e.base,Bi)),a.push(mo(cs(e.base),await Fs(e,t,Xo(n))))),Zi in n&&(i.push(as(e.base,Zi)),a.push(Ya(n[Zi]))),Hi in n&&(i.push(as(e.base,Hi)),a.push(n[Hi]?oa:sa)),{k:i,v:a}}async function ys(e,t,n,r,i){return ls(n,r,i,await vs(e,t,r))}async function bs(e,t,n,r){return ao(n,await Fs(e,t,r.valueOf()))}async function xs(e,t,n,r){return r=ds(e.base,r),so(n,r,await Fs(e,t,r.buffer))}async function Ss(e,t,n,r){return r=ds(e.base,r),co(n,r,await Fs(e,t,r.buffer))}async function Cs(e,t,n,r){return r=ds(e.base,r),lo(n,r,await Fs(e,t,r.buffer))}async function ws(e,t,n,r){let i=Ka(r,e.base.features);return uo(n,r,i?await vs(e,t,i):void 0)}async function Ts(e,t,n,r){let i=Ka(r,e.base.features);return fo(n,r,i?await vs(e,t,i):void 0)}async function Es(e,t,n,r){let i=[],a=[];for(let[n,o]of r.entries())i.push(await Fs(e,t,n)),a.push(await Fs(e,t,o));return us(e.base,n,i,a)}async function Ds(e,t,n,r){let i=[];for(let n of r.keys())i.push(await Fs(e,t,n));return po(n,i)}async function Os(e,t,n,r){let i=e.base.plugins;if(i)for(let a=0,o=i.length;a<o;a++){let o=i[a];if(o.parse.async&&o.test(r))return ro(n,o.tag,await o.parse.async(r,new hs(e,t),{id:n}))}}async function ks(e,t,n,r){let[i,a]=await $o(r);return ia(12,n,i,void 0,void 0,void 0,void 0,void 0,await Fs(e,t,a),void 0,void 0,void 0)}function As(e,t,n,r,i){let a=[],o=n.on({next:n=>{ts(this.base,t),Fs(this,e,n).then(e=>{a.push(go(t,e))},e=>{i(e),o()})},throw:n=>{ts(this.base,t),Fs(this,e,n).then(e=>{a.push(_o(t,e)),r(a),o()},e=>{i(e),o()})},return:n=>{ts(this.base,t),Fs(this,e,n).then(e=>{a.push(vo(t,e)),r(a),o()},e=>{i(e),o()})}})}async function js(e,t,n,r){return ho(n,os(e.base,4),await new Promise(As.bind(e,t,n,r)))}async function Ms(e,t,n,r){let i=[];for(let n=0,a=r.v.length;n<a;n++)i[n]=await Fs(e,t,r.v[n]);return yo(n,i,r.t,r.d)}async function Ns(e,t,n,r){if(Array.isArray(r))return _s(e,t,n,r);if(Jo(r))return js(e,t,n,r);if(Eo(r))return Ms(e,t,n,r);let i=r.constructor;if(i!==void 0&&typeof i!=`function`){let e=Object.getPrototypeOf(r);i=e===null?void 0:e.constructor}if(i===bo)return Fs(e,t,r.replacement);
13let a=await Os(e,t,n,r);if(a)return a;switch(i){case Object:return ys(e,t,n,r,!1);case void 0:return ys(e,t,n,r,!0);case Date:return Qa(n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return ws(e,t,n,r);case Number:case Boolean:case String:case BigInt:return bs(e,t,n,r);case ArrayBuffer:return ps(e.base,n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return xs(e,t,n,r);case DataView:return Cs(e,t,n,r);case Map:return Es(e,t,n,r);case Set:return Ds(e,t,n,r)}if(i===Promise||r instanceof Promise)return ks(e,t,n,r);let o=e.base.features;if(o&32&&i===RegExp)return eo(n,r);if(o&16)switch(i){case BigInt64Array:case BigUint64Array:return Ss(e,t,n,r)}if(o&1&&typeof AggregateError<`u`&&(i===AggregateError||r instanceof AggregateError))return Ts(e,t,n,r);if(o&64&&typeof Temporal<`u`)switch(i){case Temporal.Instant:return $a(n,0,r);case Temporal.Duration:return $a(n,1,r);case Temporal.PlainDate:return $a(n,2,r);case Temporal.PlainDateTime:return $a(n,3,r);case Temporal.PlainMonthDay:return $a(n,4,r);case Temporal.PlainTime:return $a(n,5,r);case Temporal.PlainYearMonth:return $a(n,6,r);case Temporal.ZonedDateTime:return $a(n,7,r)}if(r instanceof Error)return ws(e,t,n,r);if(Ui in r||Bi in r)return ys(e,t,n,r,!!i);throw new Oa(r)}async function Ps(e,t,n){let r=is(e.base,n);if(r.type!==0)return r.value;let i=await Os(e,t,r.value,n);if(i)return i;throw new Oa(n)}async function Fs(e,t,n){if(t>=e.base.depthLimit)throw new Ia(e.base.depthLimit);switch(typeof n){case`boolean`:return n?oa:sa;case`undefined`:return ca;case`string`:return Ya(n);case`number`:return Ja(n);case`bigint`:return Xa(n);case`object`:if(n){let r=is(e.base,n);return r.type===0?await Ns(e,t+1,r.value,n):r.value}return la;case`symbol`:return as(e.base,n);case`function`:return Ps(e,t,n);default:throw new Oa(n)}}async function Is(e,t){try{return await Fs(e,0,t)}catch(e){throw e instanceof Ta?e:new Ta(e)}}function Ls(e){return e}function Rs(e,t){for(let n=0,r=t.length;n<r;n++){let r=t[n];e.has(r)||(e.add(r),r.extends&&Rs(e,r.extends))}}function zs(e){if(e){let t=new Set;return Rs(t,e),[...t]}}function Bs(e){switch(e){case`Int8Array`:return Int8Array;case`Int16Array`:return Int16Array;case`Int32Array`:return Int32Array;case`Uint8Array`:return Uint8Array;case`Uint16Array`:return Uint16Array;case`Uint32Array`:return Uint32Array;case`Uint8ClampedArray`:return Uint8ClampedArray;case`Float32Array`:return Float32Array;case`Float64Array`:return Float64Array;case`BigInt64Array`:return BigInt64Array;case`BigUint64Array`:return BigUint64Array;default:throw new Pa(e)}}function Vs(e){switch(e){case`constructor`:case`__proto__`:case`prototype`:case`__defineGetter__`:case`__defineSetter__`:case`__lookupGetter__`:case`__lookupSetter__`:return!1;default:return!0}}function Hs(e){switch(e){case Bi:case Hi:case Zi:case Ui:return!0;default:return!1}}var Us=1e6,Ws=512,Gs=1e4,Ks=2e4;function qs(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var Js=1e3;function Ys(e,t){let n=t.maxBase64Length??Us;if(!Number.isSafeInteger(n)||n<0)throw RangeError(`maxBase64Length must be a non-negative safe integer`);let r=t.refs||new Map;return`types`in r||Object.assign(r,{types:new Map}),{mode:e,plugins:t.plugins,refs:r,features:t.features??127^(t.disabledFeatures||0),depthLimit:t.depthLimit||Js,maxBase64Length:n}}function Xs(e){return{mode:2,base:Ys(2,e),child:void 0}}var Zs=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return zc(this._p,this.depth,e)}};function Qs(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new Fa({t:4,i:t});if(e.refs.has(t))throw Error(`Conflicted ref id: `+t)}function $s(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&`then`in e&&typeof e.then==`function`}function ec(e,t,n){return Qs(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,n),n}function tc(e,t,n){return Qs(e.base,t),e.base.refs.set(t,n),n}function nc(e,t,n){return e.mode===1?ec(e,t,n):tc(e,t,n)}
13function rc(e,t,n){if(Object.hasOwn(t,n))return t[n];throw new Fa(e)}function ic(e,t){return nc(e,t.i,Ua(ya(t.s)))}function ac(e,t){if(!Array.isArray(t))throw new Fa(e)}function oc(e,t,n){let r=n.a;ac(n,r);let i=r.length,a=nc(e,n.i,Array(i));for(let n=0,o;n<i;n++)o=r[n],o&&(a[n]=zc(e,t,o));return qs(a,n.o),a}function sc(e,t,n){Vs(t)?e[t]=n:Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function cc(e,t,n,r,i){if(typeof r==`string`)sc(n,ya(r),zc(e,t,i));else{let a=zc(e,t,r);switch(typeof a){case`string`:sc(n,a,zc(e,t,i));break;case`symbol`:Hs(a)&&(n[a]=zc(e,t,i));break;default:throw new Fa(r)}}}function lc(e,t,n){e.base.refs.types.set(t,n)}function uc(e,t,n,r){if(e.base.refs.types.get(n)!==r)throw new Fa(t)}function dc(e,t,n,r){let i=n.k;if(ac(n,i),ac(n,n.v),i.length>0)for(let a=0,o=n.v,s=i.length;a<s;a++)cc(e,t,r,i[a],o[a]);return r}function fc(e,t,n){let r=nc(e,n.i,n.t===10?{}:Object.create(null));return dc(e,t,n.p,r),qs(r,n.o),r}function pc(e,t){return nc(e,t.i,new Date(t.s))}function mc(e,t){if(!(e.base.features&64))throw new ka(t);let n;switch(t.c){case 0:n=Temporal.Instant.from(t.s);break;case 1:n=Temporal.Duration.from(t.s);break;case 2:n=Temporal.PlainDate.from(t.s);break;case 3:n=Temporal.PlainDateTime.from(t.s);break;case 4:n=Temporal.PlainMonthDay.from(t.s);break;case 5:n=Temporal.PlainTime.from(t.s);break;case 6:n=Temporal.PlainYearMonth.from(t.s);break;case 7:n=Temporal.ZonedDateTime.from(t.s);break;default:throw new Fa(t)}return nc(e,t.i,n)}function hc(e,t){if(e.base.features&32){let n=ya(t.c);if(n.length>Ks)throw new Fa(t);return nc(e,t.i,new RegExp(n,t.m))}throw new ka(t)}function gc(e,t,n){let r=nc(e,n.i,new Set);ac(n,n.a);for(let i=0,a=n.a,o=a.length;i<o;i++)r.add(zc(e,t,a[i]));return r}function _c(e,t,n){let r=nc(e,n.i,new Map);ac(n,n.e.k),ac(n,n.e.v);for(let i=0,a=n.e.k,o=n.e.v,s=a.length;i<s;i++)r.set(zc(e,t,a[i]),zc(e,t,o[i]));return r}function vc(e,t){if(typeof t.s!=`string`)throw new Fa(t);if(t.s.length>e.base.maxBase64Length)throw RangeError(`ArrayBuffer exceeds maxBase64Length (`+e.base.maxBase64Length+`)`);let n=ya(t.s),r;if(n.length<Ws||typeof Buffer>`u`)r=wo(n);else{let e=atob(n);r=new ArrayBuffer(e.length),Buffer.from(r).write(e,`latin1`)}return nc(e,t.i,r)}function yc(e,t,n){let r=Bs(n.c),i=zc(e,t,n.f);if(!(i instanceof ArrayBuffer))throw new Fa(n);let a=n.b??0;if(a<0||a>i.byteLength)throw new Fa(n);return nc(e,n.i,new r(i,a,n.l))}function bc(e,t,n){let r=zc(e,t,n.f);if(!(r instanceof ArrayBuffer))throw new Fa(n);let i=n.b??0;if(i<0||i>r.byteLength)throw new Fa(n);return nc(e,n.i,new DataView(r,i,n.l))}function xc(e,t,n,r){if(n.p){let i=dc(e,t,n.p,{});Object.defineProperties(r,Object.getOwnPropertyDescriptors(i))}return r}function Sc(e,t,n){return xc(e,t,n,nc(e,n.i,AggregateError([],ya(n.m))))}function Cc(e,t,n){let r=rc(n,ra,n.s);return xc(e,t,n,nc(e,n.i,new r(ya(n.m))))}function wc(e,t,n){let r=xo(),i=nc(e,n.i,r.p),a=zc(e,t,n.f);if($s(a))throw new Fa(n.f);return n.s?r.s(a):r.f(a),i}function Tc(e,t,n){return nc(e,n.i,Object(zc(e,t,n.f)))}function Ec(e,t,n){let r=e.base.plugins;if(r){let i=ya(n.c);for(let a=0,o=r.length;a<o;a++){let o=r[a];if(o.tag===i)return nc(e,n.i,o.deserialize(n.s,new Zs(e,t),{id:n.i}))}}throw new Aa(n.c)}function Dc(e,t){let n=nc(e,t.i,nc(e,t.s,xo()).p);return lc(e,t.s,22),n}function Oc(e,t,n){let r=e.base.refs.get(n.i);if(r){uc(e,n,n.i,22);let i=zc(e,t,n.a[1]);if($s(i))throw new Fa(n.a[1]);n.t===23?r.s(i):r.f(i);return}throw new ja(`Promise`)}function kc(e,t,n){zc(e,t,n.a[0]);let r=zc(e,t,n.a[1]);if(!Eo(r))throw new Fa(n.a[1]);return Ao(r)}function Ac(e,t,n){zc(e,t,n.a[0]);let r=zc(e,t,n.a[1]);if(!Jo(r))throw new Fa(n.a[1]);return Qo(r)}function jc(e,t,n){let r=nc(e,n.i,Yo());lc(e,n.i,31);let i=n.a;ac(n,i);let a=i.length;if(a)for(let n=0;n<a;n++)zc(e,t,i[n]);return r}function Mc(e,t,n){let r=e.base.refs.get(n.i);if(r){uc(e,n,n.i,31),r.next(zc(e,t,n.f));return}throw new ja(`Stream`)}function Nc(e,t,n){let r=e.base.refs.get(n.i);if(r){uc(e,n,n.i,31),r.throw(zc(e,t,n.f));return}throw new ja(`Stream`)}function Pc(e,t,n){let r=e.base.refs.get(n.i);if(r){uc(e,n,n.i,31),r.return(zc(e,t,n.f));return}throw new ja(`Stream`)}function Fc(e,t,n){zc(e,t,n.f)}function Ic(e,t,n){zc(e,t,n.a[1])}function Lc(e,t){return Number.isInteger(e)&&e>=-1&&e<t}function Rc(e,t,n){ac(n,n.a);let r=n.a.length;if(!(Lc(n.s,r)&&Lc(n.l,r)))throw new Fa(n);let i=nc(e,n.i,Do([],n.s,n.l));for(let a=0;a<r;a++)i.v[a]=zc(e,t,n.a[a]);return i}
13function zc(e,t,n){if(t>e.base.depthLimit)throw new Ia(e.base.depthLimit);switch(t+=1,n.t){case 2:return rc(n,ta,n.s);case 0:return Number(n.s);case 1:return ya(String(n.s));case 3:if(String(n.s).length>Gs)throw new Fa(n);return BigInt(n.s);case 4:return e.base.refs.get(n.i);case 18:return ic(e,n);case 9:return oc(e,t,n);case 10:case 11:return fc(e,t,n);case 5:return pc(e,n);case 6:return hc(e,n);case 7:return gc(e,t,n);case 8:return _c(e,t,n);case 19:return vc(e,n);case 16:case 15:return yc(e,t,n);case 20:return bc(e,t,n);case 14:return Sc(e,t,n);case 13:return Cc(e,t,n);case 12:return wc(e,t,n);case 17:return rc(n,ea,n.s);case 21:return Tc(e,t,n);case 25:return Ec(e,t,n);case 22:return Dc(e,n);case 23:case 24:return Oc(e,t,n);case 28:return kc(e,t,n);case 30:return Ac(e,t,n);case 31:return jc(e,t,n);case 32:return Mc(e,t,n);case 33:return Nc(e,t,n);case 34:return Pc(e,t,n);case 27:return Fc(e,t,n);case 29:return Ic(e,t,n);case 35:return Rc(e,t,n);case 36:return mc(e,n);default:throw new ka(n)}}function Bc(e,t){try{return zc(e,0,t)}catch(e){throw new Ea(e)}}function Vc(e,t){let n=zs(t.plugins);return Bc(Xs({maxBase64Length:t.maxBase64Length,plugins:n,refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures,depthLimit:t.depthLimit}),e)}async function Hc(e,t={}){let n=zs(t.plugins),r=ms(1,{compactArrayBufferViews:t.compactArrayBufferViews,plugins:n,disabledFeatures:t.disabledFeatures});return{t:await Is(r,e),f:r.base.features,m:Array.from(r.base.marked)}}function Uc(e){return Ls({tag:`$TSR/t/`+e.key,test:e.test,parse:{sync(t,n){return{v:n.parse(e.toSerializable(t))}},async async(t,n){return{v:await n.parse(e.toSerializable(t))}},stream(t,n){return{v:n.parse(e.toSerializable(t))}}},serialize:void 0,deserialize(t,n){return e.fromSerializable(n.deserialize(t.v))}})}var Wc=Ls({tag:`$TSR/Error`,test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return`new Error(`+t.serialize(e.message)+`)`},deserialize(e,t){return Error(t.deserialize(e.message))}}),Gc=class{constructor(e,t){this.stream=e,this.hint=t?.hint??`binary`}};function Kc(e){let t=[];for(let n=0;n<e.length;n+=32768)t.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(t.join(``))}var qc=new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});function Jc(e){try{return`t`+qc.decode(e)}catch{return`b`+Kc(e)}}function Yc(e,t,n){n?.throwIfAborted();let r=Yo(),i=e.getReader(),a=!0,o=()=>{a=!1,n?.removeEventListener(`abort`,c),i.releaseLock()},s=e=>a?(i.cancel(e).catch(()=>{}),o(),!0):!1,c=()=>{s(n.reason)&&r.throw(n.reason)};return n?.addEventListener(`abort`,c),(async()=>{try{for(;a;){let{done:e,value:n}=await i.read();if(!a)return;if(e){o(),r.return(void 0);return}r.next(t(n))}}catch(e){s(e)&&r.throw(e)}})(),[r,s]}function Xc(e){return Ls({tag:`tss/RawStream`,test:e=>e instanceof Gc,parse:{async:async(t,n)=>{let r=await n.parse(t.hint===`text`),[i]=Yc(t.stream,t.hint===`text`?Jc:Kc,e);return{text:r,stream:await n.parse(i)}}},serialize:void 0,deserialize:void 0})}var Zc=Xc(),Qc={},$c=e=>new ReadableStream({start(t){e.on({next(e){try{t.enqueue(e)}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),el=Ls({tag:`seroval-plugins/web/ReadableStreamFactory`,test(e){return e===Qc},parse:{sync(){return Qc},async async(){return await Promise.resolve(Qc)},stream(){return Qc}},serialize(){return $c.toString()},deserialize(){return Qc}});async function tl(e,t){try{for(;;){let n=await t.read();if(n.done){e.return(n.value),t.releaseLock();break}e.next(n.value)}}catch(n){t.releaseLock(),e.throw(n)}}function nl(e){e.cancel().catch(()=>{}),e.releaseLock()}function rl(e){let t=Yo(),n=e.getReader(),r=nl.bind(null,n);return tl(t,n).catch(r),[t,r]}var il=Ls({tag:`seroval/plugins/web/ReadableStream`,extends:[el],test(e){return typeof ReadableStream>`u`?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(Qc),stream:t.parse(Yo())}},async async(e,t){return{factory:await t.parse(Qc),stream:await t.parse(rl(e)[0])}},stream(e,t){let[n,r]=rl(e);return t.addCleanup(r),{factory:t.parse(Qc),stream:t.parse(n)}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t){let n=t.deserialize(e.stream);if(!n||typeof n!=`object`||!Jo(n))throw Error(`Expected a stream source.`);return $c(n)}});function al(e){return[Wc,e?Xc(e):Zc,il]}[...al()];function ol(e){return Ls({tag:`tss/RawStream`,test:()=>!1,parse:{},serialize:void 0,deserialize(t,n){return e(n.deserialize(t.streamId))}})}function sl(e){return[...(Sn()?.serializationAdapters)?.map(Uc)??[],...e]}function cl(e){return sl(al(e))}var ll=new TextDecoder,ul=new Uint8Array,dl=new ByteLengthQueuingStrategy({highWaterMark:0});function fl(e){let t=e.getReader(),n=new Map,r=0,i,a,o=()=>{i?.(),i=void 0},s=(e,t)=>{let n=e[1];e[1]=!1,n&&(t===1?n.close():n.error(t[0]))},c=new ReadableStream({start(e){a=e},pull:o,cancel(e){let i=[e===void 0?Error(`Framed response cancelled`):e];r=i,o(),t.cancel(e).catch(()=>{});for(let e of n.values())s(e,i)}});function l(e){let t=n.get(e);if(t)return t;if(n.size>=1024)throw Error(`Too many raw streams`);let i,a=[new ReadableStream({start(e){i=e},cancel(){a[1]!==!1&&(a[1]=null)}},dl),i];return n.set(e,a),r!==0&&s(a,r),a}function u(e){if(e===0||e>>>0!==e)throw RangeError(`Invalid raw stream ID`);return l(e)[0]}return(async()=>{let e=ul,o=0;async function c(){for(;o===e.byteLength;){e=ul,o=0;let n=await t.read();if(r!==0||n.done)return!1;e=n.value}return!0}async function u(t,n){if(t===0)return ul;if(!await c()){if(n)return;throw Error(`Incomplete frame`)}if(e.byteLength-o>=t){let n=e.subarray(o,o+t);return o+=t,o===e.byteLength&&(e=ul,o=0),n}let r=new Uint8Array(t),i=0;for(;i<t;){if(!await c())throw Error(`Incomplete frame`);let n=Math.min(t-i,e.byteLength-o);r.set(e.subarray(o,o+n),i),o+=n,i+=n}return o===e.byteLength&&(e=ul,o=0),r}try{for(;r===0;){let e=await u(9,!0);if(r!==0)return;if(!e){for(let e of n.values())if(e[1])throw Error(`Incomplete raw
13stream`);r=1,a.close();return}let t=e[0],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0,c=(e[5]<<24|e[6]<<16|e[7]<<8|e[8])>>>0;if(e=ul,t>3||t===0!=(o===0)||c>16777216||t===2&&c!==0)throw Error(`Invalid frame`);let d=t===0?void 0:l(o);if(d?.[1]===!1)throw Error(`Raw stream already ended`);let f=await u(c);if(r!==0)return;if(!d){let e=ll.decode(f);for(f=ul,a.enqueue(e);r===0&&a.desiredSize<=0;)await new Promise(e=>{i=e});continue}if(t===1){let e=d[1];if(e){if(-e.desiredSize>134217728){e.error(Error(`Raw stream ${o} has too many unread bytes`)),d[1]=null,f=ul;continue}let t=f.byteLength*4<f.buffer.byteLength?f.slice():f;f=ul,e.enqueue(t)}}else s(d,t===2?1:[Error(ll.decode(f))])}}catch(e){if(r===0){let i=[e];r=i,t.cancel(e).catch(()=>{}),a.error(e);for(let e of n.values())s(e,i)}}finally{e=ul,t.releaseLock()}})(),[c,u]}var pl=Symbol.for(`TSR_DEFERRED_PROMISE`);function ml(e,t){let n=e;return n[pl]?n:(n[pl]={status:`pending`},n.then(e=>{n[pl].status=`success`,n[pl].data=e}).catch(e=>{n[pl].status=`error`,n[pl].error={data:(t?.serializeError??jr)(e),__isServerError:!0}}),n)}function hl(e,t){if(e)return typeof e==`string`?e:e[t]}function gl(e){return e?.scriptFormat??`module`}function _l(e,t,n){let r=vl(t),i=hl(n,`script`)??r.crossOrigin;return{...gl(e)===`iife`?{rel:`preload`,as:`script`}:{rel:`modulepreload`},href:r.href,...i?{crossOrigin:i}:{}}}function vl(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function yl(e,t){if(t.length===0)return;if(t.length===1){e.push(t[0]);return}let n=new Set;for(let r of t){let t=JSON.stringify(r);n.has(t)||(n.add(t),e.push(r))}}function bl(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function xl(e,t,n,r){let i=Qr(e),a=[],o=[];for(let e of i)for(let t of Array.isArray(e.scripts)?e.scripts:[]){if(!t)continue;let{children:e,...i}=t;a.push({tag:`script`,attrs:{...i,...r,nonce:n},children:e})}if(t)for(let e of i)for(let r of t.routes[e.routeId]?.scripts??[])o.push({tag:`script`,attrs:{...r.attrs,nonce:n},children:r.children});return[a,o]}function Sl([e,t],n){return n?[...n.before,...e,...t,n.boundary]:[...e,...t]}function Cl(e){return e}var wl;function Tl(e,t,n){try{return Vc(e,t)}catch(e){throw Dl(n),e}}async function El(e){e.length>0&&(await Promise.allSettled(e),e.length=0)}function Dl(e){for(let t of e)t.catch(()=>{});e.length=0}var Ol=Object.prototype.hasOwnProperty;function kl(e){for(let t in e)if(Ol.call(e,t))return!0;return!1}async function Al(e,t,n){wl||=cl();let r=t[0],i=r.fetch??n,a=r.data instanceof FormData,o=new Headers(r.headers);if(o.set(`x-tsr-serverFn`,`true`),a||o.set(`accept`,`${xn}, application/x-ndjson, application/json`),r.method===`GET`){if(a)throw Error(`FormData is not supported with GET requests`);let t=await jl(r);if(t!==void 0){let n=ar({payload:t});e.includes(`?`)?e+=`&${n}`:e+=`?${n}`}}let s;return r.method===`POST`&&(s=await Nl(r),typeof s==`string`&&o.set(`content-type`,`application/json`)),Pl(()=>i(e,{method:r.method,headers:o,signal:r.signal,body:s}))}async function jl(e){let t;return e.data!==void 0&&(t={data:e.data}),e.context&&kl(e.context)&&((t??={}).context=e.context),t?Ml(t,e.signal):void 0}async function Ml(e,t){t?.throwIfAborted();let n;try{n=await Hc(e,{plugins:t?cl(t):wl})}finally{t?.throwIfAborted()}return JSON.stringify(n)}async function Nl(e){if(e.data instanceof FormData){let t;return e.context&&kl(e.context)&&(t=await Ml(e.context,e.signal)),t!==void 0&&e.data.set(vn,t),e.data}return jl(e)}async function Pl(e){let t;try{t=await e()}catch(e){if(e instanceof Response)t=e;else throw e}if(t.headers.get(`x-tss-raw`)===`true`)return t;let n=t.headers.get(`content-type`);if(n||ne(),t.headers.get(`x-tss-serialized`)){let e;if(n.includes(`application/x-tss-framed`)){let r=/;\s*v=(\d+)/.exec(n)?.[1];if(r&&+r!=1)throw Error(`Unsupported framed protocol version ${r}`);if(!t.body)throw Error(`No response body for framed response`);let[i,a]=fl(t.body);e=await Fl(i,[ol(a),...wl])}else if(n.includes(`application/json`)){let n=await t.json(),r=[];e=Tl(n,{plugins:wl},r),await El(r)}if(e||ne(),e instanceof Error)throw e;return e}if(n.includes(`application/json`)){let e=await t.json(),n=o(e);if(n)throw n;if(a(e))throw e;return e}if(!t.ok)throw Error(await t.text());return t}
13async function Fl(e,t){let n=e.getReader(),r={refs:new Map,plugins:t},i=e=>{n.cancel(e).catch(()=>{})},a,o=[];try{let e=await n.read();if(e.done)throw Error(`Stream ended before first object`);a=Tl(JSON.parse(e.value),r,o)}catch(e){throw i(e),n.releaseLock(),e}return(async()=>{let e=[];try{for(;;){let t=await n.read();if(t.done)return;Tl(JSON.parse(t.value),r,e),Dl(e)}}catch(e){i(e),console.error(`Stream processing error:`,e)}finally{n.releaseLock()}})(),await El(o),a}function Il(e){let t=`/_serverFn/`+e;return Object.assign((...e)=>{let n=Sn()?.serverFns?.fetch;return Al(t,e,n??fetch)},{url:t,serverFnMeta:{id:e},[yn]:!0})}var Ll=Cl({key:`$TSS/serverfn`,test:e=>typeof e!=`function`||!(yn in e)?!1:!!e[yn],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>Il(e)}),H=e(n(),1),U=se();function Rl({promise:e}){if(oe)return oe(e);let t=ml(e);if(t[pl].status===`pending`)throw t;if(t[pl].status===`error`)throw t[pl].error;return t[pl].data}function zl(e){let t=(0,U.jsx)(Bl,{...e});return e.fallback?(0,U.jsx)(H.Suspense,{fallback:e.fallback,children:t}):t}function Bl(e){let t=Rl(e);return e.children(t)}var W=class extends H.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?H.createElement(this.props.errorComponent??Vl,{error:e[0],reset:this.reset}):this.props.children}};function Vl({error:e}){let[t,n]=H.useState(!1);return(0,U.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,U.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,U.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,U.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,U.jsx)(`div`,{children:(0,U.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,U.jsx)(`code`,{children:e.message}):null})}):null]})}function G({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function K(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Hl=[],Ul=0,{link:Wl,unlink:Gl,propagate:Kl,checkDirty:ql,shallowPropagate:Jl}=G({update(e){return e._update()},notify(e){Hl[Xl++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,eu(e))}}),Yl=0,Xl=0,Zl,Ql=0;function $l(e){try{++Ql,e()}finally{--Ql||tu()}}function eu(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Gl(n,e)}function tu(){if(!(Ql>0)){for(;Yl<Xl;){let e=Hl[Yl];Hl[Yl++]=void 0,e.notify()}Yl=0,Xl=0}}function nu(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return Zl!==void 0&&Wl(i,Zl,Ul),i._snapshot},subscribe(e){let t=K(e),n={current:!1},r=ru(()=>{i.get(),n.current?(Zl=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Zl,o=t?.compare??Object.is;if(n)Zl=i,++Ul,i.depsTail=void 0;else if(e===void 0)return!1;
13n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Zl=a,n&&(i.flags&=-5),eu(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&ql(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Jl(e)}}else e&32&&(i.flags=e&-33);return Zl!==void 0&&Wl(i,Zl,Ul),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Kl(e),Jl(e),tu())}},i}function ru(e){let t=()=>{let t=Zl;Zl=n,++Ul,n.depsTail=void 0,n.flags=6;try{return e()}finally{Zl=t,n.flags&=-5,eu(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&ql(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,eu(this)}};return t(),n}function q(e){return e=>{let t=j(e);return t.isRoot=!1,t}}function J(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(ee(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(oe)oe(a());else throw a();return H.createElement(r,e)};return o.preload=a,o}function iu(e){let t=fe(),n=`not-found-${ue(t.stores.location,e=>e.pathname)}-${ue(t.stores.status)}`;return(0,U.jsx)(W,{getResetKey:()=>n,onCatch:(t,n)=>{if(a(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(a(t))return e.fallback?.(t);throw t},children:e.children})}function au(){return(0,U.jsx)(`p`,{children:`Not Found`})}function ou(e,t,n){return t.options.notFoundComponent?(0,U.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,U.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,U.jsx)(au,{})}function su(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,U.jsx)(n,{}):null}var cu=(e,t)=>e[0]===t[0]&&e[1]===t[1],lu=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,uu=H.memo(function({routeId:e}){let t=fe();return(0,U.jsx)(du,{router:t,match:ue(t.stores.getMatchStore(e))})});function du({router:e,match:t}){let n=e.routesById[t.routeId],r=su(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,o=n.options.onCatch??e.options.defaultOnCatch,s=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,c=t.ssr===!1||t.ssr===`data-only`,l=lu(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||c)),u=(0,U.jsx)(fu,{match:t});c&&(u=(0,U.jsx)(le,{fallback:r,children:u})),s&&(u=(0,U.jsx)(iu,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return H.createElement(s,e)},children:u})),i&&(u=(0,U.jsx)(W,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(a(e))throw e.routeId??=t.routeId,e;o?.(e,n)},children:u})),l&&(u=(0,U.jsx)(H.Suspense,{fallback:r,children:u}));let d=n.isRoot?n.options.shellComponent:void 0;return(0,U.jsx)(pe.Provider,{value:t.routeId,children:d?(0,U.jsxs)(d,{children:[u,null]}):(0,U.jsxs)(U.Fragment,{children:[u,null]})})}var fu=H.memo(function({match:e}){let t=fe(),n=e.routeId,r=t.routesById[n],i=H.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=H.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,U.jsx)(e,{},i):(0,U.jsx)(pu,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!lu(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return su(t,r)}if(e.status===`notFound`)return ou(t,r,e.error);if(e.status===`error`)throw e.error;return a}),pu=H.memo(function(){let e=fe(),t=H.useContext(pe),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=ue(a,e=>[!!e._notFound,e.error],{compare:cu}),i=ue(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return ou(e,e.routesById[t],r);if(!i)return null;let a=(0,U.jsx)(uu,{routeId:i});return t===`__root__`?(0,U.jsx)(H.Suspense,{fallback:su(e),children:a}):a});function mu(e,t){let n=e[1];e.length=0,n?.(t)}function hu({t:e}){let t=fe(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{mu(n,!1),n.push(i,a),e(t),H.startTransition(r)}),ie(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(h(r.publicHref)!==h(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Mr(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function gu(){let e=fe(),t=e.routesById[re],n=su(e,t),r=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(hu,{t:H.useState()[1]}),e.ssr?(0,U.jsx)(_u,{}):(0,U.jsx)(H.Suspense,{fallback:n,children:(0,U.jsx)(_u,{})})]});return e.options.InnerWrap?(0,U.jsx)(e.options.InnerWrap,{children:r}):r}function _u(){let e=fe(),t=e._rendered,n=ue(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;ie(()=>{t[0]===n&&mu(t,!0)},[t,n]);let a=i?(0,U.jsx)(uu,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,U.jsx)(W,{getResetKey:()=>r,onCatch:void 0,children:a})}var vu=e=>({createMutableStore:nu,createReadonlyStore:nu,batch:$l}),yu=e=>new bu(e),bu=class extends Ir{constructor(e){super(e,vu)}};function xu({router:e,children:t,...n}
13){k(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,U.jsx)(de.Provider,{value:e,children:t});return e.options.Wrap?(0,U.jsx)(e.options.Wrap,{children:r}):r}function Su({router:e,...t}){return(0,U.jsx)(xu,{router:e,...t,children:(0,U.jsx)(gu,{})})}function Cu(e){let t=fe({warn:e?.router===void 0}),n=e?.router||t;return ue(n.stores.__store,me(e,n))}function wu(e,t){if(t)for(let[n,r]of Object.entries(t))n!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&e.setAttribute(n,typeof r==`boolean`?``:String(r))}function Tu(e){let{attrs:t,children:n,nonce:r,preventScriptHoist:i}=e,a=H.useMemo(()=>n===void 0?void 0:{__html:n},[n]);switch(e.tag){case`title`:return(0,U.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,U.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,U.jsx)(`link`,{...t,precedence:t?.precedence??(t?.rel===`stylesheet`?`default`:void 0),nonce:r,suppressHydrationWarning:!0});case`style`:return e.inlineCss,(0,U.jsx)(`style`,{...t,dangerouslySetInnerHTML:a,nonce:r});case`script`:return(0,U.jsx)(Eu,{attrs:t,preventScriptHoist:i,children:n});default:return null}}function Eu({attrs:e,children:t,preventScriptHoist:n}){fe();let r=ce(),i=H.useMemo(()=>t===void 0?void 0:{__html:t},[t]),a=typeof e?.type==`string`&&e.type!==``&&e.type!==`text/javascript`&&e.type!==`module`;if(H.useEffect(()=>{if(!a){if(e?.src){let t=document.createElement(`a`);t.href=e.src;let n=t.href;for(let e of document.scripts)if(e.src===n)return;let r=document.createElement(`script`);return wu(r,e),document.head.appendChild(r),()=>r.remove()}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;for(let e of document.scripts){if(e.hasAttribute(`src`))continue;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;if(e.textContent===t&&i===n&&a===r)return}let i=document.createElement(`script`);return i.textContent=t,wu(i,e),document.head.appendChild(i),()=>i.remove()}}},[e,t,a]),a&&typeof t==`string`)return(0,U.jsx)(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:i});if(!r){if(e?.src)return(0,U.jsx)(`script`,{...e,suppressHydrationWarning:!0});if(typeof t==`string`)return(0,U.jsx)(`script`,{...e,dangerouslySetInnerHTML:i,suppressHydrationWarning:!0})}return null}function Du(e,t,n,r){n=Qr(n);let i=n.map(e=>e.meta).filter(e=>e!==void 0),a=[],o={},s;for(let e=i.length-1;e>=0;e--){let n=i[e];for(let e=n.length-1;e>=0;e--){let r=n[e];if(r)if(r.title)s||={tag:`title`,children:r.title};else if(`script:ld+json`in r)try{let e=JSON.stringify(r[`script:ld+json`]);a.push({tag:`script`,attrs:{type:`application/ld+json`},children:y(e)})}catch{}else{let e=r.name??r.property;if(e){if(o[e])continue;o[e]=!0}a.push({tag:`meta`,attrs:{...r,nonce:t}})}}}s&&a.push(s),t&&a.push({tag:`meta`,attrs:{property:`csp-nonce`,content:t}}),a.reverse();let c=n.flatMap(e=>e.links??[]).filter(e=>e!==void 0).map(e=>({tag:`link`,attrs:{...e,nonce:t}})),l=e.ssr?.manifest,u=[];l&&(n.forEach(e=>{(l.routes[e.routeId]?.css)?.forEach(e=>{let n=bl(e);u.push({tag:`link`,attrs:{rel:`stylesheet`,...n,crossOrigin:hl(r,`stylesheet`)??n.crossOrigin,suppressHydrationWarning:!0,nonce:t}})})}),l.inlineStyle&&u.push({tag:`style`,attrs:{...l.inlineStyle.attrs,nonce:t},children:l.inlineStyle.children,inlineCss:!0}));let d=[];l&&n.forEach(e=>{l.routes[e.routeId]?.preloads?.forEach(e=>{d.push({tag:`link`,attrs:{..._l(l,e,r),nonce:t}})})});let f=n.flatMap(e=>e.styles??[]).filter(e=>e!==void 0).map(({children:e,...n})=>({tag:`style`,attrs:{...n,nonce:t},children:e})),p=n.flatMap(e=>e.headScripts??[]).filter(e=>e!==void 0).map(({children:e,...n})=>({tag:`script`,attrs:{...n,nonce:t},children:e})),m=[];return yl(m,a),m.push(...d),yl(m,c),m.push(...u),yl(m,f),yl(m,p),m}var Ou=e=>{let t=fe(),n=t.options.ssr?.nonce,r=H.useCallback(r=>Du(t,n,r,e),[e,n,t]);return ue(t.stores.matches,r,{compare:T})};function ku(e){let t=Ou(e.assetCrossOrigin),n=fe().options.ssr?.nonce;return(0,U.jsx)(U.Fragment,{children:t.map(e=>(0,H.createElement)(Tu,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:n}))})}var Au={suppressHydrationWarning:!0},ju=()=>{let e=fe(),t=e.options.ssr?.nonce,n=n=>{let r=xl(n,e.ssr?.manifest,t,Au);for(let e of r[1])if(typeof e.attrs?.src==`string`){let t=e;t.preventScriptHoist=!0}return r};return Mu(ue(e.stores.matches,e=>Sl(n(e)),{compare:T}))};function Mu(e){return(0,U.jsx)(U.Fragment,{children:e.map((e,t)=>(0,H.createElement)(Tu,{...e,key:`tsr-scripts-${e.tag}-${t}`}))})}var Nu=(e,t)=>{let n={type:`request`,...t||e},r=e=>Nu({},Object.assign(n,{validator:e,inputValidator:e}));return{options:n,middleware:e=>Nu({},Object.assign(n,{middleware:e})),validator:r,inputValidator:r,client:e=>Nu({},Object.assign(n,{client:e})),server:e=>Nu({},Object.assign(n,{server:e}))}};function Pu(e,t){for(let n=0,r=t.length;n<r;n++){let r=t[n];e.has(r)||(e.add(r),r.extends&&Pu(e,r.extends))}}var Fu=e=>({getOptions:async()=>{let t=await e();if(t.serializationAdapters){let e=new Set;Pu(e,t.serializationAdapters),t.serializationAdapters=Array.from(e)}return t},createMiddleware:Nu}),Iu=Nu({type:`function`}).client(async({next:e})=>{let{data:t}=await N.auth.getSession(),n=t.session?.access_token;return e({headers:n?{Authorization:`Bearer ${n}`}:{}})}),Lu=Nu({type:`function`}).client(async({next:e})=>{let t=_e(),n=t?`memory`:`none`;return!t&&typeof window<`u`&&(t=be().resolveFromLocation({pathname:window.location.pathname,host:window.location.host})?.slug??null,t&&(n=`resolver`)),he(`attachClinicSlug`,{slug:t,source:n,pathname:typeof window<`u`?window.location.pathname:null,host:typeof window<`u`?window.location.host:null}),e({headers:t?{[ve]:t}:{}})}
13),Ru=Nu(),zu=Fu(()=>({functionMiddleware:[Iu,Lu],requestMiddleware:[Ru]}));function Bu(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ke(e,()=>t.signal,()=>n=!0)},u=Ee(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Te:Ne;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Hu:Vu,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Vu(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Vu(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Hu(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Uu=class extends Oe{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ze({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Wu(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Wu(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Wu(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Wu(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>
vendor: 4,180 bytes, line 13
13t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){je.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Pe(t,e))}findAll(e={}){return this.getAll().filter(t=>Pe(e,t))}notify(e){je.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return je.batch(()=>Promise.all(e.map(e=>e.continue().catch(we))))}};function Wu(e){return e.options.scope?.id}var Gu=class extends Oe{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??De(r,t),a=this.get(i);return a||(a=new Re({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){je.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Le(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Le(e,t)):t}notify(e){je.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){je.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){je.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ku=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Gu,this.#t=e.mutationCache||new Uu,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=xe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ce.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Fe(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Me(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return je.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;je.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return je.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=je.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(we).catch(we)}invalidateQueries(e,t={}){return je.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=je.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(we)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(we)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Fe(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(we).catch(we)}
13fetchInfiniteQuery(e){return e.behavior=Bu(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(we).catch(we)}ensureInfiniteQueryData(e){return e.behavior=Bu(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ce.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Ae(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ie(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Ae(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ie(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=De(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Se&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},qu=`/assets/styles-DSHv5d7e.css`;function Ju(e,t={}){typeof window>`u`||window.__lovableEvents?.captureException?.(e,{source:`react_error_boundary`,route:window.location.pathname,...t},{mechanism:`react_error_boundary`,handled:!1,severity:`error`})}var Yu=Ge(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Xu=Ge(`facebook`,[[`path`,{d:`M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z`,key:`1jg4f8`}]]),Zu=Ge(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Qu=Ge(`instagram`,[[`rect`,{width:`20`,height:`20`,x:`2`,y:`2`,rx:`5`,ry:`5`,key:`2e1cvw`}],[`path`,{d:`M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z`,key:`9exkf1`}],[`line`,{x1:`17.5`,x2:`17.51`,y1:`6.5`,y2:`6.5`,key:`r4j83e`}]]),$u=Ge(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),ed=Ge(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),td=Ge(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),nd=Ge(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),rd=Ge(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),id=Ge(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),ad=Ge(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),od={name:`@lovable.dev/cloud-auth-js`,version:`1.1.2`,description:`Lovable Cloud Auth JS`,main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,type:`module`,files:[`dist`],scripts:{build:`tsup src/index.ts --format cjs,esm --dts --outDir dist`,dev:`tsup src/index.ts --format cjs,esm --dts --watch`,test:`vitest run`,typecheck:`tsgo --noEmit`,prepublishOnly:`npm run clean && npm run build`,clean:`rimraf dist`},keywords:[`lovable`,`oauth`,`authentication`],license:`MIT`,devDependencies:{"@types/node":`^22`,jsdom:`^26`,rimraf:`^5.0.0`,tsup:`^7.2.0`,typescript:`^5`,vitest:`^4.1.0`}},sd=`authorization_response`,cd=`/~oauth/initiate`,ld=[`https://oauth.lovable.app`,`https://lovable.dev`],ud=`lovable://oauth-callback`,dd=`http://127.0.0.1/iframe-oauth/callback`,fd=500,pd=12e4;function md(e){let t,n=new Promise(e=>{t=e}),r=n=>{if(!e.some(e=>n.origin===e))return;let r=n.data;!r||typeof r!=`object`||r.type===sd&&t(r.response)};return window.addEventListener(`message`,r),{cleanup:()=>{window.removeEventListener(`message`,r)},messagePromise:n}}function hd(e){let t=window.screenX!==0||window.screenY!==0||!e,n=t?window.outerWidth*.5:window.screen.width*.5,r=t?window.outerHeight*.5:window.screen.height*.5;return{width:n,height:r,left:t?window.screenX+(window.outerWidth-n)/2:(window.screen.width-n)/2,top:t?window.screenY+(window.outerHeight-r)/2:(window.screen.height-r)/2}}function gd(e,t){return e.state===t?e.error?e.error===`legacy_flow`?{error:Error(`This flow is not supported in Preview mode. Please open the app in a new tab to sign in.`)}:{error:Error(e.error_description??`Sign in failed`)}:!e.access_token||!e.refresh_token?{error:Error(`No tokens received`)}:{tokens:{access_token:e.access_token,refresh_token:e.refresh_token},error:null}
13:{error:Error(`State is invalid`)}}function _d(){let e=navigator.userAgent;return!!(/iPhone|iPad|iPod|Android/i.test(e)||/Macintosh/i.test(e)&&navigator.maxTouchPoints>1)}function vd(){return typeof crypto<`u`&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(e=>e.toString(16).padStart(2,`0`)).join(``):Math.random().toString(36).substring(2)+Date.now().toString(36)}function yd(e={}){let t=e.oauthBrokerUrl??cd,n=e.supportedOAuthOrigins??ld;async function r(e,r={}){let i=!1;try{i=window.self!==window.top}catch{i=!0}let a=navigator.userAgent,o=/LovableApp\//.test(a),s=!o&&/lovable/i.test(a),c=vd(),l=r.redirect_uri??window.location.origin;o&&i?l=ud:s&&i&&(l=dd);let u=new URLSearchParams({...r.extraParams,provider:e,redirect_uri:l,state:c});if(!i)return window.location.href=`${t}?${u.toString()}`,{error:null,redirected:!0};!o&&!s&&u.set(`response_mode`,`web_message`);let d=`${t}?${u.toString()}`,{messagePromise:f,cleanup:p}=md(s?[...n,window.location.origin]:n),m;if(_d())m=window.open(d,`_blank`);else{let{width:e,height:t,left:n,top:r}=hd(i);m=window.open(d,`oauth`,`width=${e},height=${t},left=${n},top=${r}`)}if(!m&&(o||s)){let e,t=new Promise((t,n)=>{e=setTimeout(()=>{n(Error(`OAuth timed out waiting for response`))},pd)});try{return gd(await Promise.race([f,t]),c)}catch(e){return{error:e instanceof Error?e:Error(String(e))}}finally{e&&clearTimeout(e),p()}}if(!m)return p(),{error:Error(`Popup was blocked`)};let h,g=new Promise((e,t)=>{h=setInterval(()=>{m.closed&&(clearInterval(h),t(Error(`Sign in was cancelled`)))},fd)});try{return gd(await Promise.race([f,g]),c)}catch(e){return{error:e instanceof Error?e:Error(String(e))}}finally{clearInterval(h),p(),m?.close()}}return{signInWithOAuth:r}}typeof window<`u`&&(window.__lovable_cloud_auth_js_version=od.version);function bd(e={}){return yd(e)}var xd=bd(),Sd={auth:{signInWithOAuth:async(e,t)=>{let n=await xd.signInWithOAuth(e,{redirect_uri:t?.redirect_uri,extraParams:{...t?.extraParams}});if(n.redirected||n.error)return n;try{await N.auth.setSession(n.tokens)}catch(e){return{error:e instanceof Error?e:Error(String(e))}}return n}}},Y=`pending_terms_accept_email`,Cd=`pending_terms_accept_any`,wd=`pending_user_type`;function Td(e){try{localStorage.setItem(wd,e)}catch{}}function Ed(){try{let e=localStorage.getItem(wd);if(e===`spa_owner`||e===`client`)return e}catch{}return null}function Dd(){try{localStorage.removeItem(wd)}catch{}}function Od(e){try{localStorage.setItem(Y,e.trim().toLowerCase())}catch{}}async function kd(e,t){let n=null,r=null;try{n=localStorage.getItem(Y),r=localStorage.getItem(Cd)}catch{return}if(!(!(t&&n&&n===t.trim().toLowerCase())&&!r))try{let{error:t}=await N.from(`profiles`).update({terms_accepted_at:new Date().toISOString()}).eq(`id`,e).is(`terms_accepted_at`,null);if(t){console.warn(`[terms] failed to persist acceptance`,t.message);return}try{localStorage.removeItem(Y),localStorage.removeItem(Cd)}catch{}}catch(e){console.warn(`[terms] failed to persist acceptance`,e)}}async function Ad(e){try{let{logSecurityEvent:t}=await P(async()=>{let{logSecurityEvent:e}=await import(`./audit-BpqB_Evy.js`);return{logSecurityEvent:e}},__vite__mapDeps([0,1,2,3,4,5]));await t(e)}catch(t){console.warn(`[security-audit] skipped`,e,t)}}var jd={async signInWithPassword(e,t){let n=await N.auth.signInWithPassword({email:e,password:t});return n.error?(async()=>{try{let{logFailedSignIn:t}=await P(async()=>{let{logFailedSignIn:e}=await import(`./audit-BpqB_Evy.js`);return{logFailedSignIn:e}},__vite__mapDeps([0,1,2,3,4,5]));await t(e)}catch(e){console.warn(`[security-audit] skipped sign_in_failed`,e)}})():Ad(`sign_in`),n},async signUpWithPassword(e,t,n={}){return N.auth.signUp({email:e,password:t,options:{emailRedirectTo:`${window.location.origin}/auth/callback`,data:n}})},async startPasswordlessSignIn(e,t={}){return N.auth.signInWithOtp({email:e,options:{shouldCreateUser:!0,data:{full_name:t.fullName??``,user_type:`client`},emailRedirectTo:t.emailRedirectTo??`${window.location.origin}/auth/callback`}})},async verifyEmailCode(e,t){let n=await N.auth.verifyOtp({email:e,token:t,type:`email`});return n.error||Ad(`sign_in`),n},async signInWithGoogle(){return await Sd.auth.signInWithOAuth(`google`,{redirect_uri:`${window.location.origin}/auth/callback`})},async signOut(){return await Ad(`sign_out`),N.auth.signOut()},async signOutOtherSessions(){try{return await N.auth.signOut({scope:`others`})}catch(e){return console.warn(`[auth] failed to revoke other sessions`,e),{error:null}}},async requestPasswordReset(e){return N.auth.resetPasswordForEmail(e,{redirectTo:`${window.location.origin}/reset-password`})},async updatePassword(e){let t=await N.auth.updateUser({password:e});return t.error||Ad(`password_change`),t},async resendVerification(e){return N.auth.resend({type:`signup`,email:e,options:{emailRedirectTo:`${window.location.origin}/auth/callback`}})},async getSession(){return N.auth.getSession()},async getUser(){return N.auth.getUser()}},Md=(0,H.createContext)(null);function Nd(e){if(!e?.access_token)return!1;let t={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_DEV_SERVER:`false`,TSS_DEV_SSR_STYLES_BASEPATH:`/`,TSS_DEV_SSR_STYLES_ENABLED:`true`,TSS_DISABLE_CSRF_MIDDLEWARE_WARNING:`false`,TSS_INLINE_CSS_ENABLED:`false`,TSS_ROUTER_BASEPATH:``,TSS_SERVER_FN_BASE:`/_serverFn/`,VITE_LOVABLE_CONNECTOR_GOOGLE_MAPS_BROWSER_KEY:`AIzaSyBUi5X5qJ0QywEoUP8vnVUhIByNsUmWHrc`,VITE_PAYMENTS_CLIENT_TOKEN:`pk_test_51U7ZJnPDyjDLdlTKTdFTPU43inWpGO4uFWDNzFaos6ulsyh8FcDnH2b3IJ8kYSqKuE2zKexfyuEGBeSrYKa0MDND00dZ8cxzhb`,VITE_SUPABASE_PROJECT_ID:`bhjqxxnzvkpztxkeutzq`,VITE_SUPABASE_PUBLISHABLE_KEY:`sb_publishable_NO7HCR0N0hTh3gc_XNQtVQ_fuCwzcpt`,VITE_SUPABASE_URL:`https://bhjqxxnzvkpztxkeutzq.supabase.co`}
13.VITE_SUPABASE_PROJECT_ID;if(!t)return!1;try{let n=e.access_token.split(`.`);if(n.length!==3)return!0;let r=JSON.parse(atob(n[1].replace(/-/g,`+`).replace(/_/g,`/`))),i=r.ref??r.iss?.match(/https:\/\/([^.]+)\./)?.[1];return!!i&&i!==t}catch{return!0}}function Pd({children:e}){let[t,n]=(0,H.useState)(`loading`),[r,i]=(0,H.useState)(null),a=fe(),o=Ve();(0,H.useEffect)(()=>{let e=!1,t=t=>{if(!e){if(Nd(t)){N.auth.signOut({scope:`local`}).catch(()=>{}),i(null),n(`unauthenticated`);return}i(t),n(t?`authenticated`:`unauthenticated`)}},r=setTimeout(()=>t(null),4e3);N.auth.getSession().then(({data:e})=>{clearTimeout(r),t(e.session)}).catch(()=>{clearTimeout(r),t(null)});let{data:s}=N.auth.onAuthStateChange((e,s)=>{if(e===`INITIAL_SESSION`){clearTimeout(r),t(s);return}if(!(e!==`SIGNED_IN`&&e!==`SIGNED_OUT`&&e!==`USER_UPDATED`&&e!==`TOKEN_REFRESHED`)){if(Nd(s)){N.auth.signOut({scope:`local`}).catch(()=>{}),i(null),n(`unauthenticated`);return}i(s),n(s?`authenticated`:`unauthenticated`),e===`SIGNED_IN`&&s?.user&&kd(s.user.id,s.user.email),e!==`TOKEN_REFRESHED`&&e!==`SIGNED_OUT`&&(a.invalidate(),o.invalidateQueries())}});return()=>{e=!0,clearTimeout(r),s.subscription.unsubscribe()}},[a,o]);let s=(0,H.useMemo)(()=>({status:t,session:r,user:r?.user??null,service:jd,async signOut(){await o.cancelQueries(),o.clear(),await jd.signOut(),a.navigate({to:`/auth`,replace:!0})}}),[t,r,a,o]);return(0,U.jsx)(Md.Provider,{value:s,children:e})}function Fd(){let e=(0,H.useContext)(Md);if(!e)throw Error(`useAuth must be used inside <AuthProvider>`);return e}var Id=`/assets/logo-medspa-blueprint-B3sLd4XF.png`,Ld={sm:`h-8 w-8`,md:`h-10 w-10`,lg:`h-12 w-12`,xl:`h-16 w-16`};function Rd({size:e=`md`,className:t=``,eager:n=!1}){return(0,U.jsx)(`img`,{src:Id,alt:`MedSpa Blueprint AI`,loading:n?`eager`:`lazy`,decoding:`async`,className:`${Ld[e]} shrink-0 rounded-full object-contain ${t}`})}var zd=[{to:`/how-it-works`,label:`How It Works`},{to:`/join/client`,label:`For Individuals`},{to:`/for-spas`,label:`For Spa Owners`},{to:`/pricing`,label:`Pricing`},{to:`/clinics`,label:`Find a clinic`},{to:`/`,label:`vs. Other Tools`,hash:!0}];function Bd(){let[e,t]=(0,H.useState)(!1),[n,r]=(0,H.useState)(!1),{status:i,signOut:a}=Fd(),o=i===`authenticated`;return(0,H.useEffect)(()=>{let e=()=>r(window.scrollY>8);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),(0,U.jsxs)(`header`,{className:`sticky top-0 z-50 border-b transition-colors ${n?`border-border bg-black/90 backdrop-blur`:`border-transparent bg-black`}`,children:[(0,U.jsxs)(`div`,{className:`mx-auto grid grid-cols-[minmax(0,1fr)_auto] items-center gap-4 px-5 py-4 md:flex md:max-w-[1320px] md:px-10`,children:[(0,U.jsxs)(D,{to:`/`,className:`flex items-center gap-2`,"aria-label":`MedSpa Blueprint AI home`,children:[(0,U.jsx)(Rd,{size:`md`,eager:!0}),(0,U.jsx)(`span`,{className:`sr-only`,children:`MedSpa Blueprint AI`})]}),(0,U.jsx)(`nav`,{className:`hidden flex-1 items-center justify-center gap-8 md:flex`,children:zd.map(e=>e.hash?(0,U.jsxs)(`a`,{href:`/#compare`,className:`group relative text-[11px] uppercase tracking-[0.2em] text-muted-foreground transition-colors hover:text-white`,children:[e.label,(0,U.jsx)(`span`,{className:`absolute -bottom-1.5 left-0 h-px w-0 bg-gold transition-all duration-300 group-hover:w-full`})]},`compare`):(0,U.jsxs)(D,{to:e.to,className:`group relative text-[11px] uppercase tracking-[0.2em] text-muted-foreground transition-colors hover:text-white`,children:[e.label,(0,U.jsx)(`span`,{className:`absolute -bottom-1.5 left-0 h-px w-0 bg-gold transition-all duration-300 group-hover:w-full`})]},e.to))}),(0,U.jsxs)(`div`,{className:`hidden items-center gap-3 md:flex`,children:[(0,U.jsx)(D,{to:o?`/dashboard`:`/auth`,className:`text-[11px] uppercase tracking-[0.2em] text-muted-foreground hover:text-white`,children:o?`Dashboard`:`Sign in`}),o?(0,U.jsx)(`button`,{onClick:()=>a(),style:{borderRadius:50},className:`inline-flex items-center gap-2 bg-gold px-5 py-2.5 text-[12px] font-bold uppercase tracking-[0.15em] text-black transition-colors hover:bg-gold-hover`,children:`Sign Out`}):(0,U.jsx)(D,{to:`/auth`,search:{mode:`signup`},style:{borderRadius:50},className:`inline-flex items-center gap-2 bg-gold px-5 py-2.5 text-[12px] font-bold uppercase tracking-[0.15em] text-black transition-colors hover:bg-gold-hover`,children:`Create Account`})]}),(0,U.jsx)(`button`,{onClick:()=>t(!e),className:`-mr-2 inline-flex h-11 w-11 items-center justify-center text-white md:hidden`,"aria-label":`Toggle menu`,children:e?(0,U.jsx)(at,{className:`h-5 w-5`}):(0,U.jsx)(ed,{className:`h-5 w-5`})})]}),e&&(0,U.jsx)(`div`,{className:`border-t border-border bg-black px-5 py-4 md:hidden`,children:(0,U.jsxs)(`nav`,{className:`flex flex-col gap-1`,children:[zd.map(e=>e.hash?(0,U.jsx)(`a`,{href:`/#compare`,onClick:()=>t(!1),className:`py-3 text-[12px] uppercase tracking-[0.2em] text-muted-foreground`,children:e.label},`compare`):(0,U.jsx)(D,{to:e.to,onClick:()=>t(!1),className:`py-3 text-[12px] uppercase tracking-[0.2em] text-muted-foreground`,children:e.label},e.to)),(0,U.jsx)(D,{to:o?`/dashboard`:`/auth`,onClick:()=>t(!1),className:`py-3 text-[12px] uppercase tracking-[0.2em] text-muted-foreground`,children:o?`Dashboard`:`Sign in`}),o?(0,U.jsx)(`button`,{onClick:()=>{t(!1),a()},style:{borderRadius:50},className:`mt-2 inline-flex items-center justify-center gap-2 bg-gold px-5 py-3 text-[12px] font-bold uppercase tracking-[0.15em] text-black`,children:`Sign Out â`}):(0,U.jsx)(D,{to:`/auth`,search:{mode:`signup`},onClick:()=>t(!1),style:{borderRadius:50},className:`mt-2 inline-flex items-center justify-center gap-2 bg-gold px-5 py-3 text-[12px] font-bold uppercase tracking-[0.15em] text-black`,children:`Create Account â`})]})})]})}function Vd({href:e,onClick:t,...n}){let r=fe();function i(i){t?.(i),!(i.defaultPrevented||i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||n.target===`_blank`||!e.startsWith(`/`)||e.startsWith(`//`))&&(i.preventDefault(),r.navigate({href:e}))}return(0,U.jsx)(`a`,{href:e,onClick:i,...n})}var Hd=`2026-10-30T00:00:00Z`,X={name:`MedSpa Blueprint AIâ¢`,shortName:`MedSpa Blueprint AI`,tagline:`The AI Platform Built on the Blueprint.`,footerTagline:`AI Beauty Intelligence. Built on the Blueprint.`,closingTagline:`Clarity, before you ever sit in the chair.`,domain:`medspablueprint.ai`,url:`https://medspablueprint.ai`,supportEmail:`[email protected]`,authSenderName:`MedSpa Blueprint AI`,authSenderEmail:`[email protected]`,privacyEmail:`[email protected]`,billingEmail:`[email protected]`,parentBrand:`MedSpa Blueprintâ¢`,parentCompany:`Body Studio Wellness Ltd`,founderName:`Michelle Vernon`,platformFee:.1,currency:`USD`,launchMode:!1,launchDate:Hd,earlyBirdLimit:100,consultSubdomainExample:`yourspa.medspablueprint.ai`},Ud=new Intl.DateTimeFormat(`en-US`,{month:`long`,day:`numeric`,year:`numeric`,timeZone:`UTC`}).format(new Date(Hd)),Wd=`January 12, 2026`,Gd=[{path:`/privacy`,title:`Privacy Policy`,body:``},{path:`/terms`,title:`Terms of Use`,body:``},{path:`/purchase-terms`,title:`Purchase, Payment & Refund Terms`,body:``},{path:`/ai-terms`,title:`MedSpa Blueprint AI â Terms of Use`,body:``},{path:`/ai-privacy`,title:`MedSpa Blueprint AI â Privacy Notice`,body:``},{path:`/cookie-policy`,title:`Cookie Policy`,body:``},{path:`/medical-disclaimer`,title:`Medical & Health Disclaimer`,body:``},{path:`/earnings-disclaimer`,title:`Earnings & Results Disclaimer`,body:``},{path:`/testimonial-disclosure`,title:`Testimonial & Endorsement Disclosure`,body:``},{path:`/contact-legal`,title:`Contact & Legal Notices`,body:``},{path:`/accessibility`,title:`Accessibility Statement`,body:``}];function Kd(e){let t=Gd.find(t=>t.path===e);if(!t)throw Error(`Unknown legal document: ${e}`);return t}function qd(){return(0,U.jsxs)(`footer`,{className:`border-t border-gold bg-[#0F0F0F]`,children:[(0,U.jsxs)(`div`,{className:`mx-auto grid max-w-[1320px] gap-12 px-5 py-16 md:grid-cols-3 lg:grid-cols-5 md:px-10`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(Rd,{size:`xl`}),(0,U.jsx)(`p`,{className:`mt-4 max-w-xs text-sm leading-relaxed text-text-muted`,children:X.footerTagline}),(0,U.jsxs)(`div`,{className:`mt-6 flex gap-4 text-text-muted`,children:[(0,U.jsx)(`a`,{href:`https://www.instagram.com/askmedspa.ai?igsh=ZnUxN2RjaHR4Ymtz&utm_source=qr`,"aria-label":`Instagram`,className:`hover:text-gold`,children:(0,U.jsx)(Qu,{className:`h-4 w-4`})}),(0,U.jsx)(`a`,{href:`https://www.facebook.com/share/1bK2paHQHQ/?mibextid=wwXIfr`,"aria-label":`Facebook`,className:`hover:text-gold`,children:(0,U.jsx)(Xu,{className:`h-4 w-4`})})]}),(0,U.jsxs)(`a`,{href:`https://medspablueprint.co`,target:`_blank`,rel:`noreferrer`,className:`mt-6 inline-block rounded-full border border-gold/60 px-3 py-1 text-[10px] uppercase tracking-[0.15em] text-gold hover:bg-gold hover:text-black`,children:[`Powered by `,X.parentBrand]})]}),(0,U.jsx)(Jd,{title:`Platform`,links:[{to:`/how-it-works`,label:`How It Works`},{to:`/#features`,label:`Features`},{to:`/for-spas`,label:`For Spa Owners`},{to:`/pricing`,label:`Pricing`}]}),(0,U.jsx)(Jd,{title:`Compare`,links:[{to:`/#compare`,label:`vs. Other Tools`},{to:`/for-spas`,label:`Why White-Label`},{to:`/demo`,label:`Live Demo`}]}),(0,U.jsx)(Jd,{title:`Resources`,links:[{href:`https://medspablueprint.co`,label:`${X.parentBrand}`,external:!0},{href:`https://medspablueprint.co/vault`,label:`The Vault`,external:!0},{href:`mailto:${X.supportEmail}
13`,label:`Support`,external:!0}]}),(0,U.jsx)(Jd,{title:`Legal`,links:Gd.map(e=>({to:e.path,label:e.title}))})]}),(0,U.jsx)(`div`,{className:`border-t border-border`,children:(0,U.jsx)(`div`,{className:`mx-auto max-w-[1320px] px-5 py-6 text-center text-[11px] uppercase tracking-[0.2em] text-text-muted md:px-10`,children:`© 2026 BODY STUDIO WELLNESS LTD. ALL RIGHTS RESERVED. MEDSPA BLUEPRINT AI⢠IS A PRODUCT OF BODY STUDIO WELLNESS LTD.`})})]})}function Jd({title:e,links:t}){return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`mb-4 text-[11px] uppercase tracking-[0.25em] text-gold`,children:e}),(0,U.jsx)(`ul`,{className:`space-y-3`,children:t.map(e=>(0,U.jsx)(`li`,{children:e.external?(0,U.jsx)(`a`,{href:e.href,className:`text-sm text-text-muted transition-colors hover:text-gold`,target:`_blank`,rel:`noreferrer`,children:e.label}):(0,U.jsx)(Vd,{href:e.to,className:`text-sm text-text-muted transition-colors hover:text-gold`,children:e.label})},e.label))})]})}var Yd=`2336802810139452`,Xd=`sba_cookie_pref`,Zd=`sba:cookie-consent`;function Qd(){return typeof window>`u`?!1:ct.has(window.location.host.toLowerCase())}function $d(){if(typeof window>`u`)return!1;try{return localStorage.getItem(Xd)===`all`}catch{return!1}}var ef=!1;function tf(){if(typeof document>`u`||ef)return;ef=!0;let e=window;if(!e.fbq){let t=function(...e){t.callMethod?t.callMethod(...e):t.queue.push(e)};t.queue=[],t.loaded=!0,t.version=`2.0`,t.push=t,e.fbq=t,e._fbq||=t}let t=document.createElement(`script`);t.async=!0,t.src=`https://connect.facebook.net/en_US/fbevents.js`;let n=document.getElementsByTagName(`script`)[0];n?.parentNode?.insertBefore(t,n),e.fbq(`init`,Yd),e.fbq(`track`,`PageView`)}function nf(){typeof window>`u`||!ef||!window.fbq||window.fbq(`track`,`PageView`)}var rf=Xd;function af(){let[e,t]=(0,H.useState)(!1);(0,H.useEffect)(()=>{typeof window>`u`||localStorage.getItem(rf)||t(!0)},[]);let n=e=>{localStorage.setItem(rf,e),window.dispatchEvent(new Event(Zd)),t(!1)};return e?(0,U.jsxs)(`div`,{className:`fixed inset-x-3 bottom-3 z-50 rounded-sm border border-border bg-card p-5 shadow-2xl md:inset-x-auto md:right-6 md:bottom-6 md:max-w-md`,children:[(0,U.jsx)(`p`,{className:`font-display text-lg text-white`,children:`Cookies, your call.`}),(0,U.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`We use essential cookies to run this site. With your consent we also use analytics to improve it. You can change this anytime in Cookie Settings.`}),(0,U.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,U.jsx)(`button`,{onClick:()=>n(`all`),className:`rounded-sm bg-gold px-4 py-2 text-[11px] font-bold uppercase tracking-[0.15em] text-black hover:bg-gold-hover`,children:`Accept all`}),(0,U.jsx)(`button`,{onClick:()=>n(`essential`),className:`rounded-sm border border-border px-4 py-2 text-[11px] font-bold uppercase tracking-[0.15em] text-white hover:border-gold hover:text-gold`,children:`Reject non-essential`})]})]}):null}function of(){let[e,t]=(0,H.useState)(!1),n=Cu({select:e=>e.location.pathname});return(0,H.useEffect)(()=>{if(!Qd())return;let e=()=>{$d()&&(tf(),t(!0))};return e(),window.addEventListener(Zd,e),()=>window.removeEventListener(Zd,e)},[]),(0,H.useEffect)(()=>{e&&nf()},[n,e]),e?(0,U.jsx)(`noscript`,{children:(0,U.jsx)(`img`,{height:`1`,width:`1`,style:{display:`none`},src:`https://www.facebook.com/tr?id=${Yd}&ev=PageView&noscript=1`,alt:``})}):null}var sf=e(r(),1);function cf(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var lf=e=>{switch(e){case`success`:return ff;case`info`:return mf;case`warning`:return pf;case`error`:return hf;default:return null}},uf=Array(12).fill(0),df=({visible:e,className:t})=>H.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},H.createElement(`div`,{className:`sonner-spinner`},uf.map((e,t)=>
13H.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),ff=H.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},H.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),pf=H.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},H.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),mf=H.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},H.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),hf=H.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},H.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),gf=H.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},H.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),H.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),_f=()=>{let[e,t]=H.useState(document.hidden);return H.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},vf=1,yf=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:vf++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>
13this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],H.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(xf(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!H.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||vf++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},bf=(e,t)=>{let n=t?.id||vf++;return yf.addToast({title:e,...t,id:n}),n},xf=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Z=Object.assign(bf,{success:yf.success,info:yf.info,warning:yf.warning,error:yf.error,custom:yf.custom,message:yf.message,promise:yf.promise,dismiss:yf.dismiss,loading:yf.loading},{getHistory:()=>yf.toasts,getToasts:()=>yf.getActiveToasts()});cf(`
vendor: 14,859 bytes, line 13
13[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
13`);function Sf(e){return e.label!==void 0}var Cf=3,wf=`24px`,Tf=`16px`,Ef=4e3,Df=356,Of=14,kf=45,Af=200;function jf(...e){return e.filter(Boolean).join(` `)}function Mf(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Nf=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=H.useState(null),[O,k]=H.useState(null),[A,ee]=H.useState(!1),[te,ne]=H.useState(!1),[re,j]=H.useState(!1),[M,ie]=H.useState(!1),[ae,oe]=H.useState(!1),[se,ce]=H.useState(0),[le,ue]=H.useState(0),de=H.useRef(n.duration||y||Ef),fe=H.useRef(null),pe=H.useRef(null),me=c===0,N=c+1<=o,P=n.type,he=n.dismissible!==!1,ge=n.className||``,_e=n.descriptionClassName||``,ve=H.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),F=H.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ye=H.useMemo(()=>n.duration||y||Ef,[n.duration,y]),be=H.useRef(0),xe=H.useRef(0),Se=H.useRef(0),Ce=H.useRef(null),[we,Te]=b.split(`-`),Ee=H.useMemo(()=>
13s.reduce((e,t,n)=>n>=ve?e:e+t.height,0),[s,ve]),De=_f(),Oe=n.invert||t,ke=P===`loading`;xe.current=H.useMemo(()=>ve*x+Ee,[ve,Ee]),H.useEffect(()=>{de.current=ye},[ye]),H.useEffect(()=>{ee(!0)},[]),H.useEffect(()=>{let e=pe.current;if(e){let t=e.getBoundingClientRect().height;return ue(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),H.useLayoutEffect(()=>{if(!A)return;let e=pe.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ue(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ae=H.useCallback(()=>{ne(!0),ce(xe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Af)},[n,d,a,xe]);H.useEffect(()=>{if(n.promise&&P===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||De?(()=>{if(Se.current<be.current){let e=new Date().getTime()-be.current;de.current-=e}Se.current=new Date().getTime()})():de.current!==1/0&&(be.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ae()},de.current)),()=>clearTimeout(e)},[u,i,n,P,De,Ae]),H.useEffect(()=>{n.delete&&(Ae(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ae,n.delete]);function je(){return w?.loading?H.createElement(`div`,{className:jf(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":P===`loading`},w.loading):H.createElement(df,{className:jf(C?.loader,n?.classNames?.loader),visible:P===`loading`})}let Me=n.icon||w?.[P]||lf(P);return H.createElement(`li`,{tabIndex:0,ref:pe,className:jf(_,ge,C?.toast,n?.classNames?.toast,C?.default,C?.[P],n?.classNames?.[P]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":ae,"data-removed":te,"data-visible":N,"data-y-position":we,"data-x-position":Te,"data-index":c,"data-front":me,"data-swiping":re,"data-dismissible":he,"data-type":P,"data-invert":Oe,"data-swipe-out":M,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${te?se:xe.current}px`,"--initial-height":S?`auto`:`${le}px`,...m,...n.style},onDragEnd:()=>{j(!1),D(null),Ce.current=null},onPointerDown:e=>{e.button!==2&&(ke||!he||(fe.current=new Date,ce(xe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(j(!0),Ce.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(M||!he)return;Ce.current=null;let e=Number(pe.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(pe.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-fe.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=kf||a>.11){ce(xe.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ae(),ie(!0);return}else{var o,s;(o=pe.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=pe.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}oe(!1),j(!1),D(null)},onPointerMove:t=>{var n,r;if(!Ce.current||!he||window.getSelection()?.toString().length>0)return;let i=t.clientY-Ce.current.y,a=t.clientX-Ce.current.x,o=e.swipeDirections??Mf(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&oe(!0),(n=pe.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=pe.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},F&&!n.jsx&&P!==`loading`?H.createElement(`button`,{"aria-label":T,"data-disabled":ke,"data-close-button":!0,onClick:ke||!he?()=>{}:()=>{Ae(),n.onDismiss==null||n.onDismiss.call(n,n)},className:jf(C?.closeButton,n?.classNames?.closeButton)},w?.close??gf):null,(P||n.icon||n.promise)&&n.icon!==null&&(w?.[P]!==null||n.icon)?H.createElement(`div`,{"data-icon":``,className:jf(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||je():null,n.type===`loading`?null:Me):null,H.createElement(`div`,{"data-content":``,className:jf(C?.content,n?.classNames?.content)},H.createElement(`div`,{"data-title":``,className:jf(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?H.createElement(`div`,{"data-description":``,className:jf(v,_e,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),H.isValidElement(n.cancel)?n.c
13ancel:n.cancel&&Sf(n.cancel)?H.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Sf(n.cancel)&&he&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ae())},className:jf(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,H.isValidElement(n.action)?n.action:n.action&&Sf(n.action)?H.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Sf(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ae())},className:jf(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Pf(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Ff(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Tf:wf;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var If=H.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Cf,toastOptions:g,dir:_=Pf(),gap:v=Of,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=H.useState([]),C=H.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=H.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=H.useState([]),[D,O]=H.useState(!1),[k,A]=H.useState(!1),[ee,te]=H.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),ne=H.useRef(null),re=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),j=H.useRef(null),M=H.useRef(!1),ie=H.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||yf.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return H.useEffect(()=>yf.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{sf.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),H.useEffect(()=>{if(d!==`system`){te(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?te(`dark`):te(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{te(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{te(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),H.useEffect(()=>{x.length<=1&&O(!1)},[x]),H.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=ne.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===ne.current||ne.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),H.useEffect(()=>{if(ne.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,M.current=!1)}},[ne.current]),H.createElement(`section`,{ref:t,"aria-label":`${b} ${re}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?H.createElement(`ol`,{key:t,dir:_===`auto`?Pf():_,tabIndex:-1,ref:ne,className:c,"data-sonner-toaster":!0,"data-sonner-theme":ee,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Df}px`,"--gap":`${v}px`,...m,...Ff(l,u)},onBlur:e=>{M.current&&!e.currentTarget.contains(e.relatedTarget)&&(M.current=!1,j.current&&=(j.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`fal
13se`||M.current||(M.current=!0,j.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>H.createElement(Nf,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ie,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),Lf=({...e})=>(0,U.jsx)(If,{className:`toaster group`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`}},...e}),Rf=At,zf=Dt,Bf=Et,Vf=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(Ot,{ref:n,className:Pt(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Vf.displayName=Ot.displayName;var Hf=H.forwardRef(({className:e,children:t,...n},r)=>(0,U.jsxs)(Bf,{children:[(0,U.jsx)(Vf,{}),(0,U.jsxs)(kt,{ref:r,className:Pt(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg`,e),...n,children:[t,(0,U.jsxs)(Nt,{className:`absolute right-4 top-4 roun
13ded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,U.jsx)(at,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Hf.displayName=kt.displayName;var Uf=({className:e,...t})=>(0,U.jsx)(`div`,{className:Pt(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});Uf.displayName=`DialogHeader`;var Wf=({className:e,...t})=>(0,U.jsx)(`div`,{className:Pt(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Wf.displayName=`DialogFooter`;var Gf=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(Mt,{ref:n,className:Pt(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Gf.displayName=Mt.displayName;var Kf=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(jt,{ref:n,className:Pt(`text-sm text-muted-foreground`,e),...t}));Kf.displayName=jt.displayName;function qf(e,t){if(t){let e=t.toLowerCase();if(e.includes(`spa`)||e.includes(`clinic`)||e.includes(`school`))return`spa`;if(e.includes(`individual`)||e.includes(`client`))return`client`}return e?e.startsWith(`spa-`)?`spa`:e.startsWith(`client-`)?`client`:null:null}function Jf({open:e,onOpenChange:t,interestedPlan:n,planLabel:r,forcedUserType:i}){let a=qf(n,i??null),o=()=>t(!1);return(0,U.jsx)(Rf,{open:e,onOpenChange:t,children:(0,U.jsxs)(Hf,{className:`border-border bg-[#0F0F0F] text-white sm:max-w-md`,children:[(0,U.jsxs)(Uf,{children:[(0,U.jsx)(Gf,{className:`font-display text-2xl text-white`,children:`Join the Waitlist`}),(0,U.jsx)(Kf,{className:`text-text-muted`,children:r?`Reserve your place for the ${r} plan.`:a?`Reserve your early-access spot below.`:`Choose the waitlist that fits you.`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 pt-2`,children:[(a===null||a===`client`)&&(0,U.jsx)(D,{to:`/join/client`,onClick:o,style:{borderRadius:50},className:`w-full bg-gold px-6 py-4 text-center text-sm font-bold uppercase tracking-[0.18em] text-black transition-colors hover:bg-gold-hover`,children:`I'm a Client â`}),(a===null||a===`spa`)&&(0,U.jsx)(D,{to:`/join/spa-owner`,onClick:o,style:{borderRadius:50},className:a===`spa`?`w-full bg-gold px-6 py-4 text-center text-sm font-bold uppercase tracking-[0.18em] text-black transition-colors hover:bg-gold-hover`:`w-full border border-gold px-6 py-4 text-center text-sm font-bold uppercase tracking-[0.18em] text-gold transition-colors hover:bg-gold hover:text-black`,children:`I'm a Spa Owner â`}),(0,U.jsx)(`p`,{className:`pt-1 text-center text-[11px] text-text-muted`,children:`No spam. We only email about launch.`})]})]})})}function Yf(e){return F(`consultations`,{action:`founding_claim`,body:e})}function Xf(){return F(`consultations`,{action:`founding_spots_remaining`})}function Zf(){return F(`consultations`,{action:`founding_plans`})}function Qf(){return F(`admin`,{action:`founding_list`})}function $f(){return F(`admin`,{action:`founding_window_status`})}function ep(e){return F(`admin`,{action:`founding_window_set`,body:e})}var tp={starter:{label:`Starter`},growth:{label:`Growth`},agency:{label:`Agency`}};function np(e){let t=e/100;return t%1==0?`$${t.toFixed(0)}`:`$${t.toFixed(2)}`}function rp({open:e,onOpenChange:t,onSoldOut:n}){let r=Yf,i=Ve(),a=Ue({queryKey:[`founding`,`spots-remaining`],queryFn:()=>Xf(),staleTime:300*1e3,enabled:e}),o=Ue({queryKey:[`founding`,`plan-options`],queryFn:()=>Zf(),staleTime:300*1e3,enabled:e}),s=o.data??[],[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)({kind:`form`});(0,H.useEffect)(()=>{f===null&&s.length>0&&p(s[0].planSlug)},[s,f]);function v(e){e||setTimeout(()=>{l(``),d(``),p(null),_({kind:`form`})},200),t(e)}async function y(e){if(e.preventDefault(),!c||!u){_({kind:`error`,message:`Please fill in your email and clinic name.`});return}if(!f){_({kind:`error`,message:`Please choose a plan.`});return}h(!0);try{let e=await r({email:c,clinicName:u,planSlug:f});e.ok?(_({kind:`success`,position:e.position,planLabel:e.planLabel,lockedPriceCents:e.lockedPriceCents}),i.invalidateQueries({queryKey:[`eligibility`,`me`]})):e.error===`founding_spots_full`?_({kind:`sold_out`}):e.error===`duplicate_email`?_({kind:`duplicate`,position:e.position}):e.error===`pricing_unavailable`?_({kind:`error`,message:`That plan has no founding price right now. Please choose another plan.`}):_({kind:`error`,message:`Something went wrong. Please try again.`})}catch{_({kind:`error`,message:`Network error. Please try again.`})}finally{h(!1)}}let b=a.data?.remaining,x=a.data?.max??100;return(0,U.jsx)(Rf,{open:e,onOpenChange:v,children:(0,U.jsxs)(Hf,{className:`max-h-[85dvh] overflow-y-auto border-border bg-[#0F0F0F] text-white sm:max-w-lg`,children:[(0,U.jsxs)(Uf,{children:[(0,U.jsx)(Gf,{className:`font-display text-2xl text-white`,children:g.kind===`success`?`Founding spot reserved â¨`:g.kind===`duplicate`?`You're already reserved`:g.kind===`sold_out`?`All founding spots claimed`:`Claim your Founding Member spot`}),(0,U.jsx)(Kf,{className:`text-text-muted`,children:g.kind===`form`?typeof b==`number`?`${b} of ${x} founding spots remaining. Lock in today's price permanently â no payment now.`:`Lock in today's price permanently â no payment now.`:null})]}),g.kind===`form`&&(0,U.jsxs)(`form`,{onSubmit:y,className:`space-y-4`,children:[(0,U.jsxs)(`label`,{className:`block`,children:[(0,U.jsx)(`span`,{className:`text-[11px] uppercase tracking-[0.2em] text-text-muted`,children:`Email`}),(0,U.jsx)(`input`,{type:`email`,required:!0,value:c,onChange:e=>l(e.target.value),placeholder:`[email protected]`,className:`mt-2 w-full rounded border border-border bg-black px-4 py-3 text-white outline-none focus:border-gold`})]}),(0,U.jsxs)(`label`,{className:`block`,children:[(0,U.jsx)(`span`,{className:`text-[11px] uppercase tracking-[0.2em] text-text-muted`,children:`Clinic name`}),(0,U.jsx)(`input`,{type:`text`,required:!0,value:u,onChange:e=>d(e.target.value),placeholder:`Radiance Medspa`,className:`mt-2 w-full rounded border border-border bg-black px-4 py-3 text-white outline-none focus:border-gold`})]}),(0,U.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,U.jsx)(`legend`,{className:`text-[11px] uppercase tracking-[0.2em] text-text-muted`,children:`Lock in your plan`}),(0,U.jsxs)(`div`,{className:`grid gap-2`,children:[o.isPending&&(0,U.jsx)(`p`,{className:`text-sm text-text-muted`,children:`Loading founding pricesâ¦`}),!o.isPending&&s.length===0&&(0,U.jsx)(`p`,{className:`text-sm text-text-muted`,children:`Founding pricing isn't available right now. Please try again shortly.`}),s.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>p(e.planSlug),className:`flex items-center justify-between rounded border px-4 py-3 text-left transition-colors ${f===e.planSlug?`border-gold bg-gold/10`:`border-border bg-black hover:border-gold/60`}`,children:[(0,U.jsx)(`span`,{className:`text-white`,children:e.label}),(0,U.jsxs)(`span`,{className:`font-mono text-gold`,children:[np(e.monthlyPriceCents),`/mo`]})]},e.planSlug))]})]}),(0,U.jsx)(`button`,{type:`submit`,disabled:m,style:{borderRadius:50},className:`mt-1 w-full bg-gold px-6 py-4 text-sm font-bold uppercase tracking-[0.18em] text-black transition-colors hover:bg-gold-hover disabled:opacity-60`,children:m?`Reservingâ¦`:`Lock in my founding price â`}),(0,U.jsx)(`p`,{className:`text-center text-[11px] text-text-muted`,children:`No payment is due now. We'll email you at official lau
13nch.`})]}),g.kind===`error`&&(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsx)(`p`,{className:`text-sm text-destructive`,children:g.message}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>_({kind:`form`}),className:`text-[11px] uppercase tracking-[0.2em] text-gold hover:underline`,children:`â Try again`})]}),g.kind===`success`&&(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsxs)(`p`,{className:`text-white`,children:[`You're founding member `,(0,U.jsxs)(`span`,{className:`font-mono text-gold`,children:[`#`,g.position]}),` `,`â your `,(0,U.jsx)(`strong`,{children:g.planLabel}),` plan price of`,` `,(0,U.jsxs)(`span`,{className:`font-mono text-gold`,children:[np(g.lockedPriceCents),`/mo`]}),` `,`is locked in permanently, even if we raise prices later.`]}),(0,U.jsx)(`p`,{className:`text-sm text-text-muted`,children:`No payment is due now. We'll email you at official launch with a private checkout link that keeps this price on your account for life.`})]}),g.kind===`duplicate`&&(0,U.jsx)(`div`,{className:`space-y-3`,children:(0,U.jsxs)(`p`,{className:`text-white`,children:[`You're already reserved at position`,` `,(0,U.jsxs)(`span`,{className:`font-mono text-gold`,children:[`#`,g.position]}),`. We'll email you at launch.`]})}),g.kind===`sold_out`&&(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsxs)(`p`,{className:`text-white`,children:[`All `,x,` founding spots have been claimed. Join the general waitlist and we'll notify you the moment we open more capacity.`]}),(0,U.jsx)(`button`,{type:`button`,onClick:n,style:{borderRadius:50},className:`w-full bg-gold px-6 py-4 text-sm font-bold uppercase tracking-[0.18em] text-black transition-colors hover:bg-gold-hover`,children:`Join the waitlist â`})]})]})})}var ip=(0,H.createContext)(null);function ap(){let e=(0,H.useContext)(ip);if(!e)throw Error(`useWaitlistDialog must be used inside <WaitlistDialogProvider>`);return e}function op({children:e}){let[t,n]=(0,H.useState)(!1),[r,i]=(0,H.useState)({}),[a,o]=(0,H.useState)(!1),s=(0,H.useCallback)(e=>{i(e??{}),n(!0)},[]),c=(0,H.useCallback)(()=>{o(!0)},[]),l=(0,H.useMemo)(()=>({openWaitlist:s,openFoundingMember:c}),[s,c]);return(0,U.jsxs)(ip.Provider,{value:l,children:[e,(0,U.jsx)(Jf,{open:t,onOpenChange:n,interestedPlan:r.interestedPlan??null,planLabel:r.planLabel??null,forcedUserType:r.userType??null}),(0,U.jsx)(rp,{open:a,onOpenChange:o,onSoldOut:()=>{o(!1),setTimeout(()=>s({}),220)}})]})}var sp=`postAuthRedirect`;function cp(e){return e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.startsWith(`/\\`)}function lp(e){if(!(typeof window>`u`)&&!(!cp(e)||e.startsWith(`/auth`)))try{window.sessionStorage.setItem(sp,e)}catch{}}function up(){if(typeof window>`u`)return null;try{let e=window.sessionStorage.getItem(sp);return window.sessionStorage.removeItem(sp),e&&cp(e)?e:null}catch{return null}}function dp(){let e=fe(),t=Cu({select:e=>e.location.pathname});return(0,H.useEffect)(()=>{if(typeof window>`u`||t.startsWith(`/auth/callback`)||t.startsWith(`/reset-password`)||t.startsWith(`/invite/accept`)||window.location.pathname.startsWith(`/invite/accept`))return;let n=window.location.hash.startsWith(`#`)?window.location.hash.slice(1):``;if(!n)return;let r=new URLSearchParams(n),i=r.get(`type`)??``;if(i===`recovery`){let t=window.location.hash;e.navigate({to:`/reset-password`,replace:!0}),requestAnimationFrame(()=>{window.location.hash!==t&&(history.replaceState(null,``,`/reset-password${t.startsWith(`#`)?t:`#${t}`}`),window.dispatchEvent(new HashChangeEvent(`hashchange`)))});return}if(!(r.has(`access_token`)&&r.has(`refresh_token`))||![`signup`,`magiclink`,`invite`,`email_change`].includes(i))return;lp(`${window.location.pathname}${window.location.search}`);let a=window.location.hash;e.navigate({to:`/auth/callback`,replace:!0}),requestAnimationFrame(()=>{window.location.hash!==a&&(history.replaceState(null,``,`/auth/callback${a.startsWith(`#`)?a:`#${a}`}`),window.dispatchEvent(new HashChangeEvent(`hashchange`)))})},[t,e]),null}var fp=`pw_recovery_pending`,pp=!1;function mp(){pp=!0;try{sessionStorage.setItem(fp,`1`)}catch{}}function hp(){pp=!1;
13try{sessionStorage.removeItem(fp)}catch{}}function gp(){if(pp)return!0;try{return sessionStorage.getItem(fp)===`1`}catch{return!1}}function _p(e){let t=e.startsWith(`#`)?e.slice(1):e;return t?new URLSearchParams(t).get(`type`)===`recovery`:!1}function vp(){let e=ae(),t=Cu({select:e=>e.location.pathname});return(0,H.useEffect)(()=>{let{data:e}=N.auth.onAuthStateChange(e=>{e===`PASSWORD_RECOVERY`&&mp()});return()=>e.subscription.unsubscribe()},[]),(0,H.useEffect)(()=>{if(typeof window>`u`||(_p(window.location.hash)&&mp(),!gp())||t===`/reset-password`)return;let n=window.location.hash;e({to:`/reset-password`,replace:!0}),n&&_p(n)&&requestAnimationFrame(()=>{window.location.hash!==n&&(history.replaceState(null,``,`/reset-password${n}`),window.dispatchEvent(new HashChangeEvent(`hashchange`)))})},[t,e]),null}var yp=H.createContext(null),bp=null;function xp(){let e=H.useContext(yp);if(!e)throw Error(`useConfirm must be used within <ConfirmProvider>`);return e}function Sp({children:e}){let[t,n]=H.useState({open:!1,options:null,resolve:null}),r=H.useCallback(e=>new Promise(t=>{n({open:!0,options:e,resolve:t})}),[]);H.useEffect(()=>(bp=r,()=>{bp===r&&(bp=null)}),[r]);let i=H.useCallback(e=>{t.resolve?.(e)},[t]),a=H.useCallback(e=>{n(t=>({...t,open:e}))},[]);return(0,U.jsxs)(yp.Provider,{value:r,children:[e,t.options?(0,U.jsx)(Lt,{...t.options,open:t.open,onOpenChange:a,onResolve:i}):null]})}var Cp={blueprint_365:{released:!1,code:`built`,blockers:{engineering:[],configuration:[`Create the 365-Day add-on product and price in Stripe (test, then live) and link it in plan settings`],deployment:[`Apply pending Blueprint migrations; redeploy consultations and stripe-webhook; release the app`],verification:[`Live test purchase unlocks the 365-day stage; cancellation re-locks it; history is kept`],clinical:[]},inFeatureClinicalRule:`Stage guidance (home care, aftercare, warning signs, schedules) shows only when that content is clinician approved; otherwise the stage shows its non-clinical parts.`},progress_images:{released:!1,code:`built`,blockers:{engineering:[],configuration:[`Schedule the 'photo-reminders' cron job (daily) and set APP_URL`],deployment:[`Deploy cron-jobs; release the app`],verification:[`Reminders arrive once per period at the plan's cadence and link to photo comparisons`],clinical:[]},inFeatureClinicalRule:null},care_instructions:{released:!1,code:`built`,blockers:{engineering:[],configuration:[],deployment:[`Apply clinical content migrations; redeploy admin and consultations; release the app`],verification:[`Approved care shows for the right treatment on client and clinic views; unapproved shows nothing`],clinical:[`A qualified clinician approves care guidance for every treatment each clinic offers (per treatment; one approval never marks the feature ready)`]},inFeatureClinicalRule:null},render_quality:{released:!1,code:`built`,blockers:{engineering:[],configuration:[`Route 'Simulation â Premium members' and 'Simulation â VIP members' to higher-quality image models in AI Router`],deployment:[`Redeploy ai-image; release the app`],verification:[`Premium and VIP renders use their tier settings; Basic does not`],clinical:[]},inFeatureClinicalRule:null}};function wp(e){let t=Cp[e],n=Object.values(t.blockers).some(e=>e.length>0);return t.released&&!n}function Tp(e,t){return wp(e)?t:`${t} (coming soon)`}function Ep(e,t){let n=Vt(e),r=t?.[e];return r?{...n,monthlyPriceCents:r.monthlyPriceCents,annualPriceCents:r.annualPriceCents,monthlyPriceId:r.monthlyLookupKey,annualPriceId:r.annualLookupKey,trialDays:r.trialDays,active:r.active}:{...n,active:!0}}function Dp(e,t){let n=e*12,r=n-t;return{savingCents:r,percent:n>0?Math.round(r/n*100):0}}var Op={client:[`consultations`,`ai_coach`,`skin_age`,`beauty_blueprint_basic`,`beauty_blueprint_full`,`blueprint_365`,`simulations`,`treatment_simulator`,`progress_tracking`,`progress_images`,`care_instructions`,`member_report_monthly`,`member_report_annual`,`priority_coach`,`vip_discount`,`early_access`],spa:[`consultations`,`ai_coach`,`simulations`,`treatment_simulator`,`progress_tracking`,`care_instructions`,`white_label`,`basic_analytics`,`analytics`,`bi_reports`,`portal_access`,`booking_links`,`multi_location`,`multi_location_analytics`,`revenue_split`]};function kp(e,t){return jp(Vt(e),t)}function Ap(e){let t=Bt[e];if(t)return t;let n=String(e).replace(/_/g,` `);return n.charAt(0).toUpperCase()+n.slice(1)}
13function jp(e,t){let{coachMessagesPerMonth:n,consultationsPerMonth:r,locations:i}=e.limits,a=e.audience===`spa`;switch(t){case`consultations`:return r===null?a?`Unlimited client consultations`:`Unlimited AI consultations`:a?`${r} client consultations per billing month`:`${r} AI consultations, simulator runs and progress images per billing month (shared allowance)`;case`ai_coach`:return n===null?`Unlimited AI Coach messages`:`${n} AI Coach messages per billing month`;case`multi_location`:return`Up to ${i} locations`;case`skin_age`:return`Beauty Score and Estimated Skin Age`;case`beauty_blueprint_basic`:return`Basic Beauty Blueprint`;case`beauty_blueprint_full`:return`Full Beauty Blueprint, including ingredient recommendations`;case`simulations`:return`Treatment visualisations`;case`treatment_simulator`:return`Treatment Simulator`;case`progress_tracking`:return a?`Client progress tracking`:`Progress tracking`;case`blueprint_365`:return Tp(`blueprint_365`,`365-Day Blueprint`);case`progress_images`:switch(e.progressImageCadence){case`weekly`:return Tp(`progress_images`,`Weekly progress photo reminders & comparisons`);case`on_demand`:return Tp(`progress_images`,`On-demand progress photo comparisons`);case`monthly`:return Tp(`progress_images`,`Monthly progress photo reminders & comparisons`);default:return Tp(`progress_images`,`Progress images`)}case`care_instructions`:return a?Tp(`care_instructions`,`Pre-treatment, post-treatment and follow-up care instructions for your clients`):Tp(`care_instructions`,`Pre-treatment, post-treatment and follow-up care guidance`);case`white_label`:return`White-label branding (logo and colours)`;case`basic_analytics`:return`Basic analytics`;case`analytics`:return`Advanced analytics`;case`bi_reports`:return`Business Intelligence AI reports`;case`portal_access`:return`Full Beauty Blueprint for Clinicians`;case`booking_links`:return`Custom booking link`;case`multi_location_analytics`:return`Multi-location analytics`;case`revenue_split`:return`Revenue split management`;case`custom_domain`:return`Custom domain / subdomain`;case`member_report_monthly`:return`Monthly AI progress report`;case`member_report_annual`:return`Annual Beauty Report`;case`priority_coach`:return`Priority AI Coach responses`;case`vip_discount`:return`15% off eligible retail at participating clinics`;case`early_access`:return`First access to new features`;default:return Ap(t)}}function Mp(e,t){switch(t){case`consultations`:return e===`spa`?`Client consultations`:`AI consultations`;case`ai_coach`:return`AI Coach`;case`multi_location`:return`Multiple locations`;case`skin_age`:return`Estimated Skin Age`;case`beauty_blueprint_basic`:return`Basic Beauty Blueprint`;case`beauty_blueprint_full`:return`Full Beauty Blueprint`;case`blueprint_365`:return Tp(`blueprint_365`,`365-Day Blueprint`);case`progress_images`:return Tp(`progress_images`,`Progress images`);case`care_instructions`:return Tp(`care_instructions`,`Pre, post and follow-up care instructions`);case`simulations`:return`Treatment visualisations`;case`treatment_simulator`:return`Treatment Simulator`;case`progress_tracking`:return e===`spa`?`Client progress tracking`:`Progress tracking`;case`white_label`:return`White-label branding`;case`basic_analytics`:return`Basic analytics`;case`analytics`:return`Advanced analytics`;case`bi_reports`:return`Business Intelligence AI reports`;case`portal_access`:return`Full Beauty Blueprint for Clinicians`;case`booking_links`:return`Custom booking link`;case`multi_location_analytics`:return`Multi-location analytics`;case`revenue_split`:return`Revenue split management`;case`custom_domain`:return`Custom domain / subdomain`;case`member_report_monthly`:return`Monthly AI progress report`;case`member_report_annual`:return`Annual Beauty Report`;case`priority_coach`:return`Priority AI Coach responses`;case`vip_discount`:return`VIP retail discount`;case`early_access`:return`First access to new features`;default:return Ap(t)}}var Np={spa:[`Lead Dashboard`],client:[]},Pp={client_premium:[Tp(`render_quality`,`Premium render quality`)],client_vip:[Tp(`render_qual
13ity`,`Ultra render quality`)]},Fp={starter:`For a single spa getting started with AI consultations.`,growth:`For growing spas that want high-volume consultations and BI.`,agency:`For multi-location groups and agencies.`,client_basic:`Your monthly beauty check-in.`,client_premium:`30 consultations a month and your full Beauty Blueprint.`,client_vip:`The full concierge beauty experience.`},Ip={starter:`Start Free Trial`,growth:`Start Free Trial`,agency:`Start Free Trial`,client_basic:`Get Basic`,client_premium:`Start Free Trial`,client_vip:`Go VIP`},Lp={starter:`spa-starter`,growth:`spa-growth`,agency:`spa-agency`,client_basic:`client-basic`,client_premium:`client-premium`,client_vip:`client-vip`},Rp=[`growth`,`client_premium`];function zp(e){return!e.annualPriceCents||!e.monthlyPriceCents?0:Math.max(0,Math.round(12-e.annualPriceCents/e.monthlyPriceCents))}function Bp(e){let t=(e.monthlyPriceCents??0)*12,n=e.annualPriceCents??0;return!t||!n||n>=t?null:((t-n)/t*100).toFixed(2).replace(/\.?0+$/,``)}function Vp(e){let t=Bp(e);if(!t)return null;let n=zp(e);return n<=0?`Save ${t}%`:`Get ${n} month${n===1?``:`s`} free`}function Hp(e){if(!e.annualPriceCents||!e.monthlyPriceCents)return null;let t=`Or ${Rt(e.annualPriceCents)}/year`,n=Vp(e);return n?`${t} â ${n.charAt(0).toLowerCase()}${n.slice(1)}`:t}function Up(e,t,n){let r=Ep(e,t),i=!!n?.[e]?.active,a=i?Ep(e,n):r,o=a.audience===`spa`?`spa`:`client`,s=Op[o],c=[...s.filter(e=>a.features.includes(e)).map(e=>jp(a,e)),...a.audience===`none`?[]:Np[o],...Pp[e]??[]],l=s.filter(e=>!a.features.includes(e)).map(e=>Mp(o,e)),u=a.trialDays??null,d=u?ot(e):null;return{code:e,name:a.label,audience:o,blurb:Fp[e]??``,popular:Rp.includes(e),monthlyCents:a.monthlyPriceCents,annualCents:a.annualPriceCents,monthlyPrice:Rt(a.monthlyPriceCents),annualPrice:Rt(a.annualPriceCents),annualNote:Hp(a),annualSavings:Vp(a),trialDays:u,trialText:d?`${d.days}-day free trial â includes ${d.consultations} ${o===`spa`?`client consultations`:`AI consultations`}. Cancel anytime before it ends.`:null,annualTrialText:d?`${d.days}-day free trial â includes ${d.consultations} ${o===`spa`?`client consultations`:`AI consultations`}. Cancel anytime before it ends.`:null,included:c,notIncluded:l,ctaLabel:Ip[e]??`Choose ${a.label}`,monthlyPriceId:a.monthlyPriceId,annualPriceId:a.annualPriceId,waitlistSlug:Lp[e]??null,founding:i?{label:`Founding Member`,note:`This rate is locked for as long as your subscription stays active, and is limited to the first 100 spa partners.`,standardMonthlyPrice:Rt(r.monthlyPriceCents),standardAnnualPrice:Rt(r.annualPriceCents)}:null}}function Wp(e,t,n){return zt(e).filter(e=>t?.[e.code]?.active!==!1).map(e=>Up(e.code,t,n)).sort((e,t)=>e.monthlyCents-t.monthlyCents)}var Gp=(0,H.createContext)({status:`unavailable`,reason:`Pricing has not been loaded.`});function Kp({value:e,children:t}){return(0,U.jsx)(Gp.Provider,{value:e,children:t})}function qp(){return(0,H.useContext)(Gp)}function Jp(e){let t=qp();return(0,H.useMemo)(()=>t.status===`ok`?{available:!0,plans:Wp(e,t.plans,t.founding)}:{available:!1,reason:t.reason},[t,e])}var Yp=null,Xp=null;async function Zp(){if(Yp&&Date.now()-Yp.at<6e4)return Yp.value;if(Xp)return Xp;Xp=Qp().finally(()=>{Xp=null});let e=await Xp;return e.status===`ok`&&(Yp={at:Date.now(),value:e}),e}async function Qp(){try{let e=await F(`stripe-api`,{action:`public_pricing`});return e.status===`ok`||e.status===`unavailable`?e:{status:`unavailable`,reason:`Pricing could not be loaded.`}}catch(e){return console.error(`[plan-pricing] edge read failed:`,e),{status:`unavailable`,reason:`Pricing could not be loaded.`}}}function $p(){return(0,U.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-4`,children:(0,U.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,U.jsx)(`h1`,{className:`text-7xl font-bold text-foreground`,children:`404`}),(0,U.jsx)(`h2`,{className:`mt-4 text-xl font-semibold text-foreground`,children:`Page not found`}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`The page you're looking for doesn't exist or has been moved.`}),(0,U.jsx)(`div`,{className:`mt-6`,children:(0,U.jsx)(D,{to:`/`,className:`inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:`Go home`})})]})})}function em({error:e,reset:t}){console.error(e);let n=fe();return(0,H.useEffect)(()=>{Ju(e,{boundary:`tanstack_root_error_component`})},[e]),(0,U.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-4`,children:(0,U.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,U.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-foreground`,children:`This page didn't load`}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Something went wrong on our end. You can try refreshing or head back home.`}),(0,U.jsxs)(`div`,{className:`mt-6 flex flex-wrap justify-center gap-2`,children:[(0,U.jsx)(`button`,{onClick:()=>{n.invalidate(),t()},className:`inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:`Try again`}),(0,U.jsx)(`a`,{href:`/`,className:`inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent`,children:`Go home`})]})]})})}var Q=M()({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`${X.name} â AI Skin Consultations & Treatment Roadmaps for Medspas`},{name:`description`,content:`Give clients a personalized AI Beauty Score, skin age analysis, and treatment roadmap â all under your brand. Built by a practicing Master Injector.`},{name:`google-site-verification`,content:`9HfgHJyssmCcFEtBpyhOe8_2QwbVgOra0SffzrPwbIY`},{name:`author`,content:`Michelle Vernon · ${X.parentBrand}`},{property:`og:site_name`,content:X.shortName},{property:`og:type`,content:`website`},{property:`og:title`,content:`${X.name} â AI Skin Consultations & Treatment Roadmaps for Medspas`},{property:`og:description`,content:`Give clients a personalized AI Beauty Score, skin age analysis, and treatment roadmap â all under your brand. Built by a practicing Master Injector.`},{name:`twitter:card`,content:`summary_large_image`},{name:`theme-color`,content:`#000000`}],links:[{rel:`stylesheet`,href:qu}
13,{rel:`icon`,type:`image/png`,href:`/favicon.png`},{rel:`preconnect`,href:`https://fonts.googleapis.com`},{rel:`preconnect`,href:`https://fonts.gstatic.com`,crossOrigin:`anonymous`},{rel:`stylesheet`,href:`https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&family=Karla:wght@400;500;600;700&display=swap`}]}),staleTime:6e4,loader:async()=>{try{return{pricing:await Zp()}}catch{return{pricing:{status:`unavailable`,reason:`Pricing could not be loaded.`}}}},shellComponent:tm,component:nm,notFoundComponent:$p,errorComponent:em});function tm({children:e}){return(0,U.jsxs)(`html`,{lang:`en`,children:[(0,U.jsx)(`head`,{children:(0,U.jsx)(ku,{})}),(0,U.jsxs)(`body`,{children:[e,(0,U.jsx)(ju,{})]})]})}function nm(){let{queryClient:e}=Q.useRouteContext(),{pricing:t}=Q.useLoaderData(),n=Cu({select:e=>e.location.pathname}),r=n.startsWith(`/dashboard`)||n.startsWith(`/onboarding`)||n.startsWith(`/super-admin`)||n===`/seo`||n.startsWith(`/seo/`)||n.startsWith(`/clinic/`)||n===`/auth`||n.startsWith(`/auth/`)||n===`/forgot-password`||n===`/reset-password`;return(0,U.jsx)(He,{client:e,children:(0,U.jsx)(Kp,{value:t,children:(0,U.jsx)(Pd,{children:(0,U.jsx)(op,{children:(0,U.jsxs)(Sp,{children:[(0,U.jsx)(dp,{}),(0,U.jsx)(vp,{}),(0,U.jsxs)(`div`,{className:`flex min-h-screen flex-col bg-background font-sans text-foreground`,children:[!r&&(0,U.jsx)(Bd,{}),(0,U.jsx)(`main`,{className:`flex-1`,children:(0,U.jsx)(pu,{})}),!r&&(0,U.jsx)(qd,{}),!r&&(0,U.jsx)(af,{}),(0,U.jsx)(of,{}),(0,U.jsx)(Lf,{})]})]})})})})})}var rm=`https://www.instagram.com/askmedspa.ai`;function im(e){return`${Ht(e)}/#organization`}function am(e){return`${Ht(e)}/#michelle-vernon`}function om(e){return{"@context":`https://schema.org`,"@type":`Organization`,"@id":im(e),name:`MedSpa Blueprint AI`,url:Ht(e),logo:{"@type":`ImageObject`,url:Wt(e),width:1200,height:1200},description:`White-label AI skin consultation, Beauty Score and business intelligence platform for medspa and spa owners.`,email:`[email protected]`,address:{"@type":`PostalAddress`,addressRegion:`FL`,addressCountry:`US`},parentOrganization:{"@type":`Organization`,name:`Body Studio Wellness Ltd`},founder:{"@id":am(e)},sameAs:[rm]}}function sm(e){return{"@context":`https://schema.org`,"@type":`WebSite`,"@id":`${Ht(e)}/#website`,url:Ht(e),name:`MedSpa Blueprint AI`,publisher:{"@id":im(e)}}}function cm(e){let t=Gt(`/pricing`,e);return{"@context":`https://schema.org`,"@type":`SoftwareApplication`,"@id":`${Ht(e)}/#software`,name:`MedSpa Blueprint AI`,applicationCategory:`BusinessApplication`,applicationSubCategory:`White-label AI skin consultation platform`,operatingSystem:`Web`,url:Ht(e),publisher:{"@id":im(e)},offers:[{"@type":`Offer`,name:`Starter`,price:`197.00`,priceCurrency:`USD`,category:`Spa owner plan`,url:t},{"@type":`Offer`,name:`Growth`,price:`297.00`,priceCurrency:`USD`,category:`Spa owner plan`,url:t},{"@type":`Offer`,name:`Agency`,price:`497.00`,priceCurrency:`USD`,category:`Spa owner plan`,url:t}],description:`White-label AI skin consultation platform for medspas. Four spa-owner tiers including Enterprise at custom pricing, plus personal memberships.`}}function lm(e){return{"@context":`https://schema.org`,"@type":`Person`,"@id":am(e),name:`Michelle Vernon`,jobTitle:`Founder`,description:`Practicing Master Injector and founder of MedSpa Blueprint AI. CEO of Body Studio Skincare.`,worksFor:{"@id":im(e)},knowsAbout:[`Medical aesthetics`,`Injectables`,`Medspa operations`,`Skin analysis`],sameAs:[rm],subjectOf:{"@type":`NewsArticle`,headline:`Cocktails with Michelle Vernon`,url:`https://www.jamaicaobserver.com/2025/06/22/cocktails-michelle-vernon/`,publisher:{"@type":`Organization`,name:`Jamaica Observer`},datePublished:`2025-06-22`}}}var um=[{path:`/`,label:`Home`,indexable:!0,inSitemap:!0,changefreq:`weekly`},{path:`/how-it-works`,label:`How it works`,indexable:!0,inSitemap:!0,changefreq:`monthly`},{path:`/for-spas`,label:`For spa owners`,indexable:!0,inSitemap:!0,changefreq:`monthly`},{path:`/pricing`,label:`Pricing`,indexable:!0,inSitemap:!0,changefreq:`weekly`},{path:`/demo`,label:`Live demo`,indexable:!0,inSitemap:!0,changefreq:`monthly`},{path:`/clinics`,label:`Partner clinics`,indexable:!0,inSitemap:!0,changefreq:`daily`},{path:`/join/client`,label:`Early access â individuals`,indexable:!0,inSitemap:!0,changefreq:`monthly`},{path:`/join/spa-owner`,label:`Early access â spa owners`,indexable:!0,inSitemap:!0,changefreq:`monthly`},{path:`/clinic/$clinicSlug`,label:`Partner clinic page (shared)`,indexable:!1,inSitemap:!1,changefreq:`weekly`,note:`Tenant page: works normally for visitors, but noindex so it never competes with the main site.`,fixedAddress:!0},{path:`/clinic/$clinicSlug/book`,label:`Clinic booking page (shared)`,indexable:!1,inSitemap:!1,changefreq:`monthly`,n
13ote:`Transactional appointment form â hidden from search and the sitemap.`,fixedAddress:!0},{path:`/start-consultation`,label:`Start a consultation`,indexable:!0,inSitemap:!0,changefreq:`monthly`},{path:`/terms`,label:`Terms of Service`,indexable:!0,inSitemap:!0,changefreq:`yearly`},{path:`/privacy`,label:`Privacy Policy`,indexable:!0,inSitemap:!0,changefreq:`yearly`},{path:`/cookies`,label:`Cookie Policy`,indexable:!0,inSitemap:!0,changefreq:`yearly`},{path:`/cancellation`,label:`Cancellation Policy`,indexable:!0,inSitemap:!0,changefreq:`yearly`},{path:`/purchase-terms`,label:`Purchase Terms`,indexable:!1,inSitemap:!1,changefreq:`yearly`,note:`Hidden until the owner-supplied document text is in place.`},{path:`/ai-terms`,label:`AI Terms of Use`,indexable:!1,inSitemap:!1,changefreq:`yearly`,note:`Hidden until the owner-supplied document text is in place.`},{path:`/ai-privacy`,label:`AI Privacy Notice`,indexable:!1,inSitemap:!1,changefreq:`yearly`,note:`Hidden until the owner-supplied document text is in place.`},{path:`/cookie-policy`,label:`Cookie Policy (document)`,indexable:!1,inSitemap:!1,changefreq:`yearly`,note:`Hidden until the owner-supplied document text is in place.`},{path:`/medical-disclaimer`,label:`Medical Disclaimer`,indexable:!1,inSitemap:!1,changefreq:`yearly`,note:`Hidden until the owner-supplied document text is in place.`},{path:`/earnings-disclaimer`,label:`Earnings Disclaimer`,indexable:!1,inSitemap:!1,changefreq:`yearly`,note:`Hidden until the owner-supplied document text is in place.`},{path:`/testimonial-disclosure`,label:`Testimonial Disclosure`,indexable:!1,inSitemap:!1,changefreq:`yearly`,note:`Hidden until the owner-supplied document text is in place.`},{path:`/contact-legal`,label:`Contact & Legal Notices`,indexable:!1,inSitemap:!1,changefreq:`yearly`,note:`Hidden until the owner-supplied document text is in place.`},{path:`/accessibility`,label:`Accessibility Statement`,indexable:!1,inSitemap:!1,changefreq:`yearly`,note:`Hidden until the owner-supplied document text is in place.`}],dm=[`/terms`,`/privacy`,`/cookies`,`/cancellation`,`/purchase-terms`,`/ai-terms`,`/ai-privacy`,`/cookie-policy`,`/medical-disclaimer`,`/earnings-disclaimer`,`/testimonial-disclosure`,`/contact-legal`,`/accessibility`,`/start-consultation`,`/clinic/$clinicSlug`];function fm(e){return dm.includes(e)}function pm(e){return um.find(t=>t.path===e)}function mm(e){return e===`/`?`home`:e.replace(/^\//,``).replace(/\//g,`_`)}function hm(e){return e===`home`?`/`:`/${e.replace(/_/g,`/`)}`}var gm=[`Organization`,`WebSite`,`WebPage`,`FAQPage`,`BreadcrumbList`,`Service`,`Product`,`Article`,`MedicalBusiness`,`LocalBusiness`,`OfferCatalog`],_m=e=>R().trim().max(e).transform(e=>e===``?null:e).nullable().default(null),vm=R().trim().max(500).refine(e=>e===``||/^https:\/\/[^\s]+$/i.test(e),`Enter a full web address starting with https://`).transform(e=>e===``?null:e).nullable().default(null),ym=L({type:Kt(gm),json:R().min(2).max(2e4)}),bm=L({label:R().trim().min(1).max(80),path:R().trim().regex(/^\/[A-Za-z0-9\-/]*$/,`Use a path on this site, e.g. /pricing`)}),xm=L({title:_m(200),description:_m(400),og_title:_m(200),og_description:_m(400),og_image_url:vm,canonical_url:vm,indexable:Zt().default(!0),follow:Zt().default(!0),in_sitemap:Zt().default(!0),h1:_m(200),subheading:_m(400),headings:Yt(R(),R().max(300)).default({}),alt_text:Yt(R(),R().max(300)).default({}),schema_blocks:Xt(ym).max(10).default([]),internal_links:Xt(bm).max(12).default([])});function Sm(){return xm.parse({})}var Cm=/^[a-z0-9]+(?:[-/][a-z0-9]+)*$/,wm=[`auth`,`api`,`dashboard`,`super-admin`,`checkout`,`clinic`,`invite`,`booking`,`sitemap.xml`,`robots.txt`,`assets`];function Tm(e,t){let n=e.trim().replace(/^\/+|\/+$/g,``).toLowerCase();return n===``?t.isHome?{ok:!0,slug:n}:{ok:!1,message:`Give the page an address ending.`}:Cm.test(n)?wm.includes(n.split(`/`)[0]??``)?{ok:!1,message:`"${n}" is reserved by the app and cannot be used.`}:t.taken.includes(n)?{ok:!1,message:`Another page already uses this address.`}:{ok:!0,slug:n}:{ok:!1,message:`Use lowercase letters, numbers and hyphens only, e.g. how-it-works.`}}function Em(e){return e===``?`/`:`/${e}`}function Dm(e){let t;try{t=JSON.parse(e.json)}
13catch(e){return{ok:!1,message:`Not valid JSON: ${e.message}`}}if(!t||typeof t!=`object`||Array.isArray(t))return{ok:!1,message:`Structured data must be a single JSON object.`};let n=t;return n[`@type`]===e.type?{ok:!0,value:{"@context":`https://schema.org`,...n}}:{ok:!1,message:`The JSON "@type" must be "${e.type}".`}}function Om(e,t){let n=e.trim();if(n===``)return{ok:!0,slug:``};let r;try{r=new URL(n)}catch{return{ok:!1,message:`Enter a full web address, e.g. https://example.com/page`}}return r.protocol===`https:`?t.length&&!t.includes(r.host)?{ok:!1,message:`Use an address on ${t.join(` or `)}.`}:{ok:!0,slug:r.toString()}:{ok:!1,message:`Use an https:// address.`}}function km(...e){for(let t of e){let e=t?.trim();if(e)return e}return``}function Am(e){return e?{...e,title:null,description:null,og_title:null,og_description:null,canonical_url:null,indexable:void 0,follow:void 0,in_sitemap:void 0}:null}function jm(e){let t=e.overrides??null,n=pm(e.path),r=fm(e.path)?e.indexable??n?.indexable??!0:t?.indexable??e.indexable??n?.indexable??!0,i=t?.follow??e.follow??!0,a=e.baseUrl??null,o=km(t?.title,e.title),s=km(/three spa-owner tiers/i.test(t?.description??``)?null:t?.description,e.description),c=km(t?.og_title,e.ogTitle,o),l=km(/launching september 2026/i.test(t?.og_description??``)?null:t?.og_description,e.ogDescription,s),u=km(t?.og_image_url,e.image),d=Gt((!u||u.startsWith(`/assets/`)||/r2\.dev|lovable\.app\/opengraph|lovableproject\.com/i.test(u)?``:u)||Ut(a),a),f=d===Ut(a),p=Gt(e.path,a),m=km(t?.canonical_url)||p,h=e.twitterCard??`summary_large_image`,g=[{title:o},{name:`description`,content:s},{property:`og:title`,content:c},{property:`og:description`,content:l},{property:`og:type`,content:e.ogType??`website`},{property:`og:url`,content:p},{property:`og:image`,content:d},...f?[{property:`og:image:width`,content:`1200`},{property:`og:image:height`,content:`630`},{property:`og:image:alt`,content:`MedSpa Blueprint AI â AI skin consultation under your own brand`}]:[],{name:`twitter:card`,content:h},{name:`twitter:title`,content:c},{name:`twitter:description`,content:l},{name:`twitter:image`,content:d}];(!r||!i)&&g.push({name:`robots`,content:`${r?`index`:`noindex`},${i?`follow`:`nofollow`}`});let _=[];if(r&&_.push({type:`application/ld+json`,children:JSON.stringify(om(a))},{type:`application/ld+json`,children:JSON.stringify(sm(a))}),r&&e.path!==`/`&&e.breadcrumb!==!1){let r=km(t?.h1,e.breadcrumbName,n?.label,o);_.push({type:`application/ld+json`,children:JSON.stringify({"@context":`https://schema.org`,"@type":`BreadcrumbList`,itemListElement:[{"@type":`ListItem`,position:1,name:`Home`,item:Gt(`/`,a)},{"@type":`ListItem`,position:2,name:r,item:p}]})})}for(let e of t?.schema_blocks??[]){let t=Dm(e);t.ok&&_.push({type:`application/ld+json`,children:JSON.stringify(t.value)})}let v={meta:g,links:[{rel:`canonical`,href:m}]};return _.length&&(v.scripts=_),v}var Mm=N,Nm=6e4,Pm=null,Fm=null;async function Im(e=!1){if(!e&&Pm&&Date.now()-Pm.at<Nm)return Pm.rows;try{let{data:e,error:t}=await Mm.from(`seo_pages_public`).select(`*`);if(t)throw t;let n=e??[];return Pm={at:Date.now(),rows:n},n}catch{return Pm?.rows??[]}}async function Lm(e){return(await Im()).find(t=>t.route_id===e||t.path===e)?.published??null}async function Rm(e=!1){if(!e&&Fm&&Date.now()-Fm.at<Nm)return Fm.row;try{let{data:e,error:t}=await Mm.from(`seo_site_settings`).select(`production_site_url, default_og_image_url, site_name, robots_disallow`).maybeSingle();if(t)throw t;let n=e??null;return Fm={at:Date.now(),row:n},n}catch{return Fm?.row??null}}function zm(){Pm=null,Fm=null}async function Bm(e){let[t,n]=await Promise.all([Lm(e),Rm()]);return{seo:t,siteUrl:n?.production_site_url??null}}var Vm=()=>P(()=>import(`./routes-DiZXXVnk.js`),__vite__mapDeps([6,3,7,8,9,10,11,12,13,14,15,16,17,18,19,2,4,20,21,22,23,24,25,26,27,28,29])),Hm=`${X.name} â AI Skin Consultations & Treatment Roadmaps for Medspas`,Um=`Give clients a personalized AI Beauty Score, skin age analysis, and treatment roadmap â all under your brand. Built by a practicing Master Injector.`,Wm=q(`/`)({head:({loaderData:e})=>{let t=jm({path:`/`,overrides:e?.seo,baseUrl:e?.siteUrl,title:Hm,description:Um});return{...t,scripts:[...t.scripts??[],{type:`application/ld+json`,children:JSON.stringify(cm(e?.siteUrl))},{type:`application/ld+json`,children:JSON.stringify(lm(e?.siteUrl))}]}},loader:()=>Bm(`/`),component:J(Vm,`component`)}),Gm=()=>P(()=>import(`./_-Cb8gi8yj.js`),[]),Km=N;function qm(e){let t=e.split(`?`)[0]??e;return t.length>1&&t.endsWith(`/`)?t.slice(0,-1):t}var Jm=q(`/$`)({head:()=>({meta:[{title:`Page not found · ${X.name}`},{name:`description`,content:`This address doesn't exist or has moved. Head back to the home page.`},{name:`robots`,content:`noindex,nofollow`}]}),loader:async({location:e})=>{let t=qm(e.pathname);try{let{data:e,error:n}=await Km.from(`seo_redirects`).select(`to_path, status`).eq(`from_path`,t).maybeSingle();if(n)throw n;let r=e;if(r?.to_path)throw s({href:r.to_path,statusCode:r.status===302?302:301})}catch(e){if(e&&typeof e==`object`&&`isRedirect`in e)throw e}return{notFound:!0}},component:J(Gm,`component`)});async function Ym(){let{data:e,error:t}=await N.auth.getUser();if(t)throw t;if(!e.user)throw Error(`Unauthorized: sign in required`);return e.user.id}async function Xm(){let e=await Ym(),{data:t,error:n}=await N.from(`profiles`).select(`*`).eq(`id`,e).maybeSingle();if(n)throw n;return t}async function Zm(){let e=await Ym(),[t,n]=await Promise.all([N.from(`profiles`).select(`user_type, onboarding_completed`).eq(`id`,e).maybeSingle(),N.from(`clinic_members`).select(`clinic_id, role, clinics(name, owner_user_id
13)`).eq(`user_id`,e)]);if(t.error)throw t.error;if(n.error)throw n.error;let r=n.data??[],i=r.find(t=>t.clinics?.owner_user_id===e),a=r.find(t=>t.clinics&&t.clinics.owner_user_id!==e);return{onboardingCompleted:!!t.data?.onboarding_completed,userType:t.data?.user_type??null,ownsAnyClinic:!!i,invitedMembership:a?{clinicId:a.clinic_id,clinicName:a.clinics?.name??`your clinic`,role:a.role}:null}}var Qm=L({full_name:R().trim().min(1).max(120),phone:R().trim().max(40).optional()});async function $m(e){let t=`data`in e?e.data:e,n=Qm.parse(t),r=await Ym(),{count:i,error:a}=await N.from(`clinic_members`).select(`id`,{count:`exact`,head:!0}).eq(`user_id`,r);if(a)throw a;if(!i)throw Error(`You are not a member of any clinic yet.`);let{error:o}=await N.from(`profiles`).update({full_name:n.full_name,phone:n.phone?.trim()?n.phone.trim():null,onboarding_completed:!0}).eq(`id`,r);if(o)throw o;return{ok:!0}}var eh=L({user_type:Kt([`client`,`spa_owner`])});async function th(e){let t=`data`in e?e.data:e;return await F(`consultations`,{action:`set_initial_user_type`,body:{userType:eh.parse(t).user_type}})}var nh=L({full_name:R().trim().min(1).max(100).optional(),spa_name:R().trim().max(120).optional(),spa_subdomain:R().trim().toLowerCase().regex(/^[a-z0-9-]{3,40}$/i,`Subdomain must be 3â40 letters, numbers, or hyphens`).optional(),skin_goals:Xt(R().max(60)).max(10).optional(),region:R().trim().max(80).optional(),country:R().trim().max(80).optional(),timezone:R().trim().max(80).optional(),focus_areas:Xt(R().max(60)).max(20).optional(),app_url:R().url().optional()});async function rh(e){let t=`data`in e?e.data:e;return await F(`consultations`,{action:`complete_onboarding`,body:nh.parse(t)})}var ih=null,ah=new Map;function oh(){ih=null,ah.clear()}function sh(e,t,n){ih!==e&&(oh(),ih=e);let r=ah.get(t);if(r&&Date.now()-r.at<3e4)return r.value;let i=n();return ah.set(t,{at:Date.now(),value:i}),i.catch(()=>{ah.get(t)?.value===i&&ah.delete(t)}),i}var ch=!1;function lh(){ch||typeof window>`u`||(ch=!0,N.auth.onAuthStateChange((e,t)=>{if(e===`TOKEN_REFRESHED`||e===`INITIAL_SESSION`){t?.user?.id&&ih&&t.user.id!==ih&&oh();return}oh()}))}async function uh(){lh();let{data:e}=await N.auth.getSession(),t=e.session?.user?.id;return t?sh(t,`user`,async()=>{let{data:e,error:n}=await N.auth.getUser();if(n||!e.user||e.user.id!==t)throw n??Error(`no user`);return{user:e.user,error:null}}).catch(e=>({user:null,error:e})):{user:null,error:null}}var dh=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,fh=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ph=/^([01]\d|2[0-3]):[0-5]\d$/,mh=/^\d{4}-\d{2}-\d{2}$/;function hh(e){throw Error(e)}function gh(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function _h(e,t,n=`value`){if(e==null)return;typeof e!=`string`&&hh(`Invalid ${n}`);let r=e.trim();if(r)return r.length>t&&hh(`${n} is too long (max ${t})`),r}function vh(e){let t=_h(e,2048,`URL`);if(t)try{return new URL(t),t}catch{hh(`Invalid URL`)}}function yh(e){let t=_h(e,255,`email`);if(t)return fh.test(t)||hh(`Invalid email`),t}function bh(e){let t=_h(e,20,`color`);if(t)return dh.test(t)||hh(`Use a hex color like #C9A84C`),t}function xh(e){let t=_h(e,5,`time`);if(t)return ph.test(t)||hh(`Use HH:MM (24h)`),t}var Sh=[`subtle`,`moderate`,`strong`],Ch=[`natural`,`clinical`,`dramatic`],wh=[`immediate`,`healed`,`course-complete`],Th=[`default`,`warm`,`clinical`,`luxury`],Eh=[/\bprescrib/i,/\bdiagnos/i,/\bdosag/i,/\bdose\b/i,/\b\d+\s?mg\b/i,/\b\d+\s?ml\b/i,/\bmedication/i,/\bguarantee/i,/\bpromise/i,/\bcure\b/i,/\bignore (previous|all|the) instructions/i,/\boverride\b/i,/\bremove (the )?disclaim/i,/\bwithout disclaim/i],Dh=`Cannot include medical dosing, diagnoses, outcome guarantees, or safety disclaimers.`;function Oh(e,t){if(!(e==null||e===``))return(typeof e!=`string`||!t.includes(e))&&hh(`Invalid input`),e}function kh(e){return gh(e)||hh(`Invalid input`),{strength:Oh(e.strength,Sh),naturalness:Oh(e.naturalness,Ch),recovery_stage:Oh(e.recovery_stage,wh)}}function Ah(e){gh(e)||hh(`Invalid input`);let t=Oh(e.tone,Th),n=_h(e.extra_instructions,500,`extra instructions`);return n&&Eh.some(e=>e.test(n))&&hh(Dh),{tone:t,extra_instructions:n}}function jh(e){try{return kh(e??{})}catch{return{}}}function Mh(e){try{return Ah(e??{})}catch{return{}}}var Nh=[`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`],Ph={logoUrl:void 0,description:void 0,website:void 0,contact:{email:void 0,phone:void 0},address:{line1:void 0,line2:void 0,city:void 0,region:void 0,postalCode:void 0,country:void 0},hours:Nh.reduce((e,t)=>
13({...e,[t]:{closed:!1,open:void 0,close:void 0}}),{}),holidays:[],social:{instagram:void 0,facebook:void 0,tiktok:void 0,linkedin:void 0,youtube:void 0,x:void 0}};function Fh(e){return gh(e)||hh(`Invalid hours`),{closed:typeof e.closed==`boolean`?e.closed:!1,open:xh(e.open),close:xh(e.close)}}function Ih(e){gh(e)||hh(`Invalid profile`);let t=gh(e.contact)?e.contact:hh(`Invalid contact`),n=gh(e.address)?e.address:hh(`Invalid address`),r=gh(e.hours)?e.hours:hh(`Invalid hours`),i=gh(e.social)?e.social:hh(`Invalid social`),a={};for(let e of Nh)a[e]=Fh(r[e]);let o=[],s=e.holidays;return s!=null&&((!Array.isArray(s)||s.length>100)&&hh(`Invalid holidays`),o=s.map(e=>{gh(e)||hh(`Invalid holiday`);let t=typeof e.date==`string`?e.date.trim():``;return mh.test(t)||hh(`Use YYYY-MM-DD`),{date:t,label:_h(e.label,120,`holiday label`)}})),{logoUrl:vh(e.logoUrl),description:_h(e.description,2e3,`description`),website:vh(e.website),contact:{email:yh(t.email),phone:_h(t.phone,40,`phone`)},address:{line1:_h(n.line1,200,`address`),line2:_h(n.line2,200,`address`),city:_h(n.city,120,`city`),region:_h(n.region,120,`region`),postalCode:_h(n.postalCode,40,`postal code`),country:_h(n.country,120,`country`)},hours:a,holidays:o,social:{instagram:vh(i.instagram),facebook:vh(i.facebook),tiktok:vh(i.tiktok),linkedin:vh(i.linkedin),youtube:vh(i.youtube),x:vh(i.x)}}}function Lh(e){if(!gh(e))return Ph;try{return Ih(e.profile)}catch{return Ph}}var Rh=[{key:`name`,label:`Clinic name`},{key:`timezone`,label:`Timezone`},{key:`description`,label:`Description`},{key:`logoUrl`,label:`Logo`},{key:`contact.email`,label:`Contact email`},{key:`contact.phone`,label:`Contact phone`},{key:`address.line1`,label:`Street address`},{key:`address.city`,label:`City`},{key:`address.country`,label:`Country`},{key:`hours`,label:`Business hours`}];function zh(e,t,n){let r=[],i=(e,t,n)=>{n||r.push({key:e,label:t})};i(`name`,`Clinic name`,!!(e&&e.trim())),i(`timezone`,`Timezone`,!!(t&&t.trim())),i(`description`,`Description`,!!n.description),i(`logoUrl`,`Logo`,!!n.logoUrl),i(`contact.email`,`Contact email`,!!n.contact.email),i(`contact.phone`,`Contact phone`,!!n.contact.phone),i(`address.line1`,`Street address`,!!n.address.line1),i(`address.city`,`City`,!!n.address.city),i(`address.country`,`Country`,!!n.address.country),i(`hours`,`Business hours`,Nh.some(e=>{let t=n.hours[e];return!t.closed&&t.open&&t.close}));let a=Rh.length,o=a-r.length;return{missing:r,complete:o,total:a,percent:Math.round(o/a*100)}}var Bh=[`Inter`,`Cormorant Garamond`,`Playfair Display`,`Space Grotesk`,`DM Sans`,`Lora`,`Poppins`],Vh={logoUrl:void 0,faviconUrl:void 0,colors:{primary:void 0,primaryForeground:void 0,accent:void 0,background:void 0,primaryHover:void 0,secondary:void 0,secondaryHover:void 0,secondaryForeground:void 0,text:void 0,textMuted:void 0,surface:void 0,border:void 0,success:void 0,successForeground:void 0,warning:void 0,warningForeground:void 0,danger:void 0,dangerForeground:void 0,link:void 0,linkHover:void 0},typography:{fontFamily:void 0},welcomeMessage:{title:void 0,body:void 0},email:{fromName:void 0,headerLogoUrl:void 0,footerText:void 0,accentColor:void 0}};function Hh(e){gh(e)||hh(`Invalid brand`);let t=gh(e.colors)?e.colors:hh(`Invalid colors`),n=gh(e.welcomeMessage)?e.welcomeMessage:hh(`Invalid welcome message`),r=gh(e.email)?e.email:hh(`Invalid email settings`),i;return e.typography!==void 0&&e.typography!==null&&(gh(e.typography)||hh(`Invalid typography`),i={fontFamily:Oh(e.typography.fontFamily,Bh)}),{logoUrl:vh(e.logoUrl),faviconUrl:vh(e.faviconUrl),colors:{primary:bh(t.primary),primaryForeground:bh(t.primaryForeground),accent:bh(t.accent),background:bh(t.background),primaryHover:bh(t.primaryHover),secondary:bh(t.secondary),secondaryHover:bh(t.secondaryHover),secondaryForeground:bh(t.secondaryForeground),text:bh(t.text),textMuted:bh(t.textMuted),surface:bh(t.surface),border:bh(t.border),success:bh(t.success),successForeground:bh(t.successForeground),warning:bh(t.warning),warningForeground:bh(t.warningForeground),danger:bh(t.danger),dangerForeground:bh(t.dangerForeground),link:bh(t.link),linkHover:bh(t.linkHover)},typography:i,welcomeMessage:{title:_h(n.title,120,`welcome title`),body:_h(n.body,600,`welcome body`)},email:{fromName:_h(r.fromName,80,`from name`),headerLogoUrl:vh(r.headerLogoUrl),footerText:_h(r.footerText,400,`footer text`),accentColor:bh(r.accentColor)}}}function Uh(e){if(!gh(e))return Vh;try{return Hh(e.brand)}catch{return Vh}}async function Wh(e){let{data:t,error:n}=await N.from(`clinics_public`).select(`id, slug, name, branding`).eq(`slug`,e.data.slug.trim().toLowerCase()).maybeSingle();if(n)throw n;return t}async function Gh(e){return await F(`consultations`,{action:`public_clinic_profile`,body:{slug:e.data.slug}})}async function Kh(e){return await F(`consultations`,{action:`public_clinic_availability`,body:{slug:e.data.slug}})}async function qh(){return await F(`consultations`,{action:`clinics_list_mine`,body:{}})}async function Jh(){return await F(`consultations`,{action:`clinic_platform_ref`,body:{}})}async function Yh(e){let{data:{user:t}}=await N.auth.getUser();if(!t)return null;let{data:n,error:r}=await N.from(`clinics`).select(`id`).eq(`slug`,e.data.slug.trim().toLowerCase()).maybeSingle();if(r)throw r;if(!n)return null;let{data:i,error:a}=await N.from(`clinic_members`).select(`role`).eq(`clinic_id`,n.id).eq(`user_id`,t.id).maybeSingle();if(a)throw a;if(!i)return null;let o=i.role===`admin`?`manager`:i.role;return{clinicId:n.id,role:o}}async function Xh(){let e=await $t(),{data:t,error:n}=await N.from(`clinic_settings`).select(`simulation_defaults, ai_voice`).eq(`clinic_id`,e).maybeSingle();if(n)throw n;return{simulation_defaults:jh(t?.simulation_defaults??{}),ai_voice:Mh(t?.ai_voice??{})}}async function Zh(e){return await F(`consultations`,{action:`clinic_ai_settings_update`,body:{...e.data}})}async function Qh(){let e=await $t(),{data:t,error:n}=await N.from(`clinics`).select(`id, name, slug`).eq(`id`,e).maybeSingle();if(n)throw n;if(!t)throw Error(`Clinic not found`);let{data:r,error:i}=await N.from(`clinic_settings`).select(`timezone, branding`).eq(`clinic_id`,e).maybeSingle();if(i)throw i;return{name:t.name,slug:t.slug,timezone:r?.timezone??`UTC`,profile:Lh(r?.branding)}}async function $h(e){return await F(`consultations`,{action:`clinic_profile_update`,body:{...e.data}})}async function eg(){let{data:{user:e}}=await N.auth.getUser();if(!e)return[];let{data:t,error:n}=await N.from(`clinic_members`).select(`role, clinic:clinics ( id, slug, name )`).eq(`user_id`,e.id).in(`role`,[`owner`,`manager`,`admin`]);if(n)throw n;let r=(t??[]).filter(e=>e.clinic);if(r.length===0)return[];let i=r.map(e=>e.clinic.id),{data:a,error:o}=await N.from(`clinic_settings`).select(`clinic_id, timezone, branding`).in(`clinic_id`,i);if(o)throw o;let s=new Map((a??[]).map(e=>[e.clinic_id,e]));return r.map(e=>{let t=s.get(e.clinic.id),n=Lh(t?.branding),r=zh(e.clinic.name,t?.timezone,n);return{clinicId:e.clinic.id,clinicSlug:e.clinic.slug,clinicName:e.clinic.name,role:e.role===`admin`?`manager`:e.role,...r}})}async function tg(){let e=await $t(),{data:t,error:n}=await N.from(`clinics`).select(`branding`).eq(`id`,e).maybeSingle();if(n)throw n;return{brand:Uh(t?.branding),clinicId:e}}async function ng(e){return await F(`consultations`,{action:`clinic_brand_update`,body:{brand:e.data.brand}})}async function rg(e){return await F(`consultations`,{action:`public_clinic_locations`,body:{slug:e.data.slug}})}var ig=()=>We({queryKey:[`my-clinics`],queryFn:async()=>{let{data:e}=await N.auth.getSession();return e.session?qh():[]},staleTime:6e4,retry:!1});function ag(e){if(!e||e.length===0)return;let t=e.filter(e=>e.clinic.slug!==`platform`);if(t.length===0)return;let n={owner:0,admin:1,manager:1,staff:2};return[...t].sort((e,t)=>
13(n[e.role]??3)-(n[t.role]??3))[0]}var og=()=>P(()=>import(`./route-B0BNlrZL.js`),__vite__mapDeps([30,3,31,32,9,33,10,34,35,36,37,38,39,40,16,8,41,42,43,44,45,46,47,22,23,20,21,13,12,14,48,15,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,18,67,68,7,69,70,71,72,73,74,19,2,4,75,76,1,5,77,78,79,80]));async function sg(e){let t=await sh(e,`profile`,()=>Xm());return t?.user_type||lg(),t}async function cg(e){let t=await sh(e,`onboarding`,()=>Zm());return t.onboardingCompleted||lg(),t}function lg(){oh()}var ug=q(`/_authenticated`)({beforeLoad:async({location:e,context:t})=>{let{user:n,error:r}=await uh(),i={user:n};if(r||!i.user)throw s({to:`/auth`,search:{redirect:e.href}});if(gp())throw window.location.replace(`/reset-password`),new Promise(()=>{});let a=i.user.id,{isSuperAdmin:o,isSeoManager:c}=await sh(a,`global-roles`,async()=>{let[e,t]=await Promise.all([N.rpc(`is_super_admin`,{_user:a}),N.rpc(`is_seo_manager`,{_user:a})]);if(e.error)throw e.error;if(t.error)throw t.error;return{isSuperAdmin:!!e.data,isSeoManager:!!t.data}});if(o){ge(null);let t=e.pathname;if(!(t.startsWith(`/super-admin`)||t.startsWith(`/seo`)||t.startsWith(`/dashboard/account`)))throw window.location.replace(`/super-admin`),new Promise(()=>{});return{user:i.user,profile:null,isSuperAdmin:!0}}if(c){if(ge(null),!e.pathname.startsWith(`/seo`))throw window.location.replace(`/seo`),new Promise(()=>{});return{user:i.user,profile:null,isSeoManager:!0}}let l=e.pathname===`/complete-profile`;if(e.pathname!==`/auth/choose-role`&&!l){let e=await sg(a);if(e&&!e.user_type)throw s({to:`/auth/choose-role`})}if(e.pathname!==`/onboarding`&&!l){let e=await cg(a);if(!e.onboardingCompleted)throw s({to:e.invitedMembership?`/complete-profile`:`/onboarding`});let n=await sg(a),r=ag(await t.queryClient.ensureQueryData(ig()));return ge(r?r.clinic.slug:null),{user:i.user,profile:n}}if(l){let e=await Zm();if(e.onboardingCompleted)throw s({to:`/dashboard`});if(!e.invitedMembership)throw s({to:`/onboarding`})}return{user:i.user,profile:null}},component:J(og,`component`)}),dg=q(`/accessibility`)({head:({loaderData:e})=>jm({path:`/accessibility`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Accessibility Statement â ${X.name}`,description:`The ${X.name} accessibility statement.`,twitterCard:`summary`}),loader:()=>Bm(`/accessibility`),component:J(()=>P(()=>import(`./accessibility-COX4-oJK.js`),__vite__mapDeps([81,82,3,83,10,9])),`component`)}),fg=q(`/ai-privacy`)({head:({loaderData:e})=>jm({path:`/ai-privacy`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`AI Privacy Notice â ${X.name}`,description:`Privacy notice for MedSpa Blueprint AI.`,twitterCard:`summary`}),loader:()=>Bm(`/ai-privacy`),component:J(()=>P(()=>import(`./ai-privacy-h33ps5U7.js`),__vite__mapDeps([84,82,3,83,10,9])),`component`)}),pg=q(`/ai-terms`)({head:({loaderData:e})=>jm({path:`/ai-terms`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`AI Terms of Use â ${X.name}`,description:`Terms of use for MedSpa Blueprint AI.`,twitterCard:`summary`}),loader:()=>Bm(`/ai-terms`),component:J(()=>P(()=>import(`./ai-terms-DBi5POgt.js`),__vite__mapDeps([85,82,3,83,10,9])),`component`)}),mg=()=>P(()=>import(`./auth-B-JqqChD.js`),__vite__mapDeps([86,3,31,32,9,33,10,35,39,40,38,37,87,88,12,13,14,89,90,91,92,93,8,51,42,59,94,67,95,96,43,44,71,45,48,97])),hg=L({mode:Kt([`signin`,`signup`]).optional(),type:Kt([`spa_owner`,`client`]).optional(),redirect:R().optional()}),gg=q(`/auth`)({validateSearch:e=>hg.parse(e),beforeLoad:async({search:e})=>{let{data:t}=await N.auth.getUser();if(t.user){if(e.redirect)throw s({href:e.redirect});let{data:n}=await N.rpc(`is_super_admin`,{_user:t.user.id});throw s({to:n?`/super-admin`:`/dashboard`})}},head:()=>({meta:[{title:`Sign in · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(mg,`component`)}),_g=q(`/cancellation`)({head:({loaderData:e})=>jm({path:`/cancellation`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Cancellation Policy â ${X.name}`,description:`How to cancel your MedSpa Blueprint AI plan, what happens to your data after cancellation, and how refunds and the 7-day free trial are handled.`,twitterCard:`summary`}),loader:()=>Bm(`/cancellation`),component:J(()=>P(()=>import(`./cancellation-C1ZyYy7k.js`),__vite__mapDeps([98,10,3,99])),`component`)}),vg=We({queryKey:[`all-active-clinics`],queryFn:()=>en(),staleTime:300*1e3});function yg(e){return e.split(/\s+/).map(e=>
13e[0]).filter(Boolean).slice(0,2).join(``).toUpperCase()}function bg({clinic:e,newTab:t}){let n=[e.city,e.region].filter(Boolean).join(`, `);return(0,U.jsxs)(D,{to:`/clinic/$clinicSlug`,params:{clinicSlug:e.slug},...t?{target:`_blank`,rel:`noopener noreferrer`}:{},className:`group flex items-start gap-4 rounded-lg border border-border bg-[#0F0F0F] p-5 transition-colors hover:border-gold/50`,children:[e.logoUrl?(0,U.jsx)(`img`,{src:e.logoUrl,alt:`${e.name} logo`,className:`h-14 w-14 shrink-0 rounded-full border border-border object-cover`,loading:`lazy`}):(0,U.jsx)(`div`,{"aria-hidden":!0,className:`flex h-14 w-14 shrink-0 items-center justify-center rounded-full border border-gold/40 bg-gold/10 font-display text-base text-gold`,children:yg(e.name)}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`h2`,{className:`font-display text-base text-white group-hover:text-gold`,children:e.name}),n&&(0,U.jsxs)(`p`,{className:`mt-1 flex items-center gap-1 text-xs text-text-muted`,children:[(0,U.jsx)(tt,{className:`h-3 w-3`,"aria-hidden":!0}),n]})]})]})}function xg({clinics:e,newTab:t}){return e.length===0?(0,U.jsx)(`div`,{className:`mx-auto mt-10 max-w-md rounded-lg border border-border bg-[#0F0F0F] p-8 text-center text-sm text-text-muted`,children:`No partner clinics are live yet. Check back soon.`}):(0,U.jsx)(`div`,{className:`mt-10 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:e.map(e=>(0,U.jsx)(bg,{clinic:e,newTab:t},e.id))})}var Sg=q(`/clinics`)({loader:async({context:e})=>{let[,t]=await Promise.all([e.queryClient.ensureQueryData(vg),Bm(`/clinics`)]);return t},head:({loaderData:e})=>jm({path:`/clinics`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Partner clinics · ${X.name}`,description:`Browse verified medspa partner clinics using MedSpa Blueprint's AI consultation platform.`}),component:J(()=>P(()=>import(`./clinics-CxMnjUSP.js`),__vite__mapDeps([100,101,21,3,22,23,10,9,102,103])),`component`),errorComponent:J(()=>P(()=>import(`./clinics-CeetGTVu.js`),[]),`errorComponent`),notFoundComponent:J(()=>P(()=>import(`./clinics-CtrOJ3E-.js`),[]),`notFoundComponent`)}),Cg=q(`/contact-legal`)({head:({loaderData:e})=>jm({path:`/contact-legal`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Contact & Legal Notices â ${X.name}`,description:`How to contact ${X.name} and send legal notices.`,twitterCard:`summary`}),loader:()=>Bm(`/contact-legal`),component:J(()=>P(()=>import(`./contact-legal-USW_vQXY.js`),__vite__mapDeps([104,82,3,83,10,9])),`component`)}),wg=q(`/cookie-policy`)({head:({loaderData:e})=>jm({path:`/cookie-policy`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Cookie Policy â ${X.name}`,description:`The ${X.name} Cookie Policy.`,twitterCard:`summary`}),loader:()=>Bm(`/cookie-policy`),component:J(()=>P(()=>import(`./cookie-policy-pzOXMSS-.js`),__vite__mapDeps([105,82,3,83,10,9])),`component`)}),Tg=q(`/cookies`)({head:({loaderData:e})=>jm({path:`/cookies`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Cookie Policy â ${X.name}`,description:`Learn how ${X.name} uses cookies and similar technologies to run the site, remember your preferences, and measure product performance.`,twitterCard:`summary`}),loader:()=>Bm(`/cookies`),component:J(()=>P(()=>import(`./cookies-B9A8kFsa.js`),__vite__mapDeps([106,10,3,99])),`component`)}),Eg=q(`/demo`)({head:({loaderData:e})=>jm({path:`/demo`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Live Demo â ${X.name}`,description:`Try a sample AI skin consultation in 2 minutes. See the Beauty Score, skin age analysis, and personalized routine your clients would receive.`,ogDescription:`Try a sample AI skin consultation in 2 minutes.`}),loader:()=>Bm(`/demo`),component:J(()=>P(()=>import(`./demo-_cOXgf1l.js`),__vite__mapDeps([107,3,12,13,10,9,14,102,103])),`component`)}),Dg=q(`/earnings-disclaimer`)({head:({loaderData:e})=>jm({path:`/earnings-disclaimer`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Earnings & Results Disclaimer â ${X.name}`,description:`The ${X.name} earnings and results disclaimer.`,twitterCard:`summary`}),loader:()=>Bm(`/earnings-disclaimer`),component:J(()=>P(()=>import(`./earnings-disclaimer-t--J8xRW.js`),__vite__mapDeps([108,82,3,83,10,9])),`component`)}),Og=q(`/for-spas`)({head:({loaderData:e})=>jm({path:`/for-spas`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`For Spa Owners â ${X.name}`,description:`Run a smarter, more profitable medspa with white-label AI consultations, business intelligence, and the MedSpa Blueprint education ecosystem built in.`,ogDescription:`White-label AI, business intelligence, and a complete education ecosystem for spa & medspa owners.`}),loader:()=>Bm(`/for-spas`),component:J(()=>P(()=>import(`./for-spas-CvpbAIo9.js`),__vite__mapDeps([109,3,110,31,32,9,33,10,35,38,111,8,43,44,11,12,13,14,15,16,17,18,7,19,2,4,20,21,22,23,24,102,25,26,27,28,29,103])),`component`)}),kg=q(`/forgot-password`)({beforeLoad:async()=>{let{data:e}=await N.auth.getUser();if(e.user)throw s({to:`/dashboard`})},head:()=>({meta:[{title:`Reset your password · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./forgot-password-BAkWk7Rv.js`),__vite__mapDeps([112,3,12,13,10,9,14,71,45,32,48,44,43,96])),`component`)}),Ag=q(`/how-it-works`)({head:({loaderData:e})=>jm({path:`/how-it-works`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`How It Works â ${X.name}`,description:`See exactly how ${X.shortName} turns an Instagram bio click into a booked appointment in under 2 minutes.`,ogDescription:`From quiz to booking â the full client journey, plus the spa owner dashboard.`}),loader:()=>Bm(`/how-it-works`),component:J(()=>P(()=>import(`./how-it-works-CoTQUu5k.js`),__vite__mapDeps([113,3,12,13,10,9,14,8,26,60,62,65,18,68,102,103])),`component`)}),jg=q(`/medical-disclaimer`)({head:({loaderData:e})=>jm({path:`/medical-disclaimer`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Medical & Health Disclaimer â ${X.name}`,description:`The ${X.name} medical and health disclaimer.`,twitterCard:`summary`}),loader:()=>Bm(`/medical-disclaimer`),component:J(()=>P(()=>import(`./medical-disclaimer-DKjrVnwN.js`),__vite__mapDeps([114,82,3,83,10,9])),`component`)}),Mg=[[`What happens after my 7-day trial?`,`Pick a plan to keep going. If you don't, your dashboard pauses but your data is preserved for 90 days.`],[`Can I cancel anytime?`,`Yes â month-to-month, no contracts.`],[`What does white-label mean?`,`Your spa's brand is the only one your clients ever see.`],[`Do my clients know it's powered by MedSpa Blueprint AI?`,`No. The platform is invisible to your clients.`],[`Is there a setup fee?`,`No. Every plan includes a 7-day trial that c
13overs full setup; you only pay once the trial ends.`],[`Can I switch plans?`,`Yes â upgrade, downgrade, or pause from your dashboard.`]];function Ng(e){if(e===void 0)return null;let t=typeof e==`function`?e():e;return t.trim()===``?null:t}var Pg=`Simple monthly pricing. Four spa-owner tiers â Starter $197, Growth $297, Agency $497 and Enterprise â plus three personal tiers from $29. 7-day free trial on every plan. No contracts.`,Fg={"/":{title:`${X.name} â AI Skin Consultations & Treatment Roadmaps for Medspas`,description:`Give clients a personalized AI Beauty Score, skin age analysis, and treatment roadmap â all under your brand. Built by a practicing Master Injector.`,h1:`The AI Consultation Platform Built For Medspas.`,altText:{founder:`${X.founderName}, founder of ${X.parentBrand}`}},"/how-it-works":{title:`How It Works â ${X.name}`,description:`See exactly how ${X.shortName} turns an Instagram bio click into a booked appointment in under 2 minutes.`,ogDescription:`From quiz to booking â the full client journey, plus the spa owner dashboard.`,h1:`How MedSpa Blueprint AI Works`,subheading:`From an Instagram bio click to a booked appointment â in under 2 minutes.`},"/for-spas":{title:`For Spa Owners â ${X.name}`,description:`Run a smarter, more profitable medspa with white-label AI consultations, business intelligence, and the MedSpa Blueprint education ecosystem built in.`,ogDescription:`White-label AI, business intelligence, and a complete education ecosystem for spa & medspa owners.`,h1:`The AI Platform That Runs Like a Member of Your Team.`},"/pricing":{title:`Pricing â ${X.name}`,description:Pg,ogDescription:()=>`Transparent pricing for spa owners and clients. 7-day trial on ${st}. Cancel anytime.`,h1:`Pricing`},"/demo":{title:`Live Demo â ${X.name}`,description:`Try a sample AI skin consultation in 2 minutes. See the Beauty Score, skin age analysis, and personalized routine your clients would receive.`,ogDescription:`Try a sample AI skin consultation in 2 minutes.`,h1:`A 2-Minute Sample Consultation.`},"/clinics":{title:`Partner clinics · ${X.name}`,description:`Browse verified medspa partner clinics using MedSpa Blueprint's AI consultation platform.`,h1:`All partner clinics`},"/join/client":{title:`Early Access for Individuals â ${X.name}`,description:`Join the individual client waitlist for MedSpa Blueprint AI⢠â get your personalised Beauty Score and matched treatment plan when we launch.`,ogDescription:()=>`Get your personalised Beauty Score and matched treatment plan. Launching ${Ud}.`},"/join/spa-owner":{title:`Early Access for Spa Owners â ${X.name}`,description:`Reserve your spa's spot for MedSpa Blueprint AI⢠â the only AI consultation platform built by a practicing Master Injector, designed to run under your brand.`,ogDescription:()=>`Built by a practicing Master Injector. Designed to run under your brand. Launching ${Ud}.`},"/start-consultation":{title:`Start your AI consultation â ${X.name}`,description:`Get a personalized AI skin consultation, Beauty Score, and Blueprint in minutes â under MedSpa Blueprint AI.`,ogDescription:`Choose your treatment, answer a few questions, and receive a personalized, treatment-specific AI consultation report.`,h1:`Tell us what you'd like to change`},"/terms":{title:`Terms of Service â ${X.name}`,description:`Read the ${X.name} terms of service covering account use, subscriptions, acceptable use, disclaimers, and the agreement between you and our platform.`,twitterCard:`summary`},"/privacy":{title:`Privacy Policy â ${X.name}`,description:`Read the ${X.name} privacy policy: what data we collect, how we use it, how we protect it, and the choices you have about your personal information.`,twitterCard:`summary`},"/cookies":{title:`Cookie Policy â ${X.name}`,description:`Learn how ${X.name} uses cookies and similar technologies to run the site, remember your preferences, and measure product performance.`,twitterCard:`summary`},"/cancellation":{title:`Cancellation Policy â ${X.name}`,description:`How to cancel your MedSpa Blueprint AI plan, what happens to your data after cancellation, and how refunds and the 7-day free trial are handled.`,twitterCard:`summary`}};function Ig(e){let t=Fg[e],n=um.find(t=>t.path===e),r=Sm();if(!t)return{...r,indexable:n?.indexable??!0,in_sitemap:n?.inSitemap??!0};let i=Ng(t.title),a=Ng(t.description);return{...r,title:i,description:a,og_title:Ng(t.ogTitle)??i,og_description:Ng(t.ogDescription)??a,h1:Ng(t.h1),subheading:Ng(t.subheading),alt_text:t.altText??{},indexable:n?.indexable??!0,in_sitemap:n?.inSitemap??!0}}var Lg=q(`/pricing`)({head:({loaderData:e})=>{let t=jm({path:`/pricing`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Pricing â ${X.name}`,description:Pg,ogDescription:`Transparent pricing for spa owners and clients. 7-day trial on ${st}. Cancel anytime.`});return{...t,scripts:[...t.scripts??[],{type:`application/ld+json`,children:JSON.stringify(cm(e?.siteUrl))},{type:`application/ld+json`,children:JSON.stringify({"@context":`https://schema.org`,"@type":`FAQPage`,mainEntity:Mg.map(([e,t])=>
13({"@type":`Question`,name:e,acceptedAnswer:{"@type":`Answer`,text:t}}))})}]}},loader:()=>Bm(`/pricing`),component:J(()=>P(()=>import(`./pricing-BIyR5w-1.js`),__vite__mapDeps([115,3,110,31,32,9,33,10,35,38,111,8,43,44,12,13,14,51,16,66,18,7,11,15,17,19,2,4,20,21,22,23,24,102,103])),`component`)}),Rg=q(`/privacy`)({head:({loaderData:e})=>jm({path:`/privacy`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Privacy Policy â ${X.name}`,description:`The ${X.name} Privacy Policy.`,twitterCard:`summary`}),loader:()=>Bm(`/privacy`),component:J(()=>P(()=>import(`./privacy-CYeneF2e.js`),__vite__mapDeps([116,82,3,83,10,9])),`component`)}),zg=q(`/purchase-terms`)({head:({loaderData:e})=>jm({path:`/purchase-terms`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Purchase, Payment & Refund Terms â ${X.name}`,description:`The ${X.name} purchase, payment and refund terms.`,twitterCard:`summary`}),loader:()=>Bm(`/purchase-terms`),component:J(()=>P(()=>import(`./purchase-terms-DmTF4Gn_.js`),__vite__mapDeps([117,82,3,83,10,9])),`component`)}),Bg=q(`/reset-password`)({beforeLoad:async()=>{if(typeof window>`u`)return;let e=window.location.hash??``,t=new URLSearchParams(e.startsWith(`#`)?e.slice(1):e);if(t.get(`type`)===`recovery`||t.has(`access_token`)||t.has(`error_code`)||t.has(`error`)||gp())return;let{data:n}=await N.auth.getUser();if(n.user)throw s({to:`/dashboard`})},head:()=>({meta:[{title:`Set a new password · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./reset-password-B39OO_V9.js`),__vite__mapDeps([118,3,2,4,12,13,10,9,14,89,95,96,43,44,71,45,32,48])),`component`)}),Vg=q(`/start-consultation`)({head:({loaderData:e})=>jm({path:`/start-consultation`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Start your AI consultation â ${X.name}`,description:`Get a personalized AI skin consultation, Beauty Score, and Blueprint in minutes â under MedSpa Blueprint AI.`,ogDescription:`Answer a few questions, share a selfie, and receive your personalized AI Beauty Score and Blueprint.`}),loader:()=>Bm(`/start-consultation`),component:J(()=>P(()=>import(`./start-consultation-Cx9mj0FZ.js`),__vite__mapDeps([119,120,3,4,121,31,32,9,33,10,122,39,87,88,16,8,43,44,36,37,38,53,111,41,94,66,123,71,45,48,124,1,2,5,125,76,23,20,21,22,126,79,127,47,12,13,14,63,128,65,129,7,130,131,132,133,75,77,80,134,135,136,137,138,139,140,18,141,142,143,144,145,146,147,73,148,149,150,151,152,153])),`component`)}),Hg=q(`/terms`)({head:({loaderData:e})=>jm({path:`/terms`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Terms of Use â ${X.name}`,description:`The ${X.name} Terms of Use.`,twitterCard:`summary`}),loader:()=>Bm(`/terms`),component:J(()=>P(()=>import(`./terms-BvTpllb8.js`),__vite__mapDeps([154,82,3,83,10,9])),`component`)}),Ug=q(`/testimonial-disclosure`)({head:({loaderData:e})=>jm({path:`/testimonial-disclosure`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Testimonial & Endorsement Disclosure â ${X.name}`,description:`The ${X.name} testimonial and endorsement disclosure.`,twitterCard:`summary`}),loader:()=>Bm(`/testimonial-disclosure`),component:J(()=>P(()=>import(`./testimonial-disclosure-BRtUgZlT.js`),__vite__mapDeps([155,82,3,83,10,9])),`component`)});async function Wg(){let{data:e,error:t}=await N.auth.getUser();if(t)throw t;if(!e.user)throw Error(`Unauthorized: sign in required`);return e.user.id}async function Gg(e,t){if(t)return t;let n=_e();if(!n)throw Error(`Forbidden: clinic not found / not a member`);let{data:r,error:i}=await N.from(`clinics`).select(`id`).eq(`slug`,n).maybeSingle();if(i)throw i;if(!r)throw Error(`Forbidden: clinic not found / not a member`);let{data:a,error:o}=await N.rpc(`is_super_admin`,{_user:e});if(o)throw o;if(a)return r.id;let{data:s,error:c}=await N.from(`clinic_members`).select(`id`).eq(`clinic_id`,r.id).eq(`user_id`,e).maybeSingle();if(c)throw c;if(!s)throw Error(`Forbidden: clinic not found / not a member`);return r.id}async function Kg(e){let t=await Wg(),n=await Gg(t,(e&&`data`in e?e.data:e)?.clinicId??void 0),{data:r,error:i}=await N.rpc(`effective_permissions`,{_user:t,_clinic:n});if(i)throw i;return(r??[]).map(e=>e.permission_key)}async function qg(){let e=await Wg(),{data:t,error:n}=await N.rpc(`is_super_admin`,{_user:e});if(n)throw n;let r=!!t,i=!1;if(!r){let{data:t,error:n}=await N.rpc(`is_seo_manager`,{_user:e});n||(i=!!t)}return{isSuperAdmin:r,isSeoManager:i,canManageSeo:r||i}}var Jg={staff:1,manager:2,owner:3,super_admin:4};function Yg(e){return e===`admin`?`manager`:e}function Xg(e){return Jg[Yg(e)]??0}function Zg(e,t){return Xg(e)>=Xg(t)}var Qg={"/dashboard/profile":`clinic.manage`,"/dashboard/branding":`clinic.manage`,"/dashboard/treatments":`clinic.manage`,"/dashboard/questions":`clinic.manage`,"/dashboard/locations":`clinic.manage`,"/dashboard/domains":`clinic.manage`,"/dashboard/portal":`clinic.manage`,"/dashboard/clients":`consultations.read`,"/dashboard/blueprints":`consultations.read`,"/dashboard/staff":`staff.manage`,"/dashboard/leads":`leads.read`,"/dashboard/booking-requests":`appointments.read`,"/dashboard/blueprint-365":`clinic.read`,"/dashboard/vip-benefits":`clinic.read`,"/dashboard/analytics":`clinic.read`,"/dashboard/notifications":`clinic.read`,"/dashboard/revenue-split":`billing.read`,"/dashboard/audit":`audit.read`},$g=new Set([`/dashboard/roles`]);function e_(e){let t=null,n=-1;for(let[r,i]of Object.entries(Qg))(e===r||e.startsWith(r+`/`))&&r.length>n&&(t=i,n=r.length);return t}function t_(e){for(let t of $g)if(e===t||e.startsWith(t+`/`))return!0;return!1}async function n_(e,t=`staff`){let n=await Yh({data:{slug:e}});if(!n)throw s({to:`/clinic/$clinicSlug`,params:{clinicSlug:e}});if(!Zg(n.role,t))throw s({to:`/dashboard`,search:{error:`forbidden`}});return n}async function r_(e={}){let[t,n]=await Promise.all([qg(),qh()]),r=_e(),i=r?(n??[]).find(e=>e.clinic.slug===r):void 0;if(i||=ag(n),!i){if(t.isSuperAdmin){let e=(n??[]).find(e=>e.clinic.slug===`platform`);if(e)return ge(`platform`),{clinics:n,admin:e};throw s({to:`/super-admin`})}
13throw s({to:`/dashboard`,search:{error:`no-clinic`}})}if(ge(i.clinic.slug),e.pathname&&!t.isSuperAdmin)if(t_(e.pathname)){if(i.role!==`owner`)throw s({to:`/dashboard`,search:{error:`forbidden`}})}else{let t=e_(e.pathname);if(t&&!(await Kg({clinicId:i.clinic.id})).includes(t))throw s({to:`/dashboard`,search:{error:`forbidden`}})}return{clinics:n,admin:i}}async function i_(){let e=await qg();if(!e.isSuperAdmin)throw s({to:`/dashboard`,search:{error:`forbidden`}});return e}async function a_(){let e=await qg();if(!e.canManageSeo)throw s({to:`/dashboard`,search:{error:`forbidden`}});return e}var o_=q(`/_authenticated/_clinic-admin`)({beforeLoad:async({context:e,location:t})=>{await r_({pathname:t.pathname});let n=_e();n&&await e.queryClient?.ensureQueryData({queryKey:[`clinic-brand`,n],queryFn:()=>tg(),staleTime:6e4})},component:J(()=>P(()=>import(`./_clinic-admin-UUL5nwDx.js`),__vite__mapDeps([156,20,21,3,22,23,10,9,133,12,13,14,75,76,1,2,4,5,77,80])),`component`)}),s_=q(`/_authenticated/_seo`)({beforeLoad:async()=>{await a_()},errorComponent:J(()=>P(()=>import(`./_seo-DwhmY9O-.js`),__vite__mapDeps([157,10,3])),`errorComponent`),component:J(()=>P(()=>import(`./_seo-BMZ2Qq1h.js`),__vite__mapDeps([158,10,3])),`component`)}),c_=q(`/_authenticated/_super-admin`)({beforeLoad:async({context:e})=>{e.isSuperAdmin!==!0&&await i_()},errorComponent:J(()=>P(()=>import(`./_super-admin-DwhmY9O-.js`),__vite__mapDeps([159,10,3])),`errorComponent`),component:J(()=>P(()=>import(`./_super-admin-C335Vcr-.js`),__vite__mapDeps([160,10,3,161,20,21,22,23,9,12,13,14,162,163,55,8])),`component`)}),l_=q(`/_authenticated/complete-profile`)({head:()=>({meta:[{title:`Complete your profile · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./complete-profile-BC8peVsS.js`),__vite__mapDeps([164,3,20,21,22,23,10,9,89,14,71,45,32,48,44,43])),`component`)}),u_=q(`/_authenticated/dashboard`)({component:J(()=>P(()=>import(`./dashboard-BMZ2Qq1h.js`),__vite__mapDeps([165,10,3])),`component`)}),d_=q(`/_authenticated/onboarding`)({head:()=>({meta:[{title:`Onboarding · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./onboarding-zR4BUDHP.js`),__vite__mapDeps([166,3,89,14,9,10,167,147,31,32,33,73,36,37,38,39,71,45,48,44,43,47,22,23,20,21,133,12,13,75,76,1,2,4,5,77,80,70,19])),`component`)}),f_=q(`/auth/callback`)({head:()=>({meta:[{title:`Signing you in · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./auth.callback-BFu2pqpr.js`),__vite__mapDeps([168,3,2,4,89,14,9,10,1,5])),`component`)}),p_=q(`/auth/check-email`)({validateSearch:e=>L({email:R().optional()}).parse(e),head:()=>({meta:[{title:`Check your inbox · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./auth.check-email-yoD8gR3K.js`),__vite__mapDeps([169,3,12,13,10,9,14,90,91,92,93,59,8,71,45,32,48,44,43,97,96])),`component`)}),m_=q(`/auth/choose-role`)({beforeLoad:async()=>{let{data:e}=await N.auth.getUser();if(!e.user)throw s({to:`/auth`,search:{mode:`signin`}})},loader:async()=>{let e=await Xm();if(e?.user_type)throw s({to:e.onboarding_completed?`/dashboard`:`/onboarding`});return{profile:e}},head:()=>({meta:[{title:`Choose your account type · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./auth.choose-role-_RlknaI7.js`),__vite__mapDeps([170,3,89,14,9,51,8,94,67,10,71,45,32,48,44,43])),`component`)}),h_=()=>P(()=>import(`./booking.confirm-Be80-2mG.js`),__vite__mapDeps([171,3,47,22,23,10,9,20,21,71,45,32,48,44,43,172,1,2,4,5])),g_=L({id:R().uuid().catch(``),t:R().catch(``),v:Jt.number().int().min(1).catch(1)}),__=q(`/booking/confirm`)({validateSearch:g_,head:()=>({meta:[{title:`Confirm your appointment · ${X.name}`},{name:`description`,content:`Review the time your clinic proposed and confirm or suggest another slot.`},{name:`robots`,content:`noindex`},{property:`og:title`,content:`Confirm your appointment`},{property:`og:description`,content:`Review the time your clinic proposed and confirm or suggest another slot.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`}]}),component:J(h_,`component`)}),v_=q(`/checkout/`)({head:()=>({meta:[{title:`Checkout â ${X.name}`},{name:`description`,content:`Choose your MedSpa Blueprint AI plan and complete checkout securely to activate your white-label AI consultation platform.`},{property:`og:title`,content:`Checkout â ${X.name}`},{property:`og:description`,content:`Activate your MedSpa Blueprint AI plan in a few seconds.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./checkout.index-DvKQM1xP.js`),__vite__mapDeps([173,3,125,76,1,2,4,5,23,10,9,20,21,22,8,94,126,71,45,32,48,44,43,79,12,13,14,16,174,134,123,137])),`component`)}),y_=q(`/checkout/return`)({head:()=>
13({meta:[{title:`Payment complete â ${X.name}`},{name:`description`,content:`Your MedSpa Blueprint AI subscription is being activated.`},{property:`og:title`,content:`Payment complete â ${X.name}`},{property:`og:description`,content:`Your MedSpa Blueprint AI subscription is being activated.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`},{name:`robots`,content:`noindex,nofollow`}]}),validateSearch:e=>({session_id:typeof e.session_id==`string`?e.session_id:void 0,membership:typeof e.membership==`string`?e.membership:void 0}),component:J(()=>P(()=>import(`./checkout.return-CjxbNwHc.js`),__vite__mapDeps([175,3,12,13,10,9,14,89])),`component`)});async function b_(e){return await F(`consultations`,{action:`public_treatments_list`,body:{slug:e.data.slug}})}async function x_(e){return await F(`consultations`,{action:`public_consultation_order`,body:{slug:e.data.slug}})}async function S_(){let e=await $t(),t=await tn(e),n=new Map(t.map(e=>[e.id,e])),{data:r,error:i}=await N.from(`treatments`).select(`*`).or(`is_global.eq.true,clinic_id.eq.${e}`).is(`retired_at`,null);if(i||!r)return t.map(t=>({...t,clinic_id:e}));let a=[];for(let t of r){let r=n.get(t.id);t.is_global&&!t.active&&t.clinic_id!==e||(r?(a.push({...t,price_cents:r.price_cents,price_status:r.price_status,currency:r.currency,duration_minutes:r.duration_minutes,sort_order:r.sort_order,is_global:r.is_global,active:!0}),n.delete(t.id)):a.push({...t,active:!1,...t.is_global?{price_status:`unknown`}:{}}))}for(let t of n.values())a.push({...t,clinic_id:e});return a}async function C_(e){return await F(`consultations`,{action:`treatment_create`,body:{input:e.data}})}async function w_(e){return await F(`consultations`,{action:`treatment_update`,body:{id:e.data.id,patch:e.data.patch}})}async function T_(e){return await F(`consultations`,{action:`treatment_delete`,body:{id:e.data.id}})}async function E_(e){return await F(`consultations`,{action:`treatment_sim_suggest`,body:{input:e.data}})}async function D_(e){return await F(`consultations`,{action:`treatment_content_suggest`,body:{input:e.data},timeoutMs:12e4})}async function O_(){return await F(`consultations`,{action:`treatment_sim_backfill`,body:{}})}async function k_(e){return await F(`consultations`,{action:`treatment_sim_approve`,body:{id:e.data.id,patch:e.data.patch??{}}})}async function A_(e){return await F(`consultations`,{action:`treatment_sim_discard`,body:{id:e.data.id}})}async function j_(e){return await F(`consultations`,{action:`treatment_sim_regenerate`,body:{id:e.data.id}})}async function M_(e){return await F(`consultations`,{action:`treatment_questions_suggest`,body:{input:e.data},timeoutMs:9e4})}var N_=q(`/clinic/$clinicSlug`)({loader:async({params:e})=>{let t=e.clinicSlug.toLowerCase();if(!ye(t))throw i();let[n,r,a,o,s]=await Promise.all([Wh({data:{slug:t}}),b_({data:{slug:t}}),Gh({data:{slug:t}}),Kh({data:{slug:t}}).catch(()=>null),Bm(`/clinic/$clinicSlug`)]);if(!n)throw i();return{clinic:n,treatments:r,profile:a,whiteLabel:o?.whiteLabel===!0,seo:s.seo,siteUrl:s.siteUrl}},head:({params:e,loaderData:t})=>{let n=(t?.clinic?.slug??e.clinicSlug).toLowerCase(),r=`/clinic/${encodeURIComponent(n)}`,i=t?.clinic,a=t?.profile,o=t?.treatments??[],s=P_(o,3),c=s.length?` â ${s.join(`, `)}`:``,l=t?.whiteLabel===!0,u=l?``:` · ${X.name}`,d=i?`${i.name}${c}${u}`:`Clinic${u}`,f=i?s.length?`AI skin consultation by ${i.name}. Specializing in ${s.join(`, `)}.`:`AI skin consultation by ${i.name}.`:l?`AI skin consultation.`:`AI skin consultation powered by ${X.name}.`,p=Uh(i?.branding),m=/^https?:\/\//i.test(p.logoUrl??``)?p.logoUrl:null,{meta:h,links:g}=jm({path:r,title:d,description:f,image:m,indexable:!1,follow:!0,breadcrumb:!1,overrides:Am(t?.seo),baseUrl:t?.siteUrl}),_=[];if(i){let e=a?.address,t=a?.contact,n=!!(e?.line1||e?.city||e?.region),s=Gt(r),c={"@context":`https://schema.org`,"@type":`MedicalBusiness`,name:i.name,url:s};m&&(c.image=m),a?.website&&(c.sameAs=[a.website]),t?.email&&(c.email=t.email),t?.phone&&(c.telephone=t.phone),n&&(c.address={"@type":`PostalAddress`,streetAddress:[e?.line1,e?.line2].filter(
13Boolean).join(`, `)||void 0,addressLocality:e?.city,addressRegion:e?.region,postalCode:e?.postalCode,addressCountry:e?.country});let l=o.map(e=>e.name?.trim()).filter(e=>!!e).slice(0,20);l.length&&(c.hasOfferCatalog={"@type":`OfferCatalog`,name:`Treatments at ${i.name}`,itemListElement:l.map(e=>({"@type":`Offer`,itemOffered:{"@type":`MedicalTherapy`,name:e}}))}),_.push({type:`application/ld+json`,children:JSON.stringify(c)}),_.push({type:`application/ld+json`,children:JSON.stringify({"@context":`https://schema.org`,"@type":`BreadcrumbList`,itemListElement:[{"@type":`ListItem`,position:1,name:`Home`,item:Gt(`/`)},{"@type":`ListItem`,position:2,name:`Partner clinics`,item:Gt(`/clinics`)},{"@type":`ListItem`,position:3,name:i.name,item:s}]})})}return{meta:h,links:[...g.filter(e=>e.rel!==`canonical`),...p.faviconUrl?[{rel:`icon`,href:p.faviconUrl}]:[]],scripts:_}},errorComponent:J(()=>P(()=>import(`./clinic._clinicSlug.route-Dj3ImZPS.js`),__vite__mapDeps([176,14,3,9,10,71,45,32,48,44,43])),`errorComponent`),notFoundComponent:J(()=>P(()=>import(`./clinic._clinicSlug.route-DTwZ6pjZ.js`),__vite__mapDeps([177,10,3])),`notFoundComponent`),component:J(()=>P(()=>import(`./clinic._clinicSlug.route-CTfDRY0F.js`),__vite__mapDeps([178,3,2,4,20,21,22,23,10,9,69,70,179,5])),`component`)});function P_(e,t){let n=new Map;for(let t of e){let e=t.category?.trim();e&&n.set(e,(n.get(e)??0)+1)}return[...n.entries()].sort((e,t)=>t[1]-e[1]).slice(0,t).map(([e])=>e)}var F_=q(`/invite/accept`)({validateSearch:e=>({token:typeof e.token==`string`?e.token:``}),head:()=>({meta:[{title:`Accept invitation · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./invite.accept-C0T3nDSh.js`),__vite__mapDeps([180,3,2,4,12,13,10,9,14,89,71,45,32,48,44,43,181,1,5])),`component`)}),I_=q(`/join/client`)({head:({loaderData:e})=>jm({path:`/join/client`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Early Access for Individuals â ${X.name}`,description:`Join the individual client waitlist for MedSpa Blueprint AI⢠â get your personalised Beauty Score and matched treatment plan when we launch.`,ogDescription:`Get your personalised Beauty Score and matched treatment plan. Launching ${Ud}.`}),loader:()=>Bm(`/join/client`),component:J(()=>P(()=>import(`./client-5tZflHFr.js`),__vite__mapDeps([182,3,27,8,9,18,10,28,16,29,183,130,1,2,4,5,103,184])),`component`)}),L_=q(`/join/spa-owner`)({head:({loaderData:e})=>jm({path:`/join/spa-owner`,overrides:e?.seo,baseUrl:e?.siteUrl,title:`Early Access for Spa Owners â ${X.name}`,description:`Reserve your spa's spot for MedSpa Blueprint AI⢠â the only AI consultation platform built by a practicing Master Injector, designed to run under your brand.`,ogDescription:`Built by a practicing Master Injector. Designed to run under your brand. Launching ${Ud}.`}),loader:()=>Bm(`/join/spa-owner`),component:J(()=>P(()=>import(`./join.spa-owner-DbBbFCv3.js`),__vite__mapDeps([185,3,26,8,9,60,17,27,10,183,130,1,2,4,5,103,184])),`component`)}),R_=q(`/_authenticated/_seo/seo`)({head:()=>({meta:[{title:`SEO · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_seo.seo-C7W5W2TX.js`),__vite__mapDeps([186,3,47,22,23,10,9,20,21,12,13,14,65,8,187,111,54,43,44,71,45,32,48,188,2,4,130,184])),`component`)}),z_=q(`/_authenticated/dashboard/`)({validateSearch:e=>L({error:Kt([`forbidden`,`no-clinic`]).optional()}).parse(e),head:()=>({meta:[{title:`Dashboard · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.index-9nZMBEq_.js`),__vite__mapDeps([189,3,2,4,47,22,23,10,9,20,21,12,13,14,90,91,92,93,190,8,51,53,57,191,18,68,192,16,94,123,75,76,1,5,77,133,80,161,162,163,55,193,89,59,63,71,45,32,48,44,43,146,147,31,33,73,36,37,38,39,148,149,150,194,184,74,151,130,138])),`component`)}),B_=q(`/_authenticated/dashboard/account`)({head:()=>({meta:[{title:`Account · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.account-DFIJMoQ-.js`),__vite__mapDeps([195,12,3,13,10,9,14])),`component`)}),V_=q(`/_authenticated/dashboard/annual-reports`)({component:J(()=>P(()=>import(`./dashboard.annual-reports-BMZ2Qq1h.js`),__vite__mapDeps([196,10,3])),`component`)}),H_=q(`/_authenticated/dashboard/appointments`)({head:()=>({meta:[{title:`Your appointments · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.appointments-ULQiAQvm.js`),__vite__mapDeps([197,3,147,31,32,9,33,10,73,36,37,38,39,71,45,48,44,43,47,22,23,20,21,12,13,14,198,2,4,130,1,5,194])),`component`)}),U_=q(`/_authenticated/dashboard/billing`)({component:J(()=>P(()=>import(`./dashboard.billing-D7Z7MSID.js`),__vite__mapDeps([199,3,125,76,1,2,4,5,23,10,9,20,21,22,8,94,126,71,45,32,48,44,43,79,12,13,14,190,16,200,59,60,140,129,192,123,75,77,174,74])),`component`),head:()=>({meta:[{title:`Billing & Plan | MedSpa Blueprint`},{name:`description`,content:`Review your MedSpa Blueprint plan, see what your subscription unlocks, upgrade, or manage payment details.`},{property:`og:title`,content:`Billing & Plan | MedSpa Blueprint`},{property:`og:description`,content:`Manage your MedSpa Blueprint subscription, plan and payment details.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]})}),W_=q(`/_authenticated/dashboard/blueprint`)({head:()=>({meta:[{title:`Beauty Blueprint · ${X.name}`},{name:`description`,content:`Every Beauty Blueprint generated for you, newest first.`},{property:`og:title`,content:`Beauty Blueprint · ${X.name}`},{property:`og:description`,content:`Every Beauty Blueprint generated for you, newest first.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.blueprint-Xu0hmt-X.js`),__vite__mapDeps([201,20,21,3,22,23,10,9,12,13,14,71,45,32,48,44,43])),`component`)}),G_=q(`/_authenticated/dashboard/clinics`)({loader:({context:e})=>e.queryClient.ensureQueryData(vg),head:()=>({meta:[{title:`Find a clinic · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.clinics-eLQZrClR.js`),__vite__mapDeps([202,101,21,3,22,23,10,9])),`component`),errorComponent:J(()=>P(()=>import(`./dashboard.clinics-CeetGTVu.js`),[]),`errorComponent`),notFoundComponent:J(()=>P(()=>import(`./dashboard.clinics-CtrOJ3E-.js`),[]),`notFoundComponent`)}),K_=q(`/_authenticated/dashboard/coach`)({head:()=>({meta:[{title:`AI Coach · ${X.name}`},{name:`description`,content:`Ask your AI Coach about your skin assessment and recommended treatments.`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.coach-eSL8ozi7.js`),__vite__mapDeps([203,20,21,3,22,23,10,9,12,13,14,89,64,8,133,75,76,1,2,4,5,77,80,204])),`component`)}),q_=q(`/_authenticated/dashboard/consultations`)({component:J(()=>P(()=>import(`./dashboard.consultations-BMZ2Qq1h.js`),__vite__mapDeps([205,10,3])),`component`)}),J_=q(`/_authenticated/dashboard/early-access`)({beforeLoad:()=>{throw s({to:`/dashboard/vip-discount`})}}),Y_=q(`/_authenticated/dashboard/issues`)({component:J(()=>P(()=>import(`./dashboard.issues-BMZ2Qq1h.js`),__vite__mapDeps([206,10,3])),`component`)}),X_=q(`/_authenticated/dashboard/monthly-reports`)({component:J(()=>P(()=>import(`./dashboard.monthly-reports-BMZ2Qq1h.js`),__vite__mapDeps([207,10,3])),`component`)}),Z_=q(`/_authenticated/dashboard/reports`)({component:J(()=>P(()=>import(`./dashboard.reports-BMZ2Qq1h.js`),__vite__mapDeps([208,10,3])),`component`)}),Q_=q(`/_authenticated/dashboard/vip-discount`)({head:()=>({meta:[{title:`VIP product discount · ${X.name}`},{name:`description`,content:`Generate a short-lived VIP code for 15% off eligible retail and skincare bought in person at participating clinics.`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.vip-discount-DFu9hyqr.js`),__vite__mapDeps([209,3,47,22,23,10,9,20,21,49,8,210,18,133,12,13,14,75,76,1,2,4,5,77,80,71,45,32,48,44,43,211,212])),`component`)}),$_=q(`/clinic/$clinicSlug/`)({head:({params:e})=>({links:[{rel:`canonical`,href:Gt(`/clinic/${encodeURIComponent(e.clinicSlug.toLowerCase())}`)}]}),component:J(()=>P(()=>import(`./clinic._clinicSlug.index-DFQSjSLH.js`),__vite__mapDeps([213,20,21,3,22,23,10,9,12,13,14,214,91,92,93,89,215,90,216,163,217,29,8,218,63,128,179,5])),`component`)}),ev=q(`/clinic/$clinicSlug/_members`)({beforeLoad:async({params:e,location:t})=>{let{data:n}=await N.auth.getUser();if(!n.user)throw s({to:`/auth`,search:{redirect:t.href}});return{clinicRole:(await n_(e.clinicSlug,`staff`)).role}},component:J(()=>P(()=>import(`./clinic._clinicSlug._members-BMZ2Qq1h.js`),__vite__mapDeps([219,10,3])),`component`)}),tv=q(`/clinic/$clinicSlug/book`)({loader:()=>Bm(`/clinic/$clinicSlug/book`),head:({params:e,loaderData:t})=>jm({path:`/clinic/${encodeURIComponent(e.clinicSlug.toLowerCase())}/book`,baseUrl:t?.siteUrl,indexable:!1,breadcrumb:!1,title:`Request an appointment`,description:`Tell the clinic which treatment you're interested in and when you're free. They'll come back with a time to confirm.`,ogTitle:`Request an appointment`,ogDescription:`Send the clinic y
13our preferred times and confirm your appointment online.`}),component:J(()=>P(()=>import(`./clinic._clinicSlug.book-BaI2EhFT.js`),__vite__mapDeps([220,3,47,22,23,10,9,20,21,71,45,32,48,44,43,172,1,2,4,5])),`component`)}),nv=q(`/clinic/$clinicSlug/consultation`)({head:()=>({meta:[{title:`Start your consultation`},{name:`description`,content:`Choose the treatment you're considering and answer a few questions so we can prepare a personalized, AI-assisted consultation report.`},{name:`robots`,content:`noindex`}]}),component:J(()=>P(()=>import(`./clinic._clinicSlug.consultation-BaYt0deS.js`),__vite__mapDeps([221,47,3,22,23,10,9,20,21,120,4,121,31,32,33,122,39,87,88,16,8,43,44,36,37,38,53,111,41,94,66,123,71,45,48,124,1,2,5,125,76,126,79,127,12,13,14,63,128,65,129,7,130,131,132,133,75,77,80,134,135,136,137,138,139,140,18,141,142,143,144,145,146,147,73,148,149,150,151,152,153,222,179])),`component`)}),rv=q(`/clinic/$clinicSlug/locations`)({loader:async({params:e})=>{let t=e.clinicSlug.toLowerCase();if(!ye(t))throw i();let[n,r]=await Promise.all([rg({data:{slug:t}}).catch(()=>[]),Bm(`/clinic/$clinicSlug/locations`)]);if(!n||n.length<=1)throw i();return{locations:n,siteUrl:r.siteUrl}},head:({params:e,loaderData:t})=>{let n=e.clinicSlug.toLowerCase(),r=t?.locations?.find(e=>e.isSelf)??t?.locations?.[0];return jm({path:`/clinic/${encodeURIComponent(n)}/locations`,baseUrl:t?.siteUrl,title:`Our locations${r?.name?` · ${r.name}`:``}`,description:`Every location you can visit, in one place. Book a consultation at whichever is closest to you.`,indexable:!0})},component:J(()=>P(()=>import(`./clinic._clinicSlug.locations-fKOuMiTm.js`),__vite__mapDeps([223,12,3,13,10,9,14,63,8])),`component`)}),iv=()=>P(()=>import(`./clinic._clinicSlug.report-BfBJQx_x.js`),__vite__mapDeps([224,20,21,3,22,23,10,9,12,13,14,225,1,2,4,5,141,142,143,144,226,131,125,76,8,94,126,71,45,32,48,44,43,79,132,16,111,7,133,75,77,80,134,123,135,136,145,152,179])),av=L({t:R().min(10).max(200).optional()}),ov=q(`/clinic/$clinicSlug/report`)({validateSearch:av,head:()=>({meta:[{title:`Your personalised consultation report`},{name:`description`,content:`Your personalised consultation report, prepared for you by your clinic.`},{name:`robots`,content:`noindex, nofollow`}]}),component:J(iv,`component`)}),sv=()=>P(()=>import(`./clinic._clinicSlug.simulate-CAfzGAvR.js`),__vite__mapDeps([227,20,21,3,22,23,10,9,12,13,14,145,228,121,31,32,33,122,39,87,88,16,8,43,44,36,37,38,53,111,41,94,66,123,71,45,48,124,1,2,4,5,47,89,133,75,76,77,80,142,143,144,146,147,73,148,149,150,152,179])),cv=L({t:R().min(10).max(200).optional()}),lv=q(`/clinic/$clinicSlug/simulate`)({validateSearch:cv,head:()=>({meta:[{title:`Try a treatment`},{name:`description`,content:`Preview one of your clinic's treatments on your own photo. Educational visualisation only â not a medical outcome or guarantee.`},{name:`robots`,content:`noindex, nofollow`}]}),component:J(sv,`component`)}),uv=q(`/_authenticated/_clinic-admin/dashboard/audit`)({head:()=>({meta:[{title:`Audit log · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.audit-BGzbKXHc.js`),__vite__mapDeps([229,3,20,21,22,23,10,9,12,13,14,71,45,32,48,44,43,230,0,1,2,4,5])),`component`)}),dv=q(`/_authenticated/_clinic-admin/dashboard/blueprint-365`)({head:()=>({meta:[{title:`365-Day Blueprint add-on · ${X.name}`},{name:`description`,content:`Choose whether your spa offers the 365-Day Blueprint as a paid add-on to its clients.`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.blueprint-365-CmlnVc01.js`),__vite__mapDeps([231,47,3,22,23,10,9,20,21,232,8,1,2,4,5,43,44])),`component`)}),fv=q(`/_authenticated/_clinic-admin/dashboard/booking-requests`)({head:()=>({meta:[{title:`Booking requests · ${X.name}`},{name:`description`,content:`Review incoming booking requests, propose or counter-propose times, and confirm or decline appointments.`},{property:`og:title`,content:`Booking requests · Clinic dashboard`},{property:`og:description`,content:`Manage your clinic's booking request inbox from a single place.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.booking-requests-DNdqYj8r.js`),__vite__mapDeps([233,3,47,22,23,10,9,20,21,12,13,14,52,8,218,128,67,133,75,76,1,2,4,5,77,80,71,45,32,48,44,43,74,172])),`component`)}),pv=q(`/_authenticated/_clinic-admin/dashboard/branding`)({head:()=>({meta:[{title:`Clinic branding · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.branding-Cj_TIxLu.js`),__vite__mapDeps([234,3,47,22,23,10,9,20,21,12,13,14,167,147,31,32,33,73,36,37,38,39,71,45,48,44,43,133,75,76,1,2,4,5,77,80,70,235,236])),`component`)}),mv=q(`/_authenticated/_clinic-admin/dashboard/clients`)({component:J(()=>P(()=>import(`./_clinic-admin.dashboard.clients-BMZ2Qq1h.js`),__vite__mapDeps([237,10,3])),`component`)}),hv=q(`/_authenticated/_clinic-admin/dashboard/domains`)({head:()=>({meta:[{title:`Custom domains · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.domains-CzZm-SZu.js`),__vite__mapDeps([238,3,12,13,10,9,14])),`component`)}),gv=q(`/_authenticated/_clinic-admin/dashboard/leads`)({head:()=>({meta:[{title:`Leads · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.leads-Ca4CNgdG.js`),__vite__mapDeps([239,3,47,22,23,10,9,20,21,12,13,14,89,52,8,26,61,123,240,71,45,32,48,44,43,72,73,3
131,33,36,37,38,39,7,230,241,2,4,130,194,242,1,5])),`component`)}),_v=q(`/_authenticated/_clinic-admin/dashboard/locations`)({head:()=>({meta:[{title:`Locations · ${X.name}`},{name:`description`,content:`Add, deactivate and reactivate the locations included in your multi-location plan, and see how many location slots you are using.`},{property:`og:title`,content:`Locations · ${X.name}`},{property:`og:description`,content:`Manage the locations included in your multi-location plan.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.locations-Cgf6rZgX.js`),__vite__mapDeps([243,10,3,193,2,4,47,22,23,9,20,21,12,13,14,89,59,8,63,191,123,133,75,76,1,5,77,80,71,45,32,48,44,43,146,147,31,33,73,36,37,38,39,148,149,150,94,194,184])),`component`)}),vv=q(`/_authenticated/_clinic-admin/dashboard/notifications`)({head:()=>({meta:[{title:`Notification settings · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.notifications-CzK9s5vw.js`),__vite__mapDeps([244,3,2,4,47,22,23,10,9,20,21,12,13,14,130,71,45,32,48,44,43,245,5])),`component`)}),yv=q(`/_authenticated/_clinic-admin/dashboard/portal`)({beforeLoad:()=>{throw s({to:`/dashboard/billing`})}}),bv=q(`/_authenticated/_clinic-admin/dashboard/profile`)({head:()=>({meta:[{title:`Clinic profile · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.profile-D4kcMPbN.js`),__vite__mapDeps([246,3,47,22,23,10,9,20,21,12,13,14,71,45,32,48,44,43,5])),`component`)}),xv=q(`/_authenticated/_clinic-admin/dashboard/questions`)({head:()=>({meta:[{title:`Consultation Questions · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.questions-gCt8dva8.js`),__vite__mapDeps([247,3,20,21,22,23,10,9,235,71,45,32,48,44,43,236,1,2,4,5,248,47,111,8,249,191,140,65])),`component`)}),Sv=q(`/_authenticated/_clinic-admin/dashboard/revenue-split`)({head:()=>({meta:[{title:`Revenue attribution · ${X.name}`},{name:`description`,content:`Record actual treatment revenue and report it by location, provider and treatment. Reporting only â no payments, splits or payouts are processed.`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.revenue-split-DchAI0Tl.js`),__vite__mapDeps([250,3,47,22,23,10,9,20,21,8,56,26,191,140,133,12,13,14,75,76,1,2,4,5,77,80,71,45,32,48,44,43])),`component`)}),Cv=q(`/_authenticated/_clinic-admin/dashboard/roles`)({head:()=>({meta:[{title:`Roles & permissions · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.roles-BJUUwXBA.js`),__vite__mapDeps([251,3,122,31,32,9,33,10,39,87,88,16,8,43,44,2,4,47,22,23,20,21,12,13,14,130,71,45,48,5])),`component`)}),wv=q(`/_authenticated/_clinic-admin/dashboard/staff`)({head:()=>({meta:[{title:`Staff · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.staff-CtAdfqIS.js`),__vite__mapDeps([252,3,122,31,32,9,33,10,39,87,88,16,8,43,44,34,35,36,37,38,40,41,42,2,4,47,22,23,20,21,12,13,14,15,58,66,240,253,48,71,45,72,73,7,230,181,1,5,78,242,130,194])),`component`)}),Tv=H.forwardRef(({className:e,type:t,...n},r)=>(0,U.jsx)(`input`,{"data-slot":`input`,type:t,className:Pt(`flex h-9 w-full rounded-md border border-control-border bg-control px-3 py-1 text-base text-foreground shadow-sm transition-[border-color,box-shadow,background-color] file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground hover:border-control-border-hover focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/40 disabled:cursor-not-allowed disabled:border-border disabled:bg-control-disabled disabled:text-muted-foreground disabled:opacity-70 read-only:cursor-default read-only:border-control-border read-only:border-dashed read-only:bg-control-readonly md:text-sm`,e),ref:r,...n}));Tv.displayName=`Input`;var Ev=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>
13{let n=Ft(`Primitive.${t}`),r=H.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,U.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Dv=`Label`,Ov=H.forwardRef((e,t)=>(0,U.jsx)(Ev.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Ov.displayName=Dv;var kv=Ov,Av=It(`text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:text-muted-foreground`),jv=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(kv,{ref:n,className:Pt(Av(),e),...t}));jv.displayName=kv.displayName;var Mv=`Switch`,[Nv,Pv]=dt(Mv),[Fv,Iv]=Nv(Mv),Lv=H.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=H.useState(null),m=ht(t,e=>p(e)),h=H.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=ft({prop:i,defaultProp:a??!1,onChange:l,caller:Mv});return(0,U.jsxs)(Fv,{scope:n,checked:_,disabled:s,children:[(0,U.jsx)(mt.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":Hv(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:pt(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,U.jsx)(Vv,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});Lv.displayName=Mv;var Rv=`SwitchThumb`,zv=H.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Iv(Rv,n);return(0,U.jsx)(mt.span,{"data-state":Hv(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});zv.displayName=Rv;var Bv=`SwitchBubbleInput`,Vv=H.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=H.useRef(null),s=ht(o,a),c=rn(n),l=an(t);return H.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,U.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Vv.displayName=Bv;function Hv(e){return e?`checked`:`unchecked`}var Uv=Lv,Wv=zv,Gv=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(Uv,{className:Pt(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-control-border bg-control shadow-sm transition-[border-color,box-shadow,background-color] hover:border-control-border-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/40 disabled:cursor-not-allowed disabled:border-border disabled:bg-control-disabled disabled:opacity-70 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=unchecked]:bg-control`,e),...t,ref:n,children:(0,U.jsx)(Wv,{className:Pt(`pointer-events-none block h-4 w-4 rounded-full border border-control-border bg-foreground shadow-lg transition-transform data-[state=checked]:translate-x-5 data-[state=checked]:border-primary-foreground data-[state=checked]:bg-primary-foreground data-[state=unchecked]:translate-x-0.5`)})}));Gv.displayName=Uv.displayName;function Kv(e,[t,n]){return Math.min(n,Math.max(t,e))}var qv=[`top`,`right`,`bottom`,`left`],Jv=Math.min,Yv=Math.max,Xv=Math.round,Zv=Math.floor,Qv=e=>({x:e,y:e}),$v={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ey(e,t,n){return Yv(e,Jv(t,n))}function ty(e,t){return typeof e==`function`?e(t):e}function ny(e){return e.split(`-`)[0]}function ry(e){return e.split(`-`)[1]}function iy(e){return e===`x`?`y`:`x`}function ay(e){return e===`y`?`height`:`width`}function oy(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function sy(e){return iy(oy(e))}function cy(e,t,n){n===void 0&&(n=!1);
vendor: 5,047 bytes, line 13
13let r=ry(e),i=sy(e),a=ay(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_y(o)),[o,_y(o)]}function ly(e){let t=_y(e);return[uy(e),t,uy(t)]}function uy(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var dy=[`left`,`right`],fy=[`right`,`left`],py=[`top`,`bottom`],my=[`bottom`,`top`];function hy(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fy:dy:t?dy:fy;case`left`:case`right`:return t?py:my;default:return[]}}function gy(e,t,n,r){let i=ry(e),a=hy(ny(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(uy)))),a}function _y(e){let t=ny(e);return $v[t]+e.slice(t.length)}function vy(e){return{top:0,right:0,bottom:0,left:0,...e}}function yy(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vy(e)}function by(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xy(e,t,n){let{reference:r,floating:i}=e,a=oy(t),o=sy(t),s=ay(o),c=ny(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ry(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Sy(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ty(t,e),p=yy(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=by(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=by(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Cy=50,wy=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Sy},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xy(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Cy&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=xy(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ty=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ty(e,t)||{};if(l==null)return{};let d=yy(u),f={x:n,y:r},p=sy(i),m=ay(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Jv(d[_],T),D=Jv(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,ee=ey(O,A,k),te=!c.arrow&&ry(i)!=null&&A!==ee&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,ne=te?A<O?A-O:A-k:0;return{[p]:f[p]+ne,data:{[p]:ee,centerOffset:A-ee-ne,...te&&{alignmentOffset:ne}},reset:te}}}),Ey=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ty(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ny(r),_=oy(o),v=ny(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_y(o)]:ly(o)),x=p!==`none`;!d&&x&&b.push(...gy(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=cy(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==oy(t))||T.every(e=>oy(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>
vendor: 5,964 bytes, line 13
13e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=oy(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Dy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Oy(e){return qv.some(t=>e[t]>=0)}var ky=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ty(e,t);switch(i){case`referenceHidden`:{let e=Dy(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Oy(e)}}}case`escaped`:{let e=Dy(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Oy(e)}}}default:return{}}}}},Ay=new Set([`left`,`top`]);async function jy(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ny(n),s=ry(n),c=oy(n)===`y`,l=Ay.has(o)?-1:1,u=a&&c?-1:1,d=ty(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var My=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await jy(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ny=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ty(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=oy(ny(i)),p=iy(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ey(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ey(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Py=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ty(e,t),u={x:n,y:r},d=oy(i),f=iy(d),p=u[f],m=u[d],h=ty(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ay.has(ny(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Fy=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ty(e,t),u=await o.detectOverflow(t,l),d=ny(i),f=ry(i),p=oy(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Jv(h-u[g],v),x=Jv(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Yv(u.left,0),t=Yv(u.right,0),n=Yv(u.top,0),r=Yv(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Yv(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Yv(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Iy(){return typeof window<`u`}function Ly(e){return By(e)?(e.nodeName||``).toLowerCase():`#document`}function Ry(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zy(e){return((By(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function By(e){return Iy()?e instanceof Node||e instanceof Ry(e).Node:!1}function Vy(e){return Iy()?e instanceof Element||e instanceof Ry(e).Element:!1}function Hy(e){return Iy()?e instanceof HTMLElement||e instanceof Ry(e).HTMLElement:!1}function Uy(e){return!Iy()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ry(e).ShadowRoot}function Wy(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=tb(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Gy(e){return/^(table|td|th)$/.test(Ly(e))}function Ky(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var qy=/transform|translate|scale|rotate|perspective|filter/,Jy=/paint|layout|strict|content/,Yy=e=>!!e&&e!==`none`,Xy;function Zy(e){let t=Vy(e)?tb(e):e;return Yy(t.transform)||Yy(t.translate)||Yy(t.scale)||Yy(t.rotate)||Yy(t.perspective)||!$y()&&(Yy(t.backdropFilter)||Yy(t.filter))||qy.test(t.willChange||``)||Jy.test(t.contain||``)}function Qy(e){let t=rb(e);for(;Hy(t)&&!eb(t);){if(Zy(t))return t;if(Ky(t))return null;t=rb(t)}return null}function $y(){return Xy??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Xy}function eb(e){return/^(html|body|#document)$/.test(Ly(e))}function tb(e){return Ry(e).getComputedStyle(e)}function nb(e){return Vy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rb(e){if(Ly(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Uy(e)&&e.host||zy(e);return Uy(t)?t.host:t}function ib(e){let t=rb(e);return eb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hy(t)&&Wy(t)?t:ib(t)}function ab(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ib(e),i=r===e.ownerDocument?.body,a=Ry(r);if(i){let e=ob(a);
vendor: 6,950 bytes, line 13
13return t.concat(a,a.visualViewport||[],Wy(r)?r:[],e&&n?ab(e):[])}else return t.concat(r,ab(r,[],n))}function ob(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sb(e){let t=tb(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Hy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Xv(n)!==a||Xv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cb(e){return Vy(e)?e:e.contextElement}function lb(e){let t=cb(e);if(!Hy(t))return Qv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=sb(t),o=(a?Xv(n.width):n.width)/r,s=(a?Xv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ub=Qv(0);function db(e){let t=Ry(e);return!$y()||!t.visualViewport?ub:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ry(e)?!1:t}function pb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cb(e),o=Qv(1);t&&(r?Vy(r)&&(o=lb(r)):o=lb(e));let s=fb(a,n,r)?db(a):Qv(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Ry(a),t=r&&Vy(r)?Ry(r):r,n=e,i=ob(n);for(;i&&r&&t!==n;){let e=lb(i),t=i.getBoundingClientRect(),r=tb(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ry(i),i=ob(n)}}return by({width:u,height:d,x:c,y:l})}function mb(e,t){let n=nb(e).scrollLeft;return t?t.left+n:pb(zy(e)).left+n}function hb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-mb(e,n),y:n.top+t.scrollTop}}function gb(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zy(r),s=t?Ky(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Qv(1),u=Qv(0),d=Hy(r);if((d||!d&&!a)&&((Ly(r)!==`body`||Wy(o))&&(c=nb(r)),d)){let e=pb(r);l=lb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?hb(o,c):Qv(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function _b(e){return Array.from(e.getClientRects())}function vb(e){let t=zy(e),n=nb(e),r=e.ownerDocument.body,i=Yv(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Yv(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+mb(e),s=-n.scrollTop;return tb(r).direction===`rtl`&&(o+=Yv(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var yb=25;function bb(e,t){let n=Ry(e),r=zy(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=$y();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=mb(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=yb&&(a-=o)}else l<=yb&&(a+=l);return{width:a,height:o,x:s,y:c}}function xb(e,t){let n=pb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Hy(e)?lb(e):Qv(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Sb(e,t,n){let r;if(t===`viewport`)r=bb(e,n);else if(t===`document`)r=vb(zy(e));else if(Vy(t))r=xb(t,n);else{let n=db(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return by(r)}function Cb(e,t){let n=rb(e);return n===t||!Vy(n)||eb(n)?!1:tb(n).position===`fixed`||Cb(n,t)}function wb(e,t){let n=t.get(e);if(n)return n;let r=ab(e,[],!1).filter(e=>Vy(e)&&Ly(e)!==`body`),i=null,a=tb(e).position===`fixed`,o=a?rb(e):e;for(;Vy(o)&&!eb(o);){let t=tb(o),n=Zy(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Wy(o)&&!n&&Cb(e,o))?r=r.filter(e=>e!==o):i=t,o=rb(o)}return t.set(e,r),r}function Tb(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ky(t)?[]:wb(t,this._c):[].concat(n),r],o=Sb(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Sb(t,a[e],i);s=Yv(n.top,s),c=Jv(n.right,c),l=Jv(n.bottom,l),u=Yv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Eb(e){let{width:t,height:n}=sb(e);return{width:t,height:n}}function Db(e,t,n){let r=Hy(t),i=zy(t),a=n===`fixed`,o=pb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Qv(0);function l(){c.x=mb(i)}if(r||!r&&!a)if((Ly(t)!==`body`||Wy(i))&&(s=nb(t)),r){let e=pb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?hb(i,s):Qv(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ob(e){return tb(e).position===`static`}function kb(e,t){if(!Hy(e)||tb(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zy(e)===n&&(n=n.ownerDocument.body),n}function Ab(e,t){let n=Ry(e);if(Ky(e))return n;if(!Hy(e)){let t=rb(e);for(;t&&!eb(t);){if(Vy(t)&&!Ob(t))return t;t=rb(t)}return n}let r=kb(e,t);for(;r&&Gy(r)&&Ob(r);)r=kb(r,t);return r&&eb(r)&&Ob(r)&&!Zy(r)?n:r||Qy(e)||n}var jb=async function(e){let t=this.getOffsetParent||Ab,n=this.getDimensions,r=await n(e.floating);return{reference:Db(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mb(e){return tb(e).direction===`rtl`}var Nb={convertOffsetParentRelativeRectToViewportRelativeRect:gb,getDocumentElement:zy,getClippingRect:Tb,getOffsetParent:Ab,getElementRects:jb,getClientRects:_b,getDimensions:Eb,getScale:lb,isElement:Vy,isRTL:Mb};function Pb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fb(e,t){let n=null,r,i=zy(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Zv(d),h=Zv(i.clientWidth-(u+f)),g=Zv(i.clientHeight-(d+p)),_=Zv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Yv(0,Jv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Pb(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ib(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=cb(e),u=i||a?[...l?ab(l):[],...t?ab(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fb(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?pb(e):null;c&&g();function g(){let t=pb(e);h&&!Pb(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;
vendor: 7,720 bytes, line 13
13u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Lb=My,Rb=Ny,zb=Ey,Bb=Fy,Vb=ky,Hb=Ty,Ub=Py,Wb=(e,t,n)=>{let r=new Map,i={platform:Nb,...n},a={...i.platform,_c:r};return wy(e,t,{...i,platform:a})},Gb=typeof document<`u`?H.useLayoutEffect:function(){};function Kb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Kb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jb(e,t){let n=qb(e);return Math.round(t*n)/n}function Yb(e){let t=H.useRef(e);return Gb(()=>{t.current=e}),t}function Xb(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=H.useState(r);Kb(f,r)||p(r);let[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=H.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=H.useRef(null),C=H.useRef(null),w=H.useRef(u),T=c!=null,E=Yb(c),D=Yb(i),O=Yb(l),k=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Wb(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Kb(w.current,t)&&(w.current=t,sf.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Gb(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=H.useRef(!1);Gb(()=>(A.current=!0,()=>{A.current=!1}),[]),Gb(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let ee=H.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),te=H.useMemo(()=>({reference:b,floating:x}),[b,x]),ne=H.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=Jb(te.floating,u.x),r=Jb(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qb(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:k,refs:ee,elements:te,floatingStyles:ne}),[u,k,ee,te,ne])}var Zb=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Hb({element:r.current,padding:i}).fn(n):r?Hb({element:r,padding:i}).fn(n):{}}}},Qb=(e,t)=>{let n=Lb(e);return{name:n.name,fn:n.fn,options:[e,t]}},$b=(e,t)=>{let n=Rb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ex=(e,t)=>({fn:Ub(e).fn,options:[e,t]}),tx=(e,t)=>{let n=zb(e);return{name:n.name,fn:n.fn,options:[e,t]}},nx=(e,t)=>{let n=Bb(e);return{name:n.name,fn:n.fn,options:[e,t]}},rx=(e,t)=>{let n=Vb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ix=(e,t)=>{let n=Zb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ax=`Arrow`,ox=H.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,U.jsx)(mt.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,U.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ox.displayName=ax;var sx=ox,cx=`Popper`,[lx,ux]=dt(cx),[dx,fx]=lx(cx),px=e=>{let{__scopePopper:t,children:n}=e,[r,i]=H.useState(null);return(0,U.jsx)(dx,{scope:t,anchor:r,onAnchorChange:i,children:n})};px.displayName=cx;var mx=`PopperAnchor`,hx=H.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=fx(mx,n),o=H.useRef(null),s=ht(t,o),c=H.useRef(null);return H.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,U.jsx)(mt.div,{...i,ref:s})});hx.displayName=mx;var gx=`PopperContent`,[_x,vx]=lx(gx),yx=H.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=fx(gx,n),[_,v]=H.useState(null),y=ht(t,e=>v(e)),[b,x]=H.useState(null),S=an(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Cx),altBoundary:O},{refs:A,floatingStyles:ee,placement:te,isPositioned:ne,middlewareData:re}=Xb({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Ib(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Qb({mainAxis:i+w,alignmentAxis:o}),c&&$b({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?ex():void 0,...k}),c&&tx({...k}),nx({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&ix({element:b,padding:s}),wx({arrowWidth:C,arrowHeight:w}),f&&rx({strategy:`referenceHidden`,...k})]}),[j,M]=Tx(te),ie=vt(m);ut(()=>{ne&&ie?.()},[ne,ie]);let ae=re.arrow?.x,oe=re.arrow?.y,se=re.arrow?.centerOffset!==0,[ce,le]=H.useState();return ut(()=>{_&&le(window.getComputedStyle(_).zIndex)},[_]),(0,U.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:ne?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(` `),...re.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,U.jsx)(_x,{scope:n,placedSide:j,onArrowChange:x,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,U.jsx)(mt.div,{"data-side":j,"data-align":M,...h,ref:y,style:{...h.style,animation:ne?void 0:`none`}})})})});yx.displayName=gx;var bx=`PopperArrow`,xx={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Sx=H.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=vx(bx,n),a=xx[i.placedSide];return(0,U.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,U.jsx)(sx,{...r,ref:t,style:{...r.style,display:`block`}})})});Sx.displayName=bx;function Cx(e){return e!==null}var wx=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Tx(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Tx(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ex=px,Dx=hx,Ox=yx,kx=Sx;
vendor: 4,293 bytes, line 13
13function Ax(e){let t=jx(e),n=H.forwardRef((e,n)=>{let{children:r,...i}=e,a=H.Children.toArray(r),o=a.find(Nx);if(o){let e=o.props.children,r=a.map(t=>t===o?H.Children.count(e)>1?H.Children.only(null):H.isValidElement(e)?e.props.children:null:t);return(0,U.jsx)(t,{...i,ref:n,children:H.isValidElement(e)?H.cloneElement(e,void 0,r):null})}return(0,U.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function jx(e){let t=H.forwardRef((e,t)=>{let{children:n,...r}=e;if(H.isValidElement(n)){let e=Fx(n),i=Px(r,n.props);return n.type!==H.Fragment&&(i.ref=t?gt(t,e):e),H.cloneElement(n,i)}return H.Children.count(n)>1?H.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Mx=Symbol(`radix.slottable`);function Nx(e){return H.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Mx}function Px(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Fx(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ix=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Lx=`VisuallyHidden`,Rx=H.forwardRef((e,t)=>(0,U.jsx)(mt.span,{...e,ref:t,style:{...Ix,...e.style}}));Rx.displayName=Lx;var zx=Rx,Bx=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Vx=[` `,`Enter`],Hx=`Select`,[Ux,Wx,Gx]=on(Hx),[Kx,qx]=dt(Hx,[Gx,ux]),Jx=ux(),[Yx,Xx]=Kx(Hx),[Zx,Qx]=Kx(Hx),$x=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=Jx(t),[g,_]=H.useState(null),[v,y]=H.useState(null),[b,x]=H.useState(!1),S=sn(l),[C,w]=ft({prop:r,defaultProp:i??!1,onChange:a,caller:Hx}),[T,E]=ft({prop:o,defaultProp:s,onChange:c,caller:Hx}),D=H.useRef(null),O=g?m||!!g.closest(`form`):!0,[k,A]=H.useState(new Set),ee=Array.from(k).map(e=>e.props.value).join(`;`);return(0,U.jsx)(Ex,{...h,children:(0,U.jsxs)(Yx,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:_t(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,U.jsx)(Ux.Provider,{scope:t,children:(0,U.jsx)(Zx,{scope:e.__scopeSelect,onNativeOptionAdd:H.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:H.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,U.jsxs)(JS,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,U.jsx)(`option`,{value:``}):null,Array.from(k)]},ee):null]})})};$x.displayName=Hx;var eS=`SelectTrigger`,tS=H.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Jx(n),o=Xx(eS,n),s=o.disabled||r,c=ht(t,o.onTriggerChange),l=Wx(n),u=H.useRef(`touch`),[d,f,p]=XS(e=>{let t=l().filter(e=>!e.disabled),n=ZS(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,U.jsx)(Dx,{asChild:!0,...a,children:(0,U.jsx)(mt.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":YS(o.value)?``:void 0,...i,ref:c,onClick:pt(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:pt(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:pt(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Bx.includes(e.ke
vendor: 13,362 bytes, line 13
13y)&&(m(),e.preventDefault())})})})});tS.displayName=eS;var nS=`SelectValue`,rS=H.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Xx(nS,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=ht(t,c.onValueNodeChange);return ut(()=>{l(u)},[l,u]),(0,U.jsx)(mt.span,{...s,ref:d,style:{pointerEvents:`none`},children:YS(c.value)?(0,U.jsx)(U.Fragment,{children:o}):a})});rS.displayName=nS;var iS=`SelectIcon`,aS=H.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,U.jsx)(mt.span,{"aria-hidden":!0,...i,ref:t,children:r||`â¼`})});aS.displayName=iS;var oS=`SelectPortal`,sS=e=>(0,U.jsx)(bt,{asChild:!0,...e});sS.displayName=oS;var cS=`SelectContent`,lS=H.forwardRef((e,t)=>{let n=Xx(cS,e.__scopeSelect),[r,i]=H.useState();if(ut(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?sf.createPortal((0,U.jsx)(dS,{scope:e.__scopeSelect,children:(0,U.jsx)(Ux.Slot,{scope:e.__scopeSelect,children:(0,U.jsx)(`div`,{children:e.children})})}),t):null}return(0,U.jsx)(hS,{...e,ref:t})});lS.displayName=cS;var uS=10,[dS,fS]=Kx(cS),pS=`SelectContentImpl`,mS=Ax(`SelectContent.RemoveScroll`),hS=H.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=Xx(cS,n),[y,b]=H.useState(null),[x,S]=H.useState(null),C=ht(t,e=>b(e)),[w,T]=H.useState(null),[E,D]=H.useState(null),O=Wx(n),[k,A]=H.useState(!1),ee=H.useRef(!1);H.useEffect(()=>{if(y)return wt(y)},[y]),Ct();let te=H.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),ne=H.useCallback(()=>te([w,y]),[te,w,y]);H.useEffect(()=>{k&&ne()},[k,ne]);let{onOpenChange:re,triggerPointerDownPosRef:j}=v;H.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(j.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(j.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||re(!1),document.removeEventListener(`pointermove`,t),j.current=null};return j.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,re,j]),H.useEffect(()=>{let e=()=>re(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[re]);let[M,ie]=XS(e=>{let t=O().filter(e=>!e.disabled),n=ZS(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=H.useCallback((e,t,n)=>{let r=!ee.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(ee.current=!0))},[v.value]),oe=H.useCallback(()=>y?.focus(),[y]),se=H.useCallback((e,t,n)=>{let r=!ee.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),ce=r===`popper`?yS:_S,le=ce===yS?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,U.jsx)(dS,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ae,selectedItem:w,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:ne,selectedItemText:E,position:r,isPositioned:k,searchRef:M,children:(0,U.jsx)(xt,{as:mS,allowPinchZoom:!0,children:(0,U.jsx)(yt,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:pt(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,U.jsx)(St,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,U.jsx)(ce,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:pt(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>te(t)),e.preventDefault()}})})})})})})});hS.displayName=pS;var gS=`SelectItemAlignedPosition`,_S=H.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Xx(cS,n),o=fS(cS,n),[s,c]=H.useState(null),[l,u]=H.useState(null),d=ht(t,e=>u(e)),f=Wx(n),p=H.useRef(!1),m=H.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=H.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-uS,d=Kv(a,[uS,Math.max(uS,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-uS,d=Kv(a,[uS,Math.max(uS,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-uS*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-uS,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,ee=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+ee;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${uS}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);ut(()=>y(),[y]);let[b,x]=H.useState();return ut(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,U.jsx)(bS,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:H.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,U.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,U.jsx)(mt.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});_S.displayName=gS;var vS=`SelectPopperPosition`,yS=H.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=uS,...a}=e,o=Jx(n);return(0,U.jsx)(Ox,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});yS.displayName=vS;var[bS,xS]=Kx(cS,{}),SS=`SelectViewport`,CS=H.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=fS(SS,n),o=xS(SS,n),s=ht(t,a.onViewportChange),c=H.useRef(0);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,U.jsx)(Ux.Slot,{scope:n,children:(0,U.jsx)(mt.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:pt(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-uS*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});CS.displayName=SS;var wS=`SelectGroup`,[TS,ES]=Kx(wS),DS=H.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=_t();return(0,U.jsx)(TS,{scope:n,id:i,children:(0,U.jsx)(mt.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});DS.displayName=wS;var OS=`SelectLabel`,kS=H.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=ES(OS,n);return(0,U.jsx)(mt.div,{id:i.id,...r,ref:t})});kS.displayName=OS;var AS=`SelectItem`,[jS,MS]=Kx(AS),NS=H.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Xx(AS,n),c=fS(AS,n),l=s.value===r,[u,d]=H.useState(a??``),[f,p]=H.useState(!1),m=ht(t,e=>c.itemRefCallback?.(e,r,i)),h=_t(),g=H.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,U.jsx)(jS,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:H.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,U.jsx)(Ux.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,U.jsx)(mt.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:pt(o.onFocus,()=>p(!0)),onBlur:pt(o.onBlur,()=>p(!1)),onClick:pt(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:pt(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:pt(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:pt(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:pt(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:pt(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Vx.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});NS.displayName=AS;var PS=`SelectItemText`,FS=H.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Xx(PS,n),s=fS(PS,n),c=MS(PS,n),l=Qx(PS,n),[u,d]=H.useState(null),f=ht(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=H.useMemo(()=>(0,U.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return ut(()=>(h(m),()=>g(m)),[h,g,m]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(mt.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?sf.createPortal(a.children,o.valueNode):null]})});FS.displayName=PS;var IS=`SelectItemIndicator`,LS=H.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return MS(IS,n).isSelected?(0,U.jsx)(mt.span,{"aria-hidden":!0,...r,ref:t}):null});LS.displayName=IS;var RS=`SelectScrollUpButton`,zS=H.forwardRef((e,t)=>{let n=fS(RS,e.__scopeSelect),r=xS(RS,e.__scopeSelect),[i,a]=H.useState(!1),o=ht(t,r.onScrollButtonChange);return ut(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,U.jsx)(HS,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});zS.displayName=RS;var BS=`SelectScrollDownButton`,VS=H.forwardRef((e,t)=>{let n=fS(BS,e.__scopeSelect),r=xS(BS,e.__scopeSelect),[i,a]=H.useState(!1),o=ht(t,r.onScrollButtonChange);return ut(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,U.jsx)(HS,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});VS.displayName=BS;var HS=H.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=fS(`SelectScrollButton`,n),o=H.useRef(null),s=Wx(n),c=H.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return H.useEffect(()=>()=>c(),[c]),ut(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,U.jsx)(mt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:pt(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:pt(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:pt(i.onPointerLeave,()=>{c()})})}),US=`SelectSeparator`,WS=H.forwardRef((e,t)=>
13{let{__scopeSelect:n,...r}=e;return(0,U.jsx)(mt.div,{"aria-hidden":!0,...r,ref:t})});WS.displayName=US;var GS=`SelectArrow`,KS=H.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Jx(n),a=Xx(GS,n),o=fS(GS,n);return a.open&&o.position===`popper`?(0,U.jsx)(kx,{...i,...r,ref:t}):null});KS.displayName=GS;var qS=`SelectBubbleInput`,JS=H.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=H.useRef(null),a=ht(r,i),o=rn(t);return H.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,U.jsx)(mt.select,{...n,style:{...Ix,...n.style},ref:a,defaultValue:t})});JS.displayName=qS;function YS(e){return e===``||e===void 0}function XS(e){let t=vt(e),n=H.useRef(``),r=H.useRef(0),i=H.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=H.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return H.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function ZS(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=QS(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function QS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $S=$x,eC=tS,tC=rS,nC=aS,rC=sS,iC=lS,aC=CS,oC=kS,sC=NS,cC=FS,lC=LS,uC=zS,dC=VS,fC=WS,pC=$S,mC=tC,hC=H.forwardRef(({className:e,children:t,...n},r)=>(0,U.jsxs)(eC,{ref:r,className:Pt(`flex h-9 w-full cursor-pointer items-center justify-between whitespace-nowrap rounded-md border border-control-border bg-control px-3 py-2 text-sm text-foreground shadow-sm transition-[border-color,box-shadow,background-color] data-[placeholder]:text-muted-foreground hover:border-control-border-hover focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/40 disabled:cursor-not-allowed disabled:border-border disabled:bg-control-disabled disabled:text-muted-foreground disabled:opacity-70 [&>span]:line-clamp-1`,e),...n,children:[t,(0,U.jsx)(nC,{asChild:!0,children:(0,U.jsx)(Ze,{className:`h-4 w-4 text-foreground`})})]}));hC.displayName=eC.displayName;var gC=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(uC,{ref:n,className:Pt(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,U.jsx)($e,{className:`h-4 w-4`})}));gC.displayName=uC.displayName;var _C=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(dC,{ref:n,className:Pt(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,U.jsx)(Ze,{className:`h-4 w-4`})}));_C.displayName=dC.displayName;var vC=H.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,U.jsx)(rC,{children:(0,U.jsxs)(iC,{ref:i,className:Pt(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-control-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,U.jsx)(gC,{}),(0,U.jsx)(aC,{className:Pt(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,U.jsx)(_C,{})]})}));vC.displayName=iC.displayName;var yC=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(oC,{ref:n,className:Pt(`px-2 py-1.5 text-sm font-semibold`,e),...t}));yC.displayName=oC.displayName;var bC=H.forwardRef(({className:e,children:t,...n},r)=>(0,U.jsxs)(sC,{ref:r,className:Pt(`relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=checked]:font-medium data-[state=checked]:text-primary data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground data-[disabled]:opacity-70`,e),...n,children:[(0,U.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,U.jsx)(lC,{children:(0,U.jsx)(Xe,{className:`h-4 w-4`})})}),(0,U.jsx)(cC,{children:t})]}));bC.displayName=sC.displayName;var xC=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(fC,{ref:n,className:Pt(`-mx-1 my-1 h-px bg-muted`,e),...t}));xC.displayName=fC.displayName;var SC=[`Short text`,`Yes/No`,`Single choice`,`Multiple choice`,`Long text`],CC=L({label:R().trim().min(1,`Enter the question clients should see.`).max(300),type:Kt(SC),options:Xt(R().trim().max(200)).max(50),maxSelect:R().trim().max(3),order:R().trim().max(6),helpText:R().trim().max(500),conditional:R().trim().max(300),detailMode:Kt([`none`,`optional`,`required`]),detailLabel:R().trim().max(200)}),wC=e=>(e??``).trim().toLowerCase();function TC(e,t){let n=wC(e||t);return n===`long text`||n.includes(`free text`)||n.includes(`validated screen`)?n===`free text`||n===`short text`?`Short text`:`Long text`:n===`yes/no`||n.startsWith(`yes / no`)||n===`yes_no`?`Yes/No`:n===`multiple choice`||n.startsWith(`multi-select`)||n===`multi`?`Multiple choice`:n===`single choice`||n.startsWith(`single select`)||n===`single`||n===`selectable chip`?`Single choice`:`Short text`}function EC(e){let t=(e??``).trim();if(/^yes\s*\/\s*no/i.test(t))return t.split(`+`)[0].split(`/`).map(e=>
13e.trim()).filter(Boolean);let n=t.match(/\(([^)]+)\)/);return n?n[1].split(/\s*\/\s*|\s*,\s*/).map(e=>e.trim()).filter(Boolean):[]}function DC(e){let t=(e??``).match(/max\s*(\d+)/i);return t?Number(t[1]):null}function OC(e,t){if(t===`optional`||t===`required`)return t;let n=wC(e);return n.includes(`+ optional detail`)||n.includes(`+ free text`)||n.includes(`+ date`)||n.includes(`other (specify)`)?`optional`:`none`}function kC(e){let t=Array.isArray(e.options)?e.options.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean):[];return{label:e.label,type:TC(e.answer_type,e.kind),options:t.length?t:EC(e.answer_type),maxSelect:String(e.max_select??DC(e.answer_type)??``),order:String(e.sort_order),helpText:e.help_text??``,conditional:e.conditional_logic??`Always`,detailMode:OC(e.answer_type,e.detail_mode),detailLabel:e.detail_label??``}}function AC(e){let t=CC.safeParse(e),n={};if(!t.success){for(let e of t.error.issues)n[e.path[0]]=e.message;return n}let r=e.type===`Single choice`||e.type===`Multiple choice`,i=e.options.map(e=>e.trim());if(r){i.some(e=>!e)?n.options=`Complete or remove each empty option.`:i.length<2&&(n.options=`Add at least two answer options.`);let e=new Set,t=i.find(t=>{let n=t.toLocaleLowerCase();return e.has(n)?!0:(e.add(n),!1)});t&&(n.options=`â${t}â appears more than once. Each option must be unique.`)}if((!/^\d+$/.test(e.order)||Number(e.order)>1e5)&&(n.order=`Enter a whole number from 0 to 100,000.`),e.type===`Multiple choice`){let t=Number(e.maxSelect);e.maxSelect&&(!/^\d+$/.test(e.maxSelect)||t<1||t>i.length)&&(n.maxSelect=`Enter a whole number from 1 to ${Math.max(i.length,1)}.`)}return e.detailMode!==`none`&&!e.detailLabel.trim()&&(n.detailLabel=`Enter the prompt clients should see for additional detail.`),n}function jC(e){return Object.values(e).some(Boolean)}var MC=e=>e.section===`safety`,NC=e=>(e.question_ref||e.key).trim().toUpperCase();function PC(e){let t=new Map,n=[],r=e=>(e.active?2:0)+ +!!e.approved_at;for(let i of e){if(!MC(i)){n.push(i);continue}let e=NC(i),a=t.get(e);if(!a){t.set(e,{...i,flow_id:null,siblingIds:[i.id]});continue}let o=[...a.siblingIds,i.id],s=r(i)>r(a)||r(i)===r(a)&&i.sort_order<a.sort_order;t.set(e,s?{...i,flow_id:null,siblingIds:o}:{...a,siblingIds:o})}return[...n,...t.values()]}function FC(e,t,n){let r=PC(e),i=PC(t),a=new Map(n.map(e=>[e.question_id,e])),o=e=>MC(e)?`safety|${NC(e)}`:`${e.section}|${e.key}`,s=new Map;for(let e of i)s.set(o(e),e);let c=[],l=new Set;for(let e of r){let t=o(e),n=s.get(t);if(n)l.add(t),c.push({...n,active:MC(e)?!0:n.active,origin:`customised`,platformId:e.id,hidden:!1,platformUpdated:!!e.updated_at&&!!n.updated_at&&Date.parse(e.updated_at)>Date.parse(n.updated_at),safetyLocked:MC(e)});else{let t=a.get(e.id);c.push({...e,sort_order:t?.sort_order??e.sort_order,origin:`platform`,platformId:e.id,hidden:!MC(e)&&!!t?.hidden,platformUpdated:!1,safetyLocked:MC(e)})}}for(let[e,t]of s)l.has(e)||c.push({...t,origin:`clinic_only`,platformId:null,hidden:!1,platformUpdated:!1,safetyLocked:MC(t)});return c}var IC={search:``,section:`all`,flow:`all`,type:`all`,status:`all`,required:`all`};function LC(e){return TC(e.answer_type,e.kind)}function RC(e){return Array.isArray(e.options)?e.options.filter(e=>typeof e==`string`&&e.trim()!==``):[]}function zC(e){return e.active&&!e.hidden}function BC(e,t){let n=t.search.trim().toLowerCase();return e.filter(e=>!(t.section!==`all`&&e.section!==t.section||t.flow!==`all`&&(e.flow_id??`none`)!==t.flow||t.type!==`all`&&LC(e)!==t.type||t.status===`active`&&!zC(e)||t.status===`inactive`&&zC(e)||t.required===`required`&&!e.required||t.required===`optional`&&e.required||n&&!`${e.label} ${e.key} ${e.question_ref??``} ${RC(e).join(` `)}`.toLowerCase().includes(n)))}var VC=[`safety`,`flow`,`goals`,`concerns`,`medical_flags`],HC={safety:`Safety questions`,flow:`Treatment questions`,goals:`Treatment goals`,concerns:`Skin concerns`,medical_flags:`Medical history`};function UC(e){let t=new Map;for(let n of e){let e=t.get(n.section)??new Map;t.set(n.section,e);let r=MC(n)?`none`:n.flow_id??`none`,i=e.get(r)??[];i.push(n),e.set(r,i)}let n=e=>{let t=VC.indexOf(e);return t===-1?VC.length:t};return[...t.entries()].sort((e,t)=>
13n(e[0])-n(t[0])||e[0].localeCompare(t[0])).map(([e,t])=>({section:e,flows:[...t.entries()].map(([e,t])=>({flowId:e,rows:t.sort((e,t)=>e.sort_order-t.sort_order||e.label.localeCompare(t.label))})).sort((e,t)=>(e.rows[0]?.sort_order??0)-(t.rows[0]?.sort_order??0))}))}function WC(e,t){return t===`exclude`?!1:t===`include`?!0:e}function GC(e,t){return t?e?null:`include`:e?`exclude`:null}var KC=[{flow:1,ref:`1.1`,label:`How would you describe your skin type?`,answerType:`Single select (oily / dry / combination / normal / sensitive / not sure)`,conditional:`Always in this flow`,safety:`Product and peel selection`,options:[`Oily`,`Dry`,`Combination`,`Normal`,`Sensitive`,`Not sure`]},{flow:1,ref:`1.2`,label:`What are your main skin concerns? (up to three)`,answerType:`Multi-select, max 3`,conditional:`Always`,safety:`Directs treatment choice`,options:[`Dullness`,`Congestion / blackheads`,`Uneven tone`,`Dryness`,`Oiliness`,`Enlarged pores`,`Rough texture`,`Redness`,`Dark spots`,`Active breakouts`]},{flow:1,ref:`1.3`,label:`How does your skin usually react to new products or treatments?`,answerType:`Single select`,conditional:`Always`,safety:`Sensitivity and reaction risk`,options:[`Tolerates well`,`Occasionally sensitive`,`Frequently reacts`,`Not sure`]},{flow:1,ref:`1.4`,label:`Describe your current skincare routine.`,answerType:`Single select (none / basic / moderate / advanced)`,conditional:`Always`,safety:`Baseline for home care`,options:[`None`,`Basic (cleanse & moisturise)`,`Moderate`,`Advanced (actives, retinoids, acids)`]},{flow:1,ref:`1.5`,label:`Are you currently using retinoids, acids, or prescription skincare?`,answerType:`Yes / No + free text`,conditional:`Always`,safety:`Pre-treatment pause may be required`,options:null},{flow:1,ref:`1.6`,label:`Do you wear SPF daily?`,answerType:`Yes / No / Sometimes`,conditional:`Always`,safety:`Pigmentation and aftercare`,options:null},{flow:1,ref:`1.7`,label:`Have you had a professional facial or peel before? What was your experience?`,answerType:`Yes / No + free text`,conditional:`Free text when Yes`,safety:`Prior tolerance`,options:null},{flow:1,ref:`1.8`,label:`How much downtime are you comfortable with?`,answerType:`Single select`,conditional:`Always`,safety:`Expectation setting`,options:[`None â must return to normal immediately`,`1â2 days`,`Up to a week`,`Flexible`]},{flow:1,ref:`1.9`,label:`Do you have any active skin conditions? (eczema, rosacea, psoriasis, cold sores, active acne)`,answerType:`Multi-select`,conditional:`Always`,safety:`Flare and infection risk`,options:[`Eczema`,`Rosacea`,`Psoriasis`,`Cold sores`,`Active acne`]},{flow:1,ref:`1.10`,label:`Are you preparing for a specific event? If so, when?`,answerType:`Yes / No + date`,conditional:`Date when Yes`,safety:`Timing of downtime`,options:null},{flow:2,ref:`2.1`,label:`Which areas concern you most?`,answerType:`Multi-select (forehead, frown lines, crow's feet, lip lines, downturned mouth, gummy smile, jaw, neck bands, nose lines)`,conditional:`Always`,safety:`Determines dosing map`,options:[`Forehead lines`,`Frown lines between brows`,`Crow's feet`,`Lip lines`,`Downturned mouth`,`Gummy smile`,`Jaw width / clenching`,`Neck bands`,`Nose lines`]},{flow:2,ref:`2.2`,label:`Are these lines visible at rest, only when you move your face, or both?`,answerType:`Single select`,conditional:`Always`,safety:`Static vs dynamic â realistic outcome`,options:[`Only when I move`,`Slightly at rest`,`Clearly at rest`,`Not sure`]},{flow:2,ref:`2.3`,label:`Have you had wrinkle relaxer treatments before?`,answerType:`Single select (never / once or twice / regularly / stopped)`,conditional:`Always`,safety:`Tolerance and resistance`,options:[`Never`,`Once or twice`,`Regularly`,`Previously but stopped`]},{flow:2,ref:`2.4`,label:`When was your last treatment, and how did you feel about the result?`,answerType:`Free text`,conditional:`Only when 2.3 â Never. Flag if under 12 weeks`,safety:`Stacking risk within 12 weeks`,options:null},{flow:2,ref:`2.5`,label:`What look are you hoping for?`,answerType:`Single select (very natural â minimal movement)`,conditional:`Always`,safety:`Expectation setting`,options:[`Very natural â still fully expressive`,`Balanced softening`,`Smooth with minimal movement`,`Not sure`]},{flow:2,ref:`2.6`,label:`Do you clench or grind your teeth, or have jaw tension or headaches?`,answerType:`Yes / No`,conditional:`Always`,safety:`Masseter indication`,options:null},{flow:2,ref:`2.7`,label:`Do you have any history of eyelid drooping, facial asymmetry or muscle weakness?`,answerType:`Yes / No + detail`,conditional:`Always`,safety:`Ptosis risk â provider review`,options:null},{flow:2,ref:`2.8`,label:`Have you ever had a neuromodulator treatment that did not work or wore off unusually fast?`,answerType:`Yes / No`,conditional:`Always`,safety:`Possible resistance`,options:null},{flow:2,ref:`2.9`,label:`Do you have any upcoming events?`,answerType:`Yes / No + date`,conditional:`Always`,safety:`Onset 3â7 days, full effect 14 days`,options:null},{flow:3,ref:`3.1`,label:`Which areas would you like to address?`,answerType:`Multi-select`,conditional:`Always`,safety:`Directs treatment plan`,options:[`Lips`,`Cheeks / mid-face`,`Jawline`,`Chin`,`Under-eye hollows`,`Temples`,`Nose shape`,`Nasolabial folds`,`Marionette lines`,`Hands`,`Double chin / under-chin fullness`]},{flow:3,ref:`3.2`,label:`What are you hoping to achieve?`,answerType:`Single select`,conditional:`Always`,safety:`Goal mapping`,options:[`Add volume`,`Restore lost volume`,`Improve definition or contour`,`Lift and tighten`,`Reduce fullness`,`Improve symmetry`,`Not sure`]},{flow:3,ref:`3.3`,label:`What level of change are you looking for?`,answerType:`Single select`,conditional:`Always`,safety:`Expectation setting`,options:[`Very subtle â barely noticeable`,`Natural but visible`,`Noticeable enhancement`,`Not sure, I want guidance`]},{flow:3,ref:`3.4`,label:`Have you had filler or threads before?`,answerType:`Single select`,conditional:`Always`,safety:`Stacking assessment`,options:[`Never`,`Yes â in the area I'm asking about`,`Yes â elsewhere on my face`,`Previously, now dissolved`]},{flow:3,ref:`3.5`,label:`Which area, approximately when, and roughly how much?`,answerType:`Free text`,conditional:`Only when 3.4 â Never`,safety:`Volume stacking`,options:null},{flow:3,ref:`3.6`,label:`Have you ever had filler dissolved, or a complication such as swelling, lumps or vascular issues?`,answerType:`Yes / No + detail`,conditional:`Always`,safety:`Vascular event history â provider review`,options:null},{flow:3,ref:`3.7`,label:`What do you like or dislike about your lips currently?`,answerType:`Free text`,conditional:`Only when Lips selected in 3.1`,safety:`Expectation setting`,options:null},{flow:3,ref:`3.8`,label:`Do you have a history of cold sores?`,answerType:`Yes / No`,conditional:`Only when lips or perioral selected`,safety:`Antiviral prophylaxis`,options:null},{flow:3,ref:`3.9`,label:`Do you bruise easily?`,answerType:`Yes / No`,conditional:`Always`,safety:`Bruising expectation`,options:null},{flow:3,ref:`3.10`,label:`Are you taking blood thinners, fish oil, vitamin E, or anti-inflammatories?`,answerType:`Multi-select`,conditional:`Always`,safety:`Bleeding risk`,options:[`Blood thinners`,`Fish oil`,`
13Vitamin E`,`Anti-inflammatories`]},{flow:3,ref:`3.11`,label:`Do you have an event coming up?`,answerType:`Yes / No + date`,conditional:`Always`,safety:`Swelling 3â14 days`,options:null},{flow:4,ref:`4.1`,label:`What are you looking to treat?`,answerType:`Multi-select`,conditional:`Always`,safety:`Directs modality`,options:[`Acne scarring`,`Surgical or injury scars`,`Stretch marks`,`Keloids`,`Large pores`,`Rough texture`,`Fine lines`,`Warts or skin tags`,`Overall skin quality`]},{flow:4,ref:`4.2`,label:`Where on the body?`,answerType:`Multi-select + other (specify)`,conditional:`Always`,safety:`Photo and device selection`,options:[`Face`,`Neck`,`Chest`,`Back`,`Abdomen`,`Thighs`,`Arms`,`Other (specify)`]},{flow:4,ref:`4.3`,label:`How long have you had this concern?`,answerType:`Single select`,conditional:`Always`,safety:`Maturity of scar`,options:[`Under 6 months`,`6â12 months`,`1â5 years`,`Over 5 years`,`Since childhood`]},{flow:4,ref:`4.4`,label:`For scarring â how would you describe it?`,answerType:`Single select (flat / indented / raised / mixed)`,conditional:`Only when a scar type selected in 4.1`,safety:`Scar type drives technique`,options:[`Flat but discoloured`,`Indented / pitted`,`Raised`,`Mixed`,`Not sure`]},{flow:4,ref:`4.5`,label:`Do you have a personal or family history of keloid scarring?`,answerType:`Yes / No / Not sure`,conditional:`Always â flag prominently`,safety:`Critical screening`,options:null},{flow:4,ref:`4.6`,label:`Have you taken isotretinoin (Accutane) in the last 12 months?`,answerType:`Yes / No + date`,conditional:`Always`,safety:`Healing risk; window length needs clinician sign-off`,options:null},{flow:4,ref:`4.7`,label:`Have you had any resurfacing treatment before? What and when?`,answerType:`Yes / No + free text`,conditional:`Detail when Yes`,safety:`Stacking`,options:null},{flow:4,ref:`4.8`,label:`How does your skin respond to injury â does it darken, lighten, or heal evenly?`,answerType:`Single select`,conditional:`Always`,safety:`Post-inflammatory hyperpigmentation risk`,options:null},{flow:4,ref:`4.9`,label:`How much downtime can you accommodate?`,answerType:`Single select`,conditional:`Always`,safety:`3â7 days typical`,options:null},{flow:4,ref:`4.10`,label:`Are you willing to complete a course of treatments?`,answerType:`Yes / No / Not sure`,conditional:`Always`,safety:`3â6 sessions typical`,options:null},{flow:5,ref:`5.1`,label:`What are you looking to treat?`,answerType:`Multi-select`,conditional:`Always`,safety:`Device selection`,options:[`Unwanted hair`,`Sun damage / dark spots`,`Redness or broken capillaries`,`Tattoo removal`,`Skin laxity / sagging`,`Overall tone`]},{flow:5,ref:`5.2`,label:`Which area(s)?`,answerType:`Free text or body-map selector`,conditional:`Always`,safety:`Photo and device selection`,options:null},{flow:5,ref:`5.3`,label:`How would you describe your natural skin tone?`,answerType:`Single select (very fair â deep brown/black / not sure)`,conditional:`Always â must be asked`,safety:`Essential for laser safety and device selection`,options:[`Very fair`,`Fair`,`Medium`,`Olive`,`Brown`,`Deep brown / black`,`Not sure`]},{flow:5,ref:`5.4`,label:`Are you currently tanned, or have you had recent sun exposure or self-tanner?`,answerType:`Yes / No + detail`,conditional:`Always`,safety:`Burn risk â may require deferral`,options:null},{flow:5,ref:`5.5`,label:`Are you taking any photosensitising medication?`,answerType:`Yes / No + free text`,conditional:`Always`,safety:`Photosensitivity reaction risk`,options:null},{flow:5,ref:`5.6`,label:`What is your natural hair colour in that area?`,answerType:`Single select`,conditional:`Only for hair removal`,safety:`Light/grey hair responds poorly`,options:[`Black`,`Dark brown`,`Light brown`,`Blonde`,`Red`,`Grey / white`]},{flow:5,ref:`5.7`,label:`How do you currently manage this hair?`,answerType:`Single select`,conditional:`Only for hair removal`,safety:`Waxing/threading/epilating requires a wait period`,options:[`Shaving`,`Waxing`,`Threading`,`Epilating`,`Depilatory cream`,`Nothing`]},{flow:5,ref:`5.8`,label:`How old is the tattoo, what colours, and is it professional or amateur?`,answerType:`Free text`,conditional:`Only for tattoo removal`,safety:`Session count and clearance expectation`,options:null},{flow:5,ref:`5.9`,label:`Have you had laser or IPL treatment before? Any adverse reaction?`,answerType:`Yes / No + free text`,conditional:`Always`,safety:`Prior adverse reaction â provider review`,options:null},{flow:5,ref:`5.10`,label:`Do you have a history of hyperpigmentation or melasma?`,answerType:`Yes / No`,conditional:`Always`,safety:`Rebound pigmentation risk`,options:null},{flow:6,ref:`6.1`,label:`Which areas would you like to address?`,answerType:`Multi-select`,conditional:`Always`,safety:`Applicator and photo selection`,options:[`Abdomen`,`Flanks / love handles`,`Back`,`Arms`,`Inner thighs`,`Outer thighs`,`Hips / hip dips`,`Buttocks`,`Under-chin`,`Bra area`,`Breast`,`Calves`]},{flow:6,ref:`6.2`,label:`What is your primary goal?`,answerType:`Single select`,conditional:`Always`,safety:`Fat vs skin vs cellulite vs volume`,options:[`Reduce fat`,`Tighten loose skin`,`Reduce cellulite`,`Improve shape or curves`,`Add volume (hips / buttocks / breast)`,`Reduce bloating or fluid retention`,`Post-surgery recovery support`]},{flow:6,ref:`6.3`,label:`Has your weight been stable over the last six months?`,answerType:`Single select`,conditional:`Always`,safety:`Candidacy and durability`,options:[`Yes, stable`,`Gained`,`Lost`,`Fluctuating`]},{flow:6,ref:`6.4`,label:`Is this area resistant to diet and exercise?`,answerType:`Yes / No / Not sure`,conditional:`Always`,safety:`Candidacy`,options:null},{flow:6,ref:`6.5`,label:`Have you had children? If so, how long since your last pregnancy?`,answerType:`Yes / No + timeframe`,conditional:`Only for abdomen, breast or full-body goals`,safety:`Diastasis and timing`,options:null},{flow:6,ref:`6.6`,label:`Have you had any surgical body procedure? (liposuction, tummy tuck, BBL, C-section)`,answerType:`Multi-select + free text`,conditional:`Always`,safety:`Scar tissue and contour irregularity`,options:[`Liposuction`,`Tummy tuck`,`BBL`,`C-section`]},{flow:6,ref:`6.7`,label:`Do you have any hernia, implants, or metal devices in the treatment area?`,answerType:`Yes / No + detail`,conditional:`Always`,safety:`Contraindication for RF, cavitation and HIFU`,options:null},{flow:6,ref:`6.8`,label:`For cellulite â how would you describe it?`,answerType:`Single select`,conditional:`Only when cellulite selected`,safety:`Grading and realistic outcome`,options:[`Only visible when pinched`,`Visible when standing`,`Visible when standing and lying down`,`Deep dimpling`]},{flow:6,ref:`6.9`,label:`How many sessions are you realistically able to commit to?`,answerType:`Single select`,conditional:`Always`,safety:`6â10 typical`,options:null},{flow:6,ref:`6.10`,label:`Do you have a target date or event?`,answerType:`Yes / No + date`,conditional:`Always`,safety:`Timeline planning`,options:null},{flow:7,ref:`7.1`,label:`Which procedure are you considering?`,answerType:`Single select from the clinic's enabled surgical catalogue`,conditional:`Always`,safety:`Routing`,options:null},{flow:7,ref:`7.2`,label:`What is motivating you to consider surgery now?`,answerType:`Free text`,conditional:`Always`,safety:`Psychological readiness â practitioner review`,options:null},{flow:7,ref:`7.3`,label:`Have you consulted with a surgeon about this before?`,answerType:`Single select`,conditional:`Always`,safety:`Second-opinion context`,options:[`No`,`Yes, one`,`Yes, more than one`,`Yes, and I have a date booked elsewhere`]},{flow:7,ref:`7.4`,label:`Have you had any previous surgery â cosmetic or medical?`,answerType:`Free text including approximate dates`,conditional:`Always`,safety:`Anaesthetic and healing history`,options:null},{flow:7,ref:`7.5`,label:`Have you ever had a reaction to general anaesthesia?`,answerType:`Yes / No + detail`,conditional:`Always`,safety:`Anaesthetic risk`,options:null},{flow:7,ref:`7.6`,label:`Do you smoke, vape, or use nicotine in any form?`,answerType:`Single select (never / quit > 1yr / quit recently / current)`,conditional:`Always â flag prominently`,safety:`Significant surgical risk factor`,options:[`Never`,`Former â quit over a year ago`,`Former â quit recently`,`Current`]},{flow:7,ref:`7.7`,label:`Do you have any of the following? (diabetes, high blood pressure, heart condition, clotting disorder, autoimmune condition, anaemia, none)`,answerType:`Multi-select`,conditional:`Always`,safety:`Surgical risk stratification`,options:[`Diabetes`,`High blood pressure`,`Heart condition`,`Clotting disorder`,`Autoimmune condition`,`Anaemia`,`None of these`]},{flow:7,ref:`7.8`,label:`Has your weight been stable for at least six months?`,answerType:`Yes / No`,conditional:`Always`,safety:`Result durability`,options:null},{flow:7,ref:`7.9`,label:`Are you finished having children, or planning future pregnancies?`,answerType:`Single select`,conditional:`Only for abdominal, breast and body procedures`,safety:`Result durability`,options:null},{flow:7,ref:`7.10`,label:`For breast procedures â what is your current and desired size or shape?`,answerType:`Free text`,conditional:`Only for breast procedures`,safety:`Planning`,options:null},{flow:7,ref:`7.11`,label:`How much recovery time can you realistically take?`,answerType:`Single select`,conditional:`Always`,safety:`Candidacy and scheduling`,options:[`Under 1 week`,`1â2 weeks`,`2â4 weeks`,`Over a month`,`Flexible`]},{flow:7,ref:`7.12`,label:`Do you have support at home during recovery?`,answerType:`Yes / No`,conditional:`Always`,safety:`Safe discharge`,options:null},{flow:7,ref:`7.13`,label:`What is your expected timeframe for proceeding?`,answerType:`Single select`,conditional:`Always`,safety:`Routing and follow-up`,options:[`Researching only`,`Within 3 months`,`3â6 months`,`6â12 months`,`Over a year`]},{flow:8,ref:`8.1`,label:`What are you hoping to improve?`,answerType:`Multi-select`,conditional:`Always`,safety:`Protocol direction`,options:[`Energy levels`,`Weight management`,`Skin brightness`,`Hormonal balance`,`Sleep quality`,`Recovery and performance`,`Immunity`,`Bloating and fluid retention`,`General wellness`]},{flow:8,ref:`8.2`,label:`How would you describe your energy through a typical day?`,answerType:`Single select`,conditional:`Always`,safety:`Baseline`,options:[`Consistent`,`Afternoon dip`,`Tired most of the day`,`Difficulty sleeping`]},{flow:8,ref:`8.3`,label:`Have you had blood work done in the last 12 months?`,answerType:`Single select`,conditional:`Always`,safety:`Medical clearance`,options:[`Yes â and I have results`,`Yes â but not recent`,`No`,`Not sure`]},{flow:8,ref:`8.4`,label:`Are you under the care of a doctor for any ongoing condition?`,answerType:`Yes / No + free text`,conditional:`Always`,safety:`Medical oversight`,options:null},{flow:8,ref:`8.5`,label:`Are you currently taking any supplements, vitamins or prescribed medication?`,answerType:`Yes / No + free text`,conditional:`Always`,safety:`Interaction risk`,options:null},{flow:8,ref:`8.6`,label:`For weight management â what have you tried previously?`,answerType:`Multi-select`,conditional:`Only for weight-management goals`,safety:`History and expectation`,options:[`Diet changes`,`Exercise programme`,`Prescription medication`,`Supplements`,`Nothing formal`]},{flow:8,ref:`8.7`,label:`For weight management â do you have any history of thyroid, pancreatic or gallbladder issues?`,answerType:`Yes / No + detail`,conditional:`Only for weight-management goals`,safety:`Contraindication screen`,options:null},{flow:8,ref:`8.8`,label:`For hormone concerns â which symptoms apply?`,answerType:`Multi-select`,conditional:`Only for hormone goals`,safety:`Symptom baseline`,options:[`Irregular cycle`,`Mood changes`,`Low libido`,`Hot flushes`,`Weight changes`,`Hair thinning`,`Skin changes`,`None`]},{flow:8,ref:`8.9`,label:`Do you have any needle anxiety or history of fainting with injections or IV?`,answerType:`Yes / No`,conditional:`Always`,safety:`Vasovagal risk`,options:null},{flow:9,ref:`9.1`,label:`Where are you noticing thinning or loss?`,answerType:`Multi-select`,conditional:`Hair restoration only`,safety:`Pattern assessment`,options:[`Frontal hairline`,`Crown`,`Temples`,`Part line widening`,`Overall thinning`,`Patchy areas`,`Eyebrows`,`Beard`]},{flow:9,ref:`9.2`,label:`How long have you noticed the change?`,answerType:`Single select`,conditional:`Hair restoration only`,safety:`Acute vs chronic`,options:[`Under 6 months`,`6â12 months`,`1â3 years`,`Over 3 years`]},{flow:9,ref:`9.3`,label:`Is there a family history of hair loss?`,answerType:`Single select`,conditional:`Hair restoration only`,safety:`Androgenetic pattern`,options:[`Yes â maternal`,`Yes â paternal`,`Yes â both`,`No`,`Not sure`]},{flow:9,ref:`9.4`,label:`Was the onset gradual or sudden?`,answerType:`Single select`,conditional:`Hair restoration only`,safety:`Telogen effluvium vs pattern loss`,options:[`Gradual`,`Sudden`,`Not sure`]},{flow:9,ref:`9.5`,label:`Have you experienced any of the following recently? (stress, illness, childbirth, weight change, medication change)`,answerType:`Multi-select`,conditional:`Hair restoration only`,safety:`Reversible causes`,options:[`Significant stress`,`Illness`,`Childbirth`,`Major weight change`,`Change in medication`,`None`]},{flow:9,ref:`9.6`,label:`Do you use protective styles, extensions, relaxers or heat regularly?`,answerType:`Multi-select`,conditional:`Hair restoration only`,safety:`Traction alopecia assessment`,options:null},{flow:9,ref:`9.7`,label:`Have you tried any hair loss treatment before?`,answerType:`Multi-select + free text`,conditional:`Hair restoration only`,safety:`Prior response`,o
13ptions:null},{flow:9,ref:`9.8`,label:`Do you have any scalp conditions â flaking, itching, inflammation or scarring?`,answerType:`Multi-select`,conditional:`Hair restoration only`,safety:`Scarring alopecia â provider review`,options:null},{flow:9,ref:`9.9`,label:`What is your goal for your brows?`,answerType:`Single select`,conditional:`Microblading only`,safety:`Design intent`,options:[`Fill sparse areas`,`Reshape`,`Add definition`,`Correct asymmetry`,`Cover previous work`]},{flow:9,ref:`9.10`,label:`Have you had permanent makeup or microblading before?`,answerType:`Yes / No + detail`,conditional:`Microblading only`,safety:`Pigment removal / correction`,options:null},{flow:9,ref:`9.11`,label:`Do you currently fill in your brows daily?`,answerType:`Yes / No`,conditional:`Microblading only`,safety:`Expectation setting`,options:null},{flow:9,ref:`9.12`,label:`Any history of keloid scarring or poor healing?`,answerType:`Yes / No`,conditional:`Microblading only`,safety:`Healing risk`,options:null},{flow:9,ref:`9.13`,label:`What is causing the discolouration, as far as you know?`,answerType:`Single select`,conditional:`Teeth whitening only`,safety:`Whitening response`,o
13ptions:[`Coffee / tea`,`Smoking`,`Wine`,`Natural shade`,`Age`,`Medication`,`Not sure`]},{flow:9,ref:`9.14`,label:`Do you experience tooth or gum sensitivity?`,answerType:`Yes / No`,conditional:`Teeth whitening only`,safety:`Sensitivity management`,options:null},{flow:9,ref:`9.15`,label:`Do you have crowns, veneers, fillings or implants on front teeth?`,answerType:`Yes / No`,conditional:`Teeth whitening only`,safety:`These do not whiten â expectation setting`,options:null},{flow:9,ref:`9.16`,label:`Have you had whitening before? What was the result?`,answerType:`Yes / No + free text`,conditional:`Teeth whitening only`,safety:`Prior response`,options:null}],qC={"wrinkle-relaxer-forehead":2,"wrinkle-relaxer-frown-lines":2,"wrinkle-relaxer-crows-feet":2,"wrinkle-relaxer-bunny-lines":2,"wrinkle-relaxer-gummy-smile":2,"wrinkle-relaxer-lip-flip":2,"wrinkle-relaxer-jaw-slimming":2,"wrinkle-relaxer-neck-bands":2,"lip-filler-subtle":3,"lip-filler-moderate":3,"lip-filler-enhanced":3,"cheek-filler":3,"tear-trough-filler":3,"nasolabial-filler":3,"chin-filler":3,"jawline-filler":3,"non-surgical-rhinoplasty":3,"temple-filler":3,"hand-filler":3,"buttock-filler":3,"biostimulator-gradual-collagen":3,"biostimulator-volume-collagen":3,"biostimulator-long-acting":3,"skin-booster-bio-remodelling":1,"skin-booster-deep-hydration":1,"pdo-cheek-threads":3,"pdo-mono-face":3,"pdo-mono-body":6,"prp-facial":1,"prp-microneedling-facial":4,"prp-injectable-facial":1,"prp-under-eye":3,"prp-hand":3,"prp-stretch-mark-inject":4,"prp-microneedle-stretch-mark":4,"polynucleotide-facial":1,"chemical-peel-face":1,"body-peel-regional":1,microdermabrasion:1,dermaplaning:1,microneedling:4,"rf-microneedling":4,"acne-scar-subcision":4,"acne-scar-pdo":4,"acne-scar-combo":4,"ipl-photofacial":5,"carbon-laser":1,"led-therapy":1,"rf-facial":5,"hifu-face":5,"hifu-body":6,"under-eye-laser":5,"under-eye-rf":5,fibroblast:5,"laser-hair-removal":5,"tattoo-removal":5,"keloid-removal":4,"wart-removal":4,"laser-stretch-mark":4,"customised-facial":1,"eye-bag-treatment":5,"ultrasound-cavitation":6,"rf-body-contouring":6,cryolipolysis:6,"lipo-laser":6,"fat-dissolving-submental":3,"fat-dissolving-body":3,"buttock-sculpting":6,"hip-dip-treatment":6,"breast-enhancement-nonsurgical":6,"fat-transfer-nonsurgical":6,"cellulite-treatment":6,"hair-restoration":9,microblading:9,"teeth-whitening":9,"tummy-tuck":7,"breast-augmentation":7,"breast-lift":7,"breast-reduction":7,liposuction:7,bbl:7,"mommy-makeover":7,"arm-lift":7,"thigh-lift":7,"body-lift":7,facelift:7,blepharoplasty:7,"brow-lift":7,rhinoplasty:7,otoplasty:7,"iv-therapy":8,"hormone-optimisation":8,"peptide-protocol":8,"lymphatic-drainage":8,"glp1-weight-management":8,"nad-injections":8,"glutathione-beauty-shot":8},JC=`safety-v1`,YC=[{key:`pregnant`,label:`Are you currently pregnant?`,appliesTo:[`all`]},{key:`breastfeeding`,label:`Are you currently breastfeeding?`,hint:`Asked separately from pregnancy â the guidance differs.`,appliesTo:[`all`]},{key:`isotretinoin`,label:`Are you currently taking isotretinoin (Accutane) or another oral retinoid?`,appliesTo:[`facial_skin`]},{key:`activeEczemaFlare`,label:`Do you have an active eczema flare right now?`,appliesTo:[`facial_skin`]},{key:`activeRosaceaFlare`,label:`Do you have an active rosacea flare right now?`,appliesTo:[`facial_skin`]},{key:`recentResurfacing`,label:`Have you had an in-clinic resurfacing treatment in the last 14 days?`,hint:`Peels, laser, microneedling or dermabrasion.`,appliesTo:[`facial_skin`]}];YC.map(e=>e.key);var XC=[`pregnant`,`breastfeeding`,`isotretinoin`];function ZC(e){if(!e)return;let t=(Array.isArray(e.value)?e.value.join(` `):String(e.value??``)).trim().toLowerCase();if(t)return t===`no`?`no`:`yes`}function QC(e){let t=e??{},n={},r=ZC(t.S1);r&&(n.pregnant=r,n.breastfeeding=r);let i=ZC(t.S3);return i&&(n.isotretinoin=i),n}function $C(e,t){return{...e,answers:{...e.answers??{},...QC(t)}}}var ew=[`facial_skin`];function tw(e,t){return e.includes(`all`)?!0:e.some(e=>t.includes(e))}function nw(e){return e?YC.filter(t=>tw(t.appliesTo,e)):YC}function rw(e){return e?tw(ew,e):!0}var iw=[{token:`salicylate`,label:`Salicylates / aspirin (BHA)`},{token:`glycolic`,label:`Glycolic acid / AHAs`},{token:`retinoid`,label:`Retinoids`},{token:`benzoyl`,label:`Benzoyl peroxide`},{token:`niacinamide`,label:`Niacinamide`},{token:`ascorbic`,label:`Vitamin C (ascorbic acid)`},{token:`azelaic`,label:`Azelaic acid`},{token:`kojic`,label:`Kojic acid / arbutin / tranexamic acid`},{token:`peptide`,label:`Peptides`},{token:`ceramide`,label:`Ceramides`},{token:`hyaluronic`,label:`Hyaluronic acid / glycerin / panthenol`},{token:`oat`,label:`Oat / gluten`},{token:`vitamin e`,label:`Vitamin E / tocopherol`}],aw={answers:{},allergenTokens:[],allergiesOther:``,noKnownAllergies:!1,version:JC},ow=[`S1`,`S2`,`S3`,`S4`,`S5`,`S6`];function sw(e){return e.active===!0&&!!e.content_hash&&e.approved_content_hash===e.content_hash&&!!e.approved_reviewer_name&&!!e.approved_reviewer_credential&&!!e.approved_reviewed_at}function cw(e){return sw(e)?`approved`:e.approved_content_hash&&e.approved_content_hash!==e.content_hash?`outdated`:`unapproved`}var lw=e=>String(e.question_ref??``).trim().toUpperCase(),uw={approved:0,outdated:1,unapproved:2};function dw(e){let t=null;for(let n of e){let e=cw(n);(t===null||uw[e]<uw[t])&&(t=e)}return t}function fw(e,t=[]){return ow.map(n=>{let r=t.filter(e=>lw(e)===n),i=e.filter(e=>lw(e)===n),a=dw(r),o=dw(i);if(a===`approved`)return{ref:n,status:`approved`,source:`clinic`,clinicCopyPending:!1};let s=r.length>0;if(o===`approved`)return{ref:n,status:`approved`,source:`platform`,clinicCopyPending:s};let c=a??o;return c===null?{ref:n,status:`missing`,source:`none`,clinicCopyPending:!1}:{ref:n,status:c,source:a?`clinic`:`platform`,clinicCopyPending:s}})}function pw(e,t=new Date){let n=e.filter(e=>e.status!==`approved`).map(e=>({ref:e.ref,status:e.status}));return{status:n.length===0?`complete`:`incomplete`,checkedAt:t.toISOString(),reasons:n}}
13function mw(e,t,n){return n&&e.excludeTreatmentIds?.includes(n)?!1:n&&e.includeTreatmentIds?.includes(n)?!0:t!=null&&e.flow===t}var hw={1:`Facials & Skin Quality`,2:`Injectables â Wrinkle Relaxers`,3:`Injectables â Volume & Contour`,4:`Skin Resurfacing & Scarring`,5:`Laser & Energy-Based`,6:`Body Contouring â Non-Surgical`,7:`Surgical â Face, Breast & Body`,8:`Wellness & Internal`,9:`Hair & Aesthetic Enhancements`};function gw(e){let t=e.match(/\(([^)]+)\)\s*$/);if(!t)return null;let n=t[1].split(`,`).map(e=>e.trim()).filter(Boolean);return n.length>=2?n.map(e=>e[0].toUpperCase()+e.slice(1)):null}function _w(e){let t=e.toLowerCase();return t.includes(`date`)?`When?`:t.includes(`timeframe`)?`How long ago?`:t.includes(`what and when`)?`What, and when?`:`Please add any details`}function vw(e){let t=e.answerType.toLowerCase(),n=t.includes(`+`);if(t===`yes/no`||t===`yes_no`||t.startsWith(`yes / no`)){let t=e.answerType.split(`+`)[0],r=e.options??(t.includes(`/`)?t.split(`/`).map(e=>e.trim()).filter(Boolean):[`Yes`,`No`]);return{...e,kind:`yes_no`,choices:r,maxSelect:null,detail:e.detailMode===`optional`||e.detailMode===`required`||n?`on_yes`:`none`,detailLabel:e.detailLabel||_w(e.answerType)}}let r=t===`multiple choice`||t===`multi`||t.startsWith(`multi-select`),i=t===`single choice`||t===`single`||t.startsWith(`single select`)||t===`selectable chip`,a=e.options??(r?gw(e.label):null);if((r||i)&&a&&a.length>0){let i=t.match(/max\s*(\d+)/);return{...e,kind:r?`multi`:`single`,choices:a,maxSelect:e.maxSelect??(i?Number(i[1]):null),detail:e.detailMode===`optional`||e.detailMode===`required`||n?`always`:`none`,detailLabel:e.detailLabel||`Anything else to add? (optional)`}}return r||i?{...e,kind:`text`,choices:[],maxSelect:null,detail:`none`,detailLabel:``,configError:!0}:{...e,kind:`text`,choices:[],maxSelect:null,detail:e.detailMode===`optional`||e.detailMode===`required`?`always`:`none`,detailLabel:e.detailLabel||`Please add any details`}}
13function yw(e){return e?qC[e]??null:null}var bw=(e,t)=>e?(Array.isArray(e.value)?e.value:[e.value]).some(e=>t.test(e)):!1;function xw(e,t,n){let r=e.conditional.trim(),i=t.toLowerCase();if(!r||/^always/i.test(r)||/^(free text|detail|date) when/i.test(r))return!0;let a=r.match(/^Only when (\d+\.\d+) â (\w+)/);if(a){let e=n[a[1]];return!!e&&typeof e.value==`string`&&e.value!==``&&e.value!==a[2]}return/^Only when Lips selected in 3\.1/.test(r)?bw(n[`3.1`],/^Lips$/):/^Only when lips or perioral selected/i.test(r)?bw(n[`3.1`],/^Lips$/)||/lip/.test(i):/^Only when a scar type selected in 4\.1/.test(r)?bw(n[`4.1`],/scar|keloid/i)||/scar|keloid/.test(i):/^Only when cellulite selected/i.test(r)?bw(n[`6.2`],/cellulite/i)||/cellulite/.test(i):/^Only for hair removal/i.test(r)?/hair-removal/.test(i)||bw(n[`5.1`],/Unwanted hair/):/^Only for tattoo removal/i.test(r)?/tattoo/.test(i)||bw(n[`5.1`],/Tattoo/):/^Only for abdomen, breast or full-body goals/i.test(r)?/breast|abdom|tummy|body/.test(i)||bw(n[`6.1`],/^(Abdomen|Breast)$/):/^Only for breast procedures/i.test(r)?/breast|mommy/.test(i):/^Only for abdominal, breast and body procedures/i.test(r)?/breast|abdomin|tummy|lipo|bbl|body|mommy|arm-lift|thigh/.test(i):/^Only for weight-management goals/i.test(r)?/glp|weight/.test(i)||bw(n[`8.1`],/Weight management/):/^Only for hormone goals/i.test(r)?/hormone/.test(i)||bw(n[`8.1`],/Hormonal balance/):/^Hair restoration only/i.test(r)?/hair-restoration|hair-prp|prp-hair/.test(i):/^Microblading only/i.test(r)?/microblad|brow/.test(i):/^Teeth whitening only/i.test(r)?/teeth|whitening/.test(i):!1}function Sw(e,t=KC,n,r){let i=n===void 0?yw(e):n;return t.filter(e=>mw(e,i,r)).map(vw)}function Cw(e,t,n=KC,r,i){return e?Sw(e,n,r,i).filter(n=>xw(n,e,t)):[]}function ww(e,t){return e.map(vw).filter(e=>xw(e,``,t))}var Tw=new Map(KC.map(e=>[e.ref,e])),Ew=e=>e===KC?Tw:new Map(e.map(e=>[e.ref,e]));function Dw(e){return e.filter(e=>e.section===`flow`&&e.active!==!1&&!!e.question_ref&&!!e.label).map(e=>{let t=String(e.question_ref).trim(),n=Array.isArray(e.options)?e.options.filter(e=>typeof e==`string`&&e.trim()!==``):[],r={flow:Number(t.split(`.`)[0]),ref:t,label:String(e.label),answerType:e.answer_type??`Free text`,conditional:e.conditional_logic??`Always`,safety:e.safety_significance??``,options:n.length>0?n:null,required:e.required===!0,id:e.id??null,version:typeof e.version==`number`?e.version:1,maxSelect:typeof e.max_select==`number`?e.max_select:null,detailMode:e.detail_mode??null,detailLabel:e.detail_label??null};return{order:e.sort_order??0,spec:r}}).filter(e=>Number.isInteger(e.spec.flow)&&e.spec.flow>=0).sort((e,t)=>e.order-t.order).map(e=>e.spec)}function Ow(e,t=KC){if(!e||typeof e!=`object`||Array.isArray(e))return{};let n=Ew(t),r={};for(let[t,i]of Object.entries(e)){let e=n.get(t);if(!e||!i||typeof i!=`object`)continue;let a=vw(e),o=i.value,s=i.detail,c=typeof s==`string`?s.trim().slice(0,500):``,l=null;if(a.kind===`multi`&&Array.isArray(o)){let e=o.filter(e=>typeof e==`string`&&a.choices.includes(e));l=a.maxSelect?e.slice(0,a.maxSelect):e,l.length===0&&(l=null)}else (a.kind===`single`||a.kind===`yes_no`)&&typeof o==`string`?l=a.choices.includes(o)?o:null:a.kind===`text`&&typeof o==`string`&&(l=o.trim().slice(0,1e3)||null);l!==null&&(r[t]=c?{value:l,detail:c}:{value:l})}return r}function kw(e,t=KC){let n=Ew(t),r=Ow(e,t);return Object.entries(r).map(([e,t])=>{let r=Array.isArray(t.value)?t.value.join(`, `):t.value;return{ref:e,question:n.get(e).label,answer:t.detail?`${r} â ${t.detail}`:r}})}function Aw(e){let t=new Set;return e.filter(e=>e.section===`safety`&&sw(e)&&!!e.question_ref&&!!e.label).sort((e,t)=>String(e.question_ref).localeCompare(String(t.question_ref))||(e.sort_order??0)-(t.sort_order??0)).filter(e=>{let n=String(e.question_ref).trim();return t.has(n)?!1:(t.add(n),!0)}).map(e=>{let t=Array.isArray(e.options)?e.options.filter(e=>typeof e==`string`&&e.trim()!==``):[];return{flow:0,ref:String(e.question_ref).trim(),label:String(e.label),answerType:e.answer_type??`Yes / No`,conditional:e.conditional_logic??`Always`,safety:e.safety_significance??``,options:t.length>0?t:null,required:e.required===!0,id:e.id??null,version:typeof e.ver
13sion==`number`?e.version:1,contentHash:e.content_hash??null,ownerClinicId:e.clinic_id??null}})}var jw=3e4,Mw=new Map;function Nw(e,t){return t.filter(t=>(t.environment??null)===(e.environment??null)).sort((e,t)=>e.created_at<t.created_at?-1:e.created_at>t.created_at?1:e.id<t.id?-1:1)[0]?.id??e.id}async function Pw(e,t){if(!t)return t;let n=Mw.get(t);if(n&&Date.now()-n.at<jw)return n.id;try{let{data:n,error:r}=await e.from(`clinics`).select(`id, group_id, environment`).eq(`id`,t).maybeSingle();if(r||!n)return t;let i=n,a=t;if(i.group_id){let{data:t,error:n}=await e.from(`clinics`).select(`id, created_at, environment`).eq(`group_id`,i.group_id).order(`created_at`,{ascending:!0}).limit(50);!n&&Array.isArray(t)&&(a=Nw(i,t))}return Mw.set(t,{id:a,at:Date.now()}),a}catch{return t}}var Fw=`platform`;async function Iw(e,t){let{data:n,error:r}=await e.from(`consultation_questions`).select(`*`).eq(`clinic_id`,t).eq(`section`,`flow`).eq(`active`,!0).order(`sort_order`,{ascending:!0});return r?null:n??[]}async function Lw(e,t,n=`clinics`){try{t=await Pw(e,t);let{data:r,error:i}=await e.from(n).select(`id`).eq(`slug`,Fw).limit(1);if(i)return null;let a=(r??[])[0]?.id;if(!a){if(!t)return[];let n=await Iw(e,t);return n===null?null:Dw(n)}let o=await Iw(e,a);if(o===null)return null;if(!t||t===a)return Dw(o);let{data:s,error:c}=await e.from(`consultation_questions`).select(`*`).eq(`clinic_id`,t).eq(`section`,`flow`);if(c)return null;let{data:l,error:u}=await e.from(`clinic_question_overrides`).select(`question_id, hidden, sort_order`).eq(`clinic_id`,t),d=u?[]:l??[],f=new Set(d.filter(e=>e.hidden).map(e=>e.question_id)),p=new Map;for(let e of d)e.sort_order!=null&&p.set(e.question_id,e.sort_order);let m=new Map,h=e=>e.key||e.question_ref||``;
13for(let e of s??[])h(e)&&m.set(h(e),e);let g=[],_=new Set;for(let e of o){let t=h(e)?m.get(h(e)):void 0;t?(_.add(h(t)),t.active!==!1&&g.push(t)):f.has(e.id)||g.push({...e,sort_order:p.get(e.id)??e.sort_order})}for(let[e,t]of m)!_.has(e)&&t.active!==!1&&g.push(t);g.sort((e,t)=>(e.sort_order??0)-(t.sort_order??0));let{data:v,error:y}=await e.from(`clinic_question_treatments`).select(`question_key, treatment_id, mode`).eq(`clinic_id`,t),b=new Map;for(let e of y?[]:v??[]){let t=b.get(e.question_key)??[];t.push(e),b.set(e.question_key,t)}let x=new Map(g.map(e=>[e.id,h(e)]));return Dw(g).map(e=>{let t=b.get(x.get(e.id)??``)??[];return t.length===0?e:{...e,includeTreatmentIds:t.filter(e=>e.mode===`include`).map(e=>e.treatment_id),excludeTreatmentIds:t.filter(e=>e.mode===`exclude`).map(e=>e.treatment_id)}})}catch{return null}}async function Rw(e,t=`clinics`,n=null,r=new Date){try{n=await Pw(e,n);let{data:i,error:a}=await e.from(t).select(`id`).eq(`slug`,Fw).limit(1);if(a)return null;let o=(i??[])[0]?.id,s=[];if(o){let{data:t,error:n}=await e.from(`consultation_questions`).select(`*`).eq(`clinic_id`,o).eq(`section`,`safety`).order(`sort_order`,{ascending:!0});if(n)return null;s=t??[]}let c=[];if(n&&n!==o){let{data:t,error:r}=await e.from(`consultation_questions`).select(`*`).eq(`clinic_id`,n).eq(`section`,`safety`);if(r)return null;c=t??[]}let l=Aw(s),u=Aw(c),d=fw(s,c),f=c.length?Bw(l,u):l,p=new Set(d.filter(e=>e.source===`platform`&&e.clinicCopyPending).map(e=>e.ref));return{specs:f.map(e=>e.source!==`clinic_safety`&&p.has(e.ref.toUpperCase())?{...e,replacedUnapprovedClinicCopy:!0}:e),coverage:d,status:pw(d,r)}}catch{return null}}async function zw(e,t=`clinics`,n=null){let r=await Rw(e,t,n);return r?r.specs:null}function Bw(e,t){let n=new Map(t.map(e=>[e.ref,e])),r=new Set(e.map(e=>e.ref)),i=e.map(e=>{let t=n.get(e.ref);return t?{...t,required:e.required||t.required,source:`clinic_safety`}:e});for(let e of t)r.has(e.ref)||i.push({...e,source:`clinic_safety`});let a=e=>Number(/^S(\d+)$/i.exec(e)?.[1]??2**53-1);return i.sort((e,t)=>a(e.ref)-a(t.ref)||e.ref.localeCompare(t.ref))}var Vw=R().uuid(),Hw=Kt([`goals`,`concerns`,`medical_flags`]),Uw=Kt(ln),Ww=`platform`;async function Gw(e){let t=await $t(e);return await cn(t,`Consultation questions`),t}var Kw=`id, clinic_id, section, key, label, sort_order, active, treatment_id, applies_to`;async function qw(e){let{data:t,error:n}=await N.from(`consultation_questions`).select(Kw).eq(`clinic_id`,e).eq(`active`,!0).order(`section`,{ascending:!0}).order(`sort_order`,{ascending:!0});if(n)throw n;return t??[]}async function Jw(e){let t=`data`in e?e.data:e,n=L({slug:R().trim().toLowerCase().refine(ye,`Invalid slug`)}).parse(t),{data:r,error:i}=await N.from(`clinics_public`).select(`id`).eq(`slug`,n.slug).maybeSingle();if(i)throw i;if(!r?.id)return[];let a=await qw(r.id);if(a.length>0||n.slug===`platform`)return a;let{data:o,error:s}=await N.from(`clinics_public`).select(`id`).eq(`slug`,Ww).maybeSingle();if(s)throw s;return o?.id?qw(o.id):a}L({section:Hw,key:R().trim().min(1).max(80).regex(/^[a-z0-9_-]+$/i,`Use letters, numbers, _ or -`),label:R().trim().min(1).max(200),sort_order:Qt().int().min(0).max(1e4).optional(),active:Zt().optional(),treatment_id:Vw.optional().nullable(),applies_to:Xt(Uw).min(1,`Choose at least one treatment type`)}).omit({key:!0});async function Yw(e){let t=R().trim().toLowerCase().refine(ye,`Invalid slug`).parse(e.data.slug),{data:n,error:r}=await N.from(`clinics_public`).select(`id`).eq(`slug`,t).maybeSingle();if(r)throw r;let i=await Lw(N,n?.id??null,`clinics_public`);if(i===null)throw Error(`Consultation questions could not be loaded`);return i}async function Xw(e={data:{slug:Ww}}){let t=R().trim().toLowerCase().refine(ye,`Invalid slug`).parse(e.data.slug),n=null;if(t!==`platform`){let{data:e,error:r}=await N.from(`clinics_public`).select(`id`).eq(`slug`,t).maybeSingle();if(r)throw Error(`Safety questions could not be loaded`);n=e?.id??null}let r=await zw(N,`clinics_public`,n);if(r===null)throw Error(`Safety questions could not be loaded`);return r}async function Zw(){let{data:{user:e},error:t}=await N.auth.getUser();if(t)throw t;if(!e)throw Error(`Unauthorized: sign in required`);let{data:n,error:r}=await N.rpc(`is_super_admin`,{_user:e.id});if(r)throw r;if(!n)throw Error(`Forbidden: Super Admin access required`);return e.id}async function Qw(){let{data:e,error:t}=await N.from(`clinics`).select(`id`).eq(`slug`,Ww).maybeSingle();if(t)throw t;
13if(!e?.id)throw Error(`Platform clinic not found`);return e.id}async function $w(e){let t=`data`in e?e.data:e,n=L({ref:R().trim().min(1).max(40),label:R().trim().min(1).max(300)}).parse(t);await Zw();let r=await Qw(),{data:i,error:a}=await N.from(`consultation_questions`).select(`id, version`).eq(`clinic_id`,r).eq(`section`,`safety`).eq(`question_ref`,n.ref);if(a)throw a;let o=i??[];if(o.length===0)throw Error(`Safety question ${n.ref} not found`);for(let e of o){let{error:t}=await N.from(`consultation_questions`).update({label:n.label,active:!1,version:(e.version??1)+1}).eq(`id`,e.id);if(t)throw t}return{ok:!0}}var eT=`id, clinic_id, section, key, label, sort_order, active, flow_id, treatment_id, applies_to, question_ref, answer_type, kind, options, required, max_select, help_text, conditional_logic, detail_mode, detail_label, show_if, version, source, approved_at, updated_at`;async function tT(){let{data:e,error:t}=await N.from(`consultation_flows`).select(`id, name, flow_number`).order(`sort_order`,{ascending:!0});if(t)throw t;return e??[]}async function nT(e,t){let n=[];for(let r=0;;r+=1e3){let i=N.from(`consultation_questions`).select(eT).eq(`clinic_id`,e).order(`sort_order`,{ascending:!0}).range(r,r+999);t&&(i=i.eq(`active`,!0));let{data:a,error:o}=await i;if(o)throw o;if(n.push(...a??[]),!a||a.length<1e3)break}return n}async function rT(){return await Zw(),nT(await Qw(),!1)}async function iT(e){let t=await $t(e),n=await Qw();if(t===n)return FC(await nT(n,!1),[],[]);let[r,i,a]=await Promise.all([nT(n,!0),nT(t,!1),N.from(`clinic_question_overrides`).select(`question_id, hidden, sort_order`).eq(`clinic_id`,t)]);if(a.error)throw a.error;return FC(r,i,a.data??[])}var aT=L({label:R().trim().min(1).max(300).optional(),answer_type:R().trim().min(1).max(60).optional(),options:Xt(R().trim().min(1).max(200)).max(50).nullable().optional(),max_select:Qt().int().min(1).max(50).nullable().optional(),required:Zt().optional(),active:Zt().optional(),sort_order:Qt().int().min(0).max(1e5).optional(),help_text:R().trim().max(500).nullable().optional(),conditional_logic:R().trim().max(300).nullable().optional(),detail_mode:Kt([`none`,`optional`,`required`]).optional(),detail_label:R().trim().max(200).nullable().optional(),section:Kt([`flow`,`goals`,`concerns`,`medical_flags`,`safety`]).optional(),flow_id:Vw.nullable().optional(),notes:R().trim().max(300).nullable().optional()}).superRefine((e,t)=>{if((e.answer_type===`Single choice`||e.answer_type===`Multiple choice`)&&(!e.options||e.options.length<2)&&t.addIssue({code:qt.custom,message:`Choice questions need at least two answer options`,path:[`options`]}),e.options){let n=e.options.map(e=>e.toLocaleLowerCase());new Set(n).size!==n.length&&t.addIssue({code:qt.custom,message:`Answer options must be unique`,path:[`options`]})}e.answer_type===`Multiple choice`&&e.max_select!=null&&e.options&&e.max_select>e.options.length&&t.addIssue({code:qt.custom,message:`Maximum selections cannot exceed the number of options`,path:[`max_select`]}),e.detail_mode&&e.detail_mode!==`none`&&!e.detail_label&&t.addIssue({code:qt.custom,message:`Additional detail needs a client-facing prompt`,path:[`detail_label`]})});async function oT(e){await Zw();let t=await Qw(),{id:n,patch:r}=L({id:Vw,patch:aT}).parse(e),{data:i,error:a}=await N.from(`consultation_questions`).select(`section`).eq(`id`,n).eq(`clinic_id`,t).maybeSingle();if(a)throw a;if(!i)throw Error(`Question not found`);if(i.section===`safety`){let{section:e,flow_id:i,active:a,...o}=r,{data:s}=await N.from(`consultation_questions`).select(`question_ref`).eq(`id`,n).maybeSingle(),c=s?.question_ref;if(!c)throw Error(`Safety question has no reference`);let{data:l,error:u}=await N.from(`consultation_questions`).select(`id, version`).eq(`clinic_id`,t).eq(`section`,`safety`).eq(`question_ref`,c);if(u)throw u;for(let e of l??[]){let{error:t}=await N.from(`consultation_questions`).update({...o,active:!1,approved_by:null,approved_at:null,version:(e.version??1)+1}).eq(`id`,e.id);if(t)throw t}return{ok:!0}}if(r.section===`safety`)throw Error(`Create a new safety question instead of moving one`);let{error:o}=await N.from(`consultation_questions`).update(r).eq(`id`,n).eq(`clinic_id`,t);if(o)throw o;return{ok:!0}}async function sT(e){let{data:t,error:n}=await N.from(`consultation_questions`).select(`section`).eq(`id`,e).maybeSingle();if(n)throw n;if(!t)throw Error(`Question not found`);return t.section}async function cT(e){let{data:t,error:n}=await N.from(`consultation_questions`).select(`section`).eq(`id`,e).maybeSingle();if(n)throw n;if(!t)throw Error(`Question not found`);if(t.section===`safety`)throw Error(`Safety questions can't be changed by a clinic`)}async function lT(e,t){let n=await Gw(t),{platformId:r,patch:i}=L({platformId:Vw,patch:aT}).parse(e);if(await sT(r)===`safety`)return uT(n,r,i);if(i.section===`safety`)throw Error(`Clinics can't move questions into Safety`);let{data:a,error:o}=await N.from(`consultation_questions`).select(`*`).eq(`id`,r).maybeSingle();if(o)throw o;if(!a)throw Error(`Question not found`);let s=a,c={};for(let e of[`section`,`key`,`label`,`sort_order`,`active`,`flow_id`,`treatment_id`,`applies_to`,`question_ref`,`answer_type`,`kind`,`options`,`required`,`conditional_logic`,`max_select`,`help_text`,`detail_mode`,`detail_label`,`show_if`,`environment`])c[e]=s[e];let{error:l}=await N.from(`consultation_questions`).insert({...c,...i,clinic_id:n,source:`clinic_override`,version:1});if(l)throw l;return{ok:!0}}async function uT(e,t,n){let{data:r,error:i}=await N.from(`consultation_questions`).select(`*`).eq(`id`,t).maybeSingle();if(i)throw i;if(!r)throw Error(`Question not found`);let a=r,o=String(a.question_ref??``).trim();if(!o)throw Error(`Safety question has no reference`);let{section:s,flow_id:c,active:l,...u}=n,d=(u.required??!1)||a.required===!0,{data:f,error:p}=await N.from(`consultation_questions`).select(`id, version`).eq(`clinic_id`,e).eq(`section`,`safety`).eq(`question_ref`,o).limit(1);if(p)throw p;let m=(f??[])[0];if(m){let{error:t}=await N.from(`consultation_questions`).update({...u,required:d,active:!0,version:(m.version??1)+1}).eq(`id`,m.id).eq(`clinic_id`,e);if(t)throw t;return{ok:!0}}let h={};for(let e of[`label`,`sort_order`,`question_ref`,`answer_type`,`kind`,`options`,`conditional_logic`,`safety_significance`,`max_select`,`help_text`,`detail_mode`,`detail_label`,`show_if`,`environment`])h[e]=a[e];let{error:g}=await N.from(`consultation_questions`).insert({...h,...u,required:d,clinic_id:e,section:`safety`,ke
13y:`safety:${o}`,flow_id:null,applies_to:[`all`],active:!0,source:`clinic_safety`,version:1});if(g)throw g;return{ok:!0}}async function dT(e,t){let n=await Gw(t),{id:r,patch:i}=L({id:Vw,patch:aT}).parse(e);if(await sT(r)===`safety`){if(i.active===!1)throw Error(`Safety questions are always asked`);let{section:e,flow_id:t,active:a,...o}=i,{data:s}=await N.from(`consultation_questions`).select(`version`).eq(`id`,r).eq(`clinic_id`,n).maybeSingle();if(!s)throw Error(`Question not found`);let{error:c}=await N.from(`consultation_questions`).update({...o,active:!0,version:(s.version??1)+1}).eq(`id`,r).eq(`clinic_id`,n);if(c)throw c;return{ok:!0}}if(i.section===`safety`)throw Error(`Clinics can't move questions into Safety`);if(i.label){let{data:e,error:t}=await N.from(`consultation_questions`).select(`id, label, flow_id`).eq(`clinic_id`,n).eq(`section`,`flow`);if(t)throw t;let a=e??[],o=a.find(e=>e.id===r);if(xT(a,i.label,o?.flow_id??null,r))throw Error(`A question with this wording already exists in this group`)}let{error:a}=await N.from(`consultation_questions`).update(i).eq(`id`,r).eq(`clinic_id`,n);if(a)throw a;return{ok:!0}}async function fT(e,t){let n=await Gw(t),{platformId:r,hidden:i}=L({platformId:Vw,hidden:Zt()}).parse(e);await cT(r);let{error:a}=await N.from(`clinic_question_overrides`).upsert({clinic_id:n,question_id:r,hidden:i},{onConflict:`clinic_id,question_id`});if(a)throw a;return{ok:!0}}async function pT(e,t){let n=await Gw(t),{id:r}=L({id:Vw}).parse(e),{data:i,error:a}=await N.from(`consultation_questions`).select(`key, section`).eq(`id`,r).eq(`clinic_id`,n).maybeSingle();if(a)throw a;if(!i)throw Error(`Question not found`);let{error:o}=await N.from(`consultation_questions`).delete().eq(`id`,r).eq(`clinic_id`,n);if(o)throw o;if(i.section===`safety`)return{ok:!0};let{error:s}=await N.from(`clinic_question_treatments`).delete().eq(`clinic_id`,n).eq(`question_key`,i.key);if(s&&s.code!==`PGRST205`)throw s;return{ok:!0}}async function mT(e){return(await nn(await $t(e))).map(e=>({id:e.treatment_id,name:e.name,flow_id:e.flow_id})).sort((e,t)=>e.name.localeCompare(t.name))}var hT=class extends Error{constructor(){super(`Per-treatment settings need the latest database update.`),this.name=`RulesTableMissingError`}};async function gT(e){let t=await $t(e),{data:n,error:r}=await N.from(`clinic_question_treatments`).select(`question_key, treatment_id, mode`).eq(`clinic_id`,t);if(r)throw r.code===`PGRST205`?new hT:r;return n??[]}async function _T(e,t){let n=await Gw(t),r=L({questionKey:R().min(1).max(200),treatmentId:Vw,mode:Kt([`include`,`exclude`]).nullable()}).parse(e),{data:i,error:a}=await N.from(`consultation_questions`).select(`id`).eq(`key`,r.questionKey).eq(`section`,`safety`).limit(1);if(a)throw a;if((i??[]).length)throw Error(`Safety questions are always asked`);if(r.mode===null){let{error:e}=await N.from(`clinic_question_treatments`).delete().eq(`clinic_id`,n).eq(`question_key`,r.questionKey).eq(`treatment_id`,r.treatmentId);if(e)throw e}else{let{error:e}=await N.from(`clinic_question_treatments`).upsert({clinic_id:n,question_key:r.questionKey,treatment_id:r.treatmentId,mode:r.mode},{onConflict:`clinic_id,question_key,treatment_id`});if(e)throw e}return{ok:!0}}var vT=L({label:R().trim().min(1).max(300),answer_type:R().trim().min(1).max(60),options:Xt(R().trim().min(1).max(200)).max(50).nullable(),required:Zt(),flow_id:Vw.nullable(),flow_number:Qt().int().min(0).nullable(),help_text:R().trim().max(500).nullable().optional(),conditional_logic:R().trim().max(300).nullable().optional(),treatmentIds:Xt(Vw).max(500).default([]),section:Kt([`flow`,`goals`,`concerns`,`medical_flags`,`safety`]).default(`flow`),active:Zt().default(!0),notes:R().trim().max(300).nullable().optional()});async function yT(e,t){let n=await Gw(t),r=vT.parse(e);if(r.section===`safety`)throw Error(`Clinics can edit safety questions but not add new ones`);let i=crypto.randomUUID().slice(0,8),a=`${r.flow_number??0}.c${i}`,o=`clinic:${i}`,{data:s,error:c}=await N.from(`consultation_questions`).select(`id, label, flow_id`).eq(`clinic_id`,n).eq(`section`,r.section);if(c)throw c;if(xT(s??[],r.label,r.flow_id))throw Error(`A question with this wording already exists in this group`);let{error:l}=await N.from(`consultation_questions`).insert({clinic_id:n,section:r.section,key:o,question_ref:a,label:r.label,answer_type:r.answer_type,options:r.options,required:r.required,flow_id:r.flow_id,help_text:r.help_text??null,conditional_logic:r.conditional_logic||`Always`,active:r.active,notes:r.notes??null,source:`clinic`,version:1,sort_order:5e4,applies_to:[`all`]});if(l)throw l;for(let e of r.treatmentIds)await _T({questionKey:o,treatmentId:e,mode:`include`},n);let{data:u}=await N.from(`consultation_questions`).select(`id`).eq(`clinic_id`,n).eq(`key`,o).maybeSingle();return{ok:!0,key:o,id:u?.id??null}}async function bT(e,t){let n=await Gw(t),{id:r}=L({id:Vw}).parse(e),{error:i}=await N.from(`consultation_questions`).delete().eq(`id`,r).eq(`clinic_id`,n).eq(`active`,!1).neq(`section`,`safety`);if(i)throw i;return{ok:!0}}function xT(e,t,n,r){let i=t.trim().toLowerCase();return e.some(e=>e.id!==r&&(e.flow_id??null)===n&&e.label.trim().toLowerCase()===i)}async function ST(e){await Zw();let t=await Qw(),n=vT.parse(e),r=crypto.randomUUID().slice(0,8),i=await nT(t,!1);if(xT(i.filter(e=>e.section===n.section),n.label,n.section===`safety`?null:n.flow_id))throw Error(`A question with this wording already exists in this group`);let a,o;n.section===`safety`?(a=`S${Math.max(0,...i.filter(e=>e.section===`safety`).map(e=>Number(/^S(\d+)$/i.exec(e.question_ref??``)?.[1]??0)))+1}`,o=`safety:${a}`):(a=`${n.flow_number??0}.p${r}`,o=`platform:${r}`);let{error:s}=await N.from(`consultation_questions`).insert({clinic_id:t,section:n.section,key:o,question_ref:a,label:n.label,answer_type:n.answer_type,options:n.options,required:n.required,flow_id:n.section===`safety`?null:n.flow_id,help_text:n.help_text??null,conditional_logic:n.conditional_logic||`Always`,active:n.section!==`safety`,notes:n.section===`safety`?`Awaiting clinician sign-off`:null,source:`platform`,version:1,sort_order:n.section===`safety`?10*Number(a.slice(1)):5e4,applies_to:[`all`]});if(s)throw s;return{ok:!0,key:o,ref:a}}async function CT(e){await Zw();let t=await Qw(),{id:n}=L({id:Vw}).parse(e),{data:r,error:i}=await N.from(`consultation_questions`).select(`id, section, question_ref, approved_at`).eq(`id`,n).eq(`clinic_id`,t).maybeSingle();if(i)throw i;if(!r)throw Error(`Question not found`);let a=r,o=N.from(`consultation_questions`).delete().eq(`clinic_id`,t);if(a.section===`safety`){let{data:e,error:n}=await N.from(`consultation_questions`).select(`approved_at`).eq(`clinic_id`,t).eq(`section`,`safety`).eq(`question_ref`,a.question_ref??``);if(n)throw n;if((e??[]).some(e=>e.approved_at))throw Error(`Revoke this safety question's approval before deleting it`);o=o.eq(`section`,`safety`).eq(`question_ref`,a.question_ref??``)}else o=o.eq(`id`,n);let{error:s}=await o;
13if(s)throw Error(/answered/i.test(s.message)?s.message:`Couldn't delete: ${s.message}`);return{ok:!0}}var wT=[`Short text`,`Yes/No`,`Single choice`,`Multiple choice`,`Long text`],TT=e=>e===`Single choice`||e===`Multiple choice`;async function ET(e,t){let{questions:n}=await M_({data:{name:e.name,category:e.category,description:e.description}}),r=[];for(let i of n)try{let n=await yT({label:i.label,answer_type:i.type,options:i.options.length?i.options:null,required:i.required,flow_id:null,flow_number:null,treatmentIds:[e.id],active:!1,notes:`Draft â needs review (generated for new treatment)`},t);n.id&&r.push({...i,id:n.id})}catch{}if(r.length===0)throw Error(`No questions could be saved for this treatment`);return r}function DT({treatment:e,clinicId:t,initialDrafts:n,initialError:r,onClose:i}){let[a,o]=(0,H.useState)(n??[]),[s,c]=(0,H.useState)([]),[l,u]=(0,H.useState)(r),[d,f]=(0,H.useState)(null),[p,m]=(0,H.useState)(null),h=(e,t)=>o(n=>n.map((n,r)=>r===e?{...n,...t}:n)),g=async()=>{if(!d){f(`retry`),u(null);try{o(await ET(e,t)),c([])}catch(e){u(e instanceof Error?e.message:`We couldn't create questions.`)}finally{f(null)}}},_=()=>{for(let[e,t]of a.entries()){if(!t.label.trim())return`Question ${e+1}: enter the question wording.`;if(TT(t.type)){let n=t.options.map(e=>e.trim());if(n.some(e=>!e))return`Question ${e+1}: complete or remove each empty option.`;if(n.length<2)return`Question ${e+1}: add at least two answer options.`;if(new Set(n.map(e=>e.toLowerCase())).size!==n.length)return`Question ${e+1}: each option must be unique.`}}return null};return(0,U.jsx)(Rf,{open:!0,onOpenChange:e=>!e&&!d&&i(),children:(0,U.jsxs)(Hf,{className:`max-h-[90vh] overflow-y-auto sm:max-w-2xl`,children:[(0,U.jsxs)(Uf,{children:[(0,U.jsxs)(Gf,{className:`font-serif`,children:[`Review questions â `,e.name]}),(0,U.jsx)(Kf,{children:l?`Your treatment was saved, but we couldn't create its default questions.`:`Weâve created default questions for this treatment. Please review and confirm them.`})]}),l?(0,U.jsxs)(`div`,{role:`alert`,className:`rounded border border-destructive/50 p-4 text-sm`,children:[(0,U.jsx)(`p`,{className:`text-destructive`,children:l}),(0,U.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Try again, or skip and add questions later on the Questions page.`})]}):(0,U.jsxs)(`ol`,{className:`space-y-5`,children:[a.map((e,t)=>(0,U.jsxs)(`li`,{className:`rounded border border-border p-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex-1`,children:[(0,U.jsxs)(jv,{htmlFor:`gq-${e.id}`,children:[`Question `,t+1]}),(0,U.jsx)(Tv,{id:`gq-${e.id}`,value:e.label,maxLength:300,onChange:e=>h(t,{label:e.target.value})})]}),(0,U.jsx)(I,{variant:`ghost`,size:`icon`,"aria-label":`Remove question ${t+1}`,onClick:()=>{c(t=>[...t,e.id]),o(e=>e.filter((e,n)=>n!==t))},children:(0,U.jsx)(id,{className:`h-4 w-4`})})]}),(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-end gap-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-[180px]`,children:[(0,U.jsx)(jv,{children:`Answer type`}),(0,U.jsxs)(pC,{value:e.type,onValueChange:n=>{let r=n;h(t,{type:r,options:TT(r)&&e.options.length<2?[...e.options,``,``].slice(0,Math.max(2,e.options.length)):e.options})},children:[(0,U.jsx)(hC,{children:(0,U.jsx)(mC,{})}),(0,U.jsx)(vC,{children:wT.map(e=>(0,U.jsx)(bC,{value:e,children:e},e))})]})]}),(0,U.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,U.jsx)(Gv,{checked:e.required,onCheckedChange:e=>h(t,{required:e})}),`Required`]})]}),TT(e.type)&&(0,U.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,U.jsx)(jv,{children:`Answer options`}),e.options.map((n,r)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(Tv,{"aria-label":`Option ${r+1}`,value:n,maxLength:200,onChange:n=>h(t,{options:e.options.map((e,t)=>t===r?n.target.value:e)})}),(0,U.jsx)(I,{variant:`ghost`,size:`icon`,"aria-label":`Move up`,disabled:r===0,onClick:()=>{let n=[...e.options];[n[r-1],n[r]]=[n[r],n[r-1]],h(t,{options:n})},children:(0,U.jsx)($e,{className:`h-4 w-4`})}),(0,U.jsx)(I,{variant:`ghost`,size:`icon`,"aria-label":`Move down`,disabled:r===e.options.length-1,onClick:()=>{let n=[...e.options];[n[r+1],n[r]]=[n[r],n[r+1]],h(t,{options:n})},children:(0,U.jsx)(Ze,{className:`h-4 w-4`})}),(0,U.jsx)(I,{variant:`ghost`,size:`icon`,"aria-label":`Remove option ${r+1}`,onClick:()=>h(t,{options:e.options.filter((e,t)=>
13t!==r)}),children:(0,U.jsx)(id,{className:`h-4 w-4`})})]},r)),(0,U.jsxs)(I,{variant:`outline`,size:`sm`,onClick:()=>h(t,{options:[...e.options,``]}),children:[(0,U.jsx)(nt,{className:`mr-1 h-3.5 w-3.5`}),` Add option`]})]})]},e.id)),a.length===0&&(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`All questions removed. Confirm to discard them.`})]}),p&&(0,U.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:p}),(0,U.jsx)(Wf,{className:`gap-2`,children:l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I,{variant:`outline`,onClick:i,disabled:!!d,children:`Skip`}),(0,U.jsxs)(I,{onClick:g,disabled:!!d,className:`bg-gold text-black hover:bg-gold/90`,children:[d===`retry`&&(0,U.jsx)(et,{className:`mr-2 h-4 w-4 animate-spin`}),d===`retry`?`Creating questionsâ¦`:`Try again`]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I,{variant:`outline`,onClick:i,disabled:!!d,children:`Review later`}),(0,U.jsxs)(I,{onClick:async()=>{if(d)return;let e=_();if(m(e),!e){f(`confirm`);try{for(let e of s)await bT({id:e},t);for(let e of a){let n=TT(e.type)?e.options.map(e=>e.trim()):e.type===`Yes/No`?[`Yes`,`No`]:null;await dT({id:e.id,patch:{label:e.label.trim(),answer_type:e.type,options:n,required:e.required,active:!0,notes:null}},t)}Z.success(a.length?`Questions confirmed for this treatment`:`Questions removed`),i()}catch(e){Z.error(e instanceof Error?e.message:`Couldn't save the questions`)}finally{f(null)}}},disabled:!!d,className:`bg-gold text-black hover:bg-gold/90`,children:[d===`confirm`&&(0,U.jsx)(et,{className:`mr-2 h-4 w-4 animate-spin`}),d===`confirm`?`Savingâ¦`:`Confirm questions`]})]})})]})})}var OT=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(`textarea`,{"data-slot":`textarea`,className:Pt(`flex min-h-[60px] w-full rounded-md border border-control-border bg-control px-3 py-2 text-base text-foreground shadow-sm transition-[border-color,box-shadow,background-color] placeholder:text-muted-foreground hover:border-control-border-hover focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/40 disabled:cursor-not-allowed disabled:border-border disabled:bg-control-disabled disabled:text-muted-foreground disabled:opacity-70 read-only:cursor-default read-only:border-control-border read-only:border-dashed read-only:bg-control-readonly md:text-sm`,e),ref:n,...t}));OT.displayName=`Textarea`;var kT=3600*24*365*10;function AT(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function jT(e){let t={"image/png":`PNG`,"image/jpeg":`JPG`,"image/svg+xml":`SVG`,"image/webp":`WEBP`,"image/avif":`AVIF`,"image/gif":`GIF`,"image/x-icon":`ICO`,"image/vnd.microsoft.icon":`ICO`},n=new Set,r=[];for(let i of e){let e=t[i]??i.replace(`image/`,``).toUpperCase();n.has(e)||(n.add(e),r.push(e))}return r.join(`, `)}function MT(e,t){return{"image/png":`png`,"image/jpeg":`jpg`,"image/svg+xml":`svg`,"image/webp":`webp`,"image/avif":`avif`,"image/gif":`gif`,"image/x-icon":`ico`,"image/vnd.microsoft.icon":`ico`}[e]??t}function NT({id:e,label:t,value:n,onChange:r,clinicId:i,folder:a,accept:o,maxBytes:s,recommended:c,error:l,previewShape:u=`square`}){let d=(0,H.useRef)(null),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(null),[g,_]=(0,H.useState)(!1),v=o.join(`,`),y=jT(o),b=AT(s),x=(0,H.useCallback)(async e=>{if(h(null),!o.includes(e.type)){h(`That file type isn't supported. Try a ${y} image.`);return}if(e.size>s){h(`File is too large (${AT(e.size)}). Max ${b}.`);return}p(!0);try{let t=MT(e.type,e.name.split(`.`).pop()??`bin`),n=`${i}/${a}/${typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}.${t}`,{error:o}=await N.storage.from(`clinic-assets`).upload(n,e,{cacheControl:`31536000`,upsert:!1,contentType:e.type});if(o)throw o;let{data:s,error:c}=await N.storage.from(`clinic-assets`).createSignedUrl(n,kT);if(c)throw c;if(!s?.signedUrl)throw Error(`Could not get URL for uploaded file.`);r(s.signedUrl),Z.success(`Image uploaded`)}catch(e){let t=e instanceof Error?e.message:`Upload failed`;h(t),Z.error(t)}finally{p(!1),d.current&&(d.current.value=``)}},[o,y,s,b,i,a,r]),S=e=>{let t=e.target.files?.[0];t&&x(t)},C=e=>{e.preventDefault(),_(!1);let t=e.dataTransfer.files?.[0];t&&x(t)},w=l??m,T=u===`wide`?`h-16 w-full max-w-[240px]`:`h-16 w-16`;return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,U.jsx)(jv,{htmlFor:e,className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:t})}),(0,U.jsxs)(`div`,{onDragOver:e=>{e.preventDefault(),_(!0)},onDragLeave:()=>_(!1),onDrop:C,className:Pt(`group relative mt-2 flex flex-col items-center justify-center gap-3 rounded-lg border-2 border-dashed bg-zinc-950 p-6 text-center transition-colors`,g?`border-gold bg-gold/5`:w?`border-red-500/60`:`border-border hover:border-gold/70`,f&&`opacity-70`),children:[(0,U.jsx)(`input`,{ref:d,id:e,type:`file`,accept:v,onCh
13ange:S,disabled:f,className:`sr-only`,"aria-invalid":!!w,"aria-describedby":`${e}-hint`}),n?(0,U.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-3`,children:[(0,U.jsx)(`div`,{className:Pt(`flex items-center justify-center overflow-hidden rounded-md border border-border p-2`,T),style:{backgroundImage:`linear-gradient(45deg,#1a1a1a 25%,transparent 25%),linear-gradient(-45deg,#1a1a1a 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#1a1a1a 75%),linear-gradient(-45deg,transparent 75%,#1a1a1a 75%)`,backgroundSize:`12px 12px`,backgroundPosition:`0 0, 0 6px, 6px -6px, -6px 0`,backgroundColor:`#0a0a0a`},children:(0,U.jsx)(`img`,{src:n,alt:`${t} preview`,className:`max-h-full max-w-full object-contain`})}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,U.jsxs)(I,{type:`button`,size:`sm`,variant:`outline`,disabled:f,onClick:()=>d.current?.click(),className:`gap-1.5`,children:[f?(0,U.jsx)(et,{className:`h-3.5 w-3.5 animate-spin`}):(0,U.jsx)(nd,{className:`h-3.5 w-3.5`}),`Replace`]}),(0,U.jsxs)(I,{type:`button`,size:`sm`,variant:`ghost`,disabled:f,onClick:()=>r(void 0),className:`gap-1.5 text-muted-foreground hover:text-red-400`,children:[(0,U.jsx)(at,{className:`h-3.5 w-3.5`}),`Remove`]})]})]}):(0,U.jsxs)(`button`,{type:`button`,disabled:f,onClick:()=>d.current?.click(),className:`flex w-full flex-col items-center gap-2 focus:outline-none`,children:[(0,U.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-gold/10 text-gold`,children:f?(0,U.jsx)(et,{className:`h-5 w-5 animate-spin`}):(0,U.jsx)(Yu,{className:`h-5 w-5`})}),(0,U.jsx)(`span`,{className:`text-sm text-white`,children:f?`Uploadingâ¦`:`Drop image here or click to browse`}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,U.jsx)(Zu,{className:`h-3 w-3`}),y,` ⢠up to `,b,c?` ⢠${c}`:``]})]})]}),(0,U.jsx)(`p`,{id:`${e}-hint`,className:Pt(`mt-1.5 text-[11px]`,w?`text-red-400`:`text-muted-foreground`),role:w?`alert`:void 0,children:w??`Accepts ${y} ⢠up to ${b}${c?` ⢠${c}`:``}`})]})}var PT=`Tabs`,[FT,IT]=dt(PT,[dn]),LT=dn(),[RT,zT]=FT(PT),BT=H.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=sn(s),[d,f]=ft({prop:r,onChange:i,defaultProp:a??``,caller:PT});return(0,U.jsx)(RT,{scope:n,baseId:_t(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,U.jsx)(mt.div,{dir:u,"data-orientation":o,...l,ref:t})})});BT.displayName=PT;var VT=`TabsList`,HT=H.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=zT(VT,n),o=LT(n);return(0,U.jsx)(un,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,U.jsx)(mt.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});HT.displayName=VT;var UT=`TabsTrigger`,WT=H.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=zT(UT,n),s=LT(n),c=qT(o.baseId,r),l=JT(o.baseId,r),u=r===o.value;return(0,U.jsx)(fn,{asChild:!0,...s,focusable:!i,active:u,children:(0,U.jsx)(mt.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:pt(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:pt(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:pt(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});WT.displayName=UT;var GT=`TabsContent`,KT=H.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=zT(GT,n),c=qT(s.baseId,r),l=JT(s.baseId,r),u=r===s.value,d=H.useRef(u);return H.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,U.jsx)(Tt,{present:i||u,children:({present:n})=>(0,U.jsx)(mt.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});KT.displayName=GT;function qT(e,t){return`${e}-trigger-${t}`}function JT(e,t){return`${e}-content-${t}`}var YT=BT,XT=HT,ZT=WT,QT=KT,$T=YT,eE=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(XT,{ref:n,className:Pt(`inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground`,e),...t}));eE.displayName=XT.displayName;var tE=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(ZT,{ref:n,className:Pt(`inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background cursor-pointer transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow`,e),...t}));tE.displayName=ZT.displayName;var nE=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(QT,{ref:n,className:Pt(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));
13nE.displayName=QT.displayName;async function rE(e,t){let{data:n,error:r}=await e.from(`clinic_members`).select(`user_id, created_at`).eq(`clinic_id`,t).eq(`role`,`owner`).order(`created_at`,{ascending:!0}).limit(1);return r?null:(n??[])[0]?.user_id??null}async function iE(e,t,n){if(n)return n;try{return await rE(e,t)}catch{return null}}async function aE(e,t,n){let r=n.email_normalized??null,i=n.phone_normalized??null;if(!r&&!i)return!1;let a=[];r&&a.push(`email_normalized.eq.${r}`),i&&a.push(`phone_normalized.eq.${i}`);try{let{data:r,error:i}=await e.from(`leads`).select(`id`).eq(`clinic_id`,t).neq(`id`,n.id).or(a.join(`,`)).limit(1);if(i||!r||r.length===0)return!1;let{error:o}=await e.from(`leads`).update({needs_contact_review:!0}).eq(`id`,n.id);return!o}catch{return!1}}async function oE(){let e=_e();if(!e)throw Error(`No active clinic`);let t=await pn(e);if(!t)throw Error(`No active clinic`);return t}var sE=[`new`,`contacted`,`consultation_booked`,`treatment_booked`,`won`,`lost`],cE=L({name:R().trim().min(1).max(200).nullish(),email:R().trim().email().max(320).nullish(),phone:R().trim().min(3).max(40).nullish(),source:R().trim().min(1).max(80).nullish(),notes:R().trim().max(5e3).nullish(),status:Kt(sE).default(`new`),assigned_to:R().uuid().nullish()}),lE=L({id:R().uuid(),patch:L({name:R().trim().min(1).max(200).nullish(),email:R().trim().email().max(320).nullish(),phone:R().trim().min(3).max(40).nullish(),source:R().trim().min(1).max(80).nullish(),notes:R().trim().max(5e3).nullish(),status:Kt(sE).nullish()}).strict()});function uE(e){if(e)throw Error(e.message??`Request failed`)}async function dE(e){let t=cE.parse(e.data??{}),n=await oE(),r=await iE(N,n,t.assigned_to),i={clinic_id:n,name:t.name??null,email:t.email??null,phone:t.phone??null,source:t.source??null,notes:t.notes??null,status:t.status,assigned_to:r,environment:lt()},{data:a,error:o}=await N.from(`leads`).insert(i).select(`*`).single();uE(o);let s=a;return await aE(N,n,{id:s.id,email_normalized:s.email_normalized??null,phone_normalized:s.phone_normalized??null})&&(s.needs_contact_review=!0),s}async function fE(e){let{id:t,patch:n}=lE.parse(e.data??{}),{error:r}=await N.from(`leads`).update(n).eq(`id`,t);return uE(r),{ok:!0}}async function pE(e){let t=await oE(),{data:n,error:r}=await N.from(`leads`).select(`*`).eq(`id`,e.data.id).maybeSingle();if(uE(r),!n)throw Error(`Not found`);let{error:i}=await N.from(`leads`).update({status:`won`}).eq(`id`,n.id);uE(i);let a=n;if(!a.email)throw Error(`Lead needs an email to convert`);let{data:o,error:s}=await N.from(`patients`).insert({clinic_id:t,full_name:a.name??a.email,email:a.email,phone:a.phone,environment:lt()}).select(`id`).single();if(s){if(s.code===`23505`){let{data:e}=await N.from(`patients`).select(`id`).eq(`clinic_id`,t).eq(`email`,a.email).maybeSingle();if(e)return{patientId:e.id}}throw Error(s.message??`Failed to create patient`)}return{patientId:o.id}}var mE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function hE(e){let t=e.utm&&typeof e.utm==`object`?e.utm:{};for(let n of[e.consultation_id,t.consultation_id])if(typeof n==`string`&&mE.test(n))return n;return null}async function gE(e){let t=await oE(),n=e.data.id,{data:r,error:i}=await N.from(`leads`).select(`*`).eq(`id`,n).maybeSingle();if(uE(i),!r)throw Error(`Not found`);let a=r,o=hE(a),[s,c,l]=await Promise.all([o?N.from(`consultations`).select(`id, status, created_at`).eq(`id`,o).eq(`clinic_id`,t).maybeSingle():Promise.resolve({data:null}),a.email?N.from(`patients`).select(`id, full_name, email, phone`).eq(`clinic_id`,t).eq(`email`,a.email).maybeSingle():Promise.resolve({data:null}),N.from(`lead_notes`).select(`id, body, author_user_id, created_at`).eq(`lead_id`,n).order(`created_at`,{ascending:!1}).limit(50)]),u=null,d=[],f={},p=s.data;if(p){let{data:e}=await N.from(`ai_reports`).select(`id, summary, raw, created_at`).eq(`consultation_id`,p.id).order(`created_at`,{ascending:!1}).limit(1).maybeSingle();u=e??null;let t=e&&typeof e.raw==`object`&&e.raw?e.raw:null,n=(t&&Array.isArray(t.photo_meta)?t.photo_meta:[]).map(e=>({slot:e.slot??`photo`,path:e.path??``})).filter(e=>e.path.startsWith(`${p.id}/`));if(n.length>0){let{data:e}=await N.storage.from(`consultation-photos`).createSignedUrls(n.map(e=>e.path),600);d=(e??[]).map((e,t)=>e?.signedUrl?{slot:n[t].slot,signedUrl:e.signedUrl}
13:null).filter(Boolean)}let r=t&&Array.isArray(t.treatment_ids)?t.treatment_ids:[];if(r.length>0){let{data:e}=await N.from(`treatments`).select(`id, name`).in(`id`,r);f=Object.fromEntries((e??[]).map(e=>[e.id,e.name]))}}return{lead:a,consultation:p??null,patient:c.data??null,report:u,treatmentNames:f,photos:d,notes:l.data??[]}}async function _E(e){return await F(`consultations`,{action:`request_consultation_lead`,body:{consultationId:e.data.consultationId,targetClinicId:e.data.targetClinicId??null}})}function vE(e){return e.toLowerCase().normalize(`NFKD`).replace(/[Ì-ͯ]/g,``).replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).slice(0,50)||`category`}function yE(e){if(e)throw Error(e.message??`Request failed`)}async function bE(e,t,n){await N.rpc(`log_clinic_audit`,{_clinic:e,_action:t,_entity_type:`treatment_category`,_diff:n,_env:lt()})}async function xE(){let e=await oE(),{data:t,error:n}=await N.from(`treatment_categories`).select(`key, label, sort_order, active, clinic_id`).or(`clinic_id.is.null,clinic_id.eq.${e}`).order(`sort_order`,{ascending:!0}).order(`label`,{ascending:!0});return yE(n),t??[]}async function SE(e){let t=L({label:R().trim().min(1).max(80),sort_order:Qt().int().min(0).max(1e4).optional()}).parse(e.data??{}),n=await oE(),r=vE(t.label),{data:i,error:a}=await N.from(`treatment_categories`).select(`key`);yE(a);let o=new Set((i??[]).map(e=>e.key)),s=r,c=2;for(;o.has(s);)s=`${r}_${c++}`;let{data:l,error:u}=await N.from(`treatment_categories`).insert({key:s,label:t.label,sort_order:t.sort_order??999,clinic_id:n,active:!0}).select(`key, label, sort_order, active, clinic_id`).single();return yE(u),await bE(n,`treatment_category.create`,{key:s,label:t.label}),l}async function CE(e){let t=L({key:R().trim().min(1).max(80),label:R().trim().min(1).max(80).optional(),active:Zt().optional(),sort_order:Qt().int().min(0).max(1e4).optional()}).parse(e.data??{}),n=await oE(),{key:r,...i}=t,{error:a}=await N.from(`treatment_categories`).update(i).eq(`key`,r).eq(`clinic_id`,n);return yE(a),await bE(n,`treatment_category.update`,{key:r,...i}),{ok:!0}}async function wE(e){let t=L({key:R().trim().min(1).max(80)}).parse(e.data??{}),n=await oE(),{count:r,error:i}=await N.from(`treatments`).select(`id`,{count:`exact`,head:!0}).eq(`clinic_id`,n).eq(`category`,t.key);if(yE(i),(r??0)>0)throw Error(`Cannot delete: ${r} treatment${r===1?``:`s`} still use this category. Deactivate it instead.`);let{error:a}=await N.from(`treatment_categories`).delete().eq(`key`,t.key).eq(`clinic_id`,n);return yE(a),await bE(n,`treatment_category.delete`,{key:t.key}),{ok:!0}}function TE(){let e=Ve(),t=xp(),{data:n,isLoading:r}=Ue({queryKey:[`treatment-categories`,`manage`],queryFn:()=>xE()}),i=n??[],a=()=>{e.invalidateQueries({queryKey:[`treatment-categories`,`manage`]}),e.invalidateQueries({queryKey:[`treatment-categories`]})},[o,s]=(0,H.useState)(``),c=Be({mutationFn:()=>SE({data:{label:o.trim()}}),onSuccess:()=>{s(``),Z.success(`Category added`),a()},onError:e=>Z.error(e.message)}),l=Be({mutationFn:e=>CE({data:e}),onSuccess:a,onError:e=>Z.error(e.message)}),u=Be({mutationFn:e=>wE({data:{key:e}}),onSuccess:()=>{Z.success(`Category deleted`),a()},onError:e=>Z.error(e.message)}),d=i.filter(e=>e.clinic_id),f=(e,t)=>{let n=d[d.findIndex(t=>t.key===e.key)+t];n&&(l.mutate({key:e.key,sort_order:n.sort_order}),l.mutate({key:n.key,sort_order:e.sort_order}))};return(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,U.jsx)(`div`,{className:`flex-1`,children:(0,U.jsx)(Tv,{value:o,placeholder:`New category name, e.g. Body contouring`,maxLength:80,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&o.trim()&&c.mutate()}})}),(0,U.jsxs)(I,{className:`bg-gold text-black hover:bg-gold/90`,disabled:!o.trim()||c.isPending,onClick:()=>c.mutate(),children:[(0,U.jsx)(nt,{className:`mr-2 h-4 w-4`}),` Add category`]})]}),r?(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loadingâ¦`}):(0,U.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-border`,children:(0,U.jsxs)(`table`,{className:`w-full text-left text-sm`,children:[(0,U.jsx)(`thead`,{className:`bg-zinc-950 text-[10px] uppercase tracking-[0.2em] text-muted-foreground`,children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Category`}),(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Scope`}),(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Active`}),(0,U.jsx)(`th`,{className:`px-3 py-2 text-right`,children:`Order`}),(0,U.jsx)(`th`,{className:`w-12 px-3 py-2`})]})}),(0,U.jsx)(`tbody`,{children:i.map(e=>(0,U.jsxs)(`tr`,{className:`border-t border-border bg-black`,children:[(0,U.jsx)(`td`,{className:`px-3 py-2 text-white`,children:e.label}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:e.clinic_id?`This clinic`:`Platform default`}),(0,U.jsx)(`td`,{className:`px-3 py-2`,children:(0,U.jsx)(Gv,{checked:e.active,disabled:!e.clinic_id,onCheckedChange:t=>l.mutate({key:e.key,active:t})})}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-right`,children:e.clinic_id&&(0,U.jsxs)(`div`,{className:`inline-flex gap-1`,children:[(0,U.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>f(e,-1),children:(0,U.jsx)(Ye,{className:`h-4 w-4`})}),(0,U.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>f(e,1),children:(0,U.jsx)(Ke,{className:`h-4 w-4`})})]})}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-right`,children:e.clinic_id&&(0,U.jsx)(I,{variant:`ghost`,size:`sm`,onClick:async()=>{await t({title:`Delete â${e.label}â?`,message:`Categories in use by a treatment can't be deleted until those treatments are moved.`,confirmText:`Delete`,type:`danger`})&&u.mutate(e.key)},children:(0,U.jsx)(id,{className:`h-4 w-4 text-muted-foreground`})})})]},e.key))})]})})]})}
13var EE=`Skin / Facial.Facial Skin.Skin / Lesion & Removal.Skin / Resurfacing.Skin / Scar Revision.Skin / Energy & Laser.Brows.Injectable / Neuromodulator.Facial Injectables.Injectable / Dermal Filler.Injectable / Skin Booster.Injectable / Biostimulator.Injectable / Regenerative.Injectable / PDO Threads.Injectable / Fat Reduction.Dental.Hair.Body / Contouring.Body Non-Surgical.Intimate Health.Surgical / Face.Surgical / Body.Surgical / Breast.Surgical.Wellness.Wellness & IV`.split(`.`);function DE(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e.categories;if(!Array.isArray(t))return[];let n=new Set,r=[];for(let e of t){if(typeof e!=`string`)continue;let t=e.trim();!t||n.has(t)||(n.add(t),r.push(t))}return r}function OE(e,t){let n=new Set(t),r=[];for(let t of e)n.delete(t)&&r.push(t);let i=[...n].sort((e,t)=>{let n=EE.indexOf(e),r=EE.indexOf(t);return n!==-1||r!==-1?(n===-1?9999:n)-(r===-1?9999:r):e.localeCompare(t)});return[...r,...i]}function kE(e){if(e)throw Error(e.message??`Request failed`)}async function AE(e,t,n){await N.rpc(`log_clinic_audit`,{_clinic:e,_action:t,_entity_type:t.startsWith(`treatment.`)?`treatment`:`clinic_settings`,_diff:n,_env:lt()})}async function jE(){let e=await oE(),[{data:t,error:n},{data:r,error:i},{data:a,error:o}]=await Promise.all([N.from(`clinic_settings`).select(`consultation_order`).eq(`clinic_id`,e).maybeSingle(),tn(e).then(e=>({data:e,error:null}),e=>({data:null,error:e})),N.from(`treatment_categories`).select(`key, label`)]);kE(n),kE(i),kE(o);let s=DE(t?.consultation_order),c=new Map((a??[]).map(e=>[e.key,e.label])),l=new Map;for(let e of r??[]){let t=(e.category??``).trim()||`Other`,n=l.get(t)??[];n.push({id:e.id,name:e.name,active:e.active,sort_order:e.sort_order??0}),l.set(t,n)}let u=OE(s,[...l.keys()]);return{customised:s.length>0,categories:u.map(e=>({key:e,label:c.get(e)??e,treatments:l.get(e)??[]}))}}async function ME(e){let t=L({categories:Xt(R().trim().min(1).max(120)).max(200)}).parse(e.data??{}),n=await oE(),{error:r}=await N.from(`clinic_settings`).upsert({clinic_id:n,consultation_order:{categories:t.categories}},{onConflict:`clinic_id`});return kE(r),await AE(n,`consultation_order.save`,{categories:t.categories}),{ok:!0}}async function NE(){let e=await oE(),{error:t}=await N.from(`clinic_settings`).upsert({clinic_id:e,consultation_order:{}},{onConflict:`clinic_id`});return kE(t),await AE(e,`consultation_order.reset`,{}),{ok:!0}}async function PE(e){let t=L({category:R().trim().min(1).max(120),ids:Xt(R().uuid()).max(500)}).parse(e.data??{}),n=await oE(),r=await nn(n),i=new Map(r.map(e=>[e.treatment_id,e]));for(let e=0;e<t.ids.length;e++){let r=i.get(t.ids[e]);if(!r||(r.category??``)!==t.category)continue;let{error:a}=r.settings_id?await N.from(`clinic_treatment_settings`).update({sort_order:e}).eq(`id`,r.settings_id):await N.from(`treatments`).update({sort_order:e}).eq(`id`,r.treatment_id).eq(`clinic_id`,n);kE(a)}return await AE(n,`treatment.reorder`,{category:t.category,ids:t.ids}),{ok:!0}}function FE(){let e=Ve(),{data:t,isLoading:n}=Ue({queryKey:[`consultation-order`],queryFn:()=>jE()}),[r,i]=(0,H.useState)([]),[a,o]=(0,H.useState)(null);(0,H.useEffect)(()=>{t&&i(t.categories)},[t]);let s=()=>e.invalidateQueries({queryKey:[`consultation-order`]}),c=Be({mutationFn:e=>ME({data:{categories:e}}),onSuccess:()=>Z.success(`Consultation order saved`),onError:e=>Z.error(e.message)}),l=Be({mutationFn:()=>NE(),onSuccess:()=>{Z.success(`Restored the recommended order`),s()},onError:e=>Z.error(e.message)}),u=Be({mutationFn:e=>PE({data:e}),onSuccess:()=>Z.success(`Treatment order saved`),onError:e=>Z.error(e.message)}),d=(e,t)=>{let n=[...r],a=n[e+t],o=n[e];!a||!o||(n[e+t]=o,n[e]=a,i(n),c.mutate(n.map(e=>e.key)))},f=(e,t,n)=>{let a=r.map(e=>({...e,treatments:[...e.treatments]})),o=a[e];if(!o)return;let s=o.treatments[t+n],c=o.treatments[t];!s||!c||(o.treatments[t+n]=c,o.treatments[t]=s,i(a),u.mutate({category:o.key,ids:o.treatments.map(e=>e.id)}))};return n?(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loadingâ¦`}):(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,U.jsxs)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:[`This is the order
13clients see on your consultation page when choosing what to focus on. Move a category up to show it first, or open one to reorder the treatments inside it.`,t?.customised?` You're using a custom order.`:` You're using the recommended skin-first order.`]}),(0,U.jsxs)(I,{variant:`outline`,disabled:!t?.customised||l.isPending,onClick:()=>l.mutate(),children:[(0,U.jsx)(rt,{className:`mr-2 h-4 w-4`}),` Reset to recommended`]})]}),r.length===0?(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No active treatments yet. Add treatments first â categories appear here once they have at least one active treatment.`}):(0,U.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-border`,children:r.map((e,t)=>(0,U.jsxs)(`div`,{className:`border-t border-border first:border-t-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 bg-black px-3 py-2`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`flex flex-1 items-center gap-2 text-left text-sm text-white`,onClick:()=>o(a===e.key?null:e.key),children:[a===e.key?(0,U.jsx)(Ze,{className:`h-4 w-4 text-muted-foreground`}):(0,U.jsx)(Qe,{className:`h-4 w-4 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,U.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.treatments.length,` treatment`,e.treatments.length===1?``:`s`]})]}),(0,U.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`#`,t+1]}),(0,U.jsx)(I,{size:`icon`,variant:`ghost`,"aria-label":`Move ${e.label} up`,disabled:t===0||c.isPending,onClick:()=>d(t,-1),children:(0,U.jsx)(Ye,{className:`h-4 w-4`})}),(0,U.jsx)(I,{size:`icon`,variant:`ghost`,"aria-label":`Move ${e.label} down`,disabled:t===r.length-1||c.isPending,onClick:()=>d(t,1),children:(0,U.jsx)(Ke,{className:`h-4 w-4`})})]}),a===e.key&&(0,U.jsx)(`ul`,{className:`bg-zinc-950 px-3 py-2`,children:e.treatments.map((n,r)=>(0,U.jsxs)(`li`,{className:`flex items-center gap-3 border-b border-border/50 py-1.5 last:border-b-0`,children:[(0,U.jsx)(`span`,{className:`flex-1 pl-6 text-sm text-white`,children:n.name}),(0,U.jsx)(I,{size:`icon`,variant:`ghost`,"aria-label":`Move ${n.name} up`,disabled:r===0||u.isPending,onClick:()=>f(t,r,-1),children:(0,U.jsx)(Ye,{className:`h-4 w-4`})}),(0,U.jsx)(I,{size:`icon`,variant:`ghost`,"aria-label":`Move ${n.name} down`,disabled:r===e.treatments.length-1||u.isPending,onClick:()=>f(t,r,1),children:(0,U.jsx)(Ke,{className:`h-4 w-4`})})]},n.id))})]},e.key))})]})}var IE=`This clinic hasn't been approved for surgical previews yet. Please choose a non-surgical treatment or contact the clinic.`,LE=class extends Error{code=`SURGICAL_VERIFICATION_REQUIRED`;constructor(e=IE){super(e),this.name=`SurgicalVerificationError`}};function RE(e){if(e instanceof LE)return!0;let t=e instanceof Error?e.message:String(e??``);return t.includes(`SURGICAL_VERIFICATION_REQUIRED`)||t===`This clinic hasn't been approved for surgical previews yet. Please choose a non-surgical treatment or contact the clinic.`}var zE=`We don't generate a visual preview for this treatment. Your consultation continues without one.`,BE=`Before & after visualisation isn't available for this assessment or treatment. Your consultation results and personalised recommendations are still available below.`,VE=`This treatment is reviewed without photos, so there's no visual preview to generate.`,HE=`This treatment has a minimum age requirement, so we can't generate a visual preview for it.`,UE=`We need your date of birth before we can generate a visual preview for this treatment.`,WE=`This treatment isn't suitable during pregnancy or breastfeeding, so we don't generate a visual preview for it. Your consultation continues without one.`;function GE(e){let t=null;for(let n of e??[]){if(typeof n!=`string`)continue;let e=/\bunder\s+(\d{1,2})\b/i.exec(n);if(!e)continue;let r=Number(e[1]);!Number.isFinite(r)||r<12||r>30||/age|year|yo\b|18|16|21/i.test(n)&&(t=t===null?r:Math.max(t,r))}return t}function KE(e){let t=new Set;for(let n of e??[])typeof n==`string`&&(/pregnan/i.test(n)&&t.add(`pregnant`),/breast[\s-]?feed|lactat|nursing/i.test(n)&&t.add(`breastfeeding`));return[...t].sort()}function qE(e,t=new Date){if(typeof e!=`string`)return null;let n=/^(\d{4})-(\d{2})-(\d{2})/.exec(e.trim());if(!n)return null;let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]),o=new Date(Date.UTC(r,i-1,a));if(Number.isNaN(o.getTime()))return null;let s=t.getUTCFullYear()-r;return(t.getUTCMonth()+1<i||t.getUTCMonth()+1===i&&t.getUTCDate()<a)&&--s,s>=0&&s<130?s:null}var JE=[`generative`,`parametric`];function YE(e){return JE.includes(String(e??``).trim().toLowerCase())}function XE(e){let t=e instanceof Error?e.message:String(e??``),n=t.indexOf(`SIMULATION_NOT_ALLOWED:`);return n===-1?null:t.slice(n+23).trim()||BE}function ZE(e){return typeof e==`string`&&e.trim()?e.trim():null}function QE(e,t){if(!e)return{eligible:!0};let n=ZE(e.alternative_ui),r=ZE(e.client_disclaimer),i=ZE(e.do_not_simulate_reason);if(e.hard_block_all_paths===!0)return{eligible:!1,code:`HARD_BLOCKED`,terminal:!0,clientMessage:r??zE,internalReason:i??`hard_block_all_paths is set for this treatment: no prompt path, safety-retry path, or clinic override may reach an image model.`,alternativeUi:n??`expectation_card`};let a=ZE(e.simulation_class)?.toLowerCase()??null;if(a===`none`)return{eligible:!1,code:`SIMULATION_CLASS_NONE`,terminal:!1,clientMessage:r??BE,internalReason:i??`simulation_class = none`,alternativeUi:n};if(!YE(a))return{eligible:!1,code:`SIMULATION_CLASS_NOT_SIMULATABLE`,terminal:!1,clientMessage:r??BE,internalReason:i??`simulation_class ${a===null?`is missing`:`= ${a}`} and is not on the simulatable allow-list (${JE.join(`, `)})`,alternativeUi:n};if(e.upload_allowed===!1)return{eligible:!1,code:`UPLOAD_NOT_ALLOWED`,terminal:!1,clientMessage:r??VE,internalReason:i??`upload_allowed = false`,alternativeUi:n};let o=t?GE(e.block_conditions):null;if(o!==null){let e=qE(t?.dateOfBirth??null,t?.now??new Date);if(e===null)return{eligible:!1,code:`CLIENT_AGE_BLOCKED`,terminal:!1,clientMessage:UE,internalReason:`block_conditions require age >= ${o} but no usable date of birth is recorded â failing closed`,alternativeUi:n};if(e<o)return{eligible:!1,code:`CLIENT_AGE_BLOCKED`,terminal:!0,clientMessage:HE,internalReason:`block_conditions require age >= ${o}; client age is ${e}`,alternativeUi:n}}if(t){let r=KE(e.block_conditions).filter(e=>t.safetyAnswers?.[e]===`yes`);
13if(r.length>0)return{eligible:!1,code:`CLIENT_PREGNANCY_BLOCKED`,terminal:!0,clientMessage:WE,internalReason:`block_conditions contraindicate this treatment while ${r.join(` / `)} = yes`,alternativeUi:n}}if(t){let r=tD(e.block_conditions),i=r.filter(e=>e===`isotretinoin`&&t.safetyAnswers?.[e]===`yes`);if(i.length>0)return{eligible:!1,code:`CLIENT_PREGNANCY_BLOCKED`,terminal:!0,clientMessage:$E,internalReason:`block_conditions contraindicate this treatment while ${i.join(` / `)} = yes`,alternativeUi:n};let a=t.safetyIncomplete?r.filter(e=>{let n=t.safetyAnswers?.[e];return n!==`yes`&&n!==`no`}):[];if(a.length>0)return{eligible:!1,code:`CLIENT_SAFETY_INCOMPLETE`,terminal:!1,clientMessage:rD,internalReason:`safety questions incomplete; ${a.join(` / `)} unknown for a contraindicated treatment`,alternativeUi:n};let o=nD(e.block_conditions);if(o.length>0)return{eligible:!1,code:`CLIENT_SAFETY_UNASSESSED`,terminal:!1,clientMessage:eD,internalReason:`block_conditions not assessed by the consultation: ${o.join(` | `)}`,alternativeUi:n}}return{eligible:!0}}var $E=`This treatment isn't suitable with one of the safety answers you gave, so we don't generate a visual preview for it. Your clinic will discuss options with you.`,eD=`We can't show a preview for this treatment until your clinic has checked a few safety details with you in person.`;function tD(e){let t=new Set(KE(e));for(let n of e??[])typeof n==`string`&&/isotretinoin|accutane|oral retinoid/i.test(n)&&t.add(`isotretinoin`);return[...t].sort()}function nD(e){let t=[];for(let n of e??[])typeof n==`string`&&(/\bunder\s+\d{1,2}\b|pregnan|breast[\s-]?feed|lactat|nursing|isotretinoin|accutane|oral retinoid/i.test(n)||/soft block|\bflag\b/i.test(n)||/\bblock\b/i.test(n)&&t.push(n.trim()));return t}var rD=`We can't show a preview for this treatment yet because some safety questions haven't been answered. Your clinic will go through them with you.`,iD=[`face`,`full_face`,`lips`,`nose`,`eyes`,`jawline`,`neck`,`hairline`,`abdomen`,`breast`,`waist`,`flanks`,`arms`,`hands`,`chest`,`thighs`,`buttocks`,`legs`,`full_body`],aD=[`face_oval`,`face_profile`,`face_profile_left`,`face_profile_right`,`closeup`,`lips`,`eyes`,`jawline_front`,`jawline_left`,`jawline_right`,`nose`,`neck`,`hairline`,`torso`,`abdomen`,`breast`,`buttocks`,`arm`,`hand`,`leg`,`full_body`,`none`],oD=[`image/jpeg`,`image/png`,`image/webp`,`image/heic`,`image/heif`],sD={minimum_resolution:{width:600,height:600},max_bytes:12*1024*1024,blur:!0,lighting:!0};function $(e,t,n,r,i){return{key:e,label:t,instruction:n,camera_angle:r,required:!0,...i}}var cD=$(`front`,`Front-facing`,`Face the camera straight on, neutral expression, eyes on the horizontal guide.`,`front`,{facing:`user`,overlay_type:`face_oval`}),lD=$(`left_45`,`Left 45°`,`Turn your head 45° to your right so the camera sees your left cheek.`,`left_45`,{facing:`user`,overlay_type:`face_profile_left`}),uD=$(`right_45`,`Right 45°`,`Turn your head 45° to your left so the camera sees your right cheek.`,`right_45`,{facing:`user`,overlay_type:`face_profile_right`}),dD=$(`left_profile`,`Left profile`,`Turn fully to your right so the camera sees your complete left profile.`,`left_profile`,{facing:`user`,overlay_type:`face_profile_left`}),fD=$(`right_profile`,`Right profile`,`Turn fully to your left so the camera sees your complete right profile.`,`right_profile`,{facing:`user`,overlay_type:`face_profile_right`});function pD(e,t,n=`oblique`){let r=n===`oblique`?`45°`:`profile`,i=n===`oblique`?`left_45`:`left_profile`,a=n===`oblique`?`right_45`:`right_profile`;return[$(`front`,`Front-facing`,`Keep the ${t} centred inside the guide.`,`front`,{facing:`user`,overlay_type:e}),$(i,`Left ${r}`,`Turn ${n===`oblique`?`45°`:`fully`} to your right while keeping the ${t} in the guide.`,i,{facing:`user`,overlay_type:e}),$(a,`Right ${r}`,`Turn ${n===`oblique`?`45°`:`fully`} to your left while keeping the ${t} in the guide.`,a,{facing:`user`,overlay_type:e})]}var mD={face:{capture_zone:`face`,overlay_type:`face_oval`,instruction_title:`Photograph your face`,instruction_text:`Stand about an arm's length from the camera in soft, even, front-on light. Plain background, no direct overhead light, head level and centred in the guide.`,clothing_guidance:`Tie hair back off the face and neck.`,accessories_to_remove:[`glasses`,`hats`,`large earrings`,`makeup where possible`],prompt_tag:`face`,required_photo_views:[cD,dD,fD]},full_face:{capture_zone:`full_face`,overlay_type:`face_oval`,instruction_title:`Photograph your full face`,instruction_text:`Include your whole face from hairline to chin, arm's length away, even front lighting, plain background.`,clothing_guidance:`Tie hair back off the face.`,accessories_to_remove:[`glasses`,`hats`,`makeup where possible`],prompt_tag:`full_face`,required_photo_views:[cD,lD,uD]},lips:{capture_zone:`lips`,overlay_type:`lips`,instruction_title:`Photograph your lips`,instruction_text:`Fill the frame from nose to chin. Relaxed mouth, lips together, even light with no shadow under the nose.`,clothing_guidance:null,accessories_to_remove:[`lipstick`,`lip gloss`,`lip balm`],prompt_tag:`lips`,required_photo_views:pD(`lips`,`nose-to-chin area`)},nose:{capture_zone:`nose`,overlay_type:`nose`,instruction_title:`Photograph your nose`,instruction_text:`Frame from brow to upper lip. Keep the camera level with the tip of your nose â no tilting up or down.`,clothing_guidance:`Tie hair back off the face.`,accessories_to_remove:[`glasses`,`makeup where possible`],prompt_tag:`nose`,required_photo_views:[$(`front`,`Front-facing`,`Face the camera straight on with the lens level with the tip of your nose.`,`front`,{facing:`user`,overlay_type:`nose`}),$(`left_profile`,`Left profile`,`Turn fully to your right so the camera sees your complete left profile.`,`left_profile`,{facing:`user`,overlay_type:`nose`}),$(`right_profile`,`Right profile`,`Turn fully to your left so the camera sees your complete right profile.`,`right_profile`,{facing:`user`,overlay_type:`nose`}),$(`base`,`Base / worm's eye`,`Tilt your chin up slightly so the camera sees the nostril base. Optional but very helpful.`,`base`,{facing:`user`,overlay_type:`nose`,required:!1})]},eyes:{capture_zone:`eyes`,overlay_type:`eyes`,instruction_title:`Photograph your eye area`,instruction_text:`Frame from brow to cheekbone. Eyes open, looking straight at the lens, soft even light with no glare.`,clothing_guidance:`Tie hair back off the face.`,accessories_to_remove:[`glasses`,`contact lens cases`,`eye makeup`],prompt_tag:`periorbital`,required_photo_views:pD(`eyes`,`brow-to-cheekbone area`)},jawline:{capture_zone:`jawline`,overlay_type:`jawline_front`,instruction_title:`Photograph your jawline`,instruction_text:`Include the full jaw and upper neck.
13Chin level (not lifted), shoulders relaxed, even side lighting.`,clothing_guidance:`Wear a low collar so the jaw and neck are visible.`,accessories_to_remove:[`necklaces`,`scarves`],prompt_tag:`jawline`,required_photo_views:[$(`front`,`Front-facing`,`Keep your chin level and centre the jaw in the guide.`,`front`,{facing:`user`,overlay_type:`jawline_front`}),$(`left_profile`,`Left profile`,`Turn fully right to show your left jawline.`,`left_profile`,{facing:`user`,overlay_type:`jawline_left`}),$(`right_profile`,`Right profile`,`Turn fully left to show your right jawline.`,`right_profile`,{facing:`user`,overlay_type:`jawline_right`})]},neck:{capture_zone:`neck`,overlay_type:`neck`,instruction_title:`Photograph your neck`,instruction_text:`Frame from lower lip to collarbone. Keep your chin level and your neck relaxed â do not stretch it.`,clothing_guidance:`Wear a low or open collar.`,accessories_to_remove:[`necklaces`,`scarves`,`collars`],prompt_tag:`neck`,required_photo_views:pD(`neck`,`lower-face-to-collarbone area`,`profile`)},hairline:{capture_zone:`hairline`,overlay_type:`hairline`,instruction_title:`Photograph your hairline`,instruction_text:`Dry, unstyled hair in bright even light. Keep the camera level for the front shot and directly above for the crown shot.`,clothing_guidance:`No hair products, hairspray, or fibres.`,accessories_to_remove:[`hats`,`hair clips`,`headbands`],prompt_tag:`scalp_hairline`,required_photo_views:[$(`front`,`Front hairline`,`Camera level with your forehead, hair pushed back.`,`front`,{facing:`user`,overlay_type:`hairline`}),$(`top`,`Crown / top`,`Tilt your head forward so the camera sees the crown from above.`,`top`,{facing:`environment`,overlay_type:`hairline`}),$(`back`,`Back`,`Have someone photograph the back of your head at head height.`,`back`,{facing:`environment`,overlay_type:`hairline`})]},abdomen:{capture_zone:`abdomen`,overlay_type:`abdomen`,instruction_title:`Photograph your abdomen`,instruction_text:`Stand 2 metres from the camera against a plain wall, arms slightly away from your body, relaxed posture â do not hold your stomach in.`,clothing_guidance:`Fitted underwear or swimwear so the waistline is visible.`,accessories_to_remove:[`loose clothing`,`belts`],prompt_tag:`abdomen`,required_photo_views:[$(`front`,`Front`,`Face the camera square-on.`,`front`,{facing:`environment`,overlay_type:`abdomen`}),$(`left`,`Left side`,`Turn 90° to your right.`,`left_profile`,{facing:`environment`,overlay_type:`abdomen`}),$(`right`,`Right side`,`Turn 90° to your left.`,`right_profile`,{facing:`environment`,overlay_type:`abdomen`})]},breast:{capture_zone:`breast`,overlay_type:`breast`,instruction_title:`Photograph your chest for a breast consultation`,instruction_text:`Stand about 2 metres from the camera against a plain wall in even, front-on light. Shoulders level and square, arms relaxed at your sides, and keep the camera at chest height so the frame runs from collarbone to navel.`,clothing_guidance:`Unpadded, non-supportive clothing or bare chest â a padded or push-up bra changes the shape and makes the visualisation inaccurate.`,accessories_to_remove:[`padded or push-up bras`,`necklaces`,`loose tops`],prompt_tag:`breast`,required_photo_views:[$(`front`,`Front`,`Face the camera square-on, shoulders level, arms relaxed at your sides.`,`front`,{facing:`environment`,overlay_type:`breast`}),$(`left_profile`,`Left profile`,`Turn 90° to your right, standing tall with your arm forward and clear of the chest.`,`left_profile`,{facing:`environment`,overlay_type:`breast`}),$(`right_profile`,`Right profile`,`Turn 90° to your left, standing tall with your arm forward and clear of the chest.`,`right_profile`,{facing:`environment`,overlay_type:`breast`}),$(`oblique`,`45° oblique`,`Turn 45° to one side. Optional, but it helps show projection.`,`left_45`,{facing:`environment`,overlay_type:`breast`,required:!1})]},waist:{capture_zone:`waist`,overlay_type:`abdomen`,instruction_title:`Photograph your waist`,instruction_text:`Stand 2 metres away, relaxed, arms lifted slightly clear of the waistline, plain background.`,clothing_guidance:`Fitted underwear or swimwear.`,accessories_to_remove:[`belts`,`loose clothing`],prompt_tag:`waist`,required_photo_views:[$(`front`,`Front`,`Face the camera square-on.`,`front`,{facing:`environment`,overlay_type:`abdomen`}),$(`left`,`Left side`,`Turn 90° to your right.`,`left_profile`,{facing:`environment`,overlay_type:`abdomen`}
13),$(`right`,`Right side`,`Turn 90° to your left.`,`right_profile`,{facing:`environment`,overlay_type:`abdomen`})]},flanks:{capture_zone:`flanks`,overlay_type:`abdomen`,instruction_title:`Photograph your flanks`,instruction_text:`Stand 2 metres away with arms raised clear of your sides so both flanks are fully visible.`,clothing_guidance:`Fitted underwear or swimwear.`,accessories_to_remove:[`loose clothing`],prompt_tag:`flanks`,required_photo_views:[$(`left`,`Left flank`,`Turn 90° to your right, arm raised.`,`left_profile`,{facing:`environment`,overlay_type:`abdomen`}),$(`right`,`Right flank`,`Turn 90° to your left, arm raised.`,`right_profile`,{facing:`environment`,overlay_type:`abdomen`})]},arms:{capture_zone:`arms`,overlay_type:`arm`,instruction_title:`Photograph your arms`,instruction_text:`Stand 2 metres away with both arms held out from your body at about 45°, palms forward.`,clothing_guidance:`Sleeveless top or vest.`,accessories_to_remove:[`watches`,`bracelets`,`long sleeves`],prompt_tag:`arms`,required_photo_views:[$(`front`,`Front`,`Face the camera, arms out at 45°.`,`front`,{facing:`environment`,overlay_type:`arm`}),$(`back`,`Back`,`Turn away from the camera, arms out at 45°.`,`back`,{facing:`environment`,overlay_type:`arm`})]},hands:{capture_zone:`hands`,overlay_type:`hand`,instruction_title:`Photograph your hands`,instruction_text:`Rest your hand flat on a plain surface in bright even light and fill the frame from wrist to fingertips.`,clothing_guidance:null,accessories_to_remove:[`rings`,`bracelets`,`watches`,`nail polish`],prompt_tag:`hands`,required_photo_views:[$(`back_of_hand`,`Back of hand`,`Palm down, fingers relaxed and slightly apart.`,`dorsal`,{facing:`environment`,overlay_type:`hand`})]},chest:{capture_zone:`chest`,overlay_type:`torso`,instruction_title:`Photograph your chest / décolletage`,instruction_text:`Frame from chin to mid-chest, shoulders square to the camera, even front lighting.`,clothing_guidance:`Low or open neckline so the décolletage is visible.`,accessories_to_remove:[`necklaces`,`scarves`],prompt_tag:`decolletage`,required_photo_views:[$(`front`,`Front`,`Face the camera square-on, shoulders level.`,`front`,{facing:`user`,overlay_type:`torso`})]},thighs:{capture_zone:`thighs`,overlay_type:`leg`,instruction_title:`Photograph your thighs`,instruction_text:`Stand 2 metres away with feet hip-width apart against a plain background, weight evenly balanced.`,clothing_guidance:`Fitted shorts, underwear, or swimwear.`,accessories_to_remove:[`loose clothing`],prompt_tag:`thighs`,required_photo_views:[$(`front`,`Front`,`Face the camera square-on.`,`front`,{facing:`environment`,overlay_type:`leg`}),$(`left`,`Left side`,`Turn 90° to your right.`,`left_profile`,{facing:`environment`,overlay_type:`leg`}),$(`right`,`Right side`,`Turn 90° to your left.`,`right_profile`,{facing:`environment`,overlay_type:`leg`})]},buttocks:{capture_zone:`buttocks`,overlay_type:`buttocks`,instruction_title:`Photograph the treatment area`,instruction_text:`Stand 2 metres away, feet hip-width apart, relaxed posture, plain background, even lighting.`,clothing_guidance:`Fitted underwear or swimwear.`,accessories_to_remove:[`loose clothing`],prompt_tag:`buttocks`,required_photo_views:[$(`back`,`Back`,`Turn away from the camera, standing tall.`,`back`,{facing:`environment`,overlay_type:`buttocks`}),$(`left`,`Left side`,`Turn 90° to your right.`,`left_profile`,{facing:`environment`,overlay_type:`buttocks`}),$(`right`,`Right side`,`Turn 90° to your left.`,`right_profile`,{facing:`environment`,overlay_type:`buttocks`})]},legs:{capture_zone:`legs`,overlay_type:`leg`,instruction_title:`Photograph your legs`,instruction_text:`Stand 2â3 metres away so your legs are fully in frame, feet hip-width apart, plain background.`,clothing_guidance:`Fitted shorts or swimwear.`,accessories_to_remove:[`loose clothing`,`socks`],prompt_tag:`legs`,required_photo_views:[$(`front`,`Front`,`Face the camera square-on.`,`front`,{facing:`environment`,overlay_type:`leg`}),$(`back`,`Back`,`Turn away from the camera.`,`back`,{facing:`environment`,overlay_type:`leg`})]},full_body:{capture_zone:`full_body`,overlay_type:`full_body`,instruction_title:`Photograph your full body`,instruction_text:`Stand 3 metres from the camera so your whole body is in frame, feet hip-width apart, arms slightly away from your sides, plain background, even lighting.`,clothing_guidance:`Fitted underwear or swimwear.`,accessories_to_remove:[`loose clothing`,`shoes`,`bulky jewellery`],prompt_tag:`full_body`,required_photo_views:[$(`front`,`Front`,`Face the camera square-on.`,`front`,{facing:`environment`,overlay_type:`full_body`}),$(`left`,`Left side`,`Turn 90° to your right.`,`left_profile`,{facing:`environment`,overlay_type:`full_body`}
13),$(`right`,`Right side`,`Turn 90° to your left.`,`right_profile`,{facing:`environment`,overlay_type:`full_body`})]}};function hD(e){return e.map((e,t)=>({...e,required:t===0}))}var gD=Object.fromEntries(Object.entries(mD).map(([e,t])=>[e,{...t,required_photo_views:hD(t.required_photo_views)}])),_D=`full_face`;function vD(e){let t=e.required_photo_views.map(t=>`${t.key}:${t.overlay_type??e.overlay_type}:${t.camera_angle}:${t.required!==!1}`).join(`|`);return`${e.version}:${e.capture_zone}:${e.overlay_type}:${t}`}var yD=/^[a-z0-9_]{1,32}$/;function bD(e,t){if(!Array.isArray(e)||e.length===0)return t;let n=[];for(let t of e){if(!t||typeof t!=`object`)continue;let e=t,r=typeof e.key==`string`?e.key.trim().toLowerCase():``;!yD.test(r)||n.some(e=>e.key===r)||n.push({key:r,label:typeof e.label==`string`&&e.label.trim()?e.label.trim():r,instruction:typeof e.instruction==`string`?e.instruction:``,camera_angle:typeof e.camera_angle==`string`?e.camera_angle:r,facing:e.facing===`user`||e.facing===`environment`?e.facing:null,overlay_type:aD.includes(e.overlay_type)?e.overlay_type:void 0,required:typeof e.required==`boolean`?e.required:n.length===0})}return n.length>0?n:t}function xD(e,t){if(!Array.isArray(e))return t;let n=e.filter(e=>typeof e==`string`&&e.trim().length>0);return n.length>0?n:t}function SD(e){let t=e.photo_config;return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}function CD(e){let t=e.zone_variable;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim()):[]}var wD={arm:`arms`,arms:`arms`,underarm:`arms`,underarms:`arms`,armpit:`arms`,armpits:`arms`,forearm:`arms`,forearms:`arms`,"upper arm":`arms`,"upper arms":`arms`,tricep:`arms`,triceps:`arms`,shoulder:`arms`,shoulders:`arms`,elbow:`arms`,elbows:`arms`,hand:`hands`,hands:`hands`,"back of hands":`hands`,"dorsal hands":`hands`,dorsal:`hands`,finger:`hands`,fingers:`hands`,wrist:`hands`,wrists:`hands`,buttock:`buttocks`,buttocks:`buttocks`,glute:`buttocks`,glutes:`buttocks`,bum:`buttocks`,thigh:`thighs`,thighs:`thighs`,"inner thigh":`thighs`,"outer thigh":`thighs`,"inner thighs":`thighs`,"outer thighs":`thighs`,"full leg":`legs`,"half leg":`legs`,"lower leg":`legs`,leg:`legs`,legs:`legs`,knee:`legs`,knees:`legs`,calf:`legs`,calves:`legs`,ankle:`legs`,ankles:`legs`,foot:`legs`,feet:`legs`,shin:`legs`,shins:`legs`,abdomen:`abdomen`,abdominal:`abdomen`,stomach:`abdomen`,tummy:`abdomen`,belly:`abdomen`,waist:`waist`,flank:`flanks`,flanks:`flanks`,"love handles":`flanks`,hips:`flanks`,hip:`flanks`,back:`full_body`,"lower back":`full_body`,"upper back":`full_body`,"full body":`full_body`,body:`full_body`,bikini:`full_body`,brazilian:`full_body`,"intimate area":`full_body`,chest:`chest`,decolletage:`chest`,décolletage:`chest`,decollete:`chest`,neck:`neck`,face:`full_face`,"full face":`full_face`,forehead:`full_face`,cheeks:`full_face`,cheek:`full_face`,temples:`full_face`,temple:`full_face`,"mid face":`full_face`,midface:`full_face`,"upper lip":`lips`,lips:`lips`,lip:`lips`,nose:`nose`,eyes:`eyes`,eye:`eyes`,"under eyes":`eyes`,"eye area":`eyes`,brows:`eyes`,brow:`eyes`,eyebrows:`eyes`,"crow's feet":`eyes`,"tear trough":`eyes`,jawline:`jawline`,jaw:`jawline`,chin:`jawline`,submental:`jawline`,"double chin":`jawline`,scalp:`hairline`,hairline:`hairline`,hair:`hairline`,breast:`breast`,breasts:`breast`};function TD(e){let t=e.trim().toLowerCase().replace(/\s+/g,` `);if(!t)return null;if(wD[t])return wD[t];let n=t.replace(/\([^)]*\)/g,` `).replace(/[-_/,&]+/g,` `).replace(/\s+/g,` `).trim();if(wD[n])return wD[n];let r=n.split(` `),i=new Set;for(let e=0;e<r.length;e++){let t=e+1<r.length?`${r[e]} ${r[e+1]}`:``;t&&wD[t]?i.add(wD[t]):wD[r[e]]&&i.add(wD[r[e]])}return i.size===1?[...i][0]:null}function ED(e,t){let n=SD(e).area_zones;if(n&&typeof n==`object`&&!Array.isArray(n)){let e=t.trim().toLowerCase();for(let[t,r]of Object.entries(n))if(t.trim().toLowerCase()===e&&iD.includes(r))return r}return TD(t)}var DD=[`overlay_type`,`instruction_title`,`instruction_text`,`clothing_guidance`,`accessories_to_remove`,`prompt_tag`,`required_photo_views`];function OD(e,t){let n=SD(e);if(n.photo_required===!1||CD(e).length===0)return e;let r=t?ED(e,t):null;if(!r){let t={...n,photo_required:!1};return delete t.capture_zone,{...e,photo_config:t}}let i={...n};if(n.capture_zone!==r)for(let e of DD)delete i[e];return{...e,photo_config:{...i,capture_zone:r,photo_required:!0}}}var kD=`Photos aren't set up for this choice yet â your clinic will assess the area in person.`;function AD(e,t){if(SD(e).photo_required===!1)return{status:`no_photos`};let n=CD(e),r=t?.trim()||null;if(n.length>0){if(!r)return{status:`needs_area`,areas:n};if(!ED(e,r))return{status:`not_configured`,reason:`area_unmapped`,area:r,adminMessage:`"${e.name}": choose which photos the area "${r}" needs, or switch photos off, on the Treatments page.`,clientMessage:kD}}let i=jD(OD(e,r));return i.configured?i.photo_required?{status:`photos`,config:i,area:r}:{status:`no_photos`}:{status:`not_configured`,reason:`no_zone`,area:r,adminMessage:`"${e.name}": choose which body area it photographs, or switch photos off, on the Treatments page.`,clientMessage:kD}}function jD(e){let t=e.photo_config&&typeof e.photo_config==`object`&&!Array.isArray(e.photo_config)?e.photo_config:{},n=iD.includes(t.capture_zone),r=n?t.capture_zone:_D,i=gD[r],a=t.validation_rules??{},o=a.minimum_resolution??t.minimum_resolution??{};return{version:typeof t.version==`number`?t.version:1,photo_required:n?t.photo_required!==!1:!1,configured:n,capture_zone:r,overlay_type:aD.includes(t.overlay_type)?t.overlay_type:i.overlay_type,instruction_title:typeof t.instruction_title==`string`&&t.instruction_title.trim()?t.instruction_title.trim():i.instruction_title,instruction_text:typeof t.instruction_text==`string`&&t.instruction_text.trim()?t.instruction_text.trim():i.instruction_text,clothing_guidance:typeof t.clothing_guidance==`string`&&t.clothing_guidance.trim()?t.clothing_guidance.trim():i.clothing_guidance,accessories_to_remove:xD(t.accessories_to_remove,i.accessories_to_remove),prompt_tag:typeof t.prompt_tag==`string`&&t.prompt_tag.trim()?t.prompt_tag.trim():i.prompt_tag,required_photo_views:bD(t.required_photo_views,i.required_photo_views),validation_rules:{minimum_resolution:{width:typeof o.width==`number`?o.width:sD.minimum_resolution.width,height:typeof o.height==`number`?o.height:sD.minimum_resolution.height},max_bytes:typeof a.max_bytes==`number`?a.max_bytes:sD.max_bytes,blur:a.blur===!1?!1:sD.blur,lighting:a.lighting===!1?!1:sD.lighting},accepted_file_types:xD(t.accepted_file_types,oD),ai_model:typeof t.ai_model==`string`&&t.ai_model.trim()?t.ai_model.trim():null}}function MD(e){let t=jD(e);return t.configured?t:null}function ND(e){if(SD(e).photo_required===!1)return[];let t=CD(e);return t.length>0?t.filter(t=>!ED(e,t)).map(e=>`Choose which photos the area "${e}" needs (or switch photos off) on the Treatments page.`):jD(e).configured?[]:[`Choose which body area this treatment photographs, or switch photos off.`]}function PD(e,t,n,r){return{treatment_id:r,capture_zone:e.capture_zone,overlay_type:t.overlay_type??e.overlay_type,prompt_tag:e.prompt_tag,camera_angle:t.camera_angle,photo_view:t.key,upload_order:n+1,config_version:e.version}}
13function FD(e,t,n){return e.photo_required?e.required_photo_views.filter(e=>e.required!==!1).every(r=>{let i=t[r.key];return!(!i?.path||i.metadata.config_version!==e.version||i.metadata.capture_zone!==e.capture_zone||n&&i.metadata.treatment_id&&i.metadata.treatment_id!==n)}):!0}function ID(e,t,n){if(e.slot!==t.key)return!1;let r=e.metadata??null,i=r&&typeof r.capture_zone==`string`?r.capture_zone:null,a=r&&typeof r.prompt_tag==`string`?r.prompt_tag:null;return!!(!i&&!a||i&&i===n.capture_zone||a&&a===n.prompt_tag)}function LD(e,t){return e.photo_required?e.required_photo_views.filter(e=>e.required!==!1).filter(n=>!t.some(t=>ID(t,n,e))):[]}var RD={name:200,category:100,currency:3,description:5e3,image_url:500,sim_text:500,sim_area:200,sim_color_changes:1e3,sim_texture_changes:1e3,sim_lighting_notes:500,sim_identity_lock:1e3,ai_notes:2e3,before_after_guidance:2e3,contraindications:2e3,recovery_time:800,expected_results:2e3,faq_question:300,faq_answer:2e3},zD=`treatment-media`;async function BD(e){return await F(`consultations`,{action:`treatment_images_list`,body:{treatmentId:e.data.treatmentId}})}async function VD(e){return await F(`consultations`,{action:`treatment_image_add`,body:{...e.data}})}async function HD(e){return await F(`consultations`,{action:`treatment_image_delete`,body:{id:e.data.id}})}async function UD(e){return await F(`consultations`,{action:`treatment_images_reorder`,body:{treatmentId:e.data.treatmentId,ids:e.data.ids}})}async function WD(e){return await F(`consultations`,{action:`treatment_image_alt`,body:{id:e.data.id,altText:e.data.altText}})}async function GD(e){return await F(`consultations`,{action:`treatment_image_cover`,body:{treatmentId:e.data.treatmentId,id:e.data.id}})}var KD=5*1024*1024,qD=[`image/png`,`image/jpeg`,`image/webp`];function JD({treatmentId:e,clinicId:t}){let n=Ve(),r=(0,H.useRef)(null),[i,a]=(0,H.useState)(!1),o=BD,s=VD,c=HD,l=UD,u=GD,d=WD,f=[`treatment-images`,e],{data:p,isLoading:m}=Ue({queryKey:f,queryFn:()=>o({data:{treatmentId:e}})}),h=p??[],g=()=>n.invalidateQueries({queryKey:f}),_=Be({mutationFn:e=>c({data:{id:e}}),onSuccess:g,onError:e=>Z.error(e.message)}),v=Be({mutationFn:t=>u({data:{treatmentId:e,id:t}}),onSuccess:g,onError:e=>Z.error(e.message)}),y=Be({mutationFn:t=>l({data:{treatmentId:e,ids:t}}),onSuccess:g,onError:e=>Z.error(e.message)}),b=Be({mutationFn:e=>d({data:e}),onSuccess:()=>{g(),Z.success(`Description saved`)},onError:e=>Z.error(e.message)}),x=(e,t)=>{let n=[...h],r=e+t;r<0||r>=n.length||([n[e],n[r]]=[n[r],n[e]],y.mutate(n.map(e=>e.id)))},S=async n=>{if(!qD.includes(n.type))return Z.error(`Use a JPG, PNG, or WebP image.`);if(n.size>KD)return Z.error(`Images must be under 5 MB.`);a(!0);try{let r=n.name.split(`.`).pop()?.toLowerCase()??`jpg`,i=`${t}/${e}/${crypto.randomUUID()}.${r}`,{error:a}=await N.storage.from(zD).upload(i,n,{contentType:n.type,upsert:!1});if(a)throw a;await s({data:{treatmentId:e,storagePath:i}}),g()}catch(e){Z.error(e instanceof Error?e.message:`Upload failed`)}finally{a(!1),r.current&&(r.current.value=``)}};return(0,U.jsxs)(`div`,{className:`rounded-md border border-border p-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-sm text-white`,children:`Photo gallery`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Up to 5 MB each. The starred image is used as the cover everywhere.`})]}),(0,U.jsxs)(I,{type:`button`,variant:`outline`,disabled:i,onClick:()=>r.current?.click(),children:[(0,U.jsx)(ad,{className:`mr-2 h-4 w-4`}),i?`Uploadingâ¦`:`Add photo`]}),(0,U.jsx)(`input`,{ref:r,type:`file`,accept:qD.join(`,`),className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&S(t)}})]}),m?(0,U.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Loadingâ¦`}):h.length===0?(0,U.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`No photos yet.`}):(0,U.jsx)(`ul`,{className:`mt-4 grid grid-cols-2 gap-3 md:grid-cols-4`,children:h.map((e,t)=>(0,U.jsxs)(`li`,{className:`overflow-hidden rounded-md border border-border bg-black`,children:[(0,U.jsx)(`img`,{src:e.url,alt:e.alt_text??``,className:`h-24 w-full object-cover`}),(0,U.jsx)(`input`,{"aria-label":`Image description`,defaultValue:e.alt_text??``,placeholder:`Describe this photo`,maxLength:200,onBlur:t=>{let n=t.target.value.trim();n!==(e.alt_text??``)&&b.mutate({id:e.id,altText:n})},className:`w-full border-t border-border bg-transparent px-2 py-1 text-[11px] text-white placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-gold`}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-1 py-1`,children:[(0,U.jsxs)(`div`,{className:`flex`,children:[(0,U.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>x(t,-1),disabled:t===0,children:(0,U.jsx)(qe,{className:`h-3.5 w-3.5`})}),(0,U.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>x(t,1),disabled:t===h.length-1,children:(0,U.jsx)(Je,{className:`h-3.5 w-3.5`})})]}),(0,U.jsxs)(`div`,{className:`flex`,children:[(0,U.jsx)(I,{variant:`ghost`,size:`sm`,title:e.is_cover?`
13Cover image`:`Make cover`,onClick:()=>v.mutate(e.id),children:(0,U.jsx)(rd,{className:`h-3.5 w-3.5 ${e.is_cover?`fill-gold text-gold`:`text-muted-foreground`}`})}),(0,U.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>_.mutate(e.id),children:(0,U.jsx)(id,{className:`h-3.5 w-3.5 text-muted-foreground`})})]})]})]},e.id))})]})}function YD(){return F(`admin`,{action:`treatment_content_missing`,timeoutMs:6e4}).then(e=>e.treatments??[])}function XD(e){return F(`admin`,{action:`treatment_content_generate`,body:{treatmentId:e},timeoutMs:18e4})}function ZD(e){return F(`admin`,{action:`treatment_content_bulk`,body:{treatmentIds:e},timeoutMs:54e4})}var QD={description:`Description`,expected_results:`Expected results`,recovery_time:`Recovery`,contraindications:`Contraindications`,ai_notes:`Recommendation notes`,before_after_guidance:`Photo guidance`,faqs:`FAQs`},$D=40,eO=1;function tO({clinicId:e}){let t=Ve(),[n,r]=(0,H.useState)({}),[i,a]=(0,H.useState)({}),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),{data:f,isLoading:p}=Ue({queryKey:[`treatment-content-gaps`,e],queryFn:()=>YD(),staleTime:3e4}),m=f??[],h=(0,H.useMemo)(()=>m.reduce((e,t)=>e+t.missing.length,0),[m]),g=e=>{a(t=>({...t,[e.treatmentId]:e})),r(t=>({...t,[e.treatmentId]:e.status}))},_=()=>{t.invalidateQueries({queryKey:[`treatment-content-gaps`,e]}),t.invalidateQueries({queryKey:[`treatments`,e]})},v=Be({mutationFn:e=>XD(e),onMutate:e=>r(t=>({...t,[e]:`generating`})),onSuccess:e=>{if(g(e),e.status===`failed`||e.status===`partial`){let t=e.failed.map(e=>`${QD[e.field]} (${e.reason.replace(/_/g,` `)})`).join(`, `);Z[e.status===`failed`?`error`:`warning`](e.error??(t?`Not written: ${t}`:`Nothing was written.`))}_()},onError:(e,t)=>{r(e=>({...e,[t]:`failed`})),Z.error(e.message)}}),y=Be({mutationFn:async e=>{let t=[];for(let n=0;n<e.length;n+=eO){let{results:r}=await ZD(e.slice(n,n+eO));r.forEach(g),t.push(...r)}return{results:t}},onMutate:e=>r(t=>({...t,...Object.fromEntries(e.map(e=>[e,`queued`]))})),onSuccess:({results:e})=>{e.forEach(g);let t=e.filter(e=>e.status===`completed`).length,n=e.filter(e=>e.status===`partial`).length,r=e.filter(e=>e.status===`failed`).length;Z[r?`warning`:`success`](`${t} completed, ${n} partially completed, ${r} failed.`),_()},onError:e=>Z.error(e.message)}),b=async()=>{let e=m.map(e=>e.id);l({processed:0,total:e.length}),d(null),r(t=>({...t,...Object.fromEntries(e.map(e=>[e,`queued`]))}));let t=[],n=0;for(let i=0;i<e.length;i+=eO){let a=e.slice(i,i+eO);r(e=>({...e,...Object.fromEntries(a.map(e=>[e,`generating`]))}));try{let{results:e}=await ZD(a);e.forEach(g),t.push(...e)}catch(e){n+=1,r(e=>({...e,...Object.fromEntries(a.map(e=>[e,`failed`]))})),Z.error(e.message)}l({processed:Math.min(i+a.length,e.length),total:e.length})}d({treatments:e.length,completed:t.filter(e=>e.status===`completed`).length,partial:t.filter(e=>e.status===`partial`).length,failed:t.filter(e=>e.status===`failed`).length+(e.length-t.length),populated:t.reduce((e,t)=>e+t.populated.length,0),skipped:t.reduce((e,t)=>e+t.skipped.length,0),rejected:t.reduce((e,t)=>e+t.failed.length,0),reasons:t.flatMap(e=>e.failed.map(e=>e.reason)).reduce((e,t)=>(e[t]=(e[t]??0)+1,e),{})}),l(null),_()};if(p)return(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Checking for missing contentâ¦`});if(m.length===0)return(0,U.jsx)(`div`,{className:`rounded-lg border border-border bg-black p-4 text-sm text-muted-foreground`,children:`Every default treatment has its description, results, recovery, safety notes, photo guidance and FAQs filled in.`});let x=m.slice(0,$D).map(e=>e.id),S=y.isPending||v.isPending||c!==null;return(0,U.jsxs)(`div`,{className:`space-y-4 rounded-lg border border-amber-400/30 bg-black p-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-medium text-amber-200`,children:`Missing treatment content`}),(0,U.jsxs)(`p`,{className:`mt-1 max-w-2xl text-xs text-muted-foreground`,children:[m.length,` default treatments have `,h,` empty fields. Generating fills only the empty ones â anything already written is never changed, and everything stays editable below. Progress shows for this run only.`]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsxs)(I,{variant:`outline`,className:`border-border bg-transparent`,disabled:S,onClick:()=>y.mutate(x),children:[(0,U.jsx)(it,{className:`mr-2 h-4 w-4`}),y.isPending?`Generatingâ¦`:`Generate for ${x.length}`]}),(0,U.jsxs)(I,{className:`bg-amber-500 text-black hover:bg-amber-400`,disabled:S,onClick:()=>s(!0),children:[(0,U.jsx)(it,{className:`mr-2 h-4 w-4`}),c?`Generating allâ¦`:`Generate All Default Treatment Content`]})]})]}),c?(0,U.jsxs)(`div`,{className:`rounded-md border border-amber-400/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-200`,children:[`Generating⦠`,c.processed,` of `,c.total,` treatments processed. Keep this tab open â progress is not saved if you leave.`]}):null,u?(0,U.jsxs)(`div`,{className:`space-y-1 rounded-md border border-border bg-zinc-950 px-3 py-2 text-xs text-muted-foreground`,children:[(0,U.jsx)(`p`,{className:`text-white`,children:`Run summary`}),(0,U.jsxs)(`p`,{children:[u.treatments,` treatments: `,u.completed,` completed, `,u.partial,` `,`partially completed, `,u.failed,` failed.`]}),(0,U.jsxs)(`p`,{children:[`Fields: `,u.populated,` populated, `,u.skipped,` left as-is, `,u.rejected,` `,`rejected.`]}),Object.keys(u.reasons).length>0?(0,U.jsxs)(`p`,{className:`text-amber-300`,children:[`Rejection reasons:`,` `,Object.entries(u.reasons).map(([e,t])=>`${e} (${t})`).join(`, `)]}):null]}):null,(0,U.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border`,children:(0,U.jsxs)(`table`,{className:`w-full text-left text-xs`,children:[(0,U.jsx)(`thead`,{className:`bg-zinc-950 text-[10px] uppercase tracking-[0.2em] text-muted-foreground`,children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Treatment`}),(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Empty fields`}),(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Result`}),(0,U.jsx)(`th`,{className:`px-3 py-2 text-right`,children:`Action`})]})}),(0,U.jsx)(`tbody`,{children:m.map(e=>{let t=n[e.id]??`idle`,r=i[e.id];return(0,U.jsxs)(`tr`,{className:`border-t border-border align-top`,children:[(0,U.jsx)(`td`,{className:`px-3 py-2 text-white`,children:e.name}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:e.missing.map(e=>QD[e]).join(`, `)}),(0,U.jsx)(`td`,{className:`px-3 py-2`,children:t===`idle`?(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`â`}):r?(0,U.jsxs)(`span`,{className:`text-muted-foreground`,children:[r.populated.length>0&&(0,U.jsxs)(`span`,{className:`text-emerald-300`,children:[`Filled: `,r.populated.map(e=>QD[e]).join(`, `),`.`,` `]}),r.skipped.length>0&&(0,U.jsxs)(`span`,{children:[`Left as-is: `,r.skipped.map(e=>QD[e]).join(`, `),`.`,` `]}),r.failed.length>0&&(0,U.jsxs)(`span`,{className:`text-amber-300`,children:[`Not written:`,` `,r.failed.map(e=>`${QD[e.field]} (${e.reason})`).join(`, `),`.`]}),r.error&&(0,U.jsx)(`span`,{className:`text-red-300`,children:r.error})]}):(0,U.jsx)(`span`,{className:`text-amber-300`,children:t===`queued`?`Queuedâ¦`:`Generatingâ¦`})}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-right`,children:(0,U.jsx)(I,{size:`sm`,variant:`outline`,className:`border-border bg-transparent`,disabled:S||t===`generating`||t===`queued`,onClick:()=>v.mutate(e.id),children:`Generate`})})]},e.id)})})]})}),(0,U.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Generated
13wording is general information for patients, not clinical advice. Review it before relying on it â safety and recovery text in particular should be checked by your clinical lead.`}),(0,U.jsx)(Lt,{open:o,onOpenChange:s,type:`warning`,title:`Generate all default treatment content?`,confirmText:`Generate for ${m.length} treatments`,message:(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`p`,{children:[`Claude will write patient-facing content straight into the platform's`,` `,m.length,` default treatment records (`,h,` empty fields).`]}),(0,U.jsx)(`p`,{children:`Only empty fields are filled. Existing wording, prices, identifiers, simulation rules, gating and optional fields are never touched, and clinic-owned copies of these treatments are left unchanged.`}),(0,U.jsx)(`p`,{children:`Anything unsafe or off-topic is rejected instead of saved. Every generated value stays fully editable in the editor below.`})]}),warning:`There is no bulk undo. Generated wording is general information, not clinical advice â have your clinical lead review safety and recovery text.`,onConfirm:()=>{b()}})]})}var nO=[`name`,`category`,`duration_minutes`,`description`,`photo_setting`,`expected_results`,`recovery_time`,`contraindications`,`ai_notes`,`before_after_guidance`,`faqs`],rO={name:`basics`,category:`basics`,duration_minutes:`basics`,price_cents:`basics`,description:`basics`,photo_setting:`basics`,expected_results:`clinical`,recovery_time:`clinical`,contraindications:`clinical`,ai_notes:`clinical`,before_after_guidance:`clinical`,faqs:`clinical`};function iO(e){return typeof e==`string`?e.trim().length>0:!1}function aO(e){return typeof e==`number`?Number.isFinite(e):typeof e==`string`&&e.trim()?Number.isFinite(Number(e)):!1}function oO(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return t.photo_required===!1?!0:iD.includes(t.capture_zone)}function sO(e,t){return e===`free`?!aO(t)||Number(t)===0:e===`unknown`?!1:aO(t)&&Number(t)>0}function cO(e){return Array.isArray(e)?e.some(e=>e&&typeof e==`object`&&iO(e.question)&&iO(e.answer)):!1}function lO(e){let t=[];for(let n of nO){let r=n===`photo_setting`?e.photo_config:e[n];(n===`photo_setting`?oO(r):n===`faqs`?cO(r):n===`duration_minutes`?aO(r):n===`price_cents`?sO(e.price_status,r):iO(r))||t.push(n)}return t}function uO(e){return lO(e).length===0}function dO(e){return e==null?!1:typeof e==`string`?e.trim().length>0:Array.isArray(e)?e.length>0:typeof e==`number`?Number.isFinite(e):!0}
13function fO(e){return e.hard_block_all_paths!==!0&&!dO(e.do_not_simulate_reason)}function pO(e){let t=[];return dO(e.description)||t.push(`Description`),[`typical_sessions_min`,`typical_sessions_max`,`session_interval_days`].some(t=>!dO(e[t]))&&t.push(`Session schedule (sessions and interval)`),fO(e)&&(dO(e.sim_effects)||t.push(`Simulation effects`),dO(e.sim_areas_modify)||t.push(`Simulation areas to change`),dO(e.direction_class)||t.push(`Simulation direction`)),t}var mO=()=>P(()=>import(`./_clinic-admin.dashboard.treatments-BZcGkhnb.js`),__vite__mapDeps([254,3,2,4,47,22,23,10,9,20,21,41,8,191,18,235,71,45,32,48,44,43,236,1,5,146,147,31,33,73,36,37,38,39,148,149,150,94,123])),hO={face:`Face`,full_face:`Full face`,lips:`Lips`,nose:`Nose`,eyes:`Eyes`,jawline:`Jawline and chin`,neck:`Neck`,hairline:`Scalp and hairline`,abdomen:`Abdomen`,breast:`Breast`,waist:`Waist`,flanks:`Flanks`,arms:`Arms`,hands:`Hands`,chest:`Chest and décolletage`,thighs:`Thighs`,buttocks:`Buttocks`,legs:`Legs`,full_body:`Full body`};function gO(e){if(!e||typeof e!=`object`||Array.isArray(e))return``;let t=e,n=t.capture_zone;return typeof n==`string`&&iD.includes(n)?n:t.photo_required===!1?`none`:``}function _O({onGenerate:e,generating:t,disabled:n,notes:r}){return(0,U.jsxs)(`div`,{className:`border-y border-gold/20 bg-gold/5 px-5 py-3 sm:px-6`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Draft missing details with Claude`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Existing text stays unchanged. Review before saving.`})]}),(0,U.jsxs)(I,{type:`button`,variant:`outline`,size:`sm`,onClick:e,disabled:t||n,children:[(0,U.jsx)(it,{className:`mr-2 h-3.5 w-3.5`}),t?`Generatingâ¦`:`Generate details`]})]}),r.length>0&&(0,U.jsxs)(`p`,{className:`mt-2 text-xs text-amber-300`,children:[`Left blank for you to write: `,r.join(`, `),`.`]})]})}function vO({htmlFor:e,children:t,field:n,missing:r,generated:i}){return(0,U.jsxs)(`div`,{className:`mb-1 flex min-h-5 flex-wrap items-center justify-between gap-2`,children:[(0,U.jsx)(jv,{htmlFor:e,children:t}),i?(0,U.jsx)(`span`,{className:`text-[10px] font-medium uppercase text-gold`,children:`Generated â please review`}):r?(0,U.jsx)(`span`,{className:`text-[10px] font-medium uppercase text-amber-300`,children:`Required`}):null]})}function yO({value:e,limit:t}){let n=e.length>t;return(0,U.jsxs)(`p`,{className:`mt-1 text-right text-[10px] ${n?`text-destructive`:`text-muted-foreground`}`,children:[e.length,`/`,t,n?` â shorten this field before saving`:``]})}var bO=q(`/_authenticated/_clinic-admin/dashboard/treatments`)({head:()=>({meta:[{title:`Treatments · ${X.name}`},{name:`description`,content:`Manage clinic treatments and patient-facing treatment guidance.`},{property:`og:title`,content:`Treatments · ${X.name}`},{property:`og:description`,content:`Manage clinic treatments and patient-facing treatment guidance.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(mO,`component`)});function xO({clinicId:e,surgicalVerified:t,showContentGeneration:n=!1}){let r=Ve(),[i,a]=(0,H.useState)(null),[o,s]=(0,H.useState)(null),c=e=>!n&&e.is_global===!0,l=S_,u=C_,d=w_,f=T_,p=O_,{data:m,isLoading:h}=Ue({queryKey:[`treatments`,e],queryFn:()=>l()}),g=m??[],_=()=>r.invalidateQueries({queryKey:[`treatments`,e]}),[v,y]=(0,H.useState)(null),[b,x]=(0,H.useState)(!1),[S,C]=(0,H.useState)(null),[w,T]=(0,H.useState)(!1),E=Be({mutationFn:()=>p(),onSuccess:e=>{e.total===0?Z.success(`All treatments already have AI guidance.`):e.failed===0?Z.success(`Generated AI guidance for ${e.succeeded} treatments.`):Z.warning(`Generated ${e.succeeded} of ${e.total}. ${e.failed} failed â try again later.`),_()},onError:e=>Z.error(e.message)}),D=(0,H.useMemo)(()=>g.filter(e=>!e.sim_effects||e.sim_effects.length===0).length,[g]),O=(0,H.useMemo)(()=>w?g.filter(e=>!e.sim_effects||e.sim_effects.length===0):g,[g,w]),k=(0,H.useMemo)(()=>{let e=new Map;for(let t of O){let n=t.category??`Uncategorised`;e.has(n)||e.set(n,[]),e.get(n).push(t)}for(let t of e.values())t.sort((e,t)=>
13e.sort_order-t.sort_order||e.name.localeCompare(t.name));return Array.from(e.entries()).sort(([e],[t])=>e.localeCompare(t))},[O]),A=Be({mutationFn:e=>d({data:{id:e.id,patch:{active:e.active}}}),onSuccess:()=>_(),onError:e=>Z.error(e.message)}),ee=Be({mutationFn:e=>f({data:{id:e}}),onSuccess:()=>{Z.success(`Treatment removed`),_()},onError:e=>Z.error(e.message)});return(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsxs)($T,{defaultValue:`treatments`,children:[(0,U.jsxs)(eE,{className:`bg-zinc-900`,children:[(0,U.jsx)(tE,{value:`treatments`,children:`Treatments`}),(0,U.jsx)(tE,{value:`categories`,children:`Categories`}),(0,U.jsx)(tE,{value:`order`,children:`Consultation order`})]}),(0,U.jsx)(nE,{value:`categories`,className:`mt-6`,children:(0,U.jsx)(TE,{})}),(0,U.jsx)(nE,{value:`order`,className:`mt-6`,children:(0,U.jsx)(FE,{})}),(0,U.jsxs)(nE,{value:`treatments`,className:`mt-6 space-y-6`,children:[n&&(0,U.jsx)(tO,{clinicId:e}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[g.length,` treatments · Manage the menu that powers consultations, simulations, and AI recommendations.`]}),!t&&(0,U.jsx)(`p`,{className:`mt-1 text-xs text-gold`,children:`Surgical treatments are hidden from patients until Super Admin verifies this clinic.`}),D>0&&(0,U.jsxs)(`label`,{className:`mt-2 inline-flex cursor-pointer items-center gap-2 text-xs text-amber-300`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>T(e.target.checked),className:`h-3.5 w-3.5 accent-amber-400`}),`Show only "Needs AI guidance" (`,D,`)`]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[D>0&&(0,U.jsxs)(I,{variant:`outline`,className:`border-amber-400/40 bg-transparent text-amber-300 hover:text-amber-200`,disabled:E.isPending,onClick:()=>E.mutate(),title:`Generate AI simulation guidance for every treatment currently missing it. May take a minute.`,children:[(0,U.jsx)(it,{className:`mr-2 h-4 w-4`}),E.isPending?`Generating⦠(${D})`:`Generate for all (${D})`]}),(0,U.jsxs)(I,{onClick:()=>x(!0),className:`bg-gold text-black hover:bg-gold/90`,children:[(0,U.jsx)(nt,{className:`mr-2 h-4 w-4`}),` Add treatment`]})]})]}),h?(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loadingâ¦`}):g.length===0?(0,U.jsx)(`p`,{className:`rounded-md border border-border bg-black p-6 text-sm text-muted-foreground`,children:`No treatments yet. Click "Add treatment" to create one.`}):(0,U.jsx)(`div`,{className:`space-y-8`,children:k.map(([e,r])=>(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h2`,{className:`mb-3 text-[11px] uppercase tracking-[0.25em] text-muted-foreground`,children:e}),(0,U.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-border`,children:(0,U.jsxs)(`table`,{className:`w-full text-left text-sm`,children:[(0,U.jsx)(`thead`,{className:`bg-zinc-950 text-[10px] uppercase tracking-[0.2em] text-muted-foreground`,children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{className:`w-14 px-3 py-2`}),(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Name`}),(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Price`}),(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Duration`}),(0,U.jsx)(`th`,{className:`px-3 py-2`,children:`Active`}),(0,U.jsx)(`th`,{className:`px-3 py-2 text-right`,children:`Actions`})]})}),(0,U.jsx)(`tbody`,{children:r.map(e=>{let r=e.requires_verification&&!t;return(0,U.jsxs)(`tr`,{className:`border-t border-border bg-black align-middle`,children:[(0,U.jsx)(`td`,{className:`px-3 py-2`,children:e.image_url?(0,U.jsx)(`img`,{src:e.image_url,alt:``,className:`h-10 w-10 rounded object-cover`}):(0,U.jsx)(`div`,{className:`h-10 w-10 rounded bg-zinc-800`})}),(0,U.jsxs)(`td`,{className:`px-3 py-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-white`,children:[e.name,c(e)?(0,U.jsx)(`span`,{title:`Platform default treatment. Your clinic sets its own price, duration, order and on/off; the treatment details are managed by the platform.`,className:`inline-flex items-center gap-1 rounded-full bg-zinc-800 px-2 py-0.5 text-[9px] uppercase tracking-wider text-muted-foreground`,children:`Shared default`}):!n&&(0,U.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-gold/15 px-2 py-0.5 text-[9px] uppercase tracking-wider text-gold`,children:`Your treatment`}),e.requires_verification&&(0,U.jsxs)(`span`,{title:r?`Hidden from patients â pending Super Admin verification`:`Requires clinic verification`,className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[9px] uppercase tracking-wider ${r?`bg-red-500/15 text-red-300`:`bg-gold/15 text-gold`}`,children:[(0,U.jsx)($u,{className:`h-3 w-3`}),` Surgical`]}),(!e.sim_effects||e.sim_effects.length===0)&&(0,U.jsxs)(`span`,{title:`No AI simulation guidance yet â the simulator will use a generic modality fallback. Open the treatment and click 'Generate AI guidance' for treatment-specific results.`,className:`inline-flex items-center gap-1 rounded-full bg-amber-500/15 px-2 py-0.5 text-[9px] uppercase tracking-wider text-amber-300`,children:[(0,U.jsx)(it,{className:`h-3 w-3`}),` Needs AI guidance`]}),e.sim_pending_draft&&(0,U.jsxs)(`span`,{title:`AI-drafted simulation guidance is waiting for your review. Open the treatment â AI Simulation tab.`,className:`inline-flex items-center gap-1 rounded-full bg-blue-500/15 px-2 py-0.5 text-[9px] uppercase tracking-wider text-blue-300`,children:[(0,U.jsx)(it,{className:`h-3 w-3`}),` Pending AI review`]}),e.sim_flagged_at&&(0,U.jsx)(`span`,{title:e.sim_flag_note??`Flagged by platform oversight`,className:`inline-flex items-center gap-1 rounded-full bg-red-500/15 px-2 py-0.5 text-[9px] uppercase tracking-wider text-red-300`,children:`Flagged`}),!uO(e)&&(0,U.jsx)(`span`,{title:`Some patient-facing details are still empty`,className:`inline-flex items-center gap-1 rounded-full bg-amber-500/15 px-2 py-0.5 text-[9px] uppercase tracking-wider text-amber-300`,children:`Incomplete`}),ND({name:e.name,photo_config:e.photo_config,zone_variable:e.zone_variable}).length>0&&(0,U.jsx)(`span`,{title:ND({name:e.name,photo_config:e.photo_config,zone_variable:e.zone_variable}).join(` `),className:`inline-flex items-center gap-1 rounded-full bg-amber-500/15 px-2 py-0.5 text-[9px] uppercase tracking-wider text-amber-300`,children:`Photo setup needed`}),pO(e).length>0&&(0,U.jsx)(`span`,{title:`Still empty: ${pO(e).join(`, `)}`,className:`inline-flex items-center gap-1 rounded-full bg-amber-500/15 px-2 py-0.5 text-[9px] uppercase tracking-wider text-amber-300`,children:`Setup incomplete`})]}),e.description&&(0,U.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-xs text-muted-foreground`,children:e.description})]}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:e.price_status===`free`?`Free`:e.price_status===`unknown`||!(e.price_cents>0)?`Not set`:`${e.currency} ${(e.price_cents/100).toFixed(2)}`}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:e.duration_minutes?`${e.duration_minutes} min`:`â`}),(0,U.jsx)(`td`,{className:`px-3 py-2`,children:(0,U.jsx)(Gv,{checked:e.active,"aria-label":`${e.active?`Switch off`:`Switch on`} ${e.name}`,onCheckedChange:t=>A.mutate({id:e.id,active:t})})}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-right`,children:(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(I,{size:`sm`,variant:`outline`,"aria-label":`Edit ${e.name}`,className:`border-border bg-transparent text-white`,onClick:()=>c(e)?s(e):y(e),children:(0,U.jsx)(td,{className:`h-3.5 w-3.5`})}),!c(e)&&(0,U.jsx)(I,{size:`sm`,variant:`outline`,"aria-label":`Remove ${e.name}`,className:`border-border bg-transparent text-red-400 hover:text-red-300`,onClick:()=>a(e),children:(0,U.jsx)(id,{className:`h-3.5 w-3.5`})})]})})]},e.id)})})]})})]},e))})]})]}),(v||b)&&(0,U.jsx)(CO,{initial:v,clinicId:e,requireComplete:!0,savingLabel:v?void 0:`Saving treatment and questionsâ¦`,onClose:()=>{y(null),x(!1)},onSave:async t=>{if(v)await d({data:{id:v.id,patch:t}}),Z.success(`Treatment updated`);else{let n=await u({data:t});if(Z.success(`Treatment created`),n?.id){let r={id:n.id,name:t.name??n.name??``,category:t.category??null,description:t.description??null};try{C({treatment:r,drafts:await ET(r,e),error:null})}catch(e){C({treatment:r,drafts:null,error:e instanceof Error?e.message:`We couldn't create questions.`})}}}_(),y(null),x(!1)}}),S&&(0,U.jsx)(DT,{treatment:S.treatment,clinicId:e,initialDrafts:S.drafts,initialError:S.error,onClose:()=>C(null)}),o&&(0,U.jsx)(SO,{row:o,onClose:()=>s(null),onSave:async e=>{await d({data:{id:o.id,patch:e}}),Z.success(`Your clinic's settings were saved`),_(),s(null)}}),(0,U.jsx)(Lt,{open:!!i,onOpenChange:e=>!e&&a(null),type:`danger`,title:`Remove treatment`,message:i?`Remove "${i.name}" from your clinic? Past consultations, reports and bookings that used it are kept.`:void 0,confirmText:`Remove`,onConfirm:async()=>{i&&await ee.mutateAsync(i.id)}})]})}function SO({row:e,onClose:t,onSave:n}){let[r,i]=(0,H.useState)(e.price_status??(e.price_cents>0?`priced`:`unknown`)),[a,o]=(0,H.useState)(e.price_cents>0?(e.price_cents/100).toFixed(2):``),[s,c]=(0,H.useState)(e.currency||`USD`),[l,u]=(0,H.useState)(e.duration_minutes?String(e.duration_minutes):``),[d,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(null);return(0,U.jsx)(Rf,{open:!0,onOpenChange:e=>!e&&t(),children:(0,U.jsxs)(Hf,{className:`border-border bg-zinc-950 text-white`,children:[(0,U.jsxs)(Uf,{children:[(0,U.jsx)(Gf,{children:e.name}),(0,U.jsx)(Kf,{children:`This is a platform default treatment. Its description, clinical details and photos are managed by the platform. You set your clinic's price and duration here, and switch it on or off from the list.`})]}),(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`shared-price-status`,children:`Price`}),(0,U.jsxs)(pC,{value:r,onValueChange:e=>i(e),children:[(0,U.jsx)(hC,{id:`shared-price-status`,className:`mt-1`,children:(0,U.jsx)(mC,{})}),(0,U.jsxs)(vC,{children:[(0,U.jsx)(bC,{value:`unknown`,children:`Not set (ask the clinic)`}),(0,U.jsx)(bC,{value:`priced`,children:`Set a price`}),(0,U.jsx)(bC,{value:`free`,children:`Free`})]})]})]}),r===`priced`&&(0,U.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,U.jsxs)(`div`,{className:`col-span-2`,children:[(0,U.jsx)(jv,{htmlFor:`shared-price`,children:`Amount`}),(0,U.jsx)(Tv,{id:`shared-price`,inputMode:`decimal`,value:a,onChange:e=>o(e.target.value),className:`mt-1`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`shared-currency`,children:`Currency`}),(0,U.jsx)(Tv,{id:`shared-currency`,maxLength:3,value:s,onChange:e=>c(e.target.value),className:`mt-1`})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`shared-duration`,children:`Duration (minutes)`}),(0,U.jsx)(Tv,{id:`shared-duration`,inputMode:`numeric`,value:l,onCh
13ange:e=>u(e.target.value),className:`mt-1`})]}),p&&(0,U.jsx)(`p`,{role:`alert`,className:`text-sm text-red-400`,children:p})]}),(0,U.jsxs)(Wf,{children:[(0,U.jsx)(I,{variant:`outline`,className:`border-border bg-transparent`,onClick:t,children:`Cancel`}),(0,U.jsx)(I,{onClick:async()=>{m(null);let e=Math.round(Number(a)*100);if(r===`priced`&&!(e>0)){m(`Enter a price above zero, or choose another price option.`);return}let t=l?Number(l):null;if(t!==null&&(!Number.isInteger(t)||t<=0)){m(`Duration must be a whole number of minutes.`);return}f(!0);try{await n({price_status:r,price_cents:r===`priced`?e:0,currency:s.trim().toUpperCase().slice(0,3),...t===null?{}:{duration_minutes:t}})}catch(e){m(e instanceof Error?e.message:`Could not save.`)}finally{f(!1)}},disabled:d,className:`bg-gold text-black hover:bg-gold/90`,children:d?`Savingâ¦`:`Save`})]})]})})}function CO({initial:e,clinicId:t,onClose:n,onSave:r,requireComplete:i=!0,savingLabel:a}){let o=D_,[s,c]=(0,H.useState)(e?.name??``),[l,u]=(0,H.useState)(e?.category??``),{data:d}=Ue({queryKey:[`treatment-categories`],queryFn:async()=>{let{data:e,error:t}=await N.from(`treatment_categories`).select(`key,label,sort_order`).order(`sort_order`,{ascending:!0});if(t)throw t;return e},staleTime:300*1e3}),[f,p]=(0,H.useState)(e?.description??``),[m,h]=(0,H.useState)(String(e?.duration_minutes??30)),[g,_]=(0,H.useState)(e?(e.price_cents/100).toFixed(2):`0.00`),[v,y]=(0,H.useState)(e?.price_status??(e&&e.price_cents>0?`priced`:`unknown`)),[b,x]=(0,H.useState)(e?.currency??`USD`),[S,C]=(0,H.useState)(e?.active??!0),[w,T]=(0,H.useState)(e?.image_url??void 0),[E,D]=(0,H.useState)(e?.requires_verification??!1),[O,k]=(0,H.useState)(e?.ai_notes??``),[A,ee]=(0,H.useState)(e?.expected_results??``),[te,ne]=(0,H.useState)(e?.recovery_time??``),[re,j]=(0,H.useState)(e?.contraindications??``),[M,ie]=(0,H.useState)(e?.before_after_guidance??``),[ae,oe]=(0,H.useState)(Array.isArray(e?.faqs)?e.faqs:[]),[se,ce]=(0,H.useState)((e?.sim_effects??[]).join(` 14`)),[le,ue]=(0,H.useState)((e?.sim_avoid??[]).join(` 15`)),[de,fe]=(0,H.useState)((e?.sim_areas_modify??[]).join(` 16`)),[pe,me]=(0,H.useState)((e?.sim_areas_preserve??[]).join(` 17`)),[P,he]=(0,H.useState)(e?.sim_strength??`moderate`),[ge,_e]=(0,H.useState)(e?.sim_naturalness??`natural`),[ve,F]=(0,H.useState)(e?.sim_recovery_stage??`healed`),[ye,be]=(0,H.useState)(e?.sim_color_changes??``),[xe,Se]=(0,H.useState)(e?.sim_texture_changes??``),[Ce,we]=(0,H.useState)(e?.sim_lighting_notes??``),[Te,Ee]=(0,H.useState)(e?.sim_identity_lock??``),De=(0,H.useMemo)(()=>e?.photo_config&&typeof e.photo_config==`object`&&!Array.isArray(e.photo_config)?e.photo_config:{},[e?.photo_config]),[Oe,ke]=(0,H.useState)(()=>gO(e?.photo_config)),Ae=(0,H.useMemo)(()=>{if(!Oe)return null;let e={...De};return Oe===`none`?(delete e.capture_zone,{...e,photo_required:!1}):{...e,capture_zone:Oe,photo_required:!0}},[Oe,De]),[je,Me]=(0,H.useState)(`basics`),[Ne,Pe]=(0,H.useState)(!1),Fe=(0,H.useRef)(!1),[Ie,Le]=(0,H.useState)(!1),Re=E_,ze=k_,Be=A_,He=j_,We=Ve(),[Ge,Ke]=(0,H.useState)(e?.sim_pending_draft??null),[qe,Je]=(0,H.useState)(e?.sim_flag_note??null),[Ye,Xe]=(0,H.useState)(e?.sim_flagged_at??null),[Ze,$e]=(0,H.useState)(!1),[et,tt]=(0,H.useState)(!1),[nt,rt]=(0,H.useState)([]),[it,at]=(0,H.useState)(new Set),[ot,st]=(0,H.useState)(!1),ct=lO({name:s,category:l,duration_minutes:m,price_cents:g,price_status:v,description:f,photo_config:Ae,expected_results:A,recovery_time:te,contraindications:re,ai_notes:O,before_after_guidance:M,faqs:ae}),lt=e=>ot&&ct.includes(e),ut=[[`Description`,f,RD.description,`basics`],[`AI recommendation notes`,O,RD.ai_notes,`clinical`],[`Expected results`,A,RD.expected_results,`clinical`],[`Recovery time`,te,RD.recovery_time,`clinical`],[`Contraindications`,re,RD.contraindications,`clinical`],[`Before/After guidance`,M,RD.before_after_guidance,`clinical`]].find(([,e,t])=>String(e).length>Number(t)),dt=e=>{at(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})};async function ft(){if(!s.trim()){Z.error(`Add a treatment name first.`);return}let e=[];
17if(f.trim()||e.push(`description`),A.trim()||e.push(`expected_results`),te.trim()||e.push(`recovery_time`),re.trim()||e.push(`contraindications`),O.trim()||e.push(`ai_notes`),M.trim()||e.push(`before_after_guidance`),ae.filter(e=>e.question.trim()&&e.answer.trim()).length===0&&e.push(`faqs`),e.length===0){Z.success(`Every detail is already filled in.`);return}try{tt(!0),rt([]);let t=await o({data:{name:s.trim(),category:l.trim()||null,description:f.trim()||null,fields:e}}),n=t.accepted??{},r=[],i=(e,t,i,a)=>{let o=n[e];typeof o==`string`&&o.trim()&&!t.trim()&&(i(o.trim()),at(t=>new Set(t).add(e)),r.push(a))};i(`description`,f,p,`description`),i(`expected_results`,A,ee,`expected results`),i(`recovery_time`,te,ne,`recovery`),i(`contraindications`,re,j,`contraindications`),i(`ai_notes`,O,k,`recommendation notes`),i(`before_after_guidance`,M,ie,`photo guidance`);let a=n.faqs;if(Array.isArray(a)&&ae.filter(e=>e.question.trim()&&e.answer.trim()).length===0){let e=a.filter(e=>e&&typeof e==`object`&&typeof e.question==`string`&&typeof e.answer==`string`).map(e=>({question:e.question.trim(),answer:e.answer.trim()})).filter(e=>e.question&&e.answer);e.length&&(oe(e),at(e=>new Set(e).add(`faqs`)),r.push(`FAQ`))}let c={missing:`nothing safe could be written`,wrong_type:`the answer came back in the wrong shape`,too_long:`the wording was too long`,too_short:`the wording was too short`,filler:`the wording was too vague`,prohibited_claim:`the wording made a claim we don't allow`,irrelevant:`the wording wasn't specific to this treatment`,malformed_faq:`the questions and answers came back incomplete`};rt((t.failures??[]).map(e=>`${e.field.replace(/_/g,` `)} â ${c[e.reason]??`it needed changing`}`)),r.length?Z.success(`Drafted ${r.join(`, `)}. Review the wording, then save.`):Z.warning(`Nothing could be drafted safely â please write these details yourself.`)}catch(e){Z.error(e instanceof Error?e.message:`Couldn't generate details`)}finally{tt(!1)}}async function pt(){await We.invalidateQueries({queryKey:[`treatments`]})}async function mt(t){if(e)try{$e(!0);let n=t?{sim_effects:_t(se).length?_t(se):null,sim_avoid:_t(le).length?_t(le):null,sim_areas_modify:_t(de).length?_t(de):null,sim_areas_preserve:_t(pe).length?_t(pe):null,sim_strength:P||null,sim_naturalness:ge||null,sim_recovery_stage:ve||null,sim_color_changes:ye.trim()||null,sim_texture_changes:xe.trim()||null,sim_identity_lock:Te.trim()||null}:void 0;await ze({data:{id:e.id,patch:n}}),Ke(null),Je(null),Xe(null),Z.success(`AI guidance approved and live.`),await pt()}catch(e){Z.error(e instanceof Error?e.message:`Approval failed`)}finally{$e(!1)}}async function ht(){if(e)try{$e(!0),await Be({data:{id:e.id}}),Ke(null),Z.success(`Pending AI draft discarded.`),await pt()}catch(e){Z.error(e instanceof Error?e.message:`Discard failed`)}finally{$e(!1)}}async function gt(){if(e)try{$e(!0);let t=(await He({data:{id:e.id}})).sim_pending_draft;Ke(t??null),Z.success(`Fresh AI draft generated. Review and approve.`),await pt()}catch(e){Z.error(e instanceof Error?e.message:`Regenerate failed`)}finally{$e(!1)}}let _t=e=>e.split(` 18`).map(e=>e.trim()).filter(Boolean).slice(0,12),vt=!se.trim()||!de.trim()||!pe.trim();async function yt(){if(!s.trim()){Z.error(`Add a treatment name first.`);return}try{Le(!0);let e=await Re({data:{name:s.trim(),category:l.trim()||null,description:f.trim()||null,expected_results:A.trim()||null}});ce(e.sim_effects.join(` 19`)),ue((e.sim_avoid??[]).join(` 20`)),fe(e.sim_areas_modify.join(` 21`)),me(e.sim_areas_preserve.join(` 22`)),he(e.sim_strength),_e(e.sim_naturalness),F(e.sim_recovery_stage),e.sim_color_changes&&be(e.sim_color_changes),e.sim_texture_changes&&Se(e.sim_texture_changes),e.sim_identity_lock&&Ee(e.sim_identity_lock),Z.success(`AI guidance drafted. Review and save.`),Me(`simulation`)}catch(e){Z.error(e instanceof Error?e.message:`Couldn't draft AI guidance`)}finally{Le(!1)}}return(0,U.jsx)(Rf,{open:!0,onOpenChange:e=>!e&&!Ne&&n(),children:(0,U.jsxs)(Hf,{className:`flex max-h-[92vh] w-[calc(100%-1.5rem)] max-w-4xl flex-col gap-0 overflow-hidden p-0`,children:[(0,U.jsxs)(Uf,{className:`shrink-0 border-b border-border px-5 py-5 pr-12 sm:px-6`,children:[(0,U.jsx)(Gf,{children:e?`Edit treatment`:`New treatment`}),(0,U.jsx)(Kf,{children:`Available to your clinic's consultations, simulations, and AI recommendations.`})]}),(0,U.jsx)(_O,{onGenerate:ft,generating:et,disabled:!s.trim(),notes:nt}),(0,U.jsx)(`div`,{className:`grid shrink-0 grid-cols-3 border-b border-border bg-muted/20 px-3 sm:px-6`,children:[`basics`,`clinical`,`simulation`].map(e=>{let t=e===`simulation`?0:ct.filter(t=>rO[t]===e).length;return(0,U.jsxs)(`button`,{onClick:()=>Me(e),className:`flex min-w-0 items-center justify-center gap-2 border-b-2 px-2 py-3 text-xs font-medium ${je===e?`border-gold text-gold`:`border-transparent text-muted-foreground hover:text-white`}`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:e===`basics`?`1. Basics`:e===`clinical`?`2. Clinical details`:`3. AI simulation`}),i&&t>0&&(0,U.jsx)(`span`,{title:`${t} required field${t===1?``:`s`} still missing`,className:`rounded-full bg-amber-500/20 px-1.5 py-0.5 text-[9px] text-amber-300`,children:t})]},e)})}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-5 sm:px-6`,children:[je===`basics`&&(0,U.jsxs)(`div`,{className:`grid gap-7`,children:[(0,U.jsxs)(`section`,{className:`grid gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Treatment details`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The essential information patients will see.`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-name`,field:`name`,missing:lt(`name`),generated:it.has(`name`),children:`N
22ame`}),(0,U.jsx)(Tv,{id:`tx-name`,value:s,onChange:e=>{c(e.target.value),dt(`name`)},maxLength:200})]}),(0,U.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-category`,field:`category`,missing:lt(`category`),generated:it.has(`category`),children:`Category`}),(0,U.jsxs)(pC,{value:l||void 0,onValueChange:e=>{u(e),dt(`category`)},children:[(0,U.jsx)(hC,{id:`tx-category`,className:`bg-black`,children:(0,U.jsx)(mC,{placeholder:`Select a category`})}),(0,U.jsx)(vC,{children:(d??[]).map(e=>(0,U.jsx)(bC,{value:e.key,children:e.label},e.key))})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-duration`,field:`duration_minutes`,missing:lt(`duration_minutes`),generated:it.has(`duration_minutes`),children:`Duration (minutes)`}),(0,U.jsx)(Tv,{id:`tx-duration`,type:`number`,min:0,value:m,onChange:e=>{h(e.target.value),dt(`duration_minutes`)}})]})]})]}),(0,U.jsxs)(`section`,{className:`grid gap-4 border-t border-border pt-6`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Price and patient description`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Pricing and the summary used across consultations.`})]}),(0,U.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,U.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,U.jsx)(vO,{htmlFor:`tx-price`,field:`price_cents`,missing:lt(`price_cents`),generated:it.has(`price_cents`),children:`Price`}),(0,U.jsx)(Tv,{id:`tx-price`,type:`number`,step:`0.01`,min:0,value:g,disabled:v!==`priced`,onChange:e=>{_(e.target.value),dt(`price_cents`)}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-currency`,children:`Currency`}),(0,U.jsx)(Tv,{id:`tx-currency`,value:b,onChange:e=>x(e.target.value.toUpperCase()),maxLength:3})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-price-status`,children:`Price status`}),(0,U.jsxs)(pC,{value:v,onValueChange:e=>y(e),children:[(0,U.jsx)(hC,{id:`tx-price-status`,children:(0,U.jsx)(mC,{})}),(0,U.jsxs)(vC,{children:[(0,U.jsx)(bC,{value:`unknown`,children:`Price unavailable`}),(0,U.jsx)(bC,{value:`priced`,children:`Catalogue price`}),(0,U.jsx)(bC,{value:`free`,children:`Free`})]})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-description`,field:`description`,missing:lt(`description`),generated:it.has(`description`),children:`Description`}),(0,U.jsx)(OT,{id:`tx-description`,value:f,onChange:e=>{p(e.target.value),dt(`description`)},rows:3,placeholder:`Short description shown to patients and the AI recommender.`}),(0,U.jsx)(yO,{value:f,limit:RD.description})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-photo`,field:`photo_setting`,missing:lt(`photo_setting`),generated:it.has(`photo_setting`),children:`Photos to ask the client for`}),(0,U.jsxs)(pC,{value:Oe||void 0,onValueChange:e=>{ke(e),dt(`photo_setting`)},children:[(0,U.jsx)(hC,{id:`tx-photo`,className:`bg-black`,children:(0,U.jsx)(mC,{placeholder:`Choose what the client photographs`})}),(0,U.jsxs)(vC,{children:[(0,U.jsx)(bC,{value:`none`,children:`No photos needed`}),iD.map(e=>(0,U.jsx)(bC,{value:e,children:hO[e]},e))]})]}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Without photos the client cannot see a before/after preview for this treatment. Choose âNo photos neededâ for oral, IV, dental and wellness treatments.`})]})]}),(0,U.jsxs)(`section`,{className:`grid gap-4 border-t border-border pt-6`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Media and availability`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Optional imagery and patient visibility.`})]}),(0,U.jsx)(NT,{id:`tx-image`,label:`Treatment image`,value:w,onChange:T,clinicId:t,folder:`treatments`,accept:[`image/png`,`image/jpeg`,`image/webp`],maxBytes:3*1024*1024,recommended:`800Ã600, JPG/PNG`}),e?(0,U.jsx)(JD,{treatmentId:e.id,clinicId:t}):(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Save this treatment to add a photo gallery.`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(Gv,{id:`tx-active`,checked:S,onCheckedChange:C}),(0,U.jsx)(jv,{htmlFor:`tx-active`,className:`text-sm`,children:`Active â visible to patients and AI`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(Gv,{id:`tx-req-verify`,checked:E,onCheckedChange:D}),(0,U.jsx)(jv,{htmlFor:`tx-req-verify`,className:`text-sm`,children:`Requires surgical verification`})]}),E&&(0,U.jsx)(`p`,{className:`rounded-md border border-gold/40 bg-gold/5 p-3 text-xs text-gold`,children:`This treatment will only be visible to patients after your clinic has been verified by a Super Admin.`}),e?.requires_verification&&!E&&(0,U.jsx)(`p`,{className:`rounded-md border border-gold/40 bg-gold/5 p-3 text-xs text-gold`,children:`Turning this off will make the treatment visible to patients without Super Admin verification.`})]})]}),je===`clinical`&&(0,U.jsxs)(`div`,{className:`grid gap-7`,children:[(0,U.jsxs)(`section`,{className:`grid gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Patient-facing guidance`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Ground recommendations in this treatmentâs expected use and outcomes.`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-ai-notes`,field:`ai_notes`,missing:lt(`ai_notes`),generated:it.has(`ai_notes`),children:`AI recommendation notes`}),(0,U.jsx)(OT,{id:`tx-ai-notes`,rows:3,value:O,onChange:e=>{k(e.target.value),dt(`ai_notes`)},placeholder:`Clinician guidance for when this treatment fits. The AI reads this when recommending.`}),(0,U.jsx)(yO,{value:O,limit:RD.ai_notes})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-expected`,field:`expected_results`,missing:lt(`expected_results`),generated:it.has(`expected_results`),children:`Expected results`}),(0,U.jsx)(OT,{id:`tx-expected`,rows:2,value:A,onChange:e=>{ee(e.target.value),dt(`expected_results`)},placeholder:`What patients typically see, and over what timeline.`}),(0,U.jsx)(yO,{value:A,limit:RD.expected_results})]})]}),(0,U.jsxs)(`section`,{className:`grid gap-4 border-t border-border pt-6`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Safety, recovery and photos`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Information used to set expectations and screen recommendations.`})]}),(0,U.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-recovery`,field:`recovery_time`,missing:lt(`recovery_time`),generated:it.has(`recovery_time`),children:`Recovery time`}),(0,U.jsx)(Tv,{id:`tx-recovery`,value:te,onChange:e=>{ne(e.target.value),dt(`recovery_time`)},placeholder:`e.g. 24-48h redness`}),(0,U.jsx)(yO,{value:te,limit:RD.recovery_time})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-ba`,field:`before_after_guidance`,missing:lt(`before_after_guidance`),generated:it.has(`before_after_guidance`),children:`Before/After guidance`}),(0,U.jsx)(Tv,{id:`tx-ba`,value:M,onChange:e=>{ie(e.target.value),dt(`before_after_guidance`)},placeholder:`Shown next to previews.`}),(0,U.jsx)(yO,{value:M,limit:RD.before_after_guidance})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{htmlFor:`tx-ci`,field:`contraindications`,missing:lt(`contraindications`),generated:it.has(`contraindications`),children:`Contraindications`}),(0,U.jsx)(OT,{id:`tx-ci`,rows:2,value:re,onChange:e=>{j(e.target.value),dt(`contraindications`)},placeholder:`Conditions that disqualify a patient â the AI uses this to avoid unsafe recommendations.`}),(0,U.jsx)(yO,{value:re,limit:RD.contraindications})]})]}),(0,U.jsxs)(`section`,{className:`grid gap-4 border-t border-border pt-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(vO,{field:`faqs`,missing:lt(`faqs`),generated:it.has(`faqs`),children:`Patient FAQ`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Shown on the treatment page and used by the AI coach.`})]}),(0,U.jsx)(I,{type:`button`,variant:`outline`,size:`sm`,disabled:ae.length>=20,onClick:()=>{oe(e=>[...e,{question:``,answer:``}]),dt(`faqs`)},children:`Add question`})]}),ae.length===0?(0,U.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`No questions yet.`}):(0,U.jsx)(`div`,{className:`mt-3 space-y-3`,children:ae.map((e,t)=>(0,U.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border/60 p-3`,children:[(0,U.jsx)(Tv,{"aria-label":`FAQ question ${t+1}`,value:e.question,maxLength:300,placeholder:`Question`,onChange:e=>{oe(n=>n.map((n,r)=>r===t?{...n,question:e.target.value}:n)),dt(`faqs`)}}),(0,U.jsx)(OT,{"aria-label":`FAQ answer ${t+1}`,rows:2,maxLength:2e3,value:e.answer,placeholder:`Answer`,onChange:e=>{oe(n=>n.map((n,r)=>r===t?{...n,answer:e.target.value}:n)),dt(`faqs`)}}),(0,U.jsx)(I,{type:`button`,variant:`ghost`,size:`sm`,className:`text-xs text-muted-foreground hover:text-white`,onClick:()=>{oe(e=>
22e.filter((e,n)=>n!==t)),dt(`faqs`)},children:`Remove`})]},t))})]})]}),je===`simulation`&&(0,U.jsxs)(`div`,{className:`grid gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border border-border/60 bg-black/30 p-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground sm:max-w-md`,children:`These fields build the prompt sent to the AI simulator. Filling them in is what makes previews look specific to your treatment â leave them blank and the simulator will do its best with just the name and description.`}),(0,U.jsx)(I,{type:`button`,variant:`outline`,size:`sm`,disabled:Ie||!s.trim(),onClick:yt,children:Ie?`Draftingâ¦`:`Generate AI guidance`})]}),vt&&(0,U.jsx)(`p`,{className:`rounded-md border border-gold/40 bg-gold/5 p-3 text-xs text-gold`,children:`Effects, areas to modify, and areas to preserve are strongly recommended. Without them, AI previews for this treatment may look generic. Use "Generate AI guidance" for a starting draft.`}),Ye&&(0,U.jsxs)(`div`,{className:`rounded-md border border-red-500/40 bg-red-500/5 p-3 text-xs text-red-200`,children:[(0,U.jsx)(`p`,{className:`font-semibold uppercase tracking-[0.2em] text-red-300`,children:`Flagged by platform oversight`}),qe&&(0,U.jsx)(`p`,{className:`mt-1 text-red-100/90`,children:qe}),(0,U.jsx)(`p`,{className:`mt-1 text-red-200/70`,children:`Please review the current AI guidance below and update or regenerate it.`})]}),Ge&&e&&(0,U.jsxs)(`div`,{className:`rounded-md border border-blue-500/40 bg-blue-500/5 p-3 text-xs text-blue-100`,children:[(0,U.jsx)(`p`,{className:`font-semibold uppercase tracking-[0.2em] text-blue-300`,children:`AI draft pending your review`}),(0,U.jsx)(`p`,{className:`mt-1 text-blue-100/80`,children:`Surgical treatments require Clinic Owner review before AI guidance goes live. Approve to publish, edit the fields below then approve, regenerate, or discard.`}),(0,U.jsxs)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`mb-1 text-[10px] uppercase tracking-[0.2em] text-blue-200/70`,children:`Draft effects`}),(0,U.jsx)(`ul`,{className:`list-disc pl-4 text-blue-50/90`,children:(Ge.sim_effects??[]).map((e,t)=>(0,U.jsx)(`li`,{children:e},t))})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`mb-1 text-[10px] uppercase tracking-[0.2em] text-blue-200/70`,children:`Current live effects`}),e.sim_effects?.length?(0,U.jsx)(`ul`,{className:`list-disc pl-4 text-blue-50/70`,children:e.sim_effects.map((e,t)=>(0,U.jsx)(`li`,{children:e},t))}):(0,U.jsx)(`p`,{className:`text-blue-100/50`,children:`No live guidance yet â simulator uses fallback.`})]})]}),(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,U.jsx)(I,{type:`button`,size:`sm`,className:`bg-gold text-black hover:bg-gold/90`,disabled:Ze,onClick:()=>mt(!1),children:`Approve draft`}),(0,U.jsx)(I,{type:`button`,size:`sm`,variant:`outline`,disabled:Ze,onClick:()=>{ce((Ge.sim_effects??[]).join(` 23`)),ue((Ge.sim_avoid??[]).join(` 24`)),fe((Ge.sim_areas_modify??[]).join(` 25`)),me((Ge.sim_areas_preserve??[]).join(` 26`)),Ge.sim_strength&&he(Ge.sim_strength),Ge.sim_naturalness&&_e(Ge.sim_naturalness),Ge.sim_recovery_stage&&F(Ge.sim_recovery_stage),Ge.sim_color_changes&&be(Ge.sim_color_changes),Ge.sim_texture_changes&&Se(Ge.sim_texture_changes),Ge.sim_identity_lock&&Ee(Ge.sim_identity_lock),Z.info(`Edit the fields, then click 'Edit & approve'.`)},children:`Load into editor`}),(0,U.jsx)(I,{type:`button`,size:`sm`,variant:`outline`,disabled:Ze,onClick:()=>mt(!0),children:`Edit & approve`}),(0,U.jsx)(I,{type:`button`,size:`sm`,variant:`outline`,disabled:Ze,onClick:gt,children:`Regenerate`}),(0,U.jsx)(I,{type:`button`,size:`sm`,variant:`outline`,className:`text-red-300`,disabled:Ze,onClick:ht,children:`Discard`})]})]}),(0,U.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-effects`,className:`text-xs`,children:`Visible effects (one per line)`}),(0,U.jsx)(OT,{id:`tx-sim-effects`,rows:5,value:se,onChange:e=>ce(e.target.value),placeholder:`softer forehead lines 27relaxed 11s between brows`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-avoid`,className:`text-xs`,children:`Things to avoid (one per line)`}),(0,U.jsx)(OT,{id:`tx-sim-avoid`,rows:5,value:le,onChange:e=>ue(e.target.value),placeholder:`frozen expression
28changing face shape`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-mod`,className:`text-xs`,children:`Areas to modify (one per line)`}),(0,U.jsx)(OT,{id:`tx-sim-mod`,rows:3,value:de,onChange:e=>fe(e.target.value),placeholder:`forehead 29glabella`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-pre`,className:`text-xs`,children:`Areas to preserve unchanged`}),(0,U.jsx)(OT,{id:`tx-sim-pre`,rows:3,value:pe,onChange:e=>me(e.target.value),placeholder:`eyebrows 30eye shape 31hairline`})]})]}),(0,U.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-strength`,className:`text-xs`,children:`Strength`}),(0,U.jsxs)(`select`,{id:`tx-sim-strength`,value:P,onChange:e=>he(e.target.value),className:`h-9 w-full rounded-md border border-border bg-black px-2 text-sm`,children:[(0,U.jsx)(`option`,{value:`subtle`,children:`Subtle`}),(0,U.jsx)(`option`,{value:`moderate`,children:`Moderate`}),(0,U.jsx)(`option`,{value:`strong`,children:`Strong`})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-nat`,className:`text-xs`,children:`Naturalness`}),(0,U.jsxs)(`select`,{id:`tx-sim-nat`,value:ge,onChange:e=>_e(e.target.value),className:`h-9 w-full rounded-md border border-border bg-black px-2 text-sm`,children:[(0,U.jsx)(`option`,{value:`natural`,children:`Natural`}),(0,U.jsx)(`option`,{value:`clinical`,children:`Clinical`}),(0,U.jsx)(`option`,{value:`dramatic`,children:`Dramatic`})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-rec`,className:`text-xs`,children:`Recovery stage`}),(0,U.jsxs)(`select`,{id:`tx-sim-rec`,value:ve,onChange:e=>F(e.target.value),className:`h-9 w-full rounded-md border border-border bg-black px-2 text-sm`,children:[(0,U.jsx)(`option`,{value:`immediate`,children:`Immediate`}),(0,U.jsx)(`option`,{value:`healed`,children:`Healed`}),(0,U.jsx)(`option`,{value:`course-complete`,children:`Course complete`})]})]})]}),(0,U.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-colour`,className:`text-xs`,children:`Colour change rules`}),(0,U.jsx)(OT,{id:`tx-sim-colour`,rows:2,value:ye,onChange:e=>be(e.target.value),placeholder:`fade brown spots; do not lighten overall skin tone`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-tex`,className:`text-xs`,children:`Texture change rules`}),(0,U.jsx)(OT,{id:`tx-sim-tex`,rows:2,value:xe,onChange:e=>Se(e.target.value),placeholder:`smooth crepiness around eyes; keep natural pore detail`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-light`,className:`text-xs`,children:`Lighting notes`}),(0,U.jsx)(Tv,{id:`tx-sim-light`,value:Ce,onChange:e=>we(e.target.value),placeholder:`match input lighting; no studio glow`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(jv,{htmlFor:`tx-sim-id`,className:`text-xs`,children:`Extra identity lock`}),(0,U.jsx)(Tv,{id:`tx-sim-id`,value:Te,onChange:e=>Ee(e.target.value),placeholder:`preserve moles and freckles exactly`})]})]})]})]}),i&&ct.length>0&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{st(!0),Me(rO[ct[0]]??`basics`)},className:`mx-5 mb-3 flex shrink-0 items-center justify-between gap-3 rounded-md border border-amber-500/40 bg-amber-500/5 px-3 py-2 text-left text-xs text-amber-200 sm:mx-6`,children:[(0,U.jsxs)(`span`,{children:[ct.length,` required detail`,ct.length===1?``:`s`,` remaining`]}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`Review `,(0,U.jsx)(Qe,{className:`h-3.5 w-3.5`})]})]}),(0,U.jsxs)(Wf,{className:`shrink-0 border-t border-border bg-background px-5 py-4 sm:px-6`,children:[(0,U.jsx)(I,{variant:`outline`,onClick:n,disabled:Ne,children:`Cancel`}),(0,U.jsx)(`span`,{onPointerDownCapture:()=>{i&&ct.length>0&&(st(!0),Me(rO[ct[0]]??`basics`))},children:(0,U.jsx)(I,{className:`w-full bg-gold text-black hover:bg-gold/90 sm:w-auto`,disabled:Ne||!s.trim()||i&&ct.length>0,onClick:async()=>{try{if(ut){st(!0),Me(ut[3]===`basics`?`basics`:`clinical`),Z.error(`${ut[0]} must be ${ut[2]} characters or fewer`);return}if(Fe.current)return;Fe.current=!0,Pe(!0);let e=_t(se),t=_t(le),n=_t(de),i=_t(pe);await r({name:s.trim(),category:l.trim()?l.trim():null,description:f.trim()?f.trim():null,duration_minutes:Number.isFinite(Number(m))?Number(m):30,price_cents:v===`free`?0:Math.max(0,Math.round(Number(g||0)*100)),price_status:v,currency:b.trim()||`USD`,active:S,image_url:w??null,requires_verification:E,sim_effects:e.length?e:null,sim_avoid:t.length?t:null,sim_areas_modify:n.length?n:null,
31sim_areas_preserve:i.length?i:null,sim_strength:P||null,sim_naturalness:ge||null,sim_recovery_stage:ve||null,sim_color_changes:ye.trim()||null,sim_texture_changes:xe.trim()||null,sim_lighting_notes:Ce.trim()||null,sim_identity_lock:Te.trim()||null,ai_notes:O.trim()||null,expected_results:A.trim()||null,recovery_time:te.trim()||null,contraindications:re.trim()||null,before_after_guidance:M.trim()||null,photo_config:Ae,faqs:ae.map(e=>({question:e.question.trim(),answer:e.answer.trim()})).filter(e=>e.question&&e.answer)})}catch(e){Z.error(e instanceof Error?e.message:`Save failed`)}finally{Fe.current=!1,Pe(!1)}},children:Ne?a??`Savingâ¦`:e?`Save changes`:`Create treatment`})})]})]})})}var wO=q(`/_authenticated/_clinic-admin/dashboard/vip-benefits`)({head:()=>({meta:[{title:`VIP member benefits · ${X.name}`},{name:`description`,content:`Manage your clinic's participation in the VIP 15% retail discount and redeem member codes at the counter.`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.vip-benefits-C9Uk8fTL.js`),__vite__mapDeps([255,3,47,22,23,10,9,20,21,49,8,149,71,45,32,48,44,43,212,1,2,4,5])),`component`)}),TO=q(`/_authenticated/_seo/seo_/$routeId`)({head:()=>({meta:[{title:`Edit page SEO · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_seo.seo_._routeId-Zz8A3Sf9.js`),__vite__mapDeps([256,3,147,31,32,9,33,10,73,36,37,38,39,71,45,48,44,43,47,22,23,20,21,14,89,257,8,258,187,111,54,188,2,4,130,184])),`component`)}),EO=q(`/_authenticated/_super-admin/super-admin/`)({head:()=>({meta:[{title:`Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.index-CCYbVXVz.js`),__vite__mapDeps([259,3,47,22,23,10,9,20,21,12,13,14,44,260,261,262,263,264,265,266,267,126,71,45,32,48,43,74,1,2,4,5])),`component`)}),DO=q(`/_authenticated/_super-admin/super-admin/ai-guidance`)({head:()=>({meta:[{title:`AI guidance audit · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.ai-guidance-DZV_xUit.js`),__vite__mapDeps([268,3,47,22,23,10,9,20,21,8,140,66,18,123,187,111,54,43,44,71,45,32,48,72,73,31,33,36,37,38,39,7,1,2,4,5])),`component`)}),OO=q(`/_authenticated/_super-admin/super-admin/ai-providers`)({head:()=>({meta:[{title:`AI providers · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.ai-providers-CJHGVYFW.js`),__vite__mapDeps([269,47,3,22,23,10,9,12,13,14,149,8,200,123,187,111,54,43,44,253,48,71,45,32,1,2,4,5])),`component`)}),kO=q(`/_authenticated/_super-admin/super-admin/ai-router`)({head:()=>({meta:[{title:`AI router · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.ai-router-BN8kula7.js`),__vite__mapDeps([270,3,47,22,23,10,9,20,21,8,271,272,191,273,187,111,54,43,44,253,48,71,45,32,146,147,31,33,73,36,37,38,39,148,149,150,94,123,274,1,2,4,5])),`component`)}),AO=q(`/_authenticated/_super-admin/super-admin/ai-usage`)({head:()=>({meta:[{title:`AI usage · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.ai-usage-WCY2gB07.js`),__vite__mapDeps([275,3,22,20,21,23,10,9,187,111,8,54,43,44,71,45,32,48,74,1,2,4,5])),`component`)}),jO=q(`/_authenticated/_super-admin/super-admin/atlas-entitlement`)({head:()=>({meta:[{title:`Atlas entitlement · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.atlas-entitlement-DFVJ2LxY.js`),__vite__mapDeps([276,3,47,22,23,10,9,20,21,111,8,149,200,123,187,54,43,44,253,48,71,45,32,1,2,4,5,144])),`component`)}),MO=q(`/_authenticated/_super-admin/super-admin/catalog-audit`)({head:()=>({meta:[{title:`Catalog audit · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.catalog-audit-Dd1v38s5.js`),__vite__mapDeps([277,3,4,20,21,22,23,10,9,111,8,149,54,26,150,123,253,48,44,43,71,45,32,1,2,5])),`component`)}),NO=q(`/_authenticated/_super-admin/super-admin/clinical-approvals`)({head:()=>({meta:[{title:`Clinical approvals · ${X.name}`},{name:`description`,content:`Record and review clinician sign-off of Blueprint clinical content.`},{property:`og:title`,content:`Clinical approvals · ${X.name}`},{property:`og:description`,content:`Clinician sign-off records for Blueprint content.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),validateSearch:e=>e.filter===`pending`?{filter:`pending`}:{},component:J(()=>P(()=>import(`./_super-admin.super-admin.clinical-approvals-DNZzvUa6.js`),__vite__mapDeps([278,3,2,4,47,22,23,10,9,20,21,162,14,163,130,187,111,8,54,43,44,71,45,32,48,1,5])),`component`)}),PO=q(`/_authenticated/_super-admin/super-admin/clinics`)({head:()=>({meta:[{title:`Clinics · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.clinics-Bci5CStd.js`),__vite__mapDeps([279,3,122,31,32,9,33,10,39,87,88,16,8,43,44,34,35,36,37,38,40,41,42,47,22,23,20,21,12,13,14,58,280,71,45,48,1,2,4,5])),`component`)}),FO=q(`/_authenticated/_super-admin/super-admin/default-questions`)({head:()=>({meta:[{title:`Default Questions · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),validateSearch:e=>e.filter===`pending`?{filter:`pending`}:{},loader:()=>
31(ge(`platform`),null),component:J(()=>P(()=>import(`./_super-admin.super-admin.default-questions-fqek68V8.js`),__vite__mapDeps([281,3,122,31,32,9,33,10,39,87,88,16,8,43,44,47,22,23,20,21,162,14,163,148,149,66,130,161,12,13,55,248,111,249,191,140,65,71,45,48,187,54,5])),`component`)}),IO=q(`/_authenticated/_super-admin/super-admin/default-treatments`)({head:()=>({meta:[{title:`Default Treatments · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),loader:()=>(ge(`platform`),null),component:J(()=>P(()=>import(`./_super-admin.super-admin.default-treatments-DbErzIXx.js`),__vite__mapDeps([282,3,20,21,22,23,10,9,187,111,8,54,43,44,5])),`component`)}),LO=q(`/_authenticated/_super-admin/super-admin/early-access`)({head:()=>({meta:[{title:`Early access rules · ${X.name}`},{name:`description`,content:`Platform administration for VIP early-access release dates.`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.early-access-FzK6ZlpM.js`),__vite__mapDeps([283,3,47,22,23,10,9,20,21,123,8,187,111,54,43,44,71,45,32,48,211,1,2,4,5])),`component`)}),RO=q(`/_authenticated/_super-admin/super-admin/founding`)({head:()=>({meta:[{title:`Founding members · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.founding-936JT2cu.js`),__vite__mapDeps([284,3,47,22,23,10,9,20,21,187,111,8,54,43,44,71,45,32,48])),`component`)}),zO=q(`/_authenticated/_super-admin/super-admin/issues`)({component:J(()=>P(()=>import(`./_super-admin.super-admin.issues-BMZ2Qq1h.js`),__vite__mapDeps([285,10,3])),`component`)}),BO=q(`/_authenticated/_super-admin/super-admin/patients`)({head:()=>({meta:[{title:`Platform patients · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),beforeLoad:()=>{throw ge(`platform`),s({to:`/dashboard/clients`})},component:J(()=>P(()=>import(`./_super-admin.super-admin.patients-DJ7LAi8J.js`),[]),`component`)}),VO=q(`/_authenticated/_super-admin/super-admin/question-preview`)({head:()=>({meta:[{title:`Question Preview · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),loader:()=>(ge(`platform`),null),component:J(()=>P(()=>import(`./_super-admin.super-admin.question-preview-Vwa7PJ6j.js`),__vite__mapDeps([286,3,2,4,20,21,22,23,10,9,111,8,41,123,187,54,43,44,253,48,71,45,32,245,5,287,153])),`component`)}),HO=q(`/_authenticated/_super-admin/super-admin/report-prompts`)({head:()=>({meta:[{title:`Report prompts · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`},{name:`description`,content:`The exact instructions each MedSpa Blueprint report sends to its model, the shape of the answer, and the wording the app refuses to publish.`},{property:`og:title`,content:`Report prompts · MedSpa Blueprint`},{property:`og:description`,content:`Read the real wording behind every report: photo comparisons, monthly and annual summaries, and consultation reports.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.report-prompts-kWYihXig.js`),__vite__mapDeps([288,3,47,22,23,10,9,20,21,12,13,14,162,163,16,8,111,41,210,59,258,140,289,66,187,54,43,44,253,48,71,45,32,274,1,2,4,5,290])),`component`)}),UO=q(`/_authenticated/_super-admin/super-admin/seo`)({beforeLoad:()=>{throw s({to:`/seo`})},component:J(()=>P(()=>import(`./_super-admin.super-admin.seo-DJ7LAi8J.js`),[]),`component`)}),WO=q(`/_authenticated/_super-admin/super-admin/sim-prompts`)({head:()=>({meta:[{title:`Simulation prompts · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.sim-prompts-BGnES-5E.js`),__vite__mapDeps([291,3,47,22,23,10,9,20,21,191,8,140,273,7,187,111,54,43,44,253,48,71,45,32,1,2,4,5])),`component`)}),GO=()=>P(()=>import(`./_super-admin.super-admin.simulations-DcO_3KXq.js`),__vite__mapDeps([292,3,47,22,23,10,9,20,21,89,14,142,187,111,8,54,43,44,71,45,32,48,146,147,31,33,73,36,37,38,39,148,149,150,94,123,74,1,2,4,5])),KO=e=>typeof e==`string`&&e.length>0?e:void 0,qO=q(`/_authenticated/_super-admin/super-admin/simulations`)({validateSearch:e=>({search:KO(e.search),clinicId:KO(e.clinicId),treatmentId:KO(e.treatmentId),reviewStatus:KO(e.reviewStatus),status:KO(e.status),verdict:KO(e.verdict),from:KO(e.from),to:KO(e.to),sort:e.sort===`oldest`?`oldest`:void 0,page:Number(e.page)>1?Number(e.page):void 0}),head:()=>({meta:[{title:`Simulation gallery · Platform admin`},{name:`description`,content:`Browse every AI before/after simulation generated across clinics and flag results for quality review.`},{property:`og:title`,content:`Simulation gallery · Platform admin`},{property:`og:description`,content:`Platform-wide AI simulation gallery with quality review controls.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`}]}),component:J(GO,`component`)}),JO=q(`/_authenticated/_super-admin/super-admin/subscription-pricing`)({head:()=>({meta:[{title:`Subscription pricing · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.subscription-pricing-DPj_1wr3.js`),__vite__mapDeps([293,3,47,22,23,10,9,20,21,149,8,94,123,71,45,32,48,44,43,74,1,2,4,5])),`component`)}),YO=q(`/_authenticated/_super-admin/super-admin/subscriptions`)({head:()=>({meta:[{title:`Subscriptions · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.subscriptions-Cq8xetBy.js`),__vite__mapDeps([294,3,22,20,21,23,10,9,71,45,32,48,44,43,74,1,2,4,5])),`component`)}),XO=q(`/_authenticated/_super-admin/super-admin/system`)({head:()=>({meta:[{title:`System health · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.system-B0InAjc7.js`),__vite__mapDeps([295,20,21,3,22,23,10,9,71,45,32,48,44,43,74,1,2,4,5])),`component`)}),ZO=q(`/_authenticated/_super-admin/super-admin/users`)({head:()=>({meta:[{title:`Users · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.users-CrYmH8VY.js`),__vite__mapDeps([296,3,122,31,32,9,33,10,39,87,88,16,8,43,44,34,35,36,37,38,40,41,42,47,22,23,20,21,58,280,71,45,48,1,2,4,5])),`component`)}),QO=q(`/_authenticated/_super-admin/super-admin/waitlist`)({head:()=>({meta:[{title:`Waitlist · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.waitlist-C3SUU9Yx.js`),__vite__mapDeps([297,3,47,22,23,10,9,20,21,187,111,8,54,43,44,71,45,32,48,1,2,4,5])),`component`)}),$O=q(`/_authenticated/dashboard/account/`)({component:J(()=>P(()=>import(`./dashboard.account.index-UZ354iIa.js`),__vite__mapDeps([298,47,3,22,23,10,9,20,21,12,13,14,50,8,132,67,222,1,2,4,5])),`component`)}),ek=q(`/_authenticated/dashboard/account/preferences`)({component:J(()=>P(()=>import(`./dashboard.account.preferences-CHCyUSp1.js`),__vite__mapDeps([299,3,47,22,23,10,9,20,21,71,45,32,48,44,43,151,2,4,130,1,5])),`component`)}),tk=q(`/_authenticated/dashboard/account/profile`)({component:J(()=>P(()=>import(`./dashboard.account.profile-By11DV2-.js`),__vite__mapDeps([300,3,2,4,47,22,23,10,9,20,21,71,45,32,48,44,43,151,130,1,5])),`component`)}),nk=q(`/_authenticated/dashboard/account/security`)({component:J(()=>P(()=>import(`./dashboard.account.security-COUwH--r.js`),__vite__mapDeps([301,3,10,9,95,96,43,44,71,45,32,48])),`component`)}),rk=q(`/_authenticated/dashboard/annual-reports/`)({head:()=>({meta:[{title:`Annual Beauty Report · ${X.name}`},{name:`description`,content:`Your Annual Beauty Reports: measured yearly changes in Beauty Score, skin areas and Estimated Skin Age between qualifying assessments.`},{property:`og:title`,content:`Annual Beauty Report · ${X.name}`},{property:`og:description`,content:`Review measured yearly changes across qualifying skin assessments.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.annual-reports.index-BFta2ytO.js`),__vite__mapDeps([302,3,47,22,23,10,9,20,21,12,13,14,190,8,303,132,232,149,133,75,76,1,2,4,5,77,80,71,45,32,48,44,43,152,304])),`component`)}),ik=q(`/_authenticated/dashboard/annual-reports/$reportId`)({head:()=>({meta:[{title:`Annual Beauty Report · ${X.name}`},{name:`description`,content:`A single Annual Beauty Report: measured yearly comparisons between your qual
31ifying skin assessments.`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.annual-reports._reportId-tQ8cLDQI.js`),__vite__mapDeps([305,20,21,3,22,23,10,9,12,13,14,133,75,76,1,2,4,5,77,80,304,290])),`component`)}),ak=q(`/_authenticated/dashboard/consultations/`)({head:()=>({meta:[{title:`Your consultations · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.consultations.index-DrYz0-wC.js`),__vite__mapDeps([306,3,20,21,22,23,10,9,12,13,14,44,260,261,262,263,264,265,266,267,126,307,133,75,76,1,2,4,5,77,80,135,152])),`component`)}),ok=q(`/_authenticated/dashboard/issues/`)({head:()=>({meta:[{title:`Issues · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.issues.index-CyMqalgZ.js`),__vite__mapDeps([308,20,21,3,22,23,10,9,12,13,14,191,8,309,310,2,4,130,1,5,194,253,48,44,43,71,45,32])),`component`)}),sk=q(`/_authenticated/dashboard/issues/$id`)({head:()=>({meta:[{title:`Issue · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.issues._id-CwD5AEds.js`),__vite__mapDeps([311,12,3,13,10,9,14,257,8,312,47,22,23,20,21,94,313,310,2,4,130,1,5,194,253,48,44,43,71,45,32])),`component`)}),ck=q(`/_authenticated/dashboard/issues/new`)({head:()=>({meta:[{title:`Report an issue · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.issues.new-CCrRTasE.js`),__vite__mapDeps([314,3,2,4,47,22,23,10,9,12,13,14,89,257,8,94,313,7,310,130,1,5,194,71,45,32,48,44,43])),`component`)}),lk=q(`/_authenticated/dashboard/monthly-reports/`)({head:()=>({meta:[{title:`Monthly summaries â MedSpa Blueprint`},{name:`description`,content:`Generate and review your monthly skin progress summaries.`},{property:`og:title`,content:`Monthly summaries â MedSpa Blueprint`},{property:`og:description`,content:`Generate and review your monthly skin progress summaries.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.monthly-reports.index-DAqpBLK7.js`),__vite__mapDeps([315,47,3,22,23,10,9,20,21,12,13,14,190,8,303,132,149,316,133,75,76,1,2,4,5,77,80,71,45,32,48,44,43,317])),`component`)}),uk=q(`/_authenticated/dashboard/reports/`)({head:()=>({meta:[{title:`Photo comparisons â MedSpa Blueprint`},{name:`description`,content:`Compare treatment photos and review visible changes over time.`},{property:`og:title`,content:`Photo comparisons â MedSpa Blueprint`},{property:`og:description`,content:`Compare treatment photos and review visible changes over time.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.reports.index-B0iomxXj.js`),__vite__mapDeps([318,20,21,3,22,23,10,9,12,13,14,190,8,303,132,316,289,66,71,45,32,48,44,43,319,2,4,1,5])),`component`)}),dk=q(`/_authenticated/dashboard/reports/$reportId`)({head:()=>({meta:[{title:`Monthly progress report · ${X.name}`},{name:`description`,content:`A single monthly progress report: measured comparisons between your qualifying skin assessments.`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.reports._reportId-DQu3PHYT.js`),__vite__mapDeps([320,20,21,3,22,23,10,9,12,13,14,133,75,76,1,2,4,5,77,80,317,290])),`component`)}),fk=q(`/_authenticated/_clinic-admin/dashboard/analytics/`)({head:()=>({meta:[{title:`Analytics · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.analytics.index-CdxL-KpT.js`),__vite__mapDeps([321,3,47,22,23,10,9,20,21,12,13,14,133,75,76,1,2,4,5,77,80,253,48,44,43,71,45,32,124,322,323])),`component`)}),pk=q(`/_authenticated/_clinic-admin/dashboard/analytics/$reportId`)({head:()=>({meta:[{title:`Business report · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.analytics._reportId-CKcyNCxm.js`),__vite__mapDeps([324,20,21,3,22,23,10,9,12,13,14,215,91,92,93,133,75,76,1,2,4,5,77,80,253,48,44,43,124,322,323])),`component`)}),mk=q(`/_authenticated/_clinic-admin/dashboard/analytics/locations`)({head:()=>({meta:[{title:`Multi-location analytics · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.analytics.locations-BogJDIsV.js`),__vite__mapDeps([325,3,47,22,23,10,9,20,21,12,13,14,133,75,76,1,2,4,5,77,80,253,48,44,43,71,45,32,124,322])),`component`)}),hk=q(`/_authenticated/_clinic-admin/dashboard/blueprints/`)({head:()=>({meta:[{title:`Client Blueprints · Clinic dashboard`},{name:`description`,content:`Read-only Beauty Blueprints from consultations at your clinic.`},{property:`og:title`,content:`Client Blueprints · Clinic dashboard`},{property:`og:description`,content:`Read-only Beauty Blueprints from your clinic's consultations.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex, nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.blueprints.index-CixesaLx.js`),__vite__mapDeps([326,10,3,327,20,21,22,23,9,12,13,14,190,8,65,253,48,44,43])),`component`)}),gk=q(`/_authenticated/_clinic-admin/dashboard/blueprints/$id`)({head:()=>({meta:[{title:`Client Blueprint · Clinic dashboard`},{name:`description`,content:`Read-only view of a client's Beauty Blueprint.`},{property:`og:title`,content:`Client Blueprint · Clinic dashboard`},{property:`og:description`,content:`Read-only view of a client's Beauty Blueprint.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex, nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.blueprints._id-B5fUBZS2.js`),__vite__mapDeps([328,3,47,22,23,10,9,20,21,12,13,14,327,190,8,65,253,48,44,43,71,45,32])),`component`)}),_k=q(`/_authenticated/_clinic-admin/dashboard/clients/`)({head:()=>({meta:[{title:`Client consultations · Clinic dashboard`},{name:`description`,content:`Browse your clinic's client consultations, AI reports, skin scores and before/after visualizations.`},{property:`og:title`,content:`Client consultations · Clinic dashboard`},{property:`og:description`,content:`Client consultation history for your clinic.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.clients.index-qdQHkkmA.js`),__vite__mapDeps([329,3,20,21,22,23,10,9,12,13,14,133,75,76,1,2,4,5,77,80,253,48,44,43,71,45,32,74,330])),`component`)}),vk=q(`/_authenticated/_clinic-admin/dashboard/clients/$consultationId`)({head:()=>({meta:[{title:`Client consultation detail · Clinic dashboard`},{name:`description`,content:`Client contact details, AI report, skin score, roadmap, before/after visualizations and staff notes.`},{property:`og:title`,content:`Client consultation detail`},{property:`og:description`,content:`Full consultation record for a client of your clinic.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.clients._consultationId-C5jgJDwf.js`),__vite__mapDeps([331,3,2,4,47,22,23,10,9,20,21,12,13,14,133,75,76,1,5,77,80,142,226,131,125,8,94,126,71,45,32,48,44,43,79,132,16,111,7,134,123,135,136,253,74,330,78,319])),`component`)}),yk=[`new`,`contacted`,`consultation_booked`,`treatment_booked`,`won`,`lost`],bk={new:`New`,contacted:`Contacted`,consultation_booked:`Consultation booked`,treatment_booked:`Treatment booked`,won:`Won`,lost:`Lost`};function xk(e){return e===`booked`?`consultation_booked`:yk.includes(e??``)?e:`new`}function Sk(e){return bk[xk(e)]}var Ck=q(`/_authenticated/_clinic-admin/dashboard/leads/$id`)({head:()=>({meta:[{title:`Lead detail · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_clinic-admin.dashboard.leads._id-C2Azt3DB.js`),__vite__mapDeps([332,3,47,22,23,10,9,20,21,12,13,14,149,8,42,210,59,94,218,128,225,1,2,4,5,226,131,125,76,126,71,45,32,48,44,43,79,132,16,111,7,133,75,77,80,134,123,135,136,198,130,194,330,241,242])),`component`),errorComponent:J(()=>P(()=>import(`./_clinic-admin.dashboard.leads._id-BLZf3tHn.js`),__vite__mapDeps([333,12,3,13,10,9,14])),`errorComponent`)}),wk=q(`/_authenticated/_super-admin/super-admin/blueprints/`)({head:()=>({meta:[{title:`Blueprints · Super Admin`},{name:`description`,content:`Read-only review of every Beauty Blueprint for support and quality.`},{property:`og:title`,content:`Blueprints · Super Admin`},{property:`og:description`,content:`Read-only Beauty Blueprint review.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex, nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.blueprints.index-DX0xWcBr.js`),__vite__mapDeps([334,10,3,327,20,21,22,23,9,12,13,14,190,8,65,253,48,44,43])),`component`)}),Tk=q(`/_authenticated/_super-admin/super-admin/blueprints/$id`)({head:()=>({meta:[{title:`Blueprint review · Super Admin`},{name:`description`,content:`Read-only review of a client's Beauty Blueprint.`},{property:`og:title`,content:`Blueprint review · Super Admin`},{property:`og:description`,content:`Read-only Beauty Blueprint review.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex, nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.blueprints._id-DHbQBdZt.js`),__vite__mapDeps([335,12,3,13,10,9,14])),`component`)}),Ek=q(`/_authenticated/_super-admin/super-admin/issues/`)({head:()=>({meta:[{title:`Issues · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.issues.index-CCvmSEum.js`),__vite__mapDeps([336,3,20,21,22,23,10,9,309,12,13,14,310,2,4,130,1,5,194,253,48,44,43])),`component`)}),Dk=q(`/_authenticated/_super-admin/super-admin/issues/$id`)({head:()=>({meta:[{title:`Issue · Super admin · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./_super-admin.super-admin.issues._id-Cs-8v9GW.js`),__vite__mapDeps([337,12,3,13,10,9,14,257,8,312,47,22,23,20,21,94,313,310,2,4,130,1,5,194,253,48,44,43,71,45,32])),`component`)}),Ok=q(`/_authenticated/_super-admin/super-admin/seo_/$routeId`)({beforeLoad:({params:e})=>{throw s({to:`/seo/$routeId`,params:{routeId:e.routeId}})},component:J(()=>P(()=>import(`./_super-admin.super-admin.seo_._routeId-DJ7LAi8J.js`),[]),`component`)}),kk=q(`/_authenticated/dashboard/consultations/$id/`)({head:()=>({meta:[{title:`Consultation report · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.consultations._id.index-LX36cVKp.js`),__vite__mapDeps([338,3,47,22,23,10,9,20,21,12,13,14,8,127,125,76,1,2,4,5,94,126,71,45,32,48,44,43,79,16,63,128,65,129,123,7,130,131,132,111,133,75,77,80,134,135,136,137,138,139,307,225,228,121,31,33,122,39,87,88,36,37,38,53,41,66,124,89,142,143,144,146,147,73,148,149,150])),`component`),errorComponent:J(()=>P(()=>import(`./dashboard.consultations._id.index-DuzAK6vD.js`),__vite__mapDeps([339,12,3,13,10,9,14])),`errorComponent`)});async function Ak(e){return await F(`consultations`,{action:`blueprint_clinician_notes_list`,body:{blueprintId:e}})}async function jk(e,t){return await F(`consultations`,{action:`blueprint_clinician_note_add`,body:{blueprintId:e,body:t}})}async function Mk(){return await F(`consultations`,{action:`blueprint_list_clinic`,body:{}})}async function Nk(){return await F(`consultations`,{action:`blueprint_list_all`,body:{}})}async function Pk(e){return await F(`consultations`,{action:`blueprint_get`,body:{id:e.id}})}async function Fk(){return await F(`consultations`,{action:`blueprint_list_mine`,body:{}})}async function Ik(e){return await F(`consultations`,{action:`blueprint_list`,body:{consultationId:e.consultationId}})}async function Lk(e){return await F(`consultations`,{action:`blueprint_progress_get`,body:{blueprintId:e.blueprintId}})}async function Rk(e){return await F(`consultations`,{action:`blueprint_progress_set`,body:e})}async function zk(e){return await F(`consultations`,{action:`blueprint_generate`,body:{consultationId:e.consultationId},timeoutMs:45e3})}function Bk({clinicName:e,clinicSlug:t,className:n=``}){let r=e?.trim()||`Your clinic`,i=(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-border bg-white/5 px-3 py-1 text-[11px] uppercase tracking-[0.15em] text-text-muted`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,
31children:`â`}),(0,U.jsx)(`span`,{className:`text-white`,children:r})]});return t?(0,U.jsx)(D,{to:`/clinic/$clinicSlug`,params:{clinicSlug:t},className:`inline-block transition-opacity hover:opacity-80 ${n}`,"aria-label":`Open ${r}`,children:i}):(0,U.jsx)(`span`,{className:n,children:i})}var Vk=`Collapsible`,[Hk,Uk]=dt(Vk),[Wk,Gk]=Hk(Vk),Kk=H.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=ft({prop:r,defaultProp:i??!1,onChange:o,caller:Vk});return(0,U.jsx)(Wk,{scope:n,disabled:a,contentId:_t(),open:c,onOpenToggle:H.useCallback(()=>l(e=>!e),[l]),children:(0,U.jsx)(mt.div,{"data-state":Qk(c),"data-disabled":a?``:void 0,...s,ref:t})})});Kk.displayName=Vk;var qk=`CollapsibleTrigger`,Jk=H.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=Gk(qk,n);return(0,U.jsx)(mt.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Qk(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:pt(e.onClick,i.onOpenToggle)})});Jk.displayName=qk;var Yk=`CollapsibleContent`,Xk=H.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Gk(Yk,e.__scopeCollapsible);return(0,U.jsx)(Tt,{present:n||i.open,children:({present:e})=>(0,U.jsx)(Zk,{...r,ref:t,present:e})})});Xk.displayName=Yk;var Zk=H.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Gk(Yk,n),[s,c]=H.useState(r),l=H.useRef(null),u=ht(t,l),d=H.useRef(0),f=d.current,p=H.useRef(0),m=p.current,h=o.open||s,g=H.useRef(h),_=H.useRef(void 0);return H.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),ut(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,U.jsx)(mt.div,{"data-state":Qk(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Qk(e){return e?`open`:`closed`}var $k=Kk,eA=Jk,tA=Xk,nA=$k,rA=Jk,iA=Xk;function aA({title:e,summary:t,badge:n,defaultOpen:r=!1,children:i}){let[a,o]=(0,H.useState)(r);return(0,U.jsx)(nA,{open:a,onOpenChange:o,children:(0,U.jsxs)(`section`,{className:`overflow-hidden rounded-lg border border-border bg-report-surface shadow-sm print:break-inside-avoid`,children:[(0,U.jsxs)(rA,{className:`flex w-full items-center justify-between gap-4 p-5 text-left transition-colors hover:bg-report-surface-quiet focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring md:p-6`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsxs)(`span`,{className:`flex flex-wrap items-center gap-3`,children:[(0,U.jsx)(`span`,{className:`font-display text-xl text-foreground md:text-2xl`,children:e}),n&&(0,U.jsx)(`span`,{className:`rounded-full border border-gold/40 px-2 py-0.5 text-[10px] uppercase tracking-[0.15em] text-gold`,children:n})]}),t&&(0,U.jsx)(`span`,{className:`mt-1 block text-sm text-muted-foreground`,children:t})]}),(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-[11px] uppercase tracking-[0.18em] text-muted-foreground print:hidden`,children:[(0,U.jsx)(`span`,{className:`hidden sm:inline`,children:a?`Hide details`:`View details`}),(0,U.jsx)(Ze,{"aria-hidden":!0,className:`h-4 w-4 transition-transform ${a?`rotate-180`:``}`})]})]}),(0,U.jsx)(iA,{children:(0,U.jsx)(`div`,{className:`border-t border-border/70 p-5 md:p-6 print:block`,children:i})})]})})}function oA(e,t){try{return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:t}).format(e/100)}catch{return`${t} ${(e/100).toFixed(2)}`}}function sA(e,t){return e.min===e.max?oA(e.min,t):`${oA(e.min,t)} â ${oA(e.max,t)}`}function cA(e){let t=new Date(e.priceDate).toLocaleDateString(void 0,{dateStyle:`medium`,timeZone:`UTC`});return e.priceDateKind===`catalogue`?`Prices dated ${t}`:`Estimate prepared on ${t}`}function lA(e,t){if(e.priceStatus===`unknown`||!e.unitPrice)return`Price not listed`;if(e.priceStatus===`zero`)return`Free at ${t}`;let n=sA(e.unitPrice,e.currency),r=e.priceStatus===`estimate`?` â estimate${e.locality?` for ${e.locality}`:``}, not ${t}'s price`:``;return e.costType===`per_session`?e.quantity?`${n} per session à ${e.quantity.min===e.quantity.max?`${e.quantity.min}`:`${e.quantity.min}â${e.quantity.max}`} sessions = ${e.total?sA(e.total,e.currency):`Price unavailable`}${r}`:`${n} per session (no course total â session number and timing to be agreed with your clinician)${r}`:e.costType===`recurring_monthly`?`${n} per month${r}`:`${n} one-time (${e.unit})${r}`}function uA({budget:e,clinicName:t}){return(0,U.jsxs)(`div`,{className:`mt-5 rounded-md border border-border p-4`,"data-testid":`stage-budget`,children:[(0,U.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.18em] text-gold`,children:`Indicative spend`}),e.status===`held_for_review`?(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Pricing will be shown once options are reviewed.`}):e.status===`none`?(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`No costs are planned for this stage.`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`ul`,{className:`mt-2 space-y-1.5 text-sm`,children:e.items.map(e=>(0,U.jsxs)(`li`,{className:`flex flex-col`,children:[(0,U.jsxs)(`span`,{className:`text-foreground`,children:[e.name,e.catalogueOption&&(0,U.jsx)(`span`,{className:`ml-2 roun
31ded-full border border-border px-2 py-0.5 text-[10px] uppercase tracking-[0.12em] text-muted-foreground`,children:`Clinic catalogue option`})]}),(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:lA(e,t)})]},e.name))}),(0,U.jsxs)(`div`,{className:`mt-3 space-y-1 border-t border-border pt-3 text-sm`,children:[e.totals.oneTime&&(0,U.jsxs)(`p`,{className:`text-foreground`,children:[`One-time total: `,(0,U.jsx)(`span`,{className:`font-display`,children:sA(e.totals.oneTime,e.currency)})]}),e.totals.recurringMonthly&&(0,U.jsxs)(`p`,{className:`text-foreground`,children:[`Monthly: `,(0,U.jsx)(`span`,{className:`font-display`,children:sA(e.totals.recurringMonthly,e.currency)})]}),e.totals.excludedCount>0&&(0,U.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Partial total â excludes `,e.totals.excludedCount,` item`,e.totals.excludedCount===1?``:`s`,`.`]})]})]}),(0,U.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:[cA(e),` · `,e.currency,` · indicative, not a quote`]})]})}function dA({summary:e,clinicName:t}){let n=e.warningSigns??[];return(0,U.jsxs)(`section`,{className:`rounded-lg border border-warning/30 bg-warning/5 p-6`,"data-testid":`safety-summary`,children:[(0,U.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.2em] text-warning`,children:`Safety and contact`}),n.length>0&&(0,U.jsxs)(`div`,{className:`mt-2`,children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`If you go ahead with a treatment, watch for:`}),(0,U.jsx)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-foreground`,children:n.map(e=>(0,U.jsx)(`li`,{children:e},e))})]}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-foreground`,children:e.escalation}),e.pendingNote&&(0,U.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:e.pendingNote}),e.missingSafetyInfo&&(0,U.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Some safety questions weren't answered, so some options are held until your clinician confirms them.`}),e.hasSafetyConflicts&&(0,U.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Some options were removed because they conflict with your safety answers.`}),(e.clinic.email||e.clinic.phone)&&(0,U.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[e.clinic.name??t,e.clinic.phone?` · ${e.clinic.phone}`:``,e.clinic.email?` · ${e.clinic.email}`:``]}),e.contactStatus===`missing`&&e.contactNextAction&&(0,U.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`contact-missing`,children:e.contactNextAction})]})}var fA={spec_version:`1.0.0`,rubric_version:`1.1`,scoring_version:`1.0.0`,generated:`2026-08-06`,authored_by:`Michelle Vernon, Master Injector â Body Studio Wellness Ltd`,generated_for:`Brainy Minds LLP â Sanjay Kumar`,purpose:`Clinical rubric and deterministic scoring specification for the skin_analysis route. Replaces model-generated scoring, which is the root cause of the Beauty Score zeros.`,core_principles:[`The model emits ordinal bands. The application computes every number. The model never sees or emits a score.`,`Fitzpatrick type is never a scoring input. Identical findings score identically at every skin type.`,`Pigmentary findings are assessed as CONTRAST against the person's own adjacent skin, never as absolute darkness.`,`An unassessable domain is excluded and remaining weights renormalised. It is never scored zero.`,`No domain scores below 20. If assessable weight falls below 60 of 100, no score is published at all.`,`Post-inflammatory pigmentation is a first-class domain, weighted equal to inflammatory acne.`],route_config:{route_key:`skin_analysis`,task_type:`vision_language`,note:`Distinct from the simulation_* routes, which point at image GENERATION models. This route requires a model that reads an image and returns structured text. Do not route it through gemini-3-pro-image, gpt-image-2 or gemini-2.5-flash-image.`,model_chain:[{priority:1,provider:`atlas`,model:`<claude vision model available on Atlas>`,rationale:`Already the confirmed text intelligence layer. Keeps assessment and Blueprint narrative on one model so they cannot contradict each other. Strong schema adherence.`},{priority:2,provider:`atlas`,model:`<gemini vision model available on Atlas>`,rationale:`Already contracted through Atlas. Independent vendor for failover.`}],generation_params:{temperature:0,top_p:1,seed:42,response_format:`json_schema`,strict_schema:!0,max_output_tokens:2e3},sampling:{samples_per_analysis:3,consolidation:`median_low per domain`,assessability_rule:`a domain is asse
31ssable only if a majority of samples could assess it`},retry_count:2,note_on_retry:`Ordinary transient retry. There is no relaxed-constraint variant on this route and none should be added.`,caching:`Cache on a hash of (image bytes + rubric version + scoring version). Re-analysis of an unchanged photo must return the identical stored result, not a fresh inference.`},system_prompt:`You are the skin assessment engine for MedSpa Blueprint AI, a cosmetic 32consultation platform. You are performing a COSMETIC assessment to guide aesthetic treatment 33selection. You are not diagnosing disease. 34 35ABSOLUTE RULES 36 371. You output ordinal severity bands only. You never output a score, a percentage, a grade, 38 a "skin age", or any number that could be read as a score. Scoring happens downstream. 39 402. Skin tone is never a finding. A person's constitutional skin colour, at any Fitzpatrick 41 type, is not a concern, a defect or a deviation. Never describe skin as needing to be 42 lighter, brighter, more even in TONE, fairer, or more radiant in a way that implies colour 43 change. Assess deviation from that person's OWN baseline, never from any other reference. 44 453. Contrast, not darkness. When assessing any pigmentary finding, judge how much a mark 46 differs from the immediately adjacent skin. A mark two shades darker than its surroundings 47 is the same finding at Fitzpatrick II and Fitzpatrick VI and must receive the same band. 48 494. Separate active lesions from marks left behind. Raised, inflamed lesions go to 50 acne_inflammatory. Flat marks where lesions have resolved go to 51 post_inflammatory_pigmentation. Never count one as the other. 52 535. Return not_assessable rather than guessing. If lighting, focus, angle, expression, makeup 54 or image smoothing prevents confident assessment of a domain, set assessable to false and 55 give a reason. An honest exclusion is always better than a fabricated band. This applies 56 with particular force to erythema at Fitzpatrick V-VI, where redness presents as a 57 deepened or violaceous tone and is easy to miss. Low confidence there means 58 not_assessable, never "none". 59 606. Never diagnose. Do not name conditions, do not suggest causes, do not reassure that 61 anything is harmless. If any lesion shows asymmetry, irregular borders, colour 62 variegation, diameter over 6mm, or the client reports change, set referral_flag.raise to 63 true. The only permitted referral text is exactly: "We recommend you have this reviewed by 64 a dermatologist." 65 667. Assess only what is visible. Do not infer age, gender, ethnicity, health status, lifestyle, 67 diet or skincare habits. Do not comment on attractiveness. Do not compare the person to 68 anyone. 69 708. Output valid JSON matching the supplied schema. No prose outside the JSON, no markdown 71 fences, no commentary. 72 73BAND DEFINITIONS 74Every domain uses: none, minimal, mild, moderate, marked. Use the anch
74or text supplied for 75each domain. Where a presentation sits between two anchors, choose the LOWER band.`,rubric_text_block:`### hydration_barrier â Hydration & barrier 76 none: Surface evenly supple. No flaking, no tight-looking areas, no dull patches. 77 minimal: One small area of fine flaking or dullness, typically perinasal or perioral. 78 mild: Fine flaking or dull matte patches across one facial zone. 79 moderate: Visible dryness across two or more zones, with flaking on movement lines. 80 marked: Widespread flaking, taut appearance, and roughened surface across most of the face. 81 NOTE: Assess surface quality, not colour. Dullness here means low light reflectance, never skin tone. 82 83### texture_smoothness â Surface texture 84 none: Surface uniformly smooth in raking light. No roughness or irregularity. 85 minimal: Slight irregularity confined to one small area. 86 mild: Noticeable roughness or unevenness across one zone, typically cheeks or forehead. 87 moderate: Irregular surface across multiple zones with visible relief variation. 88 marked: Pronounced surface irregularity across most of the face, evident at any angle. 89 NOTE: Judge relief and light scatter, not colour variation. 90 91### pore_visibility â Pore visibility 92 none: Pore openings not individually distinguishable at normal viewing distance. 93 minimal: Pores distinguishable only on the nose. 94 mild: Pores distinguishable across the nose and medial cheeks. 95 moderate: Pores clearly distinguishable across the central face including forehead. 96 marked: Enlarged pore openings across most of the face, with visible follicular patterning. 97 NOTE: Pore size is largely constitutional. Score visibility as presented; never imply pores can be removed. 98 99### sebum_oiliness â Sebum 100 none: No surface shine attributable to sebum. 101 minimal: Slight shine confined to the nose. 102 mild: Shine across the T-zone. 103 moderate: Shine across the T-zone and medial cheeks with visible sebaceous filaments.
104 marked: Widespread surface shine with prominent sebaceous filaments across the central face. 105 NOTE: Surface shine is highly confounded by lighting and by any product applied before capture. If the image shows a directional highlight or flash hotspot, mark this domain not_assessable rather than guessing. 106 107### acne_inflammatory â Inflammatory lesions 108 none: No papules, pustules or nodules. 109 minimal: 1-3 discrete papules or pustules. 110 mild: 4-10 inflammatory lesions, papules and pustules only. 111 moderate: 11-25 inflammatory lesions, or fewer with any nodular lesion present. 112 marked: More than 25 inflammatory lesions, or multiple nodular or cystic lesions. 113 additional fields: nodular_present (boolean), distribution (enum[t_zone|cheeks|jawline|perioral|diffuse]) 114 NOTE: Count raised, actively inflamed lesions only. Flat marks left by resolved lesions belong to post_inflammatory_pigmentation, not here. Conflating the two is the most common assessment error and it systematically over-scores deeper skin tones. 115 116### congestion_comedonal â Comedonal congestion 117 none: No visible open or closed comedones. 118 minimal: Few open comedones on the nose only. 119 mild: Open comedones across the nose and chin, or scattered closed comedones in one zone. 120 moderate: Comedones across two or more zones with textural bumpiness on oblique light. 121 marked: Dense comedonal congestion across the central face. 122 123### post_inflammatory_pigmentation â Post-inflammatory pigmentation 124 none: No flat marks at sites of resolved lesions. 125 minimal: 1-3 discrete flat marks, faint against surrounding skin. 126 mild: 4-10 discrete flat marks, clearly distinguishable from surrounding skin. 127 moderate: 11-25 marks, or confluent patches in one zone. 128 marked: Extensive marks or confluent patches across two or more zones. 129 additional fields: predominant_sites (enum[cheeks|jawline|perioral|forehead|temples|diffuse]), maturity (enum[recent_erythematous|established_pigmented|mixed]) 130 NOTE: Assess CONTRAST between the mark and the adjacent skin, never the darkness of the mark in absolute terms. A mark two shades darker than surrounding skin scores identically whether the surrounding skin is Fitzpatrick II or VI. 131 SKIN TYPE NOTE: This is frequently the dominant presenting concern at Fitzpatrick IV-VI and is weighted accordingly. It is also the domain most often misread as baseline pigmentation. If a pigmented area cannot be distinguished from the person's constitutional tone, it is NOT post-inflammatory pigmentation and must not be scored here. 132 133### pigment_solar_melasma â Pigmentary unevenness 134 none: Tone even across facial zones, allowing for normal contour shading. 135 minimal: 1-3 discrete macules, or very faint patterning in one zone. 136 mild: Scattered discrete macules, or faint symmetrical patterning across malar areas. 137 moderate: Numerous macules or defined symmetrical patches across two or more zones. 138 marked: Extensive confluent unevenness across the majority of the face. 139 additional fields: pattern (enum[discrete_macules|symmetrical_patches|mixed|none]), distribution (enum[malar|centrofacial|mandibular|forehead|diffuse|none]) 140 NOTE: Score DEVIATION from the person's own baseline tone. Freckling is a normal constitutional feature and is scored only where the client raises it as a concern; it is never a defect. 141 SKIN TYPE NOTE: Symmetrical malar or centrofacial patterning is more prevalent at Fitzpatrick III-V and carries higher recurrence risk. Flag for conservative treatment selection - aggressive resurfacing worsens it. 142 143### erythema_vascular â Erythema & vascularity 144 none: No persistent redness or visible vessels. 145 minimal: Slight persistent redness confined to the nasal alae or one small area. 146 mild: Persistent redness across the central face, or isolated visible vessels. 147 moderate: Diffuse redness across two or more zones, or multiple visible telangiectasia.
148 marked: Widespread persistent erythema with prominent vascular patterning. 149 NOTE: Distinguish persistent erythema from transient flush caused by heat, exertion or capture conditions. 150 SKIN TYPE NOTE: Erythema is substantially harder to detect at Fitzpatrick V-VI, where it presents as a deepened or violaceous tone rather than red. If detection confidence is low at these types, return not_assessable. Do NOT return band 'none' by default - a false negative here is worse than an exclusion, because it silently under-serves the client. 151 152### lines_static â Static lines 153 none: No lines visible at rest. 154 minimal: Faint lines visible at rest in one area, typically lateral canthal. 155 mild: Lines visible at rest in one to two areas. 156 moderate: Established lines at rest across three or more areas. 157 marked: Deeply etched lines at rest across the upper and lower face. 158 additional fields: sites (array[forehead|glabella|lateral_canthal|nasolabial|perioral|marionette|neck]) 159 NOTE: Assess at rest only. If the capture shows an expression, mark not_assessable and request a neutral photograph. 160 161### laxity_firmness â Laxity & firmness 162 none: Jawline and midface contours well defined with no soft-tissue descent. 163 minimal: Very slight softening of the jawline contour. 164 mild: Softening along the jawline, or early loss of midface projection. 165 moderate: Definite jawline softening with early jowl formation or submental fullness. 166 marked: Pronounced soft-tissue descent with clear jowl formation and loss of cervicomental definition. 167 NOTE: Requires an oblique or profile capture to assess properly. On a front-only image, cap the assessable band at 'mild' and note the limitation. 168 169### periorbital â Periorbital 170 none: Lower lid smooth, no hollowing, no discolouration, no puffiness. 171 minimal: Very slight hollowing or faint discolouration. 172 mild: Definite hollowing or discolouration, or mild puffiness. 173 moderate: Combination of hollowing and discolouration, or definite lower lid fullness. 174 marked: Pronounced hollowing with marked discolouration and established lower lid fullness. 175 additional fields: hollowing (enum[none|mild|moderate|marked]), discolouration_type (enum[none|pigmentary|vascular|shadow_cast|mixed]), puffiness (enum[none|mild|moderate|marked]) 176 NOTE: discolouration_type drives treatment selection and must be assessed separately from severity. Shadow cast by a hollow is not pigmentation and does not respond to pigment treatment - misclassifying it is the most common cause of an unhappy under-eye client. 177 SKIN TYPE NOTE: Constitutional periorbital hyperpigmentation is common and familial at Fitzpatrick IV-VI. Record it, and set expectations conservatively - it responds partially at best. 178 179### scarring_atrophic â Atrophic scarring 180 none: No depressed scarring. 181 minimal: 1-3 shallow depressed scars in one area. 182 mild: Scattered shallow rolling or boxcar scars in one to two zones. 183 moderate: Numerous depressed scars across two or more zones, with visible shadow relief. 184 marked: Extensive depressed scarring across the majority of the cheeks or temples. 185 additional fields: predominant_type (enum[rolling|boxcar|ice_pick|mixed|none]) 186 NOTE: Assess depth and shadow relief, not the colour of the scar. Colour belongs to post_inflammatory_pigmentation. 187`,output_json_schema:{$schema:`https://json-schema.org/draft/2020-12/schema`,type:`object`,additionalProperties:!1,required:[`hydration_barrier`,`texture_smoothness`,`pore_visibility`,`sebum_oiliness`,`acne_inflammatory`,`congestion_comedonal`,`post_inflammatory_pigmentation`,`pigment_solar_melasma`,`erythema_vascular`,`lines_static`,`laxity_firmness`,`periorbital`,`scarring_atrophic`,`fitzpatrick_estimated`,`keloid_hypertrophic_scarring`,`image_quality`,`referral_flag`],properties:{hydration_barrier:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240}}},texture_smoothness:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240}}},pore_visibility:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240}}},sebum_oiliness:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240}}},acne_inflammatory:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240},nodular_present:{type:[`string`,`boolean`,`array`,`null`]},distribution:{type:[`string`,`boolean`,`array`,`null`]}}},congestion_comedonal:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240}}},post_inflammatory_pigmentation:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240},predominant_sites:{type:[`string`,`boolean`,`array`,`null`]},maturity:{type:[`string`,`boolean`,`array`,`null`]}}},pigment_solar_melasma:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240},pattern:{type:[`string`,`boolean`,`array`,`null`]},distribution:{type:[`string`,`boolean`,`array`,`null`]}}},erythema_vascular:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240}}},lines_static:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240},sites:{type:[`string`,`boolean`,`array`,`null`]}}},laxity_firmness:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240}}},periorbital:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240},hollowing:{type:[`string`,`boolean`,`array`,`null`]},discolouration_type:{type:[`string`,`boolean`,`array`,`null`]},puffiness:{type:[`string`,`boolean`,`array`,`null`]}}},scarring_atrophic:{type:`object`,required:[`assessable`,`band`],additionalProperties:!1,properties:{assessable:{type:`boolean`},band:{type:[`string`,`null`],enum:[`none`,`minimal`,`mild`,`moderate`,`marked`,null]},not_assessable_reason:{type:[`string`,`null`]},observation:{type:`string`,maxLength:240},predominant_type:{type:[`string`,`boolean`,`array`,`null`]}}},fitzpatrick_estimated:{type:`string`,enum:[`I`,`II`,`III`,`IV`,`V`,`VI`,`uncertain`]},keloid_hypertrophic_scarring:{type:`string`,enum:[`none`,`present`,`uncertain`]},image_quality:{type:`object`,additionalProperties:!1,properties:{lighting:{type:`string`,enum:[`even`,`directional`,`flash_hotspot`,`underexposed`,`mixed`]},focus:{type:`string`,enum:[`sharp`,`acceptable`,`soft`]},view:{type:`string`,enum:[`front`,`oblique_left`,`oblique_right`,`profile_left`,`profile_right`,`other`]},expression:{type:`string`,enum:[`neutral`,`smiling`,`other`]},makeup_present:{type:`boolean`},filter_or_smoothing_detected:{type:`boolean`},face_coverage:{type:`string`,enum:[`full`,`partial`,`obscured`]}},required:[`lighting`,`focus`,`view`,`expression`,`makeup_present`,`filter_or_smoothing_detected`,`face_coverage`]},referral_flag:{type:`object`,additionalProperties:!1,properties:{raise:{type:`boolean`},reason:{type:[`string`,`null`]}},required:[`raise`]}}},domains:[{key:`hydration_barrier`,label:`Hydration & barrier`,weight:8,anchors:{none:`Surface evenly supple. No flaking, no tight-looking areas, no dull patches.`,minimal:`One small area of fine flaking or dullness, typically perinasal or perioral.`,mild:`Fine flaking or dull matte patches across one facial zone.`,moderate:`Visible dryness across two or more zones, with flaking on movement lines.`,marked:`Widespread flaking, taut appearance, and roughened surface across most of the face.`},extra_fields:{},assessor_note:`Assess surface quality, not colour. Dullness here means low light reflectance, never skin tone.`,fitzpatrick_note:null,maps_to_treatments:[`skin-booster-bio-remodelling`,`skin-booster-deep-hydration`,`polynucleotide-facial`,`customised-facial`,`prp-facial`]},{key:`texture_smoothness`,label:`Surface texture`,weight:10,anchors:{none:`Surface uniformly smooth in raking light. No roughness or irregularity.`,minimal:`Slight irregularity confined to one small area.`,mild:`Noticeable roughness or unevenness across one zone, typically cheeks or forehead.`,moderate:`Irregular surface across multiple zones with visible relief variation.`,marked:`Pronounced surface irregularity across most of the face, evident at any angle.`},extra_fields:{},assessor_note:`Judge relief and light scatter, not colour variation.`,fitzpatrick_note:null,maps_to_treatments:[`microneedling`,`chemical-peel-face`,`rf-microneedling`,`microdermabrasion`,`dermaplaning`]},{key:`pore_visibility`,label:`Pore visibility`,weight:7,anchors:{none:`Pore openings not individually distinguishable at normal viewing distance.`,minimal:`Pores distinguishable only on the nose.`,mild:`Pores distinguishable across the nose and medial cheeks.`,moderate:`Pores clearly distinguishable across the central face including forehead.`,marked:`Enlarged pore openings across most of the face, with visible follicular patterning.`},extra_fields:{},assessor_note:`Pore size is largely constitutional. Score visibility as presented; never imply pores can be removed.`,fitzpatrick_note:null,maps_to_treatments:[`microneedling`,`rf-microneedling`,`carbon-laser`,`customised-facial`]}
187,{key:`sebum_oiliness`,label:`Sebum`,weight:5,anchors:{none:`No surface shine attributable to sebum.`,minimal:`Slight shine confined to the nose.`,mild:`Shine across the T-zone.`,moderate:`Shine across the T-zone and medial cheeks with visible sebaceous filaments.`,marked:`Widespread surface shine with prominent sebaceous filaments across the central face.`},extra_fields:{},assessor_note:`Surface shine is highly confounded by lighting and by any product applied before capture. If the image shows a directional highlight or flash hotspot, mark this domain not_assessable rather than guessing.`,fitzpatrick_note:null,maps_to_treatments:[`carbon-laser`,`customised-facial`,`led-therapy`]},{key:`acne_inflammatory`,label:`Inflammatory lesions`,weight:12,anchors:{none:`No papules, pustules or nodules.`,minimal:`1-3 discrete papules or pustules.`,mild:`4-10 inflammatory lesions, papules and pustules only.`,moderate:`11-25 inflammatory lesions, or fewer with any nodular lesion present.`,marked:`More than 25 inflammatory lesions, or multiple nodular or cystic lesions.`},extra_fields:{nodular_present:`boolean`,distribution:`enum[t_zone|cheeks|jawline|perioral|diffuse]`},assessor_note:`Count raised, actively inflamed lesions only. Flat marks left by resolved lesions belong to post_inflammatory_pigmentation, not here. Conflating the two is the most common assessment error and it systematically over-scores deeper skin tones.`,fitzpatrick_note:null,maps_to_treatments:[`led-therapy`,`customised-facial`,`chemical-peel-face`,`microneedling`]},{key:`congestion_comedonal`,label:`Comedonal congestion`,weight:6,anchors:{none:`No visible open or closed comedones.`,minimal:`Few open comedones on the nose only.`,mild:`Open comedones across the nose and chin, or scattered closed comedones in one zone.`,moderate:`Comedones across two or more zones with textural bumpiness on oblique light.`,marked:`Dense comedonal congestion across the central face.`},extra_fields:{},assessor_note:null,fitzpatrick_note:null,maps_to_treatments:[`customised-facial`,`chemical-peel-face`,`carbon-laser`,`microdermabrasion`]},{key:`post_inflammatory_pigmentation`,label:`Post-inflammatory pigmentation`,weight:12,anchors:{none:`No flat marks at sites of resolved lesions.`,minimal:`1-3 discrete flat marks, faint against surrounding skin.`,mild:`4-10 discrete flat marks, clearly distinguishable from surrounding skin.`,moderate:`11-25 marks, or confluent patches in one zone.`,marked:`Extensive marks or confluent patches across two or more zones.`},extra_fields:{predominant_sites:`enum[cheeks|jawline|perioral|forehead|temples|diffuse]`,maturity:`enum[recent_erythematous|established_pigmented|mixed]`},assessor_note:`Assess CONTRAST between the mark and the adjacent skin, never the darkness of the mark in absolute terms. A mark two shades darker than surrounding skin scores identically whether the surrounding skin is Fitzpatrick II or VI.`,fitzpatrick_note:`This is frequently the dominant presenting concern at Fitzpatrick IV-VI and is weighted accordingly. It is also the domain most often misread as baseline pigmentation. If a pigmented area cannot be distinguished from the person's constitutional tone, it is NOT post-inflammatory pigmentation and must not be scored here.`,maps_to_treatments:[`chemical-peel-face`,`microneedling`,`prp-facial`,`polynucleotide-facial`,`customised-facial`]},{key:`pigment_solar_melasma`,label:`Pigmentary unevenness`,weight:10,anchors:{none:`Tone even across facial zones, allowing for normal contour shading.`,minimal:`1-3 discrete macules, or very faint patterning in one zone.`,mild:`Scattered discrete macules, or faint symmetrical patterning across malar areas.`,moderate:`Numerous macules or defined symmetrical patches across two or more zones.`,marked:`Extensive confluent unevenness across the majority of the face.`},extra_fields:{pattern:`enum[discrete_macules|symmetrical_patches|mixed|none]`,distribution:`enum[malar|centrofacial|mandibular|forehead|diffuse|none]`},assessor_note:`Score DEVIATION from the person's own baseline tone. Freckling is a normal constitutional feature and is scored only where the client raises it as a concern; it is never a defect.`,fitzpatrick_note:`Symmetrical malar or centrofacial patterning is more prevalent at Fitzpatrick III-V and carries higher recurrence risk. Flag for conservative treatment selection - aggressive resurfacing worsens it.`,maps_to_treatments:[`chemical-peel-face`,`microneedling`,`customised-facial`,`polynucleotide-facial`]},{key:`erythema_vascular`,label:`Erythema & vascularity`,weight:6,anchors:{none:`
187No persistent redness or visible vessels.`,minimal:`Slight persistent redness confined to the nasal alae or one small area.`,mild:`Persistent redness across the central face, or isolated visible vessels.`,moderate:`Diffuse redness across two or more zones, or multiple visible telangiectasia.`,marked:`Widespread persistent erythema with prominent vascular patterning.`},extra_fields:{},assessor_note:`Distinguish persistent erythema from transient flush caused by heat, exertion or capture conditions.`,fitzpatrick_note:`Erythema is substantially harder to detect at Fitzpatrick V-VI, where it presents as a deepened or violaceous tone rather than red. If detection confidence is low at these types, return not_assessable. Do NOT return band 'none' by default - a false negative here is worse than an exclusion, because it silently under-serves the client.`,maps_to_treatments:[`led-therapy`,`customised-facial`,`polynucleotide-facial`]},{key:`lines_static`,label:`Static lines`,weight:8,anchors:{none:`No lines visible at rest.`,minimal:`Faint lines visible at rest in one area, typically lateral canthal.`,mild:`Lines visible at rest in one to two areas.`,moderate:`Established lines at rest across three or more areas.`,marked:`Deeply etched lines at rest across the upper and lower face.`},extra_fields:{sites:`array[forehead|glabella|lateral_canthal|nasolabial|perioral|marionette|neck]`},assessor_note:`Assess at rest only. If the capture shows an expression, mark not_assessable and request a neutral photograph.`,fitzpatrick_note:null,maps_to_treatments:[`wrinkle-relaxer-forehead`,`wrinkle-relaxer-frown-lines`,`wrinkle-relaxer-crows-feet`,`microneedling`,`rf-microneedling`,`nasolabial-filler`]},{key:`laxity_firmness`,label:`Laxity & firmness`,weight:7,anchors:{none:`Jawline and midface contours well defined with no soft-tissue descent.`,minimal:`Very slight softening of the jawline contour.`,mild:`Softening along the jawline, or early loss of midface projection.`,moderate:`Definite jawline softening with early jowl formation or submental fullness.`,marked:`Pronounced soft-tissue descent with clear jowl formation and loss of cervicomental definition.`},extra_fields:{},assessor_note:`Requires an oblique or profile capture to assess properly. On a front-only image, cap the assessable band at 'mild' and note the limitation.`,fitzpatrick_note:null,maps_to_treatments:[`rf-microneedling`,`hifu-face`,`pdo-cheek-threads`,`biostimulator-gradual-collagen`,`jawline-filler`,`rf-facial`]},{key:`periorbital`,label:`Periorbital`,weight:6,anchors:{none:`Lower lid smooth, no hollowing, no discolouration, no puffiness.`,minimal:`Very slight hollowing or faint discolouration.`,mild:`Definite hollowing or discolouration, or mild puffiness.`,moderate:`Combination of hollowing and discolouration, or definite lower lid fullness.`,marked:`Pronounced hollowing with marked discolouration and established lower lid fullness.`},extra_fields:{hollowing:`enum[none|mild|moderate|marked]`,discolouration_type:`enum[none|pigmentary|vascular|shadow_cast|mixed]`,puffiness:`enum[none|mild|moderate|marked]`},assessor_note:`discolouration_type drives treatment selection and must be assessed separately from severity. Shadow cast by a hollow is not pigmentation and does not respond to pigment treatment - misclassifying it is the most common cause of an unhappy under-eye client.`,fitzpatrick_note:`Constitutional periorbital hyperpigmentation is common and familial at Fitzpatrick IV-VI. Record it, and set expectations conservatively - it responds partially at best.`,maps_to_treatments:[`tear-trough-filler`,`prp-under-eye`,`under-eye-laser`,`under-eye-rf`,`eye-bag-treatment`]},{key:`scarring_atrophic`,label:`Atrophic scarring`,weight:3,anchors:{none:`No depressed scarring.`,minimal:`1-3 shallow depressed scars in one area.`,mild:`Scattered shallow rolling or boxcar scars in one to two zones.`,moderate:`Numerous depressed scars across two or more zones, with visible shadow relief.`,marked:`Extensive depressed scarring across the majority of the cheeks or temples.`},extra_fields:{predominant_type:`enum[rolling|boxcar|ice_pick|mixed|none]`},assessor_note:`Assess depth and shadow relief, not the colour of the scar. Colour belongs to post_inflammatory_pigmentation.`,fitzpatrick_note:null,maps_to_treatments:[`acne-scar-subcision`,`acne-scar-pdo`,`acne-scar-combo`,`prp-microneedling-facial`,`microneedling`,`rf-microneedling`]}],context_fields:{fitzpatrick_estimated:{type:`enum[I|II|III|IV|V|VI|uncertain]`,scored:!1,rule:`NEVER contributes to any score. Client-declared value always takes precedence over the estimate. Used only to select treatment eligibility, set risk flags and calibrate detection confidence.`},keloid_hypertrophic_scarring:{type:`enum[none|present|uncertain]`,scored:!1,rule:`Flag only, never scored. Raised scarring is a clinical finding, not a cosmetic score input. Presence sets a treatment risk flag for microneedling, fibroblast, laser and any procedure involving skin penetration.`},image_quality:{type:`object`,fields:{lighting:`enum[even|directional|flash_hotspot|underexposed|mixed]`,focus:`enum[sharp|acceptable|soft]`,view:`enum[front|oblique_left|oblique_right|profile_left|profile_right|other]`,expression:`enum[neutral|smiling|other]`,makeup_present:`boolean`,filter_or_smoothing_detected:`boolean`,face_coverage:`enum[full|partial|obscured]`},scored:!1,rule:`Drives per-domain assessability. Makeup or detected smoothing suppresses the surface domains.`},referral_flag:{type:`object`,fields:{raise:`boolean`,reason:`string`},scored:!1,rule:`Set true for any lesion showing asymmetry, irregular border, colour variegation, diameter over 6mm, evolution reported by the client, or any non-healing area. Output text is strictly: 'We recommend you have this reviewed by a dermatologist.' Never name a condition, never state or imply a diagnosis, never reassure that something is benign.`}},scoring_config:{band_penalty:{none:0,minimal:12,mild:30,moderate:55,marked:80},band_order:[`none`,`minimal`,`mild`,`moderate`,`marked`],min_domain_score:20,min_coverage:60,confidence_full_threshold:85,domain_score_formula:`max(100 - band_penalty[band], min_domain_score)`,composite_formula:`round_half_up( sum(domain_score * weight for assessable) / sum(weight for assessable) )`,rounding:`half-up to integer, Decimal arithmetic, no floats in output`,band_labels:{"85-100":`excellent`,"70-84":`good`,"55-69":`fair`,"40-54":`needs attention`,"0-39":`priority focus`},priority_formula:`impact = (100 - domain_score) * weight; sort desc, tie-break on domain key asc; top 3`},acceptance_tests:[{id:`T1`,name:`Fitzpatrick neutrality`,assert:`Identical band set scores identically at FP I through VI.`,blocking:!0}
187,{id:`T2`,name:`Determinism`,assert:`50 repeat runs on identical input return one distinct composite.`,blocking:!0},{id:`T3`,name:`Domain floor`,assert:`No assessable domain scores below 20; all-marked composite is 20, never 0.`,blocking:!0},{id:`T4`,name:`Exclusion not zeroing`,assert:`Unassessable domains are excluded; composite is unchanged versus a clean assessment of the same bands.`,blocking:!0},{id:`T5`,name:`Coverage suppression`,assert:`Assessable weight below 60 returns composite null, publishable false, and a client retake message.`,blocking:!0},{id:`T6`,name:`Confidence downgrade`,assert:`Coverage between 60 and 84 publishes with confidence 'partial'.`,blocking:!0},{id:`T7`,name:`Monotonicity`,assert:`Worsening any single domain never raises the composite.`,blocking:!0},{id:`T8`,name:`Sample consolidation`,assert:`Median-low across 3 samples; a domain assessable in only a minority of samples is excluded.`,blocking:!0},{id:`T9`,name:`PIH weighting`,assert:`post_inflammatory_pigmentation weight is greater than or equal to acne_inflammatory weight.`,blocking:!0},{id:`T10`,name:`No tone domain`,assert:`Weights sum to 100 and no domain scores baseline skin tone, brightness or lightness.`,blocking:!0},{id:`T11`,name:`Priority determinism`,assert:`Priority ordering is stable and sorted by impact descending.`,blocking:!0},{id:`T12`,name:`Live tone-pair validation`,assert:`30 client photographs, minimum 15 at Fitzpatrick V-VI, each assessed twice one week apart. Band agreement must be within one band on at least 80 percent of assessable domains, and the mean composite difference between the FP II-III and FP V-VI cohorts must not exceed 5 points when clinical presentation is matched.`,blocking:!0,owner:`Michelle Vernon`}],implementation_notes:[`Store the raw band assessment on the record alongside the computed score. If the rubric or scoring version changes, historical scores are recomputed from stored bands rather than re-inferred from the photograph.`,`Persist rubric_version and scoring_version on every result. A score without its versions is not auditable.`,`Cache on hash(image bytes + rubric_version + scoring_version). Re-opening an unchanged photograph must return the stored result, not a fresh inference.`,`Never display a composite when publishable is false. Show the retake guidance instead.`,`Progress tracking compares band movement per domain, not composite deltas. A composite change of 2 points is noise.`,`The referral flag is display-only text. It must never be phrased as a diagnosis and must never appear inside a treatment recommendation.`],changelog_v1_1:[`Treatment slug mappings updated for the v2.1 brand-free slug migration.`,`assessment_profile scoping added: the rubric runs in full only for full_facial_skin treatments; facial_structural runs lines_static, laxity_firmness and periorbital with weights renormalised across those three.`],assessment_profiles:{full_facial_skin:{domains:[`hydration_barrier`,`texture_smoothness`,`pore_visibility`,`sebum_oiliness`,`acne_inflammatory`,`congestion_comedonal`,`post_inflammatory_pigmentation`,`pigment_solar_melasma`,`erythema_vascular`,`lines_static`,`laxity_firmness`,`periorbital`,`scarring_atrophic`],total_weight:100,description:`All 13 domains. Facials, peels, resurfacing, energy and laser, regenerative facials, scar revision, skin boosters.`},facial_structural:{domains:[`lines_static`,`laxity_firmness`,`periorbital`],description:`Static lines, laxity and periorbital only. Neuromodulators, fillers, biostimulators, threads, facial surgery. Skin-quality domains are not relevant to what the client asked about.`,note:`Weights renormalise across the 3 in-scope domains so they total 100.`}
187,body_zone:{domains:[],description:`No facial assessment. All body contouring, body regenerative, lesion and hair removal, body and breast surgery.`,note:`A dedicated body rubric may be added in a later version. For now the consultation proceeds directly to treatment content and simulation.`},none:{domains:[],description:`No assessment. Hair, brows, dental, lesion removal, wellness, intimate services.`},rules:[`Where no assessment runs, the report must contain no skin section at all - not an empty section, not a 'not assessed' placeholder.`,`Multiple treatments in one consultation: take the union of their profiles.`,`A client on a facial_structural or body_zone path may request a skin assessment as an explicit opt-in. It is never the default.`]}};fA.rubric_version,fA.scoring_version,fA.spec_version,fA.system_prompt,fA.rubric_text_block,fA.output_json_schema,fA.route_config.generation_params,fA.route_config.sampling,fA.route_config.retry_count,fA.scoring_config.band_order,fA.scoring_config.band_penalty,fA.scoring_config.min_domain_score,fA.scoring_config.min_coverage,fA.scoring_config.confidence_full_threshold;var pA=fA.scoring_config.band_labels,mA=fA.domains,hA=mA.map(e=>e.key),gA=Object.fromEntries(mA.map(e=>[e.key,e])),_A=mA.reduce((e,t)=>e+t.weight,0),vA=fA.assessment_profiles;fA.assessment_profiles.rules;function yA(e){if(!e)return hA;let t=vA[e];return t?t.domains??[]:hA}function bA(e){for(let[t,n]of Object.entries(pA)){let[r,i]=t.split(`-`).map(e=>Number(e));if(e>=r&&e<=i)return n}return``}var xA=Object.freeze([{key:`retinoid_otc`,name:`Over-the-counter retinoid`,category:`retinoid`,eligibleFindings:[{domain:`lines_static`,minBand:`mild`},{domain:`texture_smoothness`,minBand:`mild`},{domain:`congestion_comedonal`,minBand:`mild`},{domain:`post_inflammatory_pigmentation`,minBand:`mild`},{domain:`pore_visibility`,minBand:`moderate`}],strengthRange:`retinol 0.1%â1.0%; retinaldehyde 0.05%â0.1%`,beginnerStrength:`retinol 0.2% (or retinaldehyde 0.05%)`,routineSlot:`PM`,startFrequency:`2 nights/week`,rampSchedule:[{step:`2 nights/week`,dwell:`2 weeks`},{step:`3 nights/week`,dwell:`2 weeks`},{step:`alternate nights`,dwell:`4 weeks`},{step:`nightly if tolerated`,dwell:`ongoing`},{step:`step up strength`,dwell:`no sooner than 12 weeks`}],applicationOrder:3,conflicts:[`exfoliant_aha`,`exfoliant_bha`,`benzoyl_peroxide`],cautions:[{with:`vitamin_c_lascorbic`,rule:`Split across AM and PM.`},{with:`azelaic`,rule:`Alternate nights at first.`}],patchTest:`required`,sensitivityNotes:`Buffer over moisturiser for reactive skin; pause during active eczema or barrier compromise; expect purging in weeks 2â6.`,allergyNotes:`True allergy is rare; an irritant reaction is far more common.`,allergens:[`retinoid`],pregnancy:`avoid`,breastfeeding:`avoid`,stopUse:[`Persistent burning, weeping or swelling`,`Irritation not settling within 72 hours of pausing`],escalate:[`Suspected perioral dermatitis`,`Irritation persisting more than 2 weeks after stopping`,`Any prescription-strength request`],evidenceGrade:`strong`,suppressedByFlare:!0},{key:`exfoliant_aha`,name:`Alpha hydroxy acid`,category:`exfoliant_aha`,eligibleFindings:[{domain:`texture_smoothness`,minBand:`mild`},{domain:`hydration_barrier`,minBand:`mild`},{domain:`pigment_solar_melasma`,minBand:`mild`},{domain:`post_inflammatory_pigmentation`,minBand:`mild`}],strengthRange:`5%â10% leave-on at home; above 10% is professional-only`,beginnerStrength:`lactic or mandelic 5%`,routineSlot:`PM`,startFrequency:`1â2 nights/week`,rampSchedule:[{step:`1 night/week`,dwell:`2 weeks`},{step:`2 nights/week`,dwell:`2 weeks`},{step:`maximum 3 nights/week`,dwell:`ongoing`}],applicationOrder:2,conflicts:[`retinoid_otc`,`exfoliant_bha`,`benzoyl_peroxide`],cautions:[{with:`vitamin_c_lascorbic`,rule:`Use on separate days.`}],patchTest:`required`,sensitivityNotes:`Avoid on a compromised barrier and during an active rosacea flare; increases photosensitivity, so daily SPF is mandatory.`,allergyNotes:`Mandelic is preferred where glycolic has previously stung.`,allergens:[`aha`,`glycolic`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Frosting or blistering`,`Stinging persisting beyond 10 minutes`,`New sensitivity`],escalate:[`Any request above 10%`,`Pigmentation worsening after 8 weeks`],evidenceGrade:`strong`,suppressedByFlare:!0},{key:`exfoliant_bha`,name:`Beta hydroxy acid`,category:`exfoliant_bha`,eligibleFindings:[{domain:`congestion_comedonal`,minBand:`mild`},{domain:`sebum_oiliness`,minBand:`moderate`},{domain:`acne_inflammatory`,minBand:`minimal`},{domain:`pore_visibility`,minBand:`moderate`}],strengthRange:`0.5%â2%`,beginnerStrength:`1%`,routineSlot:`PM`,startFrequency:`2â3 applications/week`,rampSchedule:[{step:`2 applications/week`,dwell:`2 weeks`},{step:`alternate days`,dwell:`2 weeks`},{step:`daily if tolerated`,dwell:`ongoing`}],applicationOrder:2,conflicts:[`retinoid_otc`,`exfoliant_aha`],cautions:[{with:`benzoyl_peroxide`,rule:`Use in alternate slots.`}],patchTest:`recommended`,sensitivityNotes:`Well tolerated on oily skin; drying on dry or mature skin.`,allergyNotes:`Avoid with a salicylate or aspirin allergy.`,allergens:[`salicylate`,`salicylic`,`aspirin`,`bha`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Tightness, flaking or stinging that persists between applications`],escalate:[`Nodulocystic or scarring acne â refer, do not self-treat`],evidenceGrade:`strong`,suppressedByFlare:!0},{key:`vitamin_c_lascorbic`,name:`Vitamin C (L-ascorbic acid)`,category:`vitamin_c`,eligibleFindings:[{domain:`pigment_solar_melasma`,minBand:`minimal`},{domain:`post_inflammatory_pigmentation`,minBand:`minimal`},{domain:`texture_smoothness`,minBand:`minimal`},{domain:`lines_static`,minBand:`minimal`}],strengthRange:`8%â20%`,beginnerStrength:`10%`,routineSlot:`AM`,startFrequency:`Alternate mornings`,rampSchedule:[{step:`alternate mornings`,dwell:`2 weeks`},{step:`daily`,dwell:`ongoing`}],applicationOrder:3,conflicts:[],cautions:[{with:`retinoid_otc`,rule:`Split across AM and PM.`},{with:`exfoliant_aha`,rule:`Use on separate days.`},{with:`benzoyl_peroxide`,rule:`Use in separate slots.`}],patchTest:`recommended`,sensitivityNotes:`Low-pH formulas sting reactive skin â use a vitamin C derivative instead.`,allergyNotes:`Rare.`,allergens:[`ascorbic`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Persistent stinging`,`Product oxidised to deep orange or brown`],escalate:[`Melasma unresponsive after 12 weeks`],evidenceGrade:`strong`},{key:`vitamin_c_derivative`,name:`Vitamin C derivative`,category:`vitamin_c`,eligibleFindings:[{domain:`pigment_solar_melasma`,minBand:`minimal`},{domain:`post_inflammatory_pigmentation`,minBand:`minimal`},{domain:`texture_smoothness`,minBand:`minimal`},{domain:`lines_static`,minBand:`minimal`}],strengthRange:`5%â15%`,beginnerStrength:`5%`,routineSlot:`AM`,startFrequency:`Daily`,rampSchedule:[],applicationOrder:3,conflicts:[],cautions:[],patchTest:`recommended`,sensitivityNotes:`Suitable for reactive skin where L-ascorbic acid stings.`,allergyNotes:`Rare.`,allergens:[`ascorbic`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Persistent stinging`],escalate:[`Melasma unresponsive after 12 weeks`],evidenceGrade:`moderate`},{key:`niacinamide`,name:`Niacinamide`,category:`niacinamide`,eligibleFindings:[{domain:`sebum_oiliness`,minBand:`mild`},{domain:`pore_visibility`,minBand:`mild`},{domain:`post_inflammatory_pigmentation`,minBand:`mild`},{domain:`erythema_vascular`,minBand:`mild`},{domain:`hydration_barrier`,minBand:`mild`}],strengthRange:`2%â10%`,beginnerStrength:`4%`,routineSlot:`AM_PM`,startFrequency:`Daily`,rampSchedule:[{step:`alternate days above 5%`,dwell:`1 week`}],applicationOrder:3,conflicts:[],cautions:[],patchTest:`not_required`,sensitivityNotes:`Generally excellent; reduce strength if flushing occurs.`,allergyNotes:`Rare.`,allergens:[`niacinamide`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Persistent flushing or itch`],escalate:[`Erythema worsening â assess for rosacea`],evidenceGrade:`strong`},{key:`azelaic`,name:`Azelaic acid (cosmetic strength)`,category:`azelaic`,eligibleFindings:[{domain:`post_inflammatory_pigmentation`,minBand:`mild`},{domain:`erythema_vascular`,minBand:`mild`},{domain:`acne_inflammatory`,minBand:`minimal`},{domain:`pigment_solar_melasma`,minBand:`mild`}],strengthRange:`8%â10% at home (15%â20% is prescription or professional)`,beginnerStrength:`10%`,routineSlot:`AM_PM`,startFrequency:`Once daily`,rampSchedule:[{step:`once daily`,dwell:`2 weeks`},{step:`twice daily if tolerated`,dwell:`ongoing`}],applicationOrder:3,conflicts:[],cautions:[{with:`retinoid_otc`,rule:`Alternate nights at first.`}],patchTest:`recommended`,sensitivityNotes:`Transient tingling is normal in week 1.`,allergyNotes:`Rare.`,allergens:[`azelaic`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Persistent burning or dermatitis`],escalate:[`Any request for 15% or above (prescription territory)`],evidenceGrade:`strong`},{key:`benzoyl_peroxide`,name:`Benzoyl peroxide`,category:`benzoyl_peroxide`,eligibleFindings:[{domain:`acne_inflammatory`,minBand:`mild`}],strengthRange:`2.5%â5%`,beginnerStrength:`2.5%, short contact (rinse after 5 minutes)`,routineSlot:`PM`,startFrequency:`Alternate nights`,rampSchedule:[{step:`short contact, alternate nights`,dwell:`2 weeks`},{step:`leave-on alternate nights`,dwell:`2 weeks`},{step:`nightly if tolerated`,dwell:`ongoing`}],applicationOrder:4,conflicts:[`retinoid_otc`,`exfoliant_aha`],cautions:[{with:`vitamin_c_lascorbic`,rule:`Use in separate slots.`},{with:`exfoliant_bha`,rule:`Use in alternate slots.`}],patchTest:`required`,sensitivityNotes:`Highly drying; bleaches fabric and hair.`,allergyNotes:`Contact allergy is well documented â patch test is mandatory.`,allergens:[`benzoyl`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Swelling, weeping or spreading redness (possible contact allergy)`],escalate:[`Nodulocystic acne`,`No improvement after 8 weeks`],evidenceGrade:`strong`,suppressedByFlare:!0},{key:`tyrosinase_inhibitor`,name:`Tyrosinase inhibitor (non-hydroquinone)`,category:`tyrosinase_inhibitor`,eligibleFindings:[{domain:`pigment_solar_melasma`,minBand:`mild`},{domain:`post_inflammatory_pigmentation`,minBand:`mild`}],strengthRange:`2%â5%`,beginnerStrength:`2%`,routineSlot:`AM_PM`,startFrequency:`Daily`,rampSchedule:[],applicationOrder:3,conflicts:[],cautions:[],patchTest:`recommended`,sensitivityNotes:`Tranexamic, kojic or alpha-arbutin; introduce one at a time.`,allergyNotes:`Uncommon.`,allergens:[`kojic`,`tranexamic`,`arbutin`],pregnancy:`clinician_only`,breastfeeding:`clinician_only`,stopUse:[`Paradoxical darkening`],escalate:[`Melasma unchanged at 12 weeks, or worsening`],evidenceGrade:`moderate`},{key:`antioxidant`,name:`Topical antioxidant blend (non-ascorbate)`,category:`antioxidant`,eligibleFindings:[{domain:`pigment_solar_melasma`,minBand:`minimal`},{domain:`erythema_vascular`,minBand:`minimal`},{domain:`texture_smoothness`,minBand:`minimal`}],strengthRange:null,beginnerStrength:null,routineSlot:`AM`,startFrequency:`Daily`,rampSchedule:[],applicationOrder:4,conflicts:[],cautions:[],patchTest:`not_required`,sensitivityNotes:`Ferulic, resveratrol, green tea or vitamin E; supportive of daytime photoprotection, never a substitute for sunscreen.`,allergyNotes:`Botanical extracts occasionally sensitise â introduce alone.`,allergens:[`ferulic`,`resveratrol`,`green tea`,`vitamin e`,`tocopherol`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Itch, rash or persistent redness`],escalate:[],evidenceGrade:`limited`},{key:`peptide`,name:`Peptide complex`,category:`peptide`,eligibleFindings:[{domain:`lines_static`,minBand:`minimal`},{domain:`laxity_firmness`,minBand:`minimal`}],strengthRange:null,beginnerStrength:null,routineSlot:`AM_PM`,startFrequency:`Daily`,rampSchedule:[],applicationOrder:5,conflicts:[],cautions:[],patchTest:`not_required`,sensitivityNotes:`Supportive only â never a primary answer to laxity.`,allergyNotes:`Uncommon.`,allergens:[`peptide`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Irritation`],escalate:[],evidenceGrade:`limited`},{key:`humectant`,name:`Humectant (hyaluronic acid, glycerin, panthenol)`,category:`humectant`,eligibleFindings:[{domain:`hydration_barrier`,minBand:`minimal`}],strengthRange:`0.5%â2% hyaluronic acid, or 3%â10% glycerin`,beginnerStrength:null,routineSlot:`AM_PM`,startFrequency:`Daily`,rampSchedule:[],applicationOrder:5,conflicts:[],cautions:[],patchTest:`not_required`,sensitivityNotes:`Apply to damp skin and always seal with an occlusive in dry climates.`,allergyNotes:`Uncommon.`,allergens:[`hyaluronic`,`glycerin`,`panthenol`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Tightness, which indicates moisture loss to a dry environment`],escalate:[],evidenceGrade:`strong`},{key:`ceramide_lipid`,name:`Ceramide / barrier lipid`,category:`ceramide_lipid`,eligibleFindings:[{domain:`hydration_barrier`,minBand:`mild`}],strengthRange:null,beginnerStrength:null,routineSlot:`AM_PM`,startFrequency:`Daily`,rampSchedule:[],applicationOrder:6,conflicts:[],cautions:[],patchTest:`not_required`,sensitivityNotes:`Barrier support; included whenever a retinoid or exfoliant is in the plan.`,allergyNotes:`Uncommon.`,allergens:[`ceramide`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[],escalate:[],evidenceGrade:`strong`,alwaysOn:!0},{key:`sunscreen`,name:`Broad-spectrum sunscreen`,category:`sunscreen`,eligibleFindings:[],strengthRange:`SPF 30 minimum; SPF 50 with any pigmentary finding or an active in the routine`,beginnerStrength:`SPF 30`,routineSlot:`AM`,startFrequency:`Daily, reapplied every 2 hours of sun exposure`,rampSchedule:[],applicationOrder:8,conflicts:[],cautions:[],patchTest:`not_required`,sensitivityNotes:`Mineral filters preferred for reactive skin, pregnancy and breastfeeding.`,allergyNotes:`Reformulate rather than discontinue protection.`,allergens:[],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Stinging or an acneiform reaction â reformulate, never stop protection`],escalate:[],evidenceGrade:`strong`,alwaysOn:!0},{key:`soothing`,name:`Soothing / anti-inflammatory`,category:`soothing`,eligibleFindings:[{domain:`erythema_vascular`,minBand:`minimal`},{domain:`hydration_barrier`,minBand:`mild`}],strengthRange:null,beginnerStrength:null,routineSlot:`AM_PM`,startFrequency:`Daily`,rampSchedule:[],applicationOrder:5,conflicts:[],cautions:[],patchTest:`not_required`,sensitivityNotes:`Centella, allantoin, bisabolol or colloidal oat; recovery support during any ramp.`,allergyNotes:`Colloidal oat is avoided where an oat or gluten contact allergy is declared.`,allergens:[`oat`,`gluten`],pregnancy:`allowed`,breastfeeding:`allowed`,stopUse:[`Irritation`],escalate:[],evidenceGrade:`moderate`}].map(e=>Object.freeze(e))),SA=Object.freeze(Object.fromEntries(xA.map(e=>[e.key,e]))),CA=[`immediate`,`d30`,`d90`,`d180`,`d365`],wA={immediate:{fromDay:0,toDay:7,label:`Immediate (now â day 7)`},d30:{fromDay:8,toDay:30,label:`30-day (day 8 â day 30)`},d90:{fromDay:31,toDay:90,label:`90-day (day 31 â day 90)`},d180:{fromDay:91,toDay:180,label:`180-day (day 91 â day 180)`},d365:{fromDay:181,toDay:365,label:`365-day (day 181 â day 365)`}},TA=`Timings are a guide only. Results and pace vary from person to person, and no outcome is guaranteed. Your clinician may adjust this stage at review.`;function EA(e){let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t+e.charCodeAt(n)>>>0;return`s${t.toString(36)}`}function DA(e,t,n,r,i,a=!1){let o={id:EA(a?`${e}|${t}|${r}`:`${e}|${t}|${n}|${r}
187`),horizonKey:e,kind:t,day:n,title:r,detail:i};return a&&(o.undated=!0),o}var OA={preparation:0,session:1,review:2,checkpoint:3,next_step:4};function kA(e){let t=[],n=CA[0];for(let r of e.beforeFirstSession??[])t.push(DA(n,`preparation`,0,r,`Confirm with your provider before your first session.`));let r=0;for(let n of CA){let i=e.horizons?.[n];if(i){for(let e of i.checkpoints??[])r=Math.max(r,e.day),t.push(DA(n,`session`,e.day,e.observe,i.recoveryNote??null));i.reassessment&&(r=Math.max(r,i.reassessment.day),t.push(DA(n,`review`,i.reassessment.day,i.reassessment.action,null)))}}let i=e.afterPlan?.nextSteps??[];if(i.length>0){let e=AA(r);for(let n of i)t.push(DA(e,`next_step`,r,n,`Recommended after your final session.`))}let a=!!e.payloadSchema;for(let r of a?CA:[]){let i=e.horizons?.[r];if(!i||(i.checkpoints??[]).length>0||i.reassessment)continue;let a=wA[r].fromDay,o=wA[r].label,s=i.objective??null;if(r===n){let e=new Set;for(let n of i.treatments??[])n.name&&!e.has(n.name)&&(e.add(n.name),t.push(DA(r,`checkpoint`,a,`Book an in-person assessment for ${n.name}`,null,!0)));e.size>0&&t.push(DA(r,`checkpoint`,a,`Agree the number of sessions and timing with your clinician`,null,!0)),t.push(DA(r,`checkpoint`,a,`Confirm your goals and safety information with your clinician`,s,!0))}else t.push(DA(r,`checkpoint`,a,`Complete your ${o} review with your clinician`,s,!0))}return t.sort((e,t)=>e.day-t.day||OA[e.kind]-OA[t.kind])}function AA(e){for(let t of CA)if(e<=wA[t].toDay)return t;return CA[CA.length-1]??`immediate`}function jA(e,t){let n=new Date(e),r=new Date(n.getTime());return r.setDate(r.getDate()+t),r}function MA(e,t,n,r){return t.has(e.id)?`completed`:e.undated?`upcoming`:jA(n,e.day).getTime()<=r.getTime()?`due`:`upcoming`}function NA(e,t){let n=e.filter(e=>t.has(e.id)).length,r=e.find(e=>!t.has(e.id))??null;return{total:e.length,completed:n,percent:e.length===0?0:Math.round(n/e.length*100),next:r}}function PA(e){if(!e)return null;let{min:t,max:n}=e;return t===n?`${t} session${t===1?``:`s`}`:`${t}â${n} sessions`}var FA=`Session number and timing to be agreed with your clinician`,IA={immediate:`Confirm your goals and safety information with your clinician, record a starting point, and agree next steps.`,d30:`Review how things are going: what you've kept up, how your skin or body has tolerated it, and whether anything needs reassessment.`,d90:`Compare where you are with your starting point and goals, and discuss with your clinician whether to continue or change the approach.`,d180:`Reassess what's working, how well it's tolerated, what it costs and whether your priorities have changed, including whether maintenance or no change is enough.`,d365:`Review the year with your clinician, arrange any reassessment, and agree a sustainable plan for the year ahead.`},LA=q(`/_authenticated/dashboard/consultations/$id/blueprint`)({head:()=>({meta:[{title:`Beauty Blueprint · ${X.name}`},{name:`description`,content:`Your private treatment Blueprint, schedule, preparation, progress, and review plan.`},{property:`og:title`,content:`Beauty Blueprint · ${X.name}`},{property:`og:description`,content:`Your private treatment Blueprint, schedule, preparation, progress, and review plan.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.consultations._id.blueprint-Cjb3cHBP.js`),__vite__mapDeps([340,3,47,22,23,10,9,20,21,12,13,14,71,45,32,48,44,43,75,76,1,2,4,5,77])),`component`)});function RA({treatmentName:e,clinicName:t,generatedAt:n,selectedArea:r,scope:i}){return(0,U.jsxs)(`header`,{className:`border-b border-gold/30 pb-7`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,U.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.25em] text-gold`,children:`Your Treatment Blueprint`}),(0,U.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Blueprint start date `,ZA(n),` · E
187ducational â confirm with your clinician`]})]}),(0,U.jsx)(`h1`,{className:`mt-4 max-w-3xl font-display text-4xl leading-tight text-foreground md:text-5xl`,children:e}),(0,U.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[(0,U.jsx)(Bk,{clinicName:t}),r&&(0,U.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-muted-foreground`,children:[`Treatment area: `,r]})]}),(0,U.jsx)(`p`,{className:`mt-4 max-w-2xl text-sm leading-relaxed text-muted-foreground`,children:i})]})}function zA({sessions:e,cadence:t,completed:n,total:r,next:i,generatedAt:a}){return(0,U.jsx)(`section`,{"aria-label":`Your plan at a glance`,className:`overflow-hidden rounded-lg border border-border bg-report-surface`,children:(0,U.jsx)(`div`,{className:`grid sm:grid-cols-2 lg:grid-cols-[0.7fr_1fr_0.8fr_1.8fr]`,children:[{label:`Planned sessions`,value:e},{label:`Cadence`,value:t},{label:`Progress`,value:r>0?`${n} of ${r}`:`Not started`},{label:`Next action`,value:i?`${XA(a,i.day)} · ${i.title}`:r>0?`Plan complete`:`Confirm with your clinic`}].map(e=>(0,U.jsxs)(`div`,{className:`border-b border-border p-4 last:border-b-0 sm:[&:nth-child(odd)]:border-r lg:border-b-0 lg:border-r lg:last:border-r-0`,children:[(0,U.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.2em] text-gold`,children:e.label}),(0,U.jsx)(`p`,{className:`mt-2 text-sm font-medium leading-snug text-foreground`,children:e.value})]},e.label))})})}function BA({payload:e}){let t=[...(e.statedFocus??[]).map(e=>({source:`Your stated goal`,value:e})),...(e.keyFindings??[]).map(e=>({source:`Report finding`,value:e})),...(e.photoObservations??[]).map(e=>({source:`Photo observation`,value:e}))];return t.length===0?(0,U.jsx)(HA,{text:`Not assessed â no findings or stated goals were recorded for this Blueprint.`}):(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border`,children:(0,U.jsxs)(`table`,{className:`w-full border-collapse text-left text-sm`,children:[(0,U.jsx)(`thead`,{className:`bg-report-surface-quiet text-[10px] uppercase tracking-[0.18em] text-gold`,children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{className:`w-36 px-4 py-3 font-medium`,children:`Evidence`}),(0,U.jsx)(`th`,{className:`px-4 py-3 font-medium`,children:`Recorded detail`})]})}),(0,U.jsx)(`tbody`,{className:`divide-y divide-border`,children:t.map((e,t)=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{scope:`row`,className:`px-4 py-3 align-top text-xs font-medium text-foreground`,children:e.source}),(0,U.jsx)(`td`,{className:`px-4 py-3 leading-relaxed text-muted-foreground`,children:e.value})]},`${e.source}-${e.value}-${t}`))})]})}),(0,U.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Report findings are carried across unchanged. Photo observations require in-person confirmation.`})]})}function VA({items:e,empty:t}){return e.length===0?t?(0,U.jsx)(HA,{text:t}):null:(0,U.jsx)(`ol`,{className:`divide-y divide-border rounded-md border border-border`,children:e.map((e,t)=>(0,U.jsxs)(`li`,{className:`grid grid-cols-[2rem_1fr] gap-3 p-4 text-sm leading-relaxed`,children:[(0,U.jsx)(`span`,{className:`font-display text-lg text-gold`,children:String(t+1).padStart(2,`0`)}),(0,U.jsx)(`span`,{className:`text-foreground`,children:e})]},`${e}-${t}`))})}function HA({text:e}){return(0,U.jsx)(`p`,{className:`rounded-md border border-dashed border-border p-4 text-sm text-muted-foreground`,children:e})}function UA(e){let t=Ve(),n=[`blueprint-progress`,e],r=Ue({queryKey:n,queryFn:async()=>{try{return await Lk({blueprintId:e})}catch{return null}},retry:!1}),i=r.data===null,a=Be({mutationFn:t=>Rk({blueprintId:e,...t}),onMutate:async e=>{await t.cancelQueries({queryKey:n});let r=t.getQueryData(n)??[],i=e.completed?[...r,{stepId:e.stepId,completedAt:new Date().toISOString()}]:r.filter(t=>t.stepId!==e.stepId);return t.setQueryData(n,i),{previous:r}},onError:(e,r,i)=>{i?.previous&&t.setQueryData(n,i.previous),Z.error(`Could not save that step. Please try again.`)},onSettled:()=>void t.invalidateQueries({queryKey:n})});return{completed:(0,H.useMemo)(()=>new Set((r.data??[]).map(e=>e.stepId)),[r.data]),toggle:a.mutate,saving:a.isPending,unavailable:i}}var WA={immediate:`Immediate`,d30:`30 days`,d90:`90 days`,d180:`180 days`,d365:`365 days`};function GA({horizonKey:e,staff:t}){let n=e===`d365`?`Included with the 365-Day Blueprint add-on.`:`Included with the Full Beauty Blueprint.`;return(0,U.jsxs)(`section`,{className:`rounded-lg border border-dashed border-border p-5`,"aria-label":`${WA[e]} stage locked`,children:[(0,U.jsxs)(`p`,{className:`text-sm text-foreground`,children:[WA[e],` â locked`]}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t?`Locked (not purchased). Your plan does not include this view.`:n})]})}function KA({id:e,clinicName:t}){let n=t?.trim()||`your clinic`,r=Ue({queryKey:[`blueprint`,e],queryFn:()=>Pk({id:e})}),i=UA(e);if(r.isLoading)return(0,U.jsx)(`div`,{className:`mt-8 h-64 animate-pulse rounded-xl bg-muted/20`,"aria-hidden":!0});if(r.error)return(0,U.jsx)(`p`,{className:`mt-8 rounded border border-border bg-report-surface p-6 text-sm text-foreground`,children:r.error instanceof Error?r.error.message:`Could not load your Blueprint.`});let a=r.data;if(!a)return null;let o=a.payload,s=a.readOnly===!0,c=a.unlockedForClient??CA.filter(e=>o.horizons?.[e]!==void 0),l=kA(o),u=NA(l,i.completed),d=o.generatedAt??a.createdAt,f=u.next?.horizonKey??nj(o)[0],p=ij(o),m=rj(o),h=p?.scheduleStatus===`approved_general_protocol`,g=p?.intervalDays&&(h||aj(o))?`Every ${p.intervalDays} days`:`To be agreed with your clinician`,_=m>0?String(m):h?PA(p?.sessions)??`To be agreed`:`To be agreed`;return(0,U.jsxs)(`div`,{className:`mt-8 space-y-6`,children:[(0,U.jsx)(RA,{treatmentName:o.anchor?.name??p?.name??`Treatment Blueprint`,clinicName:n,generatedAt:d,selectedArea:p?.selectedArea??null,scope:sj(o)}),(0,U.jsx)(zA,{sessions:_,cadence:g,completed:u.completed,total:u.total,next:u.next,generatedAt:d}),l.length>0&&(0,U.jsx)(qA,{completed:u.completed,total:u.total,percent:u.percent,next:u.next,generatedAt:d,treatmentName:o.anchor?.name??null,clinicName:n}),aj(o)&&(0,U.jsx)(`div`,{className:`rounded border border-warning/30 bg-warning/5 p-4 text-sm text-foreground`,"data-testid":`legacy-blueprint-notice`,children:`This Blueprint was created with an earlier version. Its session count, timing and guidance were not clinically reviewed â confirm everything with your clinician before acting on it. Refresh it from your latest assessment for the current version.`}),s?(0,U.jsxs)(`div`,{className:`rounded border border-gold/30 bg-gold/10 p-4 text-sm text-gold`,children:[`Read-only staff view. The client has unlocked:`,` `,c.map(e=>WA[e]).join(`, `),`. Stages marked âLocked (not purchased)â are not part of the clientâs plan â do not present them as already purchased.`]}):c.length<CA.length&&(0,U.jsxs)(`div`,{className:`rounded border border-gold/30 bg-gold/10 p-4 text-sm text-gold`,children:[`Your Blueprint includes `,c.map(e=>WA[e]).join(`, `),`. Locked stages are shown below.`]}),(0,U.jsx)(aA,{title:`Why this plan is yours`,summary:`Your stated goals and the assessment evidence used for this plan.`,defaultOpen:!0,children:(0,U.jsx)(BA,{payload:o})}),(0,U.jsxs)(aA,{title:`Before treatment`,summary:o.beforeFirstSession?.length?`${o.beforeFirstSession.length} item${o.beforeFirstSession.length===1?``:`s`} to confirm with your clinician.`:`No preparation items were recorded.`,defaultOpen:!0,children:[(0,U.jsx)(VA,{items:o.beforeFirstSession??[],empty:`Not assessed â confirm preparation requirements with your clinic.`}),(0,U.jsx)(`p`,{className:`mt-4 text-xs leading-relaxed text-muted-foreground`,children:`Bring this checklist to your consultation. These are confirmation points, not instructions to follow on your own.`})]}),l.length>0&&a.progressEnabled===!0&&(0,U.jsxs)(aA,{title:`Track your plan steps`,summary:i.unavailable?`${u.total} steps in day order.`:`${u.completed} of ${u.total} done â tick each step as you complete it.`,defaultOpen:!0,children:[(0,U.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-muted-foreground`,"data-testid":`ticks-note`,children:`Ticks record actions youâve completed. They are not a measure of clinical results.`}),i.unavailable&&(0,U.jsx)(`p`,{className:`mb-4 rounded border border-border/70 p-3 text-xs text-muted-foreground`,children:`Marking steps as done isnât available just yet â your plan below is complete and unaffected.`}),(0,U.jsx)(`ol`,{className:`space-y-3`,children:l.map(e=>(0,U.jsx)(JA,{step:e,generatedAt:d,completed:i.completed,onToggle:t=>i.toggle({stepId:e.id,completed:t}),disabled:s||i.saving||i.unavailable,horizonLabel:o.horizons[e.horizonKey]?.label??``},e.id))})]}),o.skinAge&&(0,U.jsxs)(aA,{title:`Estimated skin age`,summary:`Your estimate is ${o.skinAge.value}.`,children:[(0,U.jsx)(`p`,{className:`font-display text-4xl text-foreground`,children:o.skinAge.value}),(0,U.jsx)(`p`,{className:`mt-3 text-[11px] leading-relaxed text-muted-foreground`,children:o.skinAge.disclaimer})]}),o.contraindications.length>0&&(0,U.jsxs)(`section`,{className:`rounded-lg border border-warning/30 bg-warning/5 p-6`,children:[(0,U.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.2em] text-warning`,children:`Safety decision`}),(0,U.jsx)(`h2`,{className:`mt-2 font-display text-xl text-foreground`,children:`Excluded for your safety`}),(0,U.jsx)(`ul`,{className:`mt-4 divide-y divide-warning/20 text-sm text-foreground`,children:o.contraindications.map(e=>(0,U.jsxs)(`li`,{className:`grid gap-1 py-3 sm:grid-cols-[minmax(9rem,0.7fr)_1.3fr]`,children:[(0,U.jsx)(`span`,{className:`font-semibold`,children:e.item}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e.reason})]},`${e.item}-${e.kind}`))})]}),o.practical&&(0,U.jsxs)(aA,{title:`Preparation, aftercare and recovery`,summary:o.practical.status===`approved`?`Approved guidance for your treatment.`:`Waiting for clinician review.`,children:[o.practical.status===`approved`?(0,U.jsxs)(`div`,{className:`space-y-3`,children:[o.practical.recovery&&(0,U.jsx)(`p`,{className:`rounded-md border border-border bg-report-surface-quiet p-4 text-sm leading-relaxed text-muted-foreground`,children:o.practical.recovery}),(o.practical.homeCare?.length??0)>0&&(0,U.jsxs)(`div`,{"data-testid":`practical-home-care`,children:[(0,U.jsx)(`h4`,{className:`text-sm font-medium text-foreground`,children:`Home care`}),(0,U.jsx)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,children:o.practical.homeCare.map(e=>(0,U.jsx)(`li`,{children:e},e))})]}),(o.practical.aftercare?.length??0)>0&&(0,U.jsxs)(`div`,{"data-testid":`practical-aftercare`,children:[(0,U.jsx)(`h4`,{className:`text-sm font-medium text-foreground`,children:`Aftercare and recovery`}),(0,U.jsx)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,children:o.practical.aftercare.map(e=>(0,U.jsx)(`li`,{children:e},e))})]})]}):(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`practical-pending`,children:o.practical.note}),(0,U.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`When to
187seek help is covered in the Safety and contact box.`})]}),o.safetySummary&&(0,U.jsx)(dA,{summary:o.safetySummary,clinicName:t}),CA.map(e=>{let t=o.horizons[e],r=c.includes(e),a=s?r?`Unlocked for client`:`Locked (not purchased)`:null;return t?tj(t)?(0,U.jsx)(QA,{horizonKey:e,payload:o,clinicName:n,defaultOpen:e===f,stepsHere:l.filter(t=>t.horizonKey===e),completed:i.completed,staffLabel:a},e):(0,U.jsxs)(`section`,{className:`rounded-lg border border-border/60 p-5`,children:[(0,U.jsx)(`p`,{className:`text-sm text-foreground`,children:t.label}),(0,U.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Review checkpoint â `,IA[e]]}),a&&(0,U.jsx)(`p`,{className:`mt-2 text-[11px] uppercase tracking-[0.2em] text-gold`,children:a})]},e):(0,U.jsx)(GA,{horizonKey:e,staff:s},e)}),(o.afterPlan?.expectedResults?.length||o.afterPlan?.nextSteps?.length)&&(0,U.jsxs)(aA,{title:`Expected result and review decision`,summary:`What your assessment recorded and the decision after treatment.`,children:[o.afterPlan?.expectedResults&&o.afterPlan.expectedResults.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`What to expect`}),(0,U.jsx)(VA,{items:o.afterPlan.expectedResults})]}),o.afterPlan?.nextSteps&&o.afterPlan.nextSteps.length>0&&(0,U.jsxs)(`div`,{className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`Next steps`}),(0,U.jsx)(VA,{items:o.afterPlan.nextSteps})]})]}),o.discussionTopics&&o.discussionTopics.length>0&&(0,U.jsx)(aA,{title:`Discuss with your clinician`,summary:`${o.discussionTopics.length} topic${o.discussionTopics.length===1?``:`s`} to raise at your appointment.`,children:(0,U.jsx)(VA,{items:o.discussionTopics})}),oj(o)&&(0,U.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This treatment is scheduled as a single session, so there are no further steps planned yet. `,n,` will advise on anything further after assessing your results.`]}),(0,U.jsxs)(`section`,{className:`border-t border-border pt-5`,role:`note`,children:[(0,U.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`Important information`}),(0,U.jsx)(`p`,{className:`mt-2 max-w-3xl text-xs leading-relaxed text-muted-foreground`,children:o.disclaimer})]})]})}function qA({completed:e,total:t,percent:n,next:r,generatedAt:i,treatmentName:a,clinicName:o}){return(0,U.jsxs)(`section`,{className:`rounded-lg border border-border bg-report-surface p-6`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.25em] text-gold`,children:`Your progress`}),(0,U.jsxs)(`p`,{className:`mt-2 font-display text-2xl text-foreground`,children:[e,` of `,t,` steps complete`]})]}),(0,U.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[a?`${a} · `:``,o]})]}),(0,U.jsx)(`div`,{className:`mt-4 h-2 w-full overflow-hidden rounded-full bg-border`,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Blueprint progress`,children:(0,U.jsx)(`div`,{className:`h-full bg-gold transition-all`,style:{width:`${n}%`}})}),(0,U.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:r?`Next: ${r.title} â ${XA(i,r.day)}`:`Every step in this plan is marked complete.`})]})}function JA({step:e,generatedAt:t,completed:n,onToggle:r,disabled:i,horizonLabel:a}){let o=MA(e,n,t,new Date),s=o===`completed`;return(0,U.jsxs)(`li`,{className:`grid grid-cols-[auto_1fr_auto] items-start gap-3 rounded border p-4 ${o===`due`&&!s?`border-gold/50 bg-gold/5`:`border-border`}`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:s,disabled:i,onChange:e=>r(e.target.checked),"aria-label":`Mark "${e.title}" as ${s?`not done`:`done`}`,className:`mt-1 h-4 w-4 shrink-0 accent-gold`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:`text-sm ${s?`text-muted-foreground line-through`:`text-foreground`}`,children:e.title}),(0,U.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.undated?`Within days ${wA[e.horizonKey]?.fromDay??0}â${wA[e.horizonKey]?.toDay??0}`:`Day ${e.day} · ${XA(t,e.day)}`,a?` · ${a}`:``,` ·`,` `,(0,U.jsx)(`span`,{className:o===`due`&&!s?`text-gold`:``,children:s?`Completed`:o===`due`?`Due now`:`Upcoming`})]}),e.detail&&(0,U.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:e.detail})]}),(0,U.jsx)(`span`,{className:`rounded-full border px-2 py-1 text-[9px] uppercase tracking-[0.14em] ${s?`border-success/30 text-success`:o===`due`?`border-gold/40 text-gold`:`border-border text-muted-foreground`}`,children:s?`Done`:o===`due`?`Due`:`Upcoming`})]})}var YA={ready:`Ready`,review_checkpoint:`Review checkpoint`,not_applicable:`Review checkpoint`,information_unavailable:`Information unavailable`,needs_clinician_review:`Needs clinician review`};function XA(e,t){let n=jA(e,t);return Number.isNaN(n.getTime())?`day ${t}`:new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}).format(n)}function ZA(e){let t=new Date(e);return Number.isNaN(t.getTime())?`date not available`:new Intl.DateTimeFormat(`en-US`,{month:`long`,day:`numeric`,year:`numeric`}).format(t)}function QA({horizonKey:e,payload:t,clinicName:n,defaultOpen:r,stepsHere:i,completed:a,staffLabel:o=null}){let s=t.horizons[e],c=t.narration?.textByHorizon?.[e],l=(s.ingredients?.excluded??[]).filter(e=>e.reason!==`slot_capacity`&&e.reason!==`conflict_deferred`),u=s.skincare,d=i.filter(e=>a.has(e.id)).length,f=CA.slice(0,CA.indexOf(e)).some(e=>t.horizons?.[e]?.recoveryNote===s.recoveryNote),p=[];return s.treatments.length>0&&p.push(`${s.treatments.length} treatment${s.treatments.length===1?``:`s`}`),i.length>0&&p.push(`${d}/${i.length} steps done`),u&&p.push(`skincare routine`),s.recoveryNote&&p.push(`recovery note`),(0,U.jsxs)(aA,{title:s.label,summary:p.join(` · `)||void 0,badge:i.length>0&&d===i.length?`Complete`:null,defaultOpen:r,children:[o&&(0,U.jsx)(`p`,{className:`mb-3 text-[11px] uppercase tracking-[0.2em] text-gold`,children:o}),s.content&&(0,U.jsxs)(`div`,{className:`mb-5 space-y-3 rounded-md border border-border p-4`,"data-testid":`stage-content`,children:[(0,U.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.18em] text-gold`,children:YA[s.content.status]}),(0,U.jsx)(`p`,{className:`text-sm text-foreground`,children:s.content.objective}),s.content.reviewNotes.length>0&&(0,U.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 text-xs text-muted-foreground`,children:s.content.reviewNotes.map(e=>(0,U.jsx)(`li`,{children:e},e))}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:`Questions for your clinician`}),(0,U.jsx)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-xs text-muted-foreground`,children:s.content.reviewQuestions.map(e=>(0,U.jsx)(`li`,{children:e},e))})]})]}),c&&(0,U.jsx)(`p`,{className:`border-l-2 border-gold pl-4 text-sm leading-relaxed text-foreground`,children:c}),u&&(0,U.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,U.jsxs)(`div`,{className:`rounded-md border border-border bg-report-surface-quiet p-4`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`Morning routine`}),(0,U.jsx)(`ol`,{className:`mt-3 space-y-3 text-sm text-muted-foreground`,children:u.am.map((e,t)=>(0,U.jsxs)(`li`,{className:`grid grid-cols-[1.5rem_1fr] gap-2`,children:[(0,U.jsx)(`span`,{className:`text-gold`,children:t+1}),(0,U.jsx)(`span`,{children:e})]},`${e}-${t}`))})]}),(0,U.jsxs)(`div`,{className:`rounded-md border border-border bg-report-surface-quiet p-4`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`Evening routine`}),(0,U.jsx)(`ol`,{className:`mt-3 space-y-3 text-sm text-muted-foreground`,children:u.pm.map((e,t)=>(0,U.jsxs)(`li`,{className:`grid grid-cols-[1.5rem_1fr] gap-2`,children:[(0,U.jsx)(`span`,{className:`text-gold`,children:t+1}),(0,U.jsx)(`span`,{children:e})]},`${e}-${t}`))})]})]}),l.length>0&&(0,U.jsxs)(`div`,{className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`Avoid for now`}),(0,U.jsx)(`ul`,{className:`mt-2 divide-y divide-border rounded-md border border-border text-sm text-muted-foreground`,children:l.map(e=>(0,U.jsxs)(`li`,{className:`grid gap-1 p-3 sm:grid-cols-[minmax(8rem,0.7fr)_1.3fr]`,children:[(0,U.jsx)(`span`,{className:`font-medium text-foreground`,children:e.key}),(0,U.jsx)(`span`,{children:e.detail})]},e.key))})]}),s.treatments.length>0&&(0,U.jsxs)(`div`,{className:`mt-5`,children:[(0,U.jsxs)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:[`Professional treatments at `,n]}),(0,U.jsx)(`ul`,{className:`mt-3 grid gap-3`,children:s.treatments.map((e,t)=>(0,U.jsxs)(`li`,{className:`rounded-md border border-border bg-report-surface-quiet p-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`font-display text-xl text-foreground`,children:e.name}),e.selectedArea&&(0,U.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Area: `,e.selectedArea]})]}),(0,U.jsx)(`span`,{className:`rounded-full border border-gold/40 px-2.5 py-1 text-[10px] uppercase tracking-[0.15em] text-gold`,children:e.sessions&&e.scheduleStatus!==`to_be_agreed`?`${PA(e.sessions)}${e.scheduleStatus===`approved_general_protocol`?` · general protocol, for discussion`:``}`:`Session number and timing to be agreed with your clinician`})]}),e.notOfferedHere&&(0,U.jsxs)(`p`,{className:`mt-3 text-xs text-warning`,children:[`Not offered at `,n]}),e.catalogueOption&&(0,U.jsxs)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:[`Clinic catalogue option â listed by `,n,`, not a personalised recommendation.`]}),(0,U.jsx)(`div`,{className:`mt-3 border-t border-border pt-3`,children:(0,U.jsx)($A,{range:e.priceRange,clinicName:n})})]},`${e.name}-${t}`))})]}),!u&&s.checkpoints.length>0&&(0,U.jsxs)(`div`,{className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`Session schedule`}),(0,U.jsx)(`ol`,{className:`mt-3 divide-y divide-border rounded-md border border-border text-sm text-muted-foreground`,children:s.checkpoints.map(e=>(0,U.jsxs)(`li`,{className:`grid gap-1 p-4 sm:grid-cols-[7rem_1fr]`,children:[(0,U.jsxs)(`span`,{className:`font-medium text-gold`,children:[`Day `,e.day]}),(0,U.jsx)(`span`,{children:e.observe})]},`${e.day}-${e.observe}`))})]}),s.recoveryNote&&f&&(0,U.jsx)(`p`,{className:`mt-5 text-xs text-muted-foreground`,children:`Recovery guidance: see the first stage above.`}),s.recoveryNote&&!f&&(0,U.jsxs)(`div`,{className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`Recovery and downtime`}),(0,U.jsx)(`p`,{className:`mt-2 rounded-md border border-border bg-report-surface-quiet p-4 text-sm leading-relaxed text-muted-foreground`,children:s.recoveryNote})]}),s.reassessment&&(0,U.jsxs)(`div`,{className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`After your treatment`}),(0,U.jsxs)(`p`,{className:`mt-2 rounded-md border border-gold/30 bg-gold/5 p-4 text-sm text-muted-foreground`,children:[(0,U.jsxs)(`span`,{className:`font-medium text-gold`,children:[`Day `,s.reassessment.day]}),` â `,s.reassessment.action]})]}),s.lifestyle.length>0&&(0,U.jsxs)(`div`,{className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] uppercase tracking-[0.2em] text-gold`,children:`Lifestyle`}),(0,U.jsx)(`ul`,{className:`mt-2 space-y-2 text-sm text-muted-foreground`,children:s.lifestyle.map(e=>(0,U.jsx)(`li`,{children:e},e))})]}),s.budgetDetail?(0,U.jsx)(uA,{budget:s.budgetDetail,clinicName:n}):s.budget&&s.budget.max>0&&(0,U.jsxs)(`div`,{className:`mt-5 rounded-md border border-border p-4`,children:[(0,U.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.18em] text-gold`,children:`Indicative spend`}),s.budget.estimatedIncluded?(0,U.jsxs)(`p`,{className:`mt-2 text-sm text-foreground`,children:[`Price unavailable â some treatments have no published price at `,n,`.`]}):(0,U.jsxs)(`p`,{className:`mt-2 font-display text-2xl text-foreground`,children:[ej(s.budget.min,s.budget.currency),` â `,ej(s.budget.max,s.budget.currency)]}),s.budget.treatmentBudgetOmitted&&(0,U.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Treatment pricing is not published by `,n,`.`]})]}),(0,U.jsx)(`p`,{className:`mt-5 text-xs leading-relaxed text-muted-foreground`,"data-testid":`stage-variability`,children:TA})]})}function $A({range:e,clinicName:t}){return!e||e.min<=0||e.source===`ai_estimate`?(0,U.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[`Price unavailable â ask `,t]}):(0,U.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[`${ej(e.min,e.currency)} â ${ej(e.max,e.currency)}
187`,` `,(0,U.jsxs)(`span`,{className:`text-muted-foreground/70`,children:[`at `,t]})]})}function ej(e,t){return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:t}).format(e/100)}function tj(e){if(!e)return!1;let t=(e.ingredients?.excluded??[]).filter(e=>e.reason!==`slot_capacity`&&e.reason!==`conflict_deferred`);return!!e.skincare||e.treatments.length>0||e.checkpoints.length>0||e.lifestyle.length>0||e.priorities.length>0||t.length>0||!!e.reassessment||!!e.recoveryNote||!!e.budget||!!(e.budgetDetail&&e.budgetDetail.status!==`none`)||!!(e.content&&e.content.status!==`not_applicable`)}function nj(e){return CA.filter(t=>tj(e.horizons?.[t]))}function rj(e){return CA.reduce((t,n)=>t+(e.horizons?.[n]?.checkpoints?.length??0),0)}function ij(e){for(let t of CA){let n=e.horizons?.[t]?.treatments?.[0];if(n)return n}return null}function aj(e){return!e.payloadSchema}function oj(e){return e.basis===`treatment_plan`&&rj(e)===1}function sj(e){if(e.basis!==`treatment_plan`)return`A step-by-step plan across five time horizons, built from your skin assessment.`;let t=e.anchor?.name??`your treatment`,n=rj(e);return!aj(e)&&n===0?`Your plan for ${t}: five review points, questions for your clinician, and what to agree before treatment. Sessions and timing are agreed with your clinician.`:n<=1?`Your plan covers your ${t} session and what follows it.`:`Your plan covers ${n} ${t} sessions and what follows them.`}var cj=q(`/_authenticated/dashboard/consultations/$id/chat`)({head:()=>({meta:[{title:`Consultation chat · ${X.name}`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.consultations._id.chat-CYOMXZXE.js`),__vite__mapDeps([341,3,4,342,343,262,344,345,47,22,23,10,9,20,21,12,13,14,83,48,44,346,347,348,33,8,271,94,7,349,350,351,352,353,354,355,356,357,358,130,133,75,76,1,2,5,77,80,71,45,32,43,204])),`component`),errorComponent:J(()=>P(()=>import(`./dashboard.consultations._id.chat-Dl_-WFLI.js`),__vite__mapDeps([359,3,10,9])),`errorComponent`)}),lj=q(`/_authenticated/dashboard/consultations/$id/simulate`)({beforeLoad:({params:e})=>{throw s({to:`/dashboard/consultations/$id`,params:{id:e.id}})}}),uj=q(`/_authenticated/dashboard/reports/treatment/$treatmentId`)({head:()=>({meta:[{title:`Treatment photo progress · ${X.name}`},{name:`description`,content:`Compare a current photo of your treatment area with an earlier one.`},{property:`og:title`,content:`Treatment photo progress · ${X.name}`},{property:`og:description`,content:`Compare a current photo of your treatment area with an earlier one.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary`},{name:`robots`,content:`noindex,nofollow`}]}),component:J(()=>P(()=>import(`./dashboard.reports.treatment._treatmentId-Ble0glFo.js`),__vite__mapDeps([360,3,4,47,22,23,10,9,20,21,12,13,14,8,257,16,133,75,76,1,2,5,77,80,142,71,45,32,48,44,43,319])),`component`)}),dj=Wm.update({id:`/`,path:`/`,getParentRoute:()=>Q}),fj=Jm.update({id:`/$`,path:`/$`,getParentRoute:()=>Q}),pj=ug.update({id:`/_authenticated`,getParentRoute:()=>Q}),mj=dg.update({id:`/accessibility`,path:`/accessibility`,getParentRoute:()=>Q}),hj=fg.update({id:`/ai-privacy`,path:`/ai-privacy`,getParentRoute:()=>Q}),gj=pg.update({id:`/ai-terms`,path:`/ai-terms`,getParentRoute:()=>Q}),_j=gg.update({id:`/auth`,path:`/auth`,getParentRoute:()=>Q}),vj=_g.update({id:`/cancellation`,path:`/cancellation`,getParentRoute:()=>Q}),yj=Sg.update({id:`/clinics`,path:`/clinics`,getParentRoute:()=>Q}),bj=Cg.update({id:`/contact-legal`,path:`/contact-legal`,getParentRoute:()=>Q}),xj=wg.update({id:`/cookie-policy`,path:`/cookie-policy`,getParentRoute:()=>Q}),Sj=Tg.update({id:`/cookies`,path:`/cookies`,getParentRoute:()=>Q}),Cj=Eg.update({id:`/demo`,path:`/demo`,getParentRoute:()=>Q}),wj=Dg.update({id:`/earnings-disclaimer`,path:`/earnings-disclaimer`,getParentRoute:()=>Q}),Tj=Og.update({id:`/for-spas`,path:`/for-spas`,getParentRoute:()=>Q}),Ej=kg.update({id:`/forgot-password`,path:`/forgot-password`,getParentRoute:()=>Q}),Dj=Ag.update({id:`/how-it-works`,path:`/how-it-works`,getParentRoute:()=>Q}),Oj=jg.update({id:`/medical-disclaimer`,path:`/medical-disclaimer`,getParentRoute:()=>Q}),kj=Lg.update({id:`/pricing`,path:`/pricing`,getParentRoute:()=>Q}),Aj=Rg.update({id:`/privacy`,path:`/privacy`,getParentRoute:()=>Q}),jj=zg.update({id:`/purchase-terms`,path:`/purchase-terms`,getParentRoute:()=>Q}),Mj=Bg.update({id:`/reset-password`,path:`/reset-password`,getParentRoute:()=>Q}),Nj=Vg.update({id:`/start-consultation`,path:`/start-consultation`,getParentRoute:()=>Q}),Pj=Hg.update({id:`/terms`,path:`/terms`,getParentRoute:()=>Q}),Fj=Ug.update({id:`/testimonial-disclosure`,path:`/testimonial-disclosure`,getParentRoute:()=>Q}),Ij=o_.update({id:`/_clinic-admin`,getParentRoute:()=>pj}),Lj=s_.update({id:`/_seo`,getParentRoute:()=>pj}),Rj=c_.update({id:`/_super-admin`,getParentRoute:()=>pj}),zj=l_.update({id:`/complete-profile`,path:`/complete-profile`,getParentRoute:()=>pj}),Bj=u_.update({id:`/dashboard`,path:`/dashboard`,getParentRoute:()=>pj}),Vj=d_.update({id:`/onboarding`,path:`/onboarding`,getParentRoute:()=>pj}),Hj=f_.update({id:`/callback`,path:`/callback`,getParentRoute:()=>_j}),Uj=p_.update({id:`/check-email`,path:`/check-email`,getParentRoute:()=>_j}),Wj=m_.update({id:`/choose-role`,path:`/choose-role`,getParentRoute:()=>_j}),Gj=__.update({id:`/booking/confirm`,path:`/booking/confirm`,getParentRoute:()=>Q}),Kj=v_.update({id:`/checkout/`,path:`/checkout/`,getParentRoute:()=>Q}),qj=y_.update({id:`/checkout/return`,path:`/checkout/return`,getParentRoute:()=>Q}),Jj=N_.update({id:`/clinic/$clinicSlug`,path:`/clinic/$clinicSlug`,getParentRoute:()=>Q}),Yj=F_.update({id:`/invite/accept`,path:`/invite/accept`,getParentRoute:()=>Q}),Xj=I_.update({id:`/join/client`,path:`/join/client`,getParentRoute:()=>Q}),Zj=L_.update({id:`/join/spa-owner`,path:`/join/spa-owner`,getParentRoute:()=>Q}),Qj=R_.update({id:`/seo`,path:`/seo`,getParentRoute:()=>Lj}),$j=z_.update({id:`/`,path:`/`,getParentRoute:()=>Bj}),eM=B_.update({id:`/account`,path:`/account`,getParentRoute:()=>Bj}),tM=V_.update({id:`/annual-reports`,path:`/annual-reports`,getParentRoute:()=>Bj}),nM=H_.update({id:`/appointments`,path:`/appointments`,getParentRoute:()=>Bj}),rM=U_.update({id:`/billing`,path:`/billing`,getParentRoute:()=>Bj}),iM=W_.update({id:`/blueprint`,path:`/blueprint`,getParentRoute:()=>Bj}),aM=G_.update({id:`/clinics`,path:`/clinics`,getParentRoute:()=>Bj}),oM=K_.update({id:`/coach`,path:`/coach`,getParentRoute:()=>Bj}),sM=q_.update({id:`/consultations`,path:`/consultations`,getParentRoute:()=>Bj}),cM=J_.update({id:`/early-access`,path:`/early-access`,getParentRoute:()=>Bj}),lM=Y_.update({id:`/issues`,path:`/issues`,getParentRoute:()=>Bj}),uM=X_.update({id:`/monthly-reports`,path:`/monthly-reports`,getParentRoute:()=>Bj}),dM=Z_.update({id:`/reports`,path:`/reports`,getParentRoute:()=>Bj}),fM=Q_.update({id:`/vip-discount`,path:`/vip-discount`,getParentRoute:()=>Bj}),pM=$_.update({id:`/`,path:`/`,getParentRoute:()=>Jj}),mM=ev.update({id:`/_members`,getParentRoute:()=>Jj}),hM=tv.update({id:`/book`,path:`/book`,getParentRoute:()=>Jj}),gM=nv.update({id:`/consultation`,path:`/consultation`,getParentRoute:()=>Jj}),_M=rv.update({id:`/locations`,path:`/locations`,getParentRoute:()=>Jj}),vM=ov.update({id:`/report`,path:`/report`,getParentRoute:()=>Jj}),yM=lv.update({id:`/simulate`,path:`/simulate`,getParentRoute:()=>Jj}),bM=uv.update({id:`/dashboard/audit`,path:`/dashboard/audit`,getParentRoute:()=>Ij}),xM=dv.update({id:`/dashboard/blueprint-365`,path:`/dashboard/blueprint-365`,getParentRoute:()=>Ij}),SM=fv.update({id:`/dashboard/booking-requests`,path:`/dashboard/booking-requests`,getParentRoute:()=>Ij}),CM=pv.update({id:`/dashboard/branding`,path:`/dashboard/branding`,getParentRoute:()=>Ij}),wM=mv.update({id:`/dashboard/clients`,path:`/dashboard/clients`,getParentRoute:()=>Ij}),TM=hv.update({id:`/dashboard/domains`,path:`/dashboard/domains`,getParentRoute:()=>Ij}),EM=gv.update({id:`/dashboard/leads`,path:`/dashboard/leads`,getParentRoute:()=>Ij}),DM=_v.update({id:`/dashboard/locations`,path:`/dashboard/locations`,getParentRoute:()=>Ij}),OM=vv.update({id:`/dashboard/notifications`,path:`/dashboard/notifications`,getParentRoute:()=>Ij}),kM=yv.update({id:`/dashboard/portal`,path:`/dashboard/portal`,getParentRoute:()=>Ij}),AM=bv.update({id:`/dashboard/profile`,path:`/dashboard/profile`,getParentRoute:()=>Ij}),jM=xv.update({id:`/dashboard/questions`,path:`/dashboard/questions`,getParentRoute:()=>Ij}),MM=Sv.update({id:`/dashboard/revenue-split`,path:`/dashboard/revenue-split`,getParentRoute:()=>Ij}),NM=Cv.update({id:`/dashboard/roles`,path:`/dashboard/roles`,getParentRoute:()=>Ij}),PM=wv.update({id:`/dashboard/staff`,path:`/dashboard/staff`,getParentRoute:()=>Ij}),FM=bO.update({id:`/dashboard/treatments`,path:`/dashboard/treatments`,getParentRoute:()=>Ij}),IM=wO.update({id:`/dashboard/vip-benefits`,path:`/dashboard/vip-benefits`,getParentRoute:()=>Ij}),LM=TO.update({id:`/seo_/$routeId`,path:`/seo/$routeId`,getParentRoute:()=>Lj}),RM=EO.update({id:`/super-admin/`,path:`/super-admin/`,getParentRoute:()=>Rj}),zM=DO.update({id:`/super-admin/ai-guidance`,path:`/super-admin/ai-guidance`,getParentRoute:()=>Rj}),BM=OO.update({id:`/super-admin/ai-providers`,path:`/super-admin/ai-providers`,getParentRoute:()=>Rj}),VM=kO.update({id:`/super-admin/ai-router`,path:`/super-admin/ai-router`,getParentRoute:()=>Rj}),HM=AO.update({id:`/super-admin/ai-usage`,path:`/super-admin/ai-usage`,getParentRoute:()=>Rj}),UM=jO.update({id:`/super-admin/atlas-entitlement`,path:`/super-admin/atlas-entitlement`,getParentRoute:()=>Rj}),WM=MO.update({id:`/super-admin/catalog-audit`,path:`/super-admin/catalog-audit`,getParentRoute:()=>Rj}),GM=NO.update({id:`/super-admin/clinical-approvals`,path:`/super-admin/clinical-approvals`,getParentRoute:()=>Rj}),KM=PO.update({id:`/super-admin/clinics`,path:`/super-admin/clinics`,getParentRoute:()=>Rj}),qM=FO.update({id:`/super-admin/default-questions`,path:`/super-admin/default-questions`,getParentRoute:()=>Rj}),JM=IO.update({id:`/super-admin/default-treatments`,path:`/super-admin/default-treatments`,getParentRoute:()=>Rj}),YM=LO.update({id:`/super-admin/early-access`,path:`/super-admin/early-access`,getParentRoute:()=>Rj}),XM=RO.update({id:`/super-admin/founding`,path:`/super-admin/founding`,getParentRoute:()=>Rj}),ZM=zO.update({id:`/super-admin/issues`,path:`/super-admin/issues`,getParentRoute:()=>Rj}),QM=BO.update({id:`/super-admin/patients`,path:`/super-admin/patients`,getParentRoute:()=>Rj}),$M=VO.update({id:`/super-admin/question-preview`,path:`/super-admin/question-preview`,getParentRoute:()=>Rj}),eN=HO.update({id:`/super-admin/report-prompts`,path:`/super-admin/report-prompts`,getParentRoute:()=>Rj}),tN=UO.update({id:`/super-admin/seo`,path:`/super-admin/seo`,getParentRoute:()=>Rj}),nN=WO.update({id:`/super-admin/sim-prompts`,path:`/super-admin/sim-prompts`,getParentRoute:()=>Rj}),rN=qO.update({id:`/super-admin/simulations`,path:`/super-admin/simulations`,getParentRoute:()=>Rj}),iN=JO.update({id:`/super-admin/subscription-pricing`,path:`/super-admin/subscription-pricing`,getParentRoute:()=>Rj}),aN=YO.update({id:`/super-admin/subscriptions`,path:`/super-admin/subscriptions`,getParentRoute:()=>Rj}),oN=XO.update({id:`/super-admin/system`,path:`/super-admin/system`,getParentRoute:()=>Rj}),sN=ZO.update({id:`/super-admin/users`,path:`/super-admin/users`,getParentRoute:()=>Rj}),cN=QO.update({id:`/super-admin/waitlist`,path:`/super-admin/waitlist`,getParentRoute:()=>Rj}),lN=$O.update({id:`/`,path:`/`,getParentRoute:()=>eM}),uN=ek.update({id:`/preferences`,path:`/preferences`,getParentRoute:()=>eM}),dN=tk.update({id:`/profile`,path:`/profile`,getParentRoute:()=>eM}),fN=nk.update({id:`/security`,path:`/security`,getParentRoute:()=>eM}),pN=rk.update({id:`/`,path:`/`,getParentRoute:()=>tM}),mN=ik.update({id:`/$reportId`,path:`/$reportId`,getParentRoute:()=>tM}),hN=ak.update({id:`/`,path:`/`,getParentRoute:()=>sM}),gN=ok.update({id:`/`,path:`/`,getParentRoute:()=>lM}),_N=sk.update({id:`/$id`,path:`/$id`,getParentRoute:()=>lM}),vN=ck.update({id:`/new`,path:`/new`,getParentRoute:()=>lM}),yN=lk.update({id:`/`,path:`/`,getParentRoute:()=>uM}),bN=uk.update({id:`/`,path:`/`,getParentRoute:()=>dM}),xN=dk.update({id:`/$reportId`,path:`/$reportId`,getParentRoute:()=>dM}),SN=fk.update({id:`/dashboard/analytics/`,path:`/dashboard/analytics/`,getParentRoute:()=>Ij}),CN=pk.update({id:`/dashboard/analytics/$reportId`,path:`/dashboard/analytics/$reportId`,getParentRoute:()=>Ij}),wN=mk.update({id:`/dashboard/analytics/locations`,path:`/dashboard/analytics/locations`,getParentRoute:()=>Ij}),TN=hk.update({id:`/dashboard/blueprints/`,path:`/dashboard/blueprints/`,getParentRoute:()=>Ij}),EN=gk.update({id:`/dashboard/blueprints/$id`,path:`/dashboard/blueprints/$id`,getParentRoute:()=>Ij}),DN=_k.update({id:`/`,path:`/`,getParentRoute:()=>wM}),ON=vk.update({id:`/$consultationId`,path:`/$consultationId`,getParentRoute:()=>wM}),kN=Ck.update({id:`/$id`,path:`/$id`,getParentRoute:()=>EM}),AN=wk.update({id:`/super-admin/blueprints/`,path:`/super-admin/blueprints/`,getParentRoute:()=>Rj}),jN=Tk.update({id:`/super-admin/blueprints/$id`,path:`/super-admin/blueprints/$id`,getParentRoute:()=>Rj}),MN=Ek.update({id:`/`,path:`/`,getParentRoute:()=>ZM}),NN=Dk.update({id:`/$id`,path:`/$id`,getParentRoute:()=>ZM}),PN=Ok.update({id:`/super-admin/seo_/$routeId`,path:`/super-admin/seo/$routeId`,getParentRoute:()=>Rj}),FN=kk.update({id:`/$id/`,path:`/$id/`,getParentRoute:()=>sM}),IN=LA.update({id:`/$id/blueprint`,path:`/$id/blueprint`,getParentRoute:()=>sM}),LN=cj.update({id:`/$id/chat`,path:`/$id/chat`,getParentRoute:()=>sM}
187),RN=lj.update({id:`/$id/simulate`,path:`/$id/simulate`,getParentRoute:()=>sM}),zN=uj.update({id:`/treatment/$treatmentId`,path:`/treatment/$treatmentId`,getParentRoute:()=>dM}),BN={AuthenticatedClinicAdminDashboardClientsConsultationIdRoute:ON,AuthenticatedClinicAdminDashboardClientsIndexRoute:DN},VN=wM._addFileChildren(BN),HN={AuthenticatedClinicAdminDashboardLeadsIdRoute:kN},UN={AuthenticatedClinicAdminDashboardAuditRoute:bM,AuthenticatedClinicAdminDashboardBlueprint365Route:xM,AuthenticatedClinicAdminDashboardBookingRequestsRoute:SM,AuthenticatedClinicAdminDashboardBrandingRoute:CM,AuthenticatedClinicAdminDashboardClientsRoute:VN,AuthenticatedClinicAdminDashboardDomainsRoute:TM,AuthenticatedClinicAdminDashboardLeadsRoute:EM._addFileChildren(HN),AuthenticatedClinicAdminDashboardLocationsRoute:DM,AuthenticatedClinicAdminDashboardNotificationsRoute:OM,AuthenticatedClinicAdminDashboardPortalRoute:kM,AuthenticatedClinicAdminDashboardProfileRoute:AM,AuthenticatedClinicAdminDashboardQuestionsRoute:jM,AuthenticatedClinicAdminDashboardRevenueSplitRoute:MM,AuthenticatedClinicAdminDashboardRolesRoute:NM,AuthenticatedClinicAdminDashboardStaffRoute:PM,AuthenticatedClinicAdminDashboardTreatmentsRoute:FM,AuthenticatedClinicAdminDashboardVipBenefitsRoute:IM,AuthenticatedClinicAdminDashboardAnalyticsReportIdRoute:CN,AuthenticatedClinicAdminDashboardAnalyticsLocationsRoute:wN,AuthenticatedClinicAdminDashboardBlueprintsIdRoute:EN,AuthenticatedClinicAdminDashboardAnalyticsIndexRoute:SN,AuthenticatedClinicAdminDashboardBlueprintsIndexRoute:TN},WN=Ij._addFileChildren(UN),GN={AuthenticatedSeoSeoRoute:Qj,AuthenticatedSeoSeoRouteIdRoute:LM},KN=Lj._addFileChildren(GN),qN={AuthenticatedSuperAdminSuperAdminIssuesIdRoute:NN,AuthenticatedSuperAdminSuperAdminIssuesIndexRoute:MN},JN={AuthenticatedSuperAdminSuperAdminAiGuidanceRoute:zM,AuthenticatedSuperAdminSuperAdminAiProvidersRoute:BM,AuthenticatedSuperAdminSuperAdminAiRouterRoute:VM,AuthenticatedSuperAdminSuperAdminAiUsageRoute:HM,AuthenticatedSuperAdminSuperAdminAtlasEntitlementRoute:UM,AuthenticatedSuperAdminSuperAdminCatalogAuditRoute:WM,AuthenticatedSuperAdminSuperAdminClinicalApprovalsRoute:GM,AuthenticatedSuperAdminSuperAdminClinicsRoute:KM,AuthenticatedSuperAdminSuperAdminDefaultQuestionsRoute:qM,AuthenticatedSuperAdminSuperAdminDefaultTreatmentsRoute:JM,AuthenticatedSuperAdminSuperAdminEarlyAccessRoute:YM,AuthenticatedSuperAdminSuperAdminFoundingRoute:XM,AuthenticatedSuperAdminSuperAdminIssuesRoute:ZM._addFileChildren(qN),AuthenticatedSuperAdminSuperAdminPatientsRoute:QM,AuthenticatedSuperAdminSuperAdminQuestionPreviewRoute:$M,AuthenticatedSuperAdminSuperAdminReportPromptsRoute:eN,AuthenticatedSuperAdminSuperAdminSeoRoute:tN,AuthenticatedSuperAdminSuperAdminSimPromptsRoute:nN,AuthenticatedSuperAdminSuperAdminSimulationsRoute:rN,AuthenticatedSuperAdminSuperAdminSubscriptionPricingRoute:iN,AuthenticatedSuperAdminSuperAdminSubscriptionsRoute:aN,AuthenticatedSuperAdminSuperAdminSystemRoute:oN,AuthenticatedSuperAdminSuperAdminUsersRoute:sN,AuthenticatedSuperAdminSuperAdminWaitlistRoute:cN,AuthenticatedSuperAdminSuperAdminIndexRoute:RM,AuthenticatedSuperAdminSuperAdminBlueprintsIdRoute:jN,AuthenticatedSuperAdminSuperAdminSeoRouteIdRoute:PN,AuthenticatedSuperAdminSuperAdminBlueprintsIndexRoute:AN},YN=Rj._addFileChildren(JN),XN={AuthenticatedDashboardAccountPreferencesRoute:uN,AuthenticatedDashboardAccountProfileRoute:dN,AuthenticatedDashboardAccountSecurityRoute:fN,AuthenticatedDashboardAccountIndexRoute:lN},ZN=eM._addFileChildren(XN),QN={AuthenticatedDashboardAnnualReportsReportIdRoute:mN,AuthenticatedDashboardAnnualReportsIndexRoute:pN},$N=tM._addFileChildren(QN),eP={AuthenticatedDashboardConsultationsIndexRoute:hN,AuthenticatedDashboardConsultationsIdBlueprintRoute:IN,AuthenticatedDashboardConsultationsIdChatRoute:LN,AuthenticatedDashboardConsultationsIdSimulateRoute:RN,AuthenticatedDashboardConsultationsIdIndexRoute:FN},tP=sM._addFileChildren(eP),nP={AuthenticatedDashboardIssuesIdRoute:_N,AuthenticatedDashboardIssuesNewRoute:vN,AuthenticatedDashboardIssuesIndexRoute:gN},rP=lM._addFileChildren(nP),iP={AuthenticatedDashboardMonthlyReportsIndexRoute:yN},aP=uM._addFileChildren(iP),oP={AuthenticatedDashboardReportsReportIdRoute:xN,AuthenticatedDashboardReportsIndexRoute:bN,AuthenticatedDashboardReportsTreatmentTreatmentIdRoute:zN},sP={AuthenticatedDashboardAccountRoute:ZN,AuthenticatedDashboardA
187nnualReportsRoute:$N,AuthenticatedDashboardAppointmentsRoute:nM,AuthenticatedDashboardBillingRoute:rM,AuthenticatedDashboardBlueprintRoute:iM,AuthenticatedDashboardClinicsRoute:aM,AuthenticatedDashboardCoachRoute:oM,AuthenticatedDashboardConsultationsRoute:tP,AuthenticatedDashboardEarlyAccessRoute:cM,AuthenticatedDashboardIssuesRoute:rP,AuthenticatedDashboardMonthlyReportsRoute:aP,AuthenticatedDashboardReportsRoute:dM._addFileChildren(oP),AuthenticatedDashboardVipDiscountRoute:fM,AuthenticatedDashboardIndexRoute:$j},cP={AuthenticatedClinicAdminRoute:WN,AuthenticatedSeoRoute:KN,AuthenticatedSuperAdminRoute:YN,AuthenticatedCompleteProfileRoute:zj,AuthenticatedDashboardRoute:Bj._addFileChildren(sP),AuthenticatedOnboardingRoute:Vj},lP=pj._addFileChildren(cP),uP={AuthCallbackRoute:Hj,AuthCheckEmailRoute:Uj,AuthChooseRoleRoute:Wj},dP=_j._addFileChildren(uP),fP={ClinicClinicSlugMembersRoute:mM,ClinicClinicSlugBookRoute:hM,ClinicClinicSlugConsultationRoute:gM,ClinicClinicSlugLocationsRoute:_M,ClinicClinicSlugReportRoute:vM,ClinicClinicSlugSimulateRoute:yM,ClinicClinicSlugIndexRoute:pM},pP={IndexRoute:dj,AuthenticatedRouteRoute:lP,SplatRoute:fj,AccessibilityRoute:mj,AiPrivacyRoute:hj,AiTermsRoute:gj,AuthRoute:dP,CancellationRoute:vj,ClinicsRoute:yj,ContactLegalRoute:bj,CookiePolicyRoute:xj,CookiesRoute:Sj,DemoRoute:Cj,EarningsDisclaimerRoute:wj,ForSpasRoute:Tj,ForgotPasswordRoute:Ej,HowItWorksRoute:Dj,MedicalDisclaimerRoute:Oj,PricingRoute:kj,PrivacyRoute:Aj,PurchaseTermsRoute:jj,ResetPasswordRoute:Mj,StartConsultationRoute:Nj,TermsRoute:Pj,TestimonialDisclosureRoute:Fj,ClinicClinicSlugRouteRoute:Jj._addFileChildren(fP),BookingConfirmRoute:Gj,CheckoutReturnRoute:qj,InviteAcceptRoute:Yj,JoinClientRoute:Xj,JoinSpaOwnerRoute:Zj,CheckoutIndexRoute:Kj},mP=Q._addFileChildren(pP);function hP(){return(0,U.jsx)(`div`,{className:`flex min-h-[60vh] items-center justify-center bg-background px-4`,children:(0,U.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,U.jsx)(`h1`,{className:`text-7xl font-bold text-foreground`,children:`404`}),(0,U.jsx)(`h2`,{className:`mt-4 text-xl font-semibold text-foreground`,children:`Page not found`}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`The page you're looking for doesn't exist or has been moved.`}),(0,U.jsx)(`div`,{className:`mt-6`,children:(0,U.jsx)(D,{to:`/`,className:`inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:`Go home`})})]})})}function gP({error:e,reset:t}){let n=fe();return(0,H.useEffect)(()=>{console.error(e),Ju(e,{boundary:`tanstack_default_error_component`})},[e]),(0,U.jsx)(`div`,{className:`flex min-h-[60vh] items-center justify-center bg-background px-4`,children:(0,U.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,U.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-foreground`,children:`This page didn't load`}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Something went wrong on our end. Try again, or head back home.`}),(0,U.jsxs)(`div`,{className:`mt-6 flex flex-wrap justify-center gap-2`,children:[(0,U.jsx)(`button`,{onClick:()=>{n.invalidate(),t()},className:`inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:`Try again`}),(0,U.jsx)(D,{to:`/`,className:`inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent`,children:`Go home`})]})]})})}var _P=!1,vP=!1,yP=null,bP=null;async function xP(){_P||typeof window>`u`||(_P=!0)}async function SP(){if(vP||typeof window<`u`)return;vP=!0;let e={}.SENTRY_DSN;if(e)try{let t=await P(()=>import(`./esm-Bmgevw16.js`),__vite__mapDeps([361,3,4,362]));t.init({dsn:e,environment:{}.APP_ENV||`production`,tracesSampleRate:.1}),bP=t}catch(e){console.warn(`[observability] Sentry server init failed`,e)}}function CP(e,t){let n=typeof window>`u`?bP:yP;if(n?.captureException)try{n.captureException(e,t?{extra:t}:void 0)}catch{}console.error(`[observability]`,e,t??{})}typeof window>`u`&&SP();var wP=()=>{xP();let e=new Ku({defaultOptions:{queries:{staleTime:15e3}}});if(typeof window<`u`){let t;P(async()=>{let{supabase:e}=await import(`./client-MUfdoZuW.js`).then(e=>e.t);return{supabase:e}},__vite__mapDeps([2,3,4])).then(({supabase:n})=>{n.auth.onAuthStateChange((n,r)=>{let i=r?.user?.id??null;t!==void 0&&i!==t&&e.clear(),t=i})})}return yu({routeTree:mP,context:{queryClient:e},scrollRestoration:!0,defaultPreload:`intent`,defaultPreloadStaleTime:0,defaultErrorComponent:gP,defaultNotFoundComponent:hP})};async function TP(){let e=await wP(),t;if(zu){let n=await zu.getOptions();n.serializationAdapters=n.serializationAdapters??[],window.__TSS_START_OPTIONS__=n,t=n.seri
187alizationAdapters,e.options.defaultSsr=n.defaultSsr}else t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t};return t.push(Ll),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.ids.get().length||await zi(e),e}var EP=TP;function DP(){return EP().finally(()=>window.$_TSR?.h())}var OP;function kP(){return OP||=DP(),(0,U.jsx)(zl,{promise:OP,children:e=>(0,U.jsx)(Su,{router:e})})}var AP=_n();(0,H.startTransition)(()=>{(0,AP.hydrateRoot)(document,(0,U.jsx)(H.StrictMode,{children:(0,U.jsx)(kP,{})}))});export{gk as $,Od as $i,lv as $n,Uh as $r,iT as $t,tA as A,tp as Ai,MC as An,Eg as Ar,FE as At,Ik as B,Gf as Bi,vC as Bn,eg as Br,nE as Bt,bA as C,xp as Ci,$C as Cn,qg as Cr,MD as Ct,nA as D,lp as Di,BC as Dn,Mg as Dr,QE as Dt,aA as E,mp as Ei,PC as En,Ig as Er,XE as Et,jk as F,Rf as Fi,SC as Fn,ag as Fr,gE as Ft,kk as G,X as Gi,Dx as Gn,ng as Gr,DT as Gt,Ak as H,Z as Hi,hC as Hn,qh as Hr,tE as Ht,zk as I,Hf as Ii,jC as In,Xh as Ir,_E as It,Ck as J,Rd as Ji,Ex as Jn,Nh as Jr,yT as Jt,Dk as K,Ud as Ki,kx as Kn,$h as Kr,ET as Kt,Pk as L,Kf as Li,kC as Ln,tg as Lr,oE as Lt,eA as M,$f as Mi,LC as Mn,xg as Mr,TE as Mt,Uk as N,Qf as Ni,GC as Nn,vg as Nr,pE as Nt,iA as O,up as Oi,UC as On,Ag as Or,IE as Ot,Bk as P,ep as Pi,WC as Pn,ig as Pr,dE as Pt,vk as Q,kd as Qi,Tv as Qn,Sh as Qr,mT as Qt,Lk as R,Wf as Ri,AC as Rn,Qh as Rr,fE as Rt,yA as S,Ep as Si,nw as Sn,e_ as Sr,jD as St,uA as T,gp as Ti,HC as Tn,Lg as Tr,OD as Tt,Fk as U,Wd as Ui,mC as Un,rg as Ur,NT as Ut,Mk as V,zf as Vi,bC as Vn,Jh as Vr,eE as Vt,Rk as W,Kd as Wi,zx as Wn,Zh as Wr,OT as Wt,Sk as X,jd as Xi,Gv as Xn,Ch as Xr,lT as Xt,yk as Y,Fd as Yi,ux as Yn,Vh as Yr,ST as Yt,xk as Z,Dd as Zi,jv as Zn,wh as Zr,CT as Zt,TA as _,qp as _i,ww as _n,E_ as _r,FD as _t,cj as a,td as aa,zm as ai,gT as an,F_ as ar,NO as at,gA as b,Wp as bi,aw as bn,__ as br,ID as bt,IA as c,Qu as ca,xm as ci,_T as cn,O_ as cr,pO as ct,kA as d,pu as da,Dm as di,$w as dn,A_ as dr,lO as dt,Td as ea,$m as ei,rT as en,ov as er,dk as et,MA as f,Il as fa,Tm as fi,hw as fn,x_ as fr,tO as ft,wA as g,Jp as gi,Cw as gn,D_ as gr,PD as gt,CA as h,mm as hi,vw as hn,j_ as hr,iD as ht,uj as i,nd as ia,th as ii,tT as in,I_ as ir,FO as it,$k as j,np as ji,RC as jn,Sg as jr,OE as jt,rA as k,ap as ki,zC as kn,Og as kr,RE as kt,FA as l,Nu as la,Em as li,dT as ln,C_ as lr,rO as lt,NA as m,bn as ma,hm as mi,yw as mn,S_ as mr,RD as mt,hP as n,ad as na,Zm as ni,Yw as nn,tv as nr,ik as nt,KA as o,ed as oa,gm as oi,pT as on,N_ as or,TO as ot,jA as p,Sn as pa,um as pi,kw as pn,b_ as pr,JD as pt,Tk as q,Vd as qi,Ox as qn,Th as qr,hT as qt,gP as r,id as ra,Xm as ri,Xw as rn,L_ as rr,qO as rt,LA as s,$u as sa,Sm as si,fT as sn,k_ as sr,xO as st,CP as t,Ed as ta,rh as ti,Jw as tn,rv as tr,sk as tt,PA as u,Cu as ua,Om as ui,oT as un,T_ as ur,uO as ut,SA as v,kp as vi,iw as vn,w_ as vr,LD as vt,dA as w,hp as wi,IC as wn,Kg as wr,AD as wt,_A as x,Dp as xi,rw as xn,t_ as xr,ND as xt,pA as y,Up as yi,XC as yn,y_ as yr,vD as yt,Nk as z,Uf as zi,pC as zn,Kh as zr,$T as zt};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.