1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-CkOSf2Sh.js","assets/vendor-ui-Cp0o_ERz.js","assets/vendor-react-DblKtrgV.js","assets/UpgradePromptDialog-BPWOX9wL.js","assets/label-CthT-n7x.js","assets/vendor-motion-P7V77m0j.js","assets/flame-BqyM9GDw.js","assets/crown-lZaTKUKT.js","assets/ProductTour-DOqj1BQt.js","assets/GatedLink-DTpVqoQr.js","assets/VerificationGateModal-D2QlibYm.js","assets/useEmailVerification-BQjKZgSy.js","assets/share-2-sIo8QWxu.js","assets/useContentPreferences-CgDJEE7B.js","assets/vendor-query-Bv5ntzP6.js","assets/vendor-charts-BTyV52R2.js","assets/vendor-supabase-B0Jha54I.js","assets/CreateVideoV2-CQvEvCgA.js","assets/useActorFavorites-DLTitzLS.js","assets/textarea-CJ3wtdnc.js","assets/coins-4cOuNMfH.js","assets/history-g6-XtwS1.js","assets/shield-alert-fTxnfW2w.js","assets/actorFilterOptions-Bmyj_sBg.js","assets/countryUtils-CCdGkFjH.js","assets/command-1MchwUcv.js","assets/GroupedChipsFilter-DI9fmjR3.js","assets/heart-C1or41Sp.js","assets/circle-user-AtUvGJBp.js","assets/chevrons-up-down-BLHizrWg.js","assets/actorVolume-CW6fpi7u.js","assets/maximize-2-srw4yYc4.js","assets/volume-x-AR9pbnpJ.js","assets/usePreviewSound-DHm0GOB2.js","assets/useInfiniteScroll-C1wiIFT3.js","assets/carousel-GC8szrRJ.js","assets/embla-carousel-react.esm-CWqdGlc4.js","assets/filter-J1tVg5_R.js","assets/arrow-up-down-Dch9zwWi.js","assets/slider-2thc8Wom.js","assets/index-B0zWfjwf.js","assets/zoom-in-BopnyuTD.js","assets/package-DjBA-BtM.js","assets/trash-2-DQl3agPF.js","assets/wand-sparkles-hf8mXBjZ.js","assets/alert-B0OC5QtB.js","assets/shirt-D-e-996a.js","assets/hand-DjaSLozI.js","assets/radio-group-5Ap-iOOe.js","assets/music-Dh-ZwRdO.js","assets/folder-lwIccgZL.js","assets/pen-line-DnwQxhei.js","assets/undo-2-C74qsef_.js","assets/redo-2-Ceb5N_hI.js","assets/Settings-CRijON7k.js","assets/form-Bmml9O_L.js","assets/ApiKeysSection-Bwesj5oq.js","assets/useApiKeys-C7ZXqg0I.js","assets/shield-off-Dj1qdDXI.js","assets/WebhooksSection-worRRdaE.js","assets/SettingsCreditPacks-Bdjm7ygX.js","assets/shopping-cart-DmbLlxjT.js","assets/separator-CFU9jP8U.js","assets/arrow-right-left-e-aeRVv-.js","assets/useSocialConnections-TJHKmiDS.js","assets/link-Dg7YVSY_.js","assets/youtube-PVhoke2O.js","assets/unlink-DXFO6ose.js","assets/avatar-BObcGlaS.js","assets/pencil-DWeohm1J.js","assets/ellipsis-C03vmgEi.js","assets/user-minus-B1avQ94n.js","assets/user-plus-DiE5Wk7B.js","assets/Exports-CI0yugE1.js","assets/calendar-C5a4LOnb.js","assets/startOfMonth-l-9f0XA8.js","assets/endOfWeek-BwrvE8dj.js","assets/AddCaptionsDialog-uCzQdNAc.js","assets/VideoThumbnail-DEAuBjaq.js","assets/videoLocalCheck-xBq4jzmV.js","assets/ExportPaywallModal-CvGvgPF1.js","assets/downloadVideo-CcFVfqem.js","assets/captions-Jl7uQFwd.js","assets/ellipsis-vertical-KqAMxaYO.js","assets/folder-minus-BxZgk_N8.js","assets/linkedin-DMSC3g_Z.js","assets/featureFlags-DhS8K_vw.js","assets/toggle-group-CCbRO1kH.js","assets/toggle-CSwWOykv.js","assets/party-popper-Bn_bBaqg.js","assets/layout-grid-dauEaVt9.js","assets/list-CIgYnwL5.js","assets/square-check-big-BKtbrZi_.js","assets/folder-plus-aD75zgJE.js","assets/Actors-CSt-Jxfn.js","assets/smartphone-BtgC142D.js","assets/ScrollToTopButton-DpMmBj9D.js","assets/Voices-C6kgIcG-.js","assets/VoiceFilters-MgIyHr2R.js","assets/Features-h8bObp05.js","assets/HowItWorksSection-OXD_UKzx.js","assets/repeat-DI6T3KWf.js","assets/shopping-bag-jgvWJ9_M.js","assets/UseCases-DE-Qijbm.js","assets/Developers-jBUifcaA.js","assets/book-B2NQC_uE.js","assets/server-B1iYEhl4.js","assets/database-7GwrLtop.js","assets/ProductShowcaseSection-C2nl08Gl.js","assets/ResultsSection-CXOusWqt.js","assets/InteractiveDemo-BNAi993z.js","assets/message-square-DuUPZRrh.js","assets/UrlToAdModule-C3gFlSJZ.js","assets/VideoTestimonialSection-bLNFRg7L.js","assets/SafeVideo-C6duRV2q.js","assets/quote-BaTSYt_G.js","assets/LanguagesSection-B84v5vFw.js","assets/ActorShowcaseSection-BNeOCYFA.js","assets/PricingSectionWithExperiment-CqCSjtZy.js","assets/CreditPackSection-CRMhMrSq.js","assets/FAQSection-DmKrMkqs.js","assets/CTASection-ebMbJLnh.js","assets/ExperimentDebugOverlay-CdUBl3SZ.js","assets/MobileCallback-Bwt_u1Tj.js","assets/AppleCallback-lqKLqEhi.js","assets/RecoverAccount-wVr_PNXH.js","assets/CreatorDashboard-CQzQitVe.js","assets/CreatorDashboardPage-CZqzrLZS.js","assets/DashboardTest-C2XsmNaj.js","assets/VoiceOutputDemo-DT7im8rf.js","assets/CheckoutSuccess-DF2pkT8Y.js","assets/Scripts-CSETMmPv.js","assets/shield-x-D7du_LsQ.js","assets/Campaigns-CthLE8D2.js","assets/sortable.esm-DTiUDZkN.js","assets/grip-vertical-BgICZHHm.js","assets/Feed-LfH8gaNh.js","assets/useActorEngagement-CmUA0P66.js","assets/ActorShareButton-DTLCbmQs.js","assets/thumbs-up-Dub5nkYZ.js","assets/FollowButton-CCCS_s_6.js","assets/Following-PjUR4aZd.js","assets/useFollowedCreators-qudEtg1C.js","assets/AppLayout-aFpeq7cF.js","assets/WhatsNew-BB-29QTx.js","assets/Credits-DcfmFVve.js","assets/ApiUsageChart-B
1aYlBYwx.js","assets/AutoReloadCard-ekEneJT4.js","assets/CreditLedgerTable-ikaVVPcM.js","assets/CreditMeterBanner-DyDwCcR2.js","assets/SpendLimitsCard-C1_l2w12.js","assets/TrustCenter-BFKxXhHJ.js","assets/brain-jN417gzM.js","assets/CreatorAgreement-D73pzpVg.js","assets/scale-C490Agx1.js","assets/Blog-bA3fVfUw.js","assets/BlogStickyCTA-DgSUZOKa.js","assets/BlogPost-BeMcNTQZ.js","assets/KeyTakeawaysBox-D5i0e8LB.js","assets/ReadingProgressBar-Dm4TTeTg.js","assets/HelpCenter-BdD6bGY0.js","assets/APIDocs-nvdc4f4R.js","assets/Tutorials-WogddvLx.js","assets/target-D10SEGj3.js","assets/CaseStudies-Cd_HQhQ5.js","assets/caseStudies-Bx8-q1wb.js","assets/circle-play-D1lraO_q.js","assets/CaseStudyDetail-BaDTb9EV.js","assets/About-DHwnHFdj.js","assets/award-CYfVGhrA.js","assets/Careers-MYY-wzgi.js","assets/Press-BK2ehli3.js","assets/Contact-Bs97dswA.js","assets/Partners-pEZJjHRx.js","assets/BrandAssets-B6u2YjLk.js","assets/FeedbackThanks-DtF_gS4q.js","assets/Quickstart-DaWR0MVf.js","assets/APIReference-uXp0s4nI.js","assets/table-DaVHv7ps.js","assets/Authentication-DnyAJJGj.js","assets/SDKs-Do4V_lzx.js","assets/Webhooks-Cd3KUkZA.js","assets/RateLimits-B2fwgvgF.js","assets/Playground-BPi_yM2Q.js","assets/ApiPricing-CyCjqJ2G.js","assets/BillingCreditsDoc-XPLMkjRI.js","assets/Sandbox-CGTzw-63.js","assets/Testing-DuHikvpZ.js","assets/ConsoleOverview-CqQMp5pY.js","assets/ConsoleApiKeys-DauHBppt.js","assets/ConsoleWebhooks-CZLlsof9.js","assets/ConsoleUsage-B_9kOrgn.js","assets/ConsoleBilling-DnR1PTer.js","assets/ConsoleLimits-BVpeEco7.js","assets/ConsoleSandbox-h-4VVQQ_.js","assets/Studio-CBLPgtyX.js","assets/API-DXWEJKWO.js","assets/UrlToAd-Dq6_y-0F.js","assets/usePostHog-ZejLMEim.js","assets/UseCaseVideoPlayer-CsTvAoJJ.js","assets/AdClone-6Cmoq5GR.js","assets/ContextReply-BBNFVQ4K.js","assets/ProductVideo-Lg7w3cVF.js","assets/ShowcaseStudioLanding-CuC-gcdf.js","assets/activity-BcSC12c0.js","assets/GuestSandbox-BCFYSkpi.js","assets/AdClone-CfIeNHY1.js","assets/UrlToAdWizard-CS7w4VL6.js","assets/ShowcaseStudio-D1OerKUJ.js","assets/storageRawUpload-BqOryg3t.js","assets/skip-forward-hT7sF5Re.js","assets/tag-k41lwaX-.js","assets/resizable-Bge6-P1Q.js","assets/ContextReplyWizard-B1G-B0PT.js","assets/SceneGenerator-aiqGfSl1.js","assets/Ecommerce-HWMIzxUp.js","assets/useUseCaseVideo-DO_24EuM.js","assets/Agencies-CNwwTby9.js","assets/UGCAds-C5eOIWH0.js","assets/TikTokAds-CKD_6K9y.js","assets/YouTubeShorts-D07hJTQa.js","assets/InstagramReels-Cpt53lYA.js","assets/FacebookAds-BbqBcy2t.js","assets/SaaS-CtxIAgQt.js","assets/Creators-Ckn2ZCYC.js","assets/AIActors-D0h-gN1c.js","assets/map-pin-bsMzwtKI.js","assets/AIVoices-uLuTOZsU.js","assets/BatchGeneration-D48F0_cn.js","assets/AIScripts-B2LwHwrY.js","assets/Captions-DwVSSaVs.js","assets/type-DMuPVw_i.js","assets/DirectPublish-CJ5tz8mC.js","assets/ExtendedScripts-BZO7OnyF.js","assets/VsSynthesia-DyOWkXca.js","assets/VsHeygen-eYyktem4.js","assets/Learn-BTCucQ8e.js","assets/GettingStarted-GTlZi-cL.js","assets/ScriptWriting-Ct5QETG_.js","assets/VoiceSelection-DtbvP7fE.js","assets/VideoBestPractices-D_feAVE4.js","assets/Docs-7JFpVWOe.js","assets/DocsLayout-DE7R8VWb.js","assets/useDocs-CqrHOgc7.js","assets/useDebounce-CW9o61XE.js","assets/camera-DFawX9kz.js","assets/DocArticle-CDmA0hVF.js","assets/MarkdownRenderer-Dp2DQQ32.js","assets/ActorDetail-Cpc9gMuS.js","assets/useCreatorFeed-D6jOiwFo.js","assets/VoiceDetail-CYJ1fPWC.js","assets/WatchVideo-UwwmURoG.js","assets/StatusPage-CE-Jk_4o.js","assets/useOpsData-ZtZCUbTe.js","assets/Partners-BN4jOfgk.js","assets/partner-BexS1Hrj.js","assets/PartnerDashboard-CJnP_N_E.js","assets/Ambassad
1orApplication-CcAN9203.js","assets/Affiliates-B2bhKpuF.js","assets/affiliate-B9gf3s73.js","assets/calculator-CtzXKyqF.js","assets/AffiliateDashboard-DAaWPE1S.js","assets/AcceptInvite-DEhC7-Jb.js","assets/BecomeCreator-BE3HRyNY.js","assets/clone-plans-C-KgHblA.js","assets/creator-BKVL8dGB.js","assets/wallet-0JBGxCnv.js","assets/CreatorOnboarding-TCsMe8I4.js","assets/AvatarCropper-DQzyf9Ub.js","assets/rotate-cw-oRGsmINq.js","assets/AvatarCropper-OEN34m2J.css","assets/CreatorAvatarSetup-Cq0ZS1_b.js","assets/CreatorAvatarSetupPage-BdzZKDY1.js","assets/CreatorSubmit-DX-xE4Kg.js","assets/CreativeTipsCard-Cj05x05G.js","assets/videoThumbnail-BSh4BL1A.js","assets/CollapsibleSection-Cn-xubAk.js","assets/CreatorPayouts-BoCvTbdW.js","assets/PayoutsContent-Bk4YWJq6.js","assets/differenceInHours-BH7t1ln4.js","assets/CreatorAnalytics-BLv_WdsU.js","assets/tourSteps-NzGcTHBI.js","assets/eachWeekOfInterval-DntUeDPD.js","assets/parseISO-bFNzwH1g.js","assets/mouse-pointer-click-Dm80nCiC.js","assets/arrow-up-right-HHow_m_Q.js","assets/arrow-down-right-B_65MveL.js","assets/CreatorSubmissions-CQuYb_NU.js","assets/square-pen-2dWAIFut.js","assets/CreatorSettings-UtytvPHC.js","assets/useAgreementStatus-Beb5Qpho.js","assets/terms-BaSwxoy-.js","assets/save-JmDIznK3.js","assets/CreatorContent-BgAz_Aph.js","assets/CreatorMonetization-BIlslYHV.js","assets/CreatorAcademy-S4K0Tv2C.js","assets/file-down-BSvy5rvE.js","assets/CreatorAcademyGuide-CYmMm2w1.js","assets/CreatorManual-BSvn7kFS.js","assets/MyClonePage-BAoGTBD7.js","assets/CreatorSharePage-Crrt5Thc.js","assets/CreatorSupport-CPC8k_Yi.js","assets/SignMock-BQjLGrqT.js","assets/VerifyPaypal-snC8hBJh.js","assets/SupportAdmin-DOfYqGtz.js","assets/SupportInbox-BC8BCfv0.js","assets/pen-B6Qmdwep.js","assets/ModeratorDashboard-BnWsiyAw.js","assets/ModeratorLimitConfig-CZrVrnvJ.js","assets/chart-Bev_nKF-.js","assets/Admin-D5zP1OT6.js","assets/StartupsLanding-BONThr8e.js","assets/percent-BCWhxJAG.js","assets/StartupsApply-Cait5Un4.js","assets/StartupsThanks-DN_6ap5J.js","assets/EmailPreferences-DCuW9Ktd.js","assets/AccountSuspended-DUQf46u6.js","assets/ViewCampaign-DaWOUfI5.js"])))=>i.map(i=>d[i]); 2import{d as pp,g as Uc,r as u,b as $,u as Ft,j as s,B as ly,P as ft,e as kn,f as Bs,h as mt,i as xr,k as fp,V as gp,l as cy,m as js,n as dy,o as Bc,p as uy,q as hy,C as xp,s as my,t as py,T as fy,S as gy,O as Nn,v as lo,w as Sn,x as Pa,y as En,D as Cn,z as co,A as uo,E as vp,F as yp,G as xy,H as bp,I as vy,J as yy,K as _p,L as by,M as wp,N as jp,Q as kp,U as _y,W as Np,X as Sp,Y as Ep,Z as wy,$ as Cp,a0 as Tp,a1 as Pp,a2 as Ap,a3 as Ip,a4 as Rp,a5 as Mp,a6 as jy,a7 as ky,a8 as Ny,a9 as Op,aa as Sy,ab as Ey,ac as Cy,ad as Ty,ae as Dp,af as Py,ag as Ay,ah as Lp,ai as Iy,aj as $p,ak as Ry,al as My,am as Fp,an as Vp,ao as zp,ap as Hp}from"./vendor-ui-Cp0o_ERz.js";import{c as Up}from"./vendor-charts-BTyV52R2.js";import{u as Pl,Q as Oy,a as Dy}from"./vendor-query-Bv5ntzP6.js";import{u as Tn,a as ot,N as Se,L as be,b as Xt,O as Bp,B as Ly,R as $y,c as I}from"./vendor-react-DblKtrgV.js";import{A as pt,m as ae,u as Fo,a as Fy}from"./vendor-motion-P7V77m0j.js";import{c as Vy}from"./vendor-supabase-B0Jha54I.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=t(a);fetch(a.href,i)}})();var qp,vu=pp;qp=vu.createRoot,vu.hydrateRoot;var zy=typeof Element<"u",Hy=typeof Map=="function",Uy=typeof Set=="function",By=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function oi(r,e){if(r===e)return!0;if(r&&e&&typeof r=="object"&&typeof e=="object"){if(r.constructor!==e.constructor)return!1;var t,n,a;if(Array.isArray(r)){if(t=r.length,t!=e.length)return!1;for(n=t;n--!==0;)if(!oi(r[n],e[n]))return!1;return!0}var i;if(Hy&&r instanceof Map&&e instanceof Map){if(r.size!==e.size)return!1;for(i=r.entries();!(n=i.next()).done;)if(!e.has(n.value[0]))return!1;for(i=r.entries();!(n=i.next()).done;)if(!oi(n.value[1],e.get(n.value[0])))return!1;return!0}if(Uy&&r instanceof Set&&e instanceof Set){if(r.size!==e.size)return!1;for(i=r.entries();!(n=i.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(By&&ArrayBuffer.isView(r)&&ArrayBuffer.isView(e)){if(t=r.length,t!=e.length)return!1;for(n=t;n--!==0;)if(r[n]!==e[n])return!1;return!0}if(r.constructor===RegExp)return r.source===e.source&&r.flags===e.flags;if(r.valueOf!==Object.prototype.valueOf&&typeof r.valueOf=="function"&&typeof e.valueOf=="function")return r.valueOf()===e.valueOf();if(r.toString!==Object.prototype.toString&&typeof r.toString=="function"&&typeof e.toString=="function")return r.toString()===e.toString();if(a=Object.keys(r),t=a.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,a[n]))return!1;if(zy&&r instanceof Element)return!1;for(n=t;n--!==0;)if(!((a[n]==="_owner"||a[n]==="__v"||a[n]==="__o")&&r.$$typeof)&&!oi(r[a[n]],e[a[n]]))return!1;return!0}return r!==r&&e!==e}var qy=function(e,t){try{return oi(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};
2const Wy=Uc(qy);var Gy=function(r,e,t,n,a,i,o,l){if(!r){var d;if(e===void 0)d=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[t,n,a,i,o,l],h=0;d=new Error(e.replace(/%s/g,function(){return c[h++]})),d.name="Invariant Violation"}throw d.framesToPop=1,d}},Yy=Gy;const yu=Uc(Yy);var Zy=function(e,t,n,a){var i=n?n.call(a,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),l=Object.keys(t);if(o.length!==l.length)return!1;for(var d=Object.prototype.hasOwnProperty.bind(t),c=0;c<o.length;c++){var h=o[c];if(!d(h))return!1;var m=e[h],f=t[h];if(i=n?n.call(a,m,f,h):void 0,i===!1||i===void 0&&m!==f)return!1}return!0};const Jy=Uc(Zy);var Wp=(r=>(r.BASE="base",r.BODY="body",r.HEAD="head",r.HTML="html",r.LINK="link",r.META="meta",r.NOSCRIPT="noscript",r.SCRIPT="script",r.STYLE="style",r.TITLE="title",r.FRAGMENT="Symbol(react.fragment)",r))(Wp||{}),Vo={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},bu=Object.values(Wp),qc={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Xy=Object.entries(qc).reduce((r,[e,t])=>(r[t]=e,r),{}),vr="data-rh",nn={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},an=(r,e)=>{for(let t=r.length-1;t>=0;t-=1){const n=r[t];if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}return null},Ky=r=>{let e=an(r,"title");const t=an(r,nn.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),t&&e)return t.replace(/%s/g,()=>e);const n=an(r,nn.DEFAULT_TITLE);return e||n||void 0},Qy=r=>an(r,nn.ON_CHANGE_CLIENT_STATE)||(()=>{}),zo=(r,e)=>e.filter(t=>typeof t[r]<"u").map(t=>t[r]).reduce((t,n)=>({...t,...n}),{}),eb=(r,e)=>e.filter(t=>typeof t.base<"u").map(t=>t.base).reverse().reduce((t,n)=>{if(!t.length){const a=Object.keys(n);for(let i=0;i<a.length;i+=1){const l=a[i].toLowerCase();if(r.indexOf(l)!==-1&&n[l])return t.concat(n)}}return t},[]),tb=r=>console&&typeof console.warn=="function"&&console.warn(r),On=(r,e,t)=>{const n={};return t.filter(a=>Array.isArray(a[r])?!0:(typeof a[r]<"u"&&tb(`Helmet: ${r} should be of type "Array". Instead found type "${typeof a[r]}"`),!1)).map(a=>a[r]).reverse().reduce((a,i)=>{const o={};i.filter(d=>{let c;const h=Object.keys(d);for(let f=0;f<h.length;f+=1){const p=h[f],v=p.toLowerCase();e.indexOf(v)!==-1&&!(c==="rel"&&d[c].toLowerCase()==="canonical")&&!(v==="rel"&&d[v].toLowerCase()==="stylesheet")&&(c=v),e.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(c=p)}if(!c||!d[c])return!1;const m=d[c].toLowerCase();return n[c]||(n[c]={}),o[c]||(o[c]={}),n[c][m]?!1:(o[c][m]=!0,!0)}).reverse().forEach(d=>a.push(d));const l=Object.keys(o);for(let d=0;d<l.length;d+=1){const c=l[d],h={...n[c],...o[c]};n[c]=h}return a},[]).reverse()},rb=(r,e)=>{if(Array.isArray(r)&&r.length){for(let t=0;t<r.length;t+=1)if(r[t][e])return!0}return!1},sb=r=>({baseTag:eb(["href"],r),bodyAttributes:zo("bodyAttributes",r),defer:an(r,nn.DEFER),encode:an(r,nn.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:zo("htmlAttributes",r),linkTags:On("link",["rel","href"],r),metaTags:On("meta",["name","charset","http-equiv","property","itemprop"],r),noscriptTags:On("noscript",["innerHTML"],r),onChangeClientState:Qy(r),scriptTags:On("script",["src","innerHTML"],r),styleTags:On("style",["cssText"],r),title:Ky(r),titleAttributes:zo("titleAttributes",r),prioritizeSeoTags:rb(r,nn.PRIORITIZE_SEO_TAGS)}),Gp=r=>Array.isArray(r)?r.join(""):r,nb=(r,e)=>{const t=Object.keys(r);for(let n=0;n<t.length;n+=1)if(e[t[n]]&&e[t[n]].includes(r[t[n]]))return!0;return!1},Ho=(r,e)=>Array.isArray(r)?r.reduce((t,n)=>(nb(n,e)?t.priority.push(n):t.default.push(n),t),{priority:[],default:[]}):{default:r,priority:[]},_u=(r,e)=>({...r,[e]:void 0}),ab=["noscript","script","style"],Al=(r,e=!0)=>e===!1?String(r):String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),Yp=r=>Object.keys(r).reduce((e,t)=>
2{const n=typeof r[t]<"u"?`${t}="${r[t]}"`:`${t}`;return e?`${e} ${n}`:n},""),ib=(r,e,t,n)=>{const a=Yp(t),i=Gp(e);return a?`<${r} ${vr}="true" ${a}>${Al(i,n)}</${r}>`:`<${r} ${vr}="true">${Al(i,n)}</${r}>`},ob=(r,e,t=!0)=>e.reduce((n,a)=>{const i=a,o=Object.keys(i).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,h)=>{const m=typeof i[h]>"u"?h:`${h}="${Al(i[h],t)}"`;return c?`${c} ${m}`:m},""),l=i.innerHTML||i.cssText||"",d=ab.indexOf(r)===-1;return`${n}<${r} ${vr}="true" ${o}${d?"/>":`>${l}</${r}>`}`},""),Zp=(r,e={})=>Object.keys(r).reduce((t,n)=>{const a=qc[n];return t[a||n]=r[n],t},e),lb=(r,e,t)=>{const n={key:e,[vr]:!0},a=Zp(t,n);return[$.createElement("title",a,e)]},li=(r,e)=>e.map((t,n)=>{const a={key:n,[vr]:!0};return Object.keys(t).forEach(i=>{const l=qc[i]||i;if(l==="innerHTML"||l==="cssText"){const d=t.innerHTML||t.cssText;a.dangerouslySetInnerHTML={__html:d}}else a[l]=t[i]}),$.createElement(r,a)}),lr=(r,e,t=!0)=>{switch(r){case"title":return{toComponent:()=>lb(r,e.title,e.titleAttributes),toString:()=>ib(r,e.title,e.titleAttributes,t)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Zp(e),toString:()=>Yp(e)};default:return{toComponent:()=>li(r,e),toString:()=>ob(r,e,t)}}},cb=({metaTags:r,linkTags:e,scriptTags:t,encode:n})=>{const a=Ho(r,Vo.meta),i=Ho(e,Vo.link),o=Ho(t,Vo.script);return{priorityMethods:{toComponent:()=>[...li("meta",a.priority),...li("link",i.priority),...li("script",o.priority)],toString:()=>`${lr("meta",a.priority,n)} ${lr("link",i.priority,n)} ${lr("script",o.priority,n)}`},metaTags:a.default,linkTags:i.default,scriptTags:o.default}},db=r=>{const{baseTag:e,bodyAttributes:t,encode:n=!0,htmlAttributes:a,noscriptTags:i,styleTags:o,title:l="",titleAttributes:d,prioritizeSeoTags:c}=r;let{linkTags:h,metaTags:m,scriptTags:f}=r,p={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:p,linkTags:h,metaTags:m,scriptTags:f}=cb(r)),{priority:p,base:lr("base",e,n),bodyAttributes:lr("bodyAttributes",t,n),htmlAttributes:lr("htmlAttributes",a,n),link:lr("link",h,n),meta:lr("meta",m,n),noscript:lr("noscript",i,n),script:lr("script",f,n),style:lr("style",o,n),title:lr("title",{title:l,titleAttributes:d},n)}},Il=db,qa=[],Jp=!!(typeof window<"u"&&window.document&&window.document.createElement),Rl=class{instances=[];canUseDOM=Jp;context;value={setHelmet:r=>{this.context.helmet=r},helmetInstances:{get:()=>this.canUseDOM?qa:this.instances,add:r=>{(this.canUseDOM?qa:this.instances).push(r)},remove:r=>{const e=(this.canUseDOM?qa:this.instances).indexOf(r);(this.canUseDOM?qa:this.instances).splice(e,1)}}};constructor(r,e){this.context=r,this.canUseDOM=e||!1,e||(r.helmet=Il({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ub={},Xp=$.createContext(ub),Kp=class Qp extends u.Component{static canUseDOM=Jp;helmetData;constructor(e){super(e),this.helmetData=new Rl(this.props.context||{},Qp.canUseDOM)}render(){return $.createElement(Xp.Provider,{value:this.helmetData.value},this.props.children)}},Ws=(r,e)=>{const t=document.head||document.querySelector("head"),n=t.querySelectorAll(`${r}[${vr}]`),a=[].slice.call(n),i=[];let o;return e&&e.length&&e.forEach(l=>{const d=document.createElement(r);for(const c in l)if(Object.prototype.hasOwnProperty.call(l,c))if(c==="innerHTML")d.innerHTML=l.innerHTML;else if(c==="cssText")d.styleSheet?d.styleSheet.cssText=l.cssText:d.appendChild(document.createTextNode(l.cssText));else{const h=c,m=typeof l[h]>"u"?"":l[h];d.setAttribute(c,m)}d.setAttribute(vr,"true"),a.some((c,h)=>(o=h,d.isEqualNode(c)))?a.splice(o,1):i.push(d)}),a.forEach(l=>l.parentNode?.removeChild(l)),i.forEach(l=>t.appendChild(l)),{oldTags:a,newTags:i}},Ml=(r,e)=>{const t=document.getElementsByTagName(r)[0];if(!t)return;const n=t.getAttribute(vr),a=n?n.split(","):[],i=[...a],o=Object.keys(e);for(const l of o){const d=e[l]||"";t.getAttribute(l)!==d&&t.setAttribute(l,d),a.indexOf(l)===-1&&a.push(l);const c=i.indexOf(l);c!==-1&&i.splice(c,1)}for(let l=i.length-1;l>=0;l-=1)t.removeAttribute(i[l]);a.length===i.length?t.removeAttribute(vr):t.getAttribute(vr)!==o.join(",")&&t.setAttribute(vr,o.join(","))},hb=(r,e)=>{typeof r<"u"&&document.title!==r&&(document.title=Gp(r)),Ml("title",e)},wu=(r,e)=>{const{baseTag:t,bodyAttributes:n,htmlAttributes:a,linkTags:i,metaTags:o,noscriptTags:l,onChangeClientState:d,scriptTags:c,styleTags:h,title:m,titleAttributes:f}=r;Ml("body",n),Ml("html",a),hb(m,f);const p={baseTag:Ws("base",t),linkTags:Ws("link",i),metaTags:Ws("meta",o),noscriptTags:Ws("noscript",l),scriptTags:Ws("script",c),styleTags:Ws("style",h)},v={},x={};
2Object.keys(p).forEach(g=>{const{newTags:b,oldTags:j}=p[g];b.length&&(v[g]=b),j.length&&(x[g]=p[g].oldTags)}),e&&e(),d(r,v,x)},Dn=null,mb=r=>{Dn&&cancelAnimationFrame(Dn),r.defer?Dn=requestAnimationFrame(()=>{wu(r,()=>{Dn=null})}):(wu(r),Dn=null)},pb=mb,ju=class extends u.Component{rendered=!1;shouldComponentUpdate(r){return!Jy(r,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:r}=this.props.context;r.remove(this),this.emitChange()}emitChange(){const{helmetInstances:r,setHelmet:e}=this.props.context;let t=null;const n=sb(r.get().map(a=>{const i={...a.props};return delete i.context,i}));Kp.canUseDOM?pb(n):Il&&(t=Il(n)),e(t)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:r}=this.props.context;r.add(this),this.emitChange()}render(){return this.init(),null}},fb=class extends u.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(r){return!Wy(_u(this.props,"helmetData"),_u(r,"helmetData"))}mapNestedChildrenToProps(r,e){if(!e)return null;switch(r.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${r.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(r,e,t,n){return{...e,[r.type]:[...e[r.type]||[],{...t,...this.mapNestedChildrenToProps(r,n)}]}}mapObjectTypeChildren(r,e,t,n){switch(r.type){case"title":return{...e,[r.type]:n,titleAttributes:{...t}};case"body":return{...e,bodyAttributes:{...t}};case"html":return{...e,htmlAttributes:{...t}};default:return{...e,[r.type]:{...t}}}}mapArrayTypeChildrenToProps(r,e){let t={...e};return Object.keys(r).forEach(n=>{t={...t,[n]:r[n]}}),t}warnOnInvalidChildren(r,e){return yu(bu.some(t=>r.type===t),typeof r.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${bu.join(", ")} are allowed. Helmet does not support rendering <${r.type}> elements. Refer to our API for more information.`),yu(!e||typeof e=="string"||Array.isArray(e)&&!e.some(t=>typeof t!="string"),`Helmet expects a string as a child of <${r.type}>. Did you forget to wrap your children in braces? ( <${r.type}>{\`\`}</${r.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(r,e){let t={};return $.Children.forEach(r,n=>{if(!n||!n.props)return;const{children:a,...i}=n.props,o=Object.keys(i).reduce((d,c)=>(d[Xy[c]||c]=i[c],d),{});let{type:l}=n;
2switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(n,a),l){case"Symbol(react.fragment)":e=this.mapChildrenToProps(a,e);break;case"link":case"meta":case"noscript":case"script":case"style":t=this.flattenArrayTypeChildren(n,t,o,a);break;default:e=this.mapObjectTypeChildren(n,e,o,a);break}}),this.mapArrayTypeChildrenToProps(t,e)}render(){const{children:r,...e}=this.props;let t={...e},{helmetData:n}=e;if(r&&(t=this.mapChildrenToProps(r,t)),n&&!(n instanceof Rl)){const a=n;n=new Rl(a.context,!0),delete t.helmetData}return n?$.createElement(ju,{...t,context:n.value}):$.createElement(Xp.Consumer,null,a=>$.createElement(ju,{...t,context:a}))}};const gb="modulepreload",xb=function(r){return"/"+r},ku={},F=function(e,t,n){let a=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");a=Promise.allSettled(t.map(d=>{if(d=xb(d),d in ku)return;ku[d]=!0;const c=d.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const m=document.createElement("link");if(m.rel=c?"stylesheet":gb,c||(m.as="script"),m.crossOrigin="",m.href=d,l&&m.setAttribute("nonce",l),document.head.appendChild(m),c)return new Promise((f,p)=>{m.addEventListener("load",f),m.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};function Ol(r){if(!(r instanceof Error))return!1;const e=r.message.toLowerCase();return e.includes("failed to fetch dynamically imported module")||e.includes("importing a module script failed")||e.includes("error loading dynamically imported module")||e.includes("failed to load module script")||e.includes("loading chunk")&&e.includes("failed")}function B(r){return u.lazy(()=>vb(r))}async function vb(r){try{return await r()}catch(e){if(!Ol(e))throw e;try{return await r()}catch(t){if(!Ol(t))throw t;const n="chunk-reload-attempted";if(!sessionStorage.getItem(n))return sessionStorage.setItem(n,"1"),window.location.reload(),new Promise(()=>{});throw sessionStorage.removeItem(n),t}}}function yb(){sessionStorage.removeItem("chunk-reload-attempted")}const bb=1,_b=1e6;let Uo=0;function wb(){return Uo=(Uo+1)%Number.MAX_SAFE_INTEGER,Uo.toString()}const Bo=new Map,Nu=r=>{if(Bo.has(r))return;const e=setTimeout(()=>{Bo.delete(r),ma({type:"REMOVE_TOAST",toastId:r})},_b);Bo.set(r,e)},jb=(r,e)=>{switch(e.type){case"ADD_TOAST":return{...r,toasts:[e.toast,...r.toasts].slice(0,bb)};case"UPDATE_TOAST":return{...r,toasts:r.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=e;return t?Nu(t):r.toasts.forEach(n=>{Nu(n.id)}),{...r,toasts:r.toasts.map(n=>n.id===t||t===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...r,toasts:[]}:{...r,toasts:r.toasts.filter(t=>t.id!==e.toastId)}}},ci=[];let di={toasts:[]};function ma(r){di=jb(di,r),ci.forEach(e=>{e(di)})}function kb({...r}){const e=wb(),t=a=>ma({type:"UPDATE_TOAST",toast:{...a,id:e}}),n=()=>ma({type:"DISMISS_TOAST",toastId:e});return ma({type:"ADD_TOAST",toast:{...r,id:e,open:!0,onOpenChange:a=>{a||n()}}}),{id:e,dismiss:n,update:t}}function Nb(){const[r,e]=u.useState(di);return u.useEffect(()=>(ci.push(e),()=>{const t=ci.indexOf(e);t>-1&&ci.splice(t,1)}),[r]),{...r,toast:kb,dismiss:t=>ma({type:"DISMISS_TOAST",toastId:t})}}var Wc="ToastProvider",[Gc,Sb,Eb]=fp("Toast"),[ef]=js("Toast",[Eb]),[Cb,ho]=ef(Wc),tf=r=>{const{__scopeToast:e,label:t="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=r,[l,d]=u.useState(null),[c,h]=u.useState(0),m=u.useRef(!1),f=u.useRef(!1);return t.trim()||console.error(`Invalid prop \`label\` supplied to \`${Wc}\`. Expected non-empty \`string\`.`),s.jsx(Gc.Provider,{scope:e,children:s.jsx(Cb,{scope:e,label:t,duration:n,swipeDirection:a,swipeThreshold:i,toastCount:c,viewport:l,onViewportChange:d,onToastAdd:u.useCallback(()=>h(p=>p+1),[]),onToastRemove:u.useCallback(()=>h(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:f,children:o})})};tf.displayName=Wc;var rf="ToastViewport",Tb=["F8"],Dl="toast.viewportPause",Ll="toast.viewportResume",sf=u.forwardRef((r,e)=>{const{__scopeToast:t,hotkey:n=Tb,label:a="Notifications ({hotkey})",...i}=r,o=ho(rf,t),l=Sb(t),d=u.useRef(null),c=u.useRef(null),h=u.useRef(null),m=u.useRef(null),f=Ft(e,m,o.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;u.useEffect(()=>{const g=b=>{n.length!==0&&n.every(k=>b[k]||b.code===k)&&m.current?.focus()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),u.useEffect(()=>{const g=d.current,b=m.current;if(v&&g&&b){const j=()=>
2{if(!o.isClosePausedRef.current){const S=new CustomEvent(Dl);b.dispatchEvent(S),o.isClosePausedRef.current=!0}},k=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(Ll);b.dispatchEvent(S),o.isClosePausedRef.current=!1}},y=S=>{!g.contains(S.relatedTarget)&&k()},w=()=>{g.contains(document.activeElement)||k()};return g.addEventListener("focusin",j),g.addEventListener("focusout",y),g.addEventListener("pointermove",j),g.addEventListener("pointerleave",w),window.addEventListener("blur",j),window.addEventListener("focus",k),()=>{g.removeEventListener("focusin",j),g.removeEventListener("focusout",y),g.removeEventListener("pointermove",j),g.removeEventListener("pointerleave",w),window.removeEventListener("blur",j),window.removeEventListener("focus",k)}}},[v,o.isClosePausedRef]);const x=u.useCallback(({tabbingDirection:g})=>{const j=l().map(k=>{const y=k.ref.current,w=[y,...Hb(y)];return g==="forwards"?w:w.reverse()});return(g==="forwards"?j.reverse():j).flat()},[l]);return u.useEffect(()=>{const g=m.current;if(g){const b=j=>{const k=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!k){const w=document.activeElement,S=j.shiftKey;if(j.target===g&&S){c.current?.focus();return}const C=x({tabbingDirection:S?"backwards":"forwards"}),O=C.findIndex(R=>R===w);qo(C.slice(O+1))?j.preventDefault():S?c.current?.focus():h.current?.focus()}};return g.addEventListener("keydown",b),()=>g.removeEventListener("keydown",b)}},[l,x]),s.jsxs(ly,{ref:d,role:"region","aria-label":a.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&s.jsx($l,{ref:c,onFocusFromOutsideViewport:()=>{const g=x({tabbingDirection:"forwards"});qo(g)}}),s.jsx(Gc.Slot,{scope:t,children:s.jsx(ft.ol,{tabIndex:-1,...i,ref:f})}),v&&s.jsx($l,{ref:h,onFocusFromOutsideViewport:()=>{const g=x({tabbingDirection:"backwards"});qo(g)}})]})});sf.displayName=rf;var nf="ToastFocusProxy",$l=u.forwardRef((r,e)=>{const{__scopeToast:t,onFocusFromOutsideViewport:n,...a}=r,i=ho(nf,t);return s.jsx(gp,{"aria-hidden":!0,tabIndex:0,...a,ref:e,style:{position:"fixed"},onFocus:o=>{const l=o.relatedTarget;!i.viewport?.contains(l)&&n()}})});$l.displayName=nf;var Aa="Toast",Pb="toast.swipeStart",Ab="toast.swipeMove",Ib="toast.swipeCancel",Rb="toast.swipeEnd",af=u.forwardRef((r,e)=>{const{forceMount:t,open:n,defaultOpen:a,onOpenChange:i,...o}=r,[l,d]=kn({prop:n,defaultProp:a??!0,onChange:i,caller:Aa});return s.jsx(Bs,{present:t||l,children:s.jsx(Db,{open:l,...o,ref:e,onClose:()=>d(!1),onPause:xr(r.onPause),onResume:xr(r.onResume),onSwipeStart:mt(r.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:mt(r.onSwipeMove,c=>{const{x:h,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:mt(r.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:mt(r.onSwipeEnd,c=>{const{x:h,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),d(!1)})})})});af.displayName=Aa;var[Mb,Ob]=ef(Aa,{onClose(){}}),Db=u.forwardRef((r,e)=>{const{__scopeToast:t,type:n="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:d,onResume:c,onSwipeStart:h,onSwipeMove:m,onSwipeCancel:f,onSwipeEnd:p,...v}=r,x=ho(Aa,t),[g,b]=u.useState(null),j=Ft(e,A=>b(A)),k=u.useRef(null),y=u.useRef(null),w=a||x.duration,S=u.useRef(0),N=u.useRef(w),_=u.useRef(0),{onToastAdd:C,onToastRemove:O}=x,R=xr(()=>{g?.contains(document.activeElement)&&x.viewport?.focus(),o()}),M=u.useCallback(A=>
2{!A||A===1/0||(window.clearTimeout(_.current),S.current=new Date().getTime(),_.current=window.setTimeout(R,A))},[R]);u.useEffect(()=>{const A=x.viewport;if(A){const V=()=>{M(N.current),c?.()},G=()=>{const se=new Date().getTime()-S.current;N.current=N.current-se,window.clearTimeout(_.current),d?.()};return A.addEventListener(Dl,G),A.addEventListener(Ll,V),()=>{A.removeEventListener(Dl,G),A.removeEventListener(Ll,V)}}},[x.viewport,w,d,c,M]),u.useEffect(()=>{i&&!x.isClosePausedRef.current&&M(w)},[i,w,x.isClosePausedRef,M]),u.useEffect(()=>(C(),()=>O()),[C,O]);const L=u.useMemo(()=>g?mf(g):null,[g]);return x.viewport?s.jsxs(s.Fragment,{children:[L&&s.jsx(Lb,{__scopeToast:t,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),s.jsx(Mb,{scope:t,onClose:R,children:pp.createPortal(s.jsx(Gc.ItemSlot,{scope:t,children:s.jsx(cy,{asChild:!0,onEscapeKeyDown:mt(l,()=>{x.isFocusedToastEscapeKeyDownRef.current||R(),x.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(ft.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":x.swipeDirection,...v,ref:j,style:{userSelect:"none",touchAction:"none",...r.style},onKeyDown:mt(r.onKeyDown,A=>{A.key==="Escape"&&(l?.(A.nativeEvent),A.nativeEvent.defaultPrevented||(x.isFocusedToastEscapeKeyDownRef.current=!0,R()))}),onPointerDown:mt(r.onPointerDown,A=>{A.button===0&&(k.current={x:A.clientX,y:A.clientY})}),onPointerMove:mt(r.onPointerMove,A=>{if(!k.current)return;const V=A.clientX-k.current.x,G=A.clientY-k.current.y,se=!!y.current,re=["left","right"].includes(x.swipeDirection),Z=["left","up"].includes(x.swipeDirection)?Math.min:Math.max,P=re?Z(0,V):0,E=re?0:Z(0,G),U=A.pointerType==="touch"?10:2,J={x:P,y:E},te={originalEvent:A,delta:J};se?(y.current=J,Wa(Ab,m,te,{discrete:!1})):Su(J,x.swipeDirection,U)?(y.current=J,Wa(Pb,h,te,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(V)>U||Math.abs(G)>U)&&(k.current=null)}),onPointerUp:mt(r.onPointerUp,A=>{const V=y.current,G=A.target;if(G.hasPointerCapture(A.pointerId)&&G.releasePointerCapture(A.pointerId),y.current=null,k.current=null,V){const se=A.currentTarget,re={originalEvent:A,delta:V};Su(V,x.swipeDirection,x.swipeThreshold)?Wa(Rb,p,re,{discrete:!0}):Wa(Ib,f,re,{discrete:!0}),se.addEventListener("click",Z=>Z.preventDefault(),{once:!0})}})})})}),x.viewport)})]}):null}),Lb=r=>{const{__scopeToast:e,children:t,...n}=r,a=ho(Aa,e),[i,o]=u.useState(!1),[l,d]=u.useState(!1);return Vb(()=>o(!0)),u.useEffect(()=>{const c=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(c)},[]),l?null:s.jsx(dy,{asChild:!0,children:s.jsx(gp,{...n,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",t]})})})},$b="ToastTitle",of=u.forwardRef((r,e)=>{const{__scopeToast:t,...n}=r;return s.jsx(ft.div,{...n,ref:e})});of.displayName=$b;var Fb="ToastDescription",lf=u.forwardRef((r,e)=>{const{__scopeToast:t,...n}=r;return s.jsx(ft.div,{...n,ref:e})});lf.displayName=Fb;var cf="ToastAction",df=u.forwardRef((r,e)=>{const{altText:t,...n}=r;return t.trim()?s.jsx(hf,{altText:t,asChild:!0,children:s.jsx(Yc,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${cf}\`. Expected non-empty \`string\`.`),null)});df.displayName=cf;var uf="ToastClose",Yc=u.forwardRef((r,e)=>{const{__scopeToast:t,...n}=r,a=Ob(uf,t);return s.jsx(hf,{asChild:!0,children:s.jsx(ft.button,{type:"button",...n,ref:e,onClick:mt(r.onClick,a.onClose)})})});Yc.displayName=uf;var hf=u.forwardRef((r,e)=>{const{__scopeToast:t,altText:n,...a}=r;return s.jsx(ft.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:e})});function mf(r){const e=[];return Array.from(r.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),zb(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...mf(n))}}),e}function Wa(r,e,t,{discrete:n}){const a=t.originalEvent.currentTarget,i=new CustomEvent(r,{bubbles:!0,cancelable:!0,detail:t});e&&a.addEventListener(r,e,{once:!0}),n?uy(a,i):a.dispatchEvent(i)}var Su=(r,e,t=0)=>{const n=Math.abs(r.x),a=Math.abs(r.y),i=n>a;return e==="left"||e==="right"?i&&n>t:!i&&a>t};function Vb(r=()=>{}){const e=xr(r);Bc(()=>{let t=0,n=0;return t=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(n)}},[e])}function zb(r){return r.nodeType===r.ELEMENT_NODE}function Hb(r){const e=[],t=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function qo(r){const e=document.activeElement;return r.some(t=>t===e?!0:(t.focus(),document.activeElement!==e))}var Ub=tf,pf=sf,ff=af,gf=of,xf=lf,vf=df,yf=Yc;const Eu=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,Cu=Up,mo=(r,e)=>t=>{var n;if(e?.variants==null)return Cu(r,t?.class,t?.className);const{variants:a,defaultVariants:i}=e,o=Object.keys(a).map(c=>{const h=t?.[c],m=i?.[c];if(h===null)return null;const f=Eu(h)||Eu(m);return a[c][f]}),l=t&&Object.entries(t).reduce((c,h)=>{let[m,f]=h;return f===void 0||(c[m]=f),c},{}),d=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((c,h)=>{let{class:m,className:f,...p}=h;return Object.entries(p).every(v=>{let[x,g]=v;return Array.isArray(g)?g.includes({...i,...l}[x]):{...i,...l}[x]===g})?[...c,m,f]:c},[]);return Cu(r,o,d,t?.class,t?.className)};/** 3 * @license lucide-react v0.462.0 - ISC 4 * 5 * This source code is licensed under the ISC license. 6 * See the LICENSE file in the root directory of this source tree. 7 */const Bb=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bf=(...r)=>
vendor: 4,225 bytes, lines 7-62
7r.filter((e,t,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===t).join(" ").trim();/** 8 * @license lucide-react v0.462.0 - ISC 9 * 10 * This source code is licensed under the ISC license. 11 * See the LICENSE file in the root directory of this source tree. 12 */var qb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 13 * @license lucide-react v0.462.0 - ISC 14 * 15 * This source code is licensed under the ISC license. 16 * See the LICENSE file in the root directory of this source tree. 17 */const Wb=u.forwardRef(({color:r="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...l},d)=>u.createElement("svg",{ref:d,...qb,width:e,height:e,stroke:r,strokeWidth:n?Number(t)*24/Number(e):t,className:bf("lucide",a),...l},[...o.map(([c,h])=>u.createElement(c,h)),...Array.isArray(i)?i:[i]]));/** 18 * @license lucide-react v0.462.0 - ISC 19 * 20 * This source code is licensed under the ISC license. 21 * See the LICENSE file in the root directory of this source tree. 22 */const Q=(r,e)=>{const t=u.forwardRef(({className:n,...a},i)=>u.createElement(Wb,{ref:i,iconNode:e,className:bf(`lucide-${Bb(r)}`,n),...a}));return t.displayName=`${r}`,t};/** 23 * @license lucide-react v0.462.0 - ISC 24 * 25 * This source code is licensed under the ISC license. 26 * See the LICENSE file in the root directory of this source tree. 27 */const Zc=Q("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 28 * @license lucide-react v0.462.0 - ISC 29 * 30 * This source code is licensed under the ISC license. 31 * See the LICENSE file in the root directory of this source tree. 32 */const _i=Q("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 33 * @license lucide-react v0.462.0 - ISC 34 * 35 * This source code is licensed under the ISC license. 36 * See the LICENSE file in the root directory of this source tree. 37 */const nr=Q("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 38 * @license lucide-react v0.462.0 - ISC 39 * 40 * This source code is licensed under the ISC license. 41 * See the LICENSE file in the root directory of this source tree. 42 */const Fl=Q("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 43 * @license lucide-react v0.462.0 - ISC 44 * 45 * This source code is licensed under the ISC license. 46 * See the LICENSE file in the root directory of this source tree. 47 */const Gb=Q("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 48 * @license lucide-react v0.462.0 - ISC 49 * 50 * This source code is licensed under the ISC license. 51 * See the LICENSE file in the root directory of this source tree. 52 */const ga=Q("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 53 * @license lucide-react v0.462.0 - ISC 54 * 55 * This source code is licensed under the ISC license. 56 * See the LICENSE file in the root directory of this source tree. 57 */const Jc=Q("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 58 * @license lucide-react v0.462.0 - ISC 59 * 60 * This source code is licensed under the ISC license. 61 * See the LICENSE file in the root directory of this source tree. 62 */const _f=Q("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}
62],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/** 63 * @license lucide-react v0.462.0 - ISC 64 * 65 * This source code is licensed under the ISC license. 66 * See the LICENSE file in the root directory of this source tree. 67 */const Yb=Q("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 68 * @license lucide-react v0.462.0 - ISC 69 * 70 * This source code is licensed under the ISC license. 71 * See the LICENSE file in the root directory of this source tree. 72 */const Zb=Q("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 73 * @license lucide-react v0.462.0 - ISC 74 * 75 * This source code is licensed under the ISC license. 76 * See the LICENSE file in the root directory of this source tree. 77 */const po=Q("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 78 * @license lucide-react v0.462.0 - ISC 79 * 80 * This source code is licensed under the ISC license. 81 * See the LICENSE file in the root directory of this source tree. 82 */const Ue=Q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 83 * @license lucide-react v0.462.0 - ISC 84 * 85 * This source code is licensed under the ISC license. 86 * See the LICENSE file in the root directory of this source tree. 87 */const Rr=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 88 * @license lucide-react v0.462.0 - ISC 89 * 90 * This source code is licensed under the ISC license. 91 * See the LICENSE file in the root directory of this source tree. 92 */const Wo=Q("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 93 * @license lucide-react v0.462.0 - ISC 94 * 95 * This source code is licensed under the ISC license. 96 * See the LICENSE file in the root directory of this source tree. 97 */const Jr=Q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 98 * @license lucide-react v0.462.0 - ISC 99 * 100 * This source code is licensed under the ISC license. 101 * See the LICENSE file in the root directory of this source tree. 102 */const wf=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 103 * @license lucide-react v0.462.0 - ISC 104 * 105 * This source code is licensed under the ISC license. 106 * See the LICENSE file in the root directory of this source tree. 107 */const Jb=Q("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 108 * @license lucide-react v0.462.0 - ISC 109 * 110 * This source code is licensed under the ISC license. 111 * See the LICENSE file in the root directory of this source tree. 112 */const jf=Q("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 113 * @license lucide-react v0.462.0 - ISC 114 * 115 * This source code is licensed under the ISC license. 116 * See the LICENSE file in the root directory of this source tree. 117 */const wi=Q("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 118 * @license lucide-react v0.462.0 - ISC 119 * 120 * This source code is licensed under the ISC license. 121 * See the LICENSE file in the root directory of this source tree. 122 */const Ia=Q("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 123 * @license lucide-react v0.462.0 - ISC 124 * 125 * This source code is licensed under the ISC license. 126 * See the LICENSE file in the root directory of this source tree. 127 */const kf=Q("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 128 * @license lucide-react v0.462.0 - ISC 129 * 130 * This source code is licensed under the ISC license. 131 * See the LICENSE file in the root directory of this source tree. 132 */const Xb=Q("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 133 * @license lucide-react v0.462.0 - ISC 134 * 135 * This source code is licensed under the ISC license. 136 * See the LICENSE file in the root directory of this source tree. 137 */const Kb=Q("Clapperboard",[["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z",key:"1tn4o7"}],["path",{d:"m6.2 5.3 3.1 3.9",key:"iuk76l"}],["path",{d:"m12.4 3.4 3.1 4",key:"6hsd6n"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z",key:"ltgou9"}]]);/** 138 * @license lucide-react v0.462.0 - ISC 139 * 140 * This source code is licensed under the ISC license. 141 * See the LICENSE file in the root directory of this source tree. 142 */const Ls=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 143 * @license lucide-react v0.462.0 - ISC 144 * 145 * This source code is licensed under the ISC license. 146 * See the LICENSE file in the root directory of this source tree. 147 */const $s=Q("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** 148 * @license lucide-react v0.462.0 - ISC 149 * 150 * This source code is licensed under the ISC license. 151 * See the LICENSE file in the root directory of this source tree. 152 */const Nf=Q("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** 153 * @license lucide-react v0.462.0 - ISC 154 * 155 * This source code is licensed under the ISC license. 156 * See the LICENSE file in the root directory of this source tree. 157 */const Qb=Q("Cookie",[["path",{d:"M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5",key:"laymnq"}],["path",{d:"M8.5 8.5v.01",key:"ue8clq"}],["path",{d:"M16 15.5v.01",key:"14dtrp"}],["path",{d:"M12 12v.01",key:"u5ubse"}],["path",{d:"M11 17v.01",key:"1hyl5a"}],["path",{d:"M7 14v.01",key:"uct60s"}]]);/** 158 * @license lucide-react v0.462.0 - ISC 159 * 160 * This source code is licensed under the ISC license. 161 * See the LICENSE file in the root directory of this source tree.
162 */const e1=Q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 163 * @license lucide-react v0.462.0 - ISC 164 * 165 * This source code is licensed under the ISC license. 166 * See the LICENSE file in the root directory of this source tree. 167 */const qs=Q("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 168 * @license lucide-react v0.462.0 - ISC 169 * 170 * This source code is licensed under the ISC license. 171 * See the LICENSE file in the root directory of this source tree. 172 */const Ra=Q("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 173 * @license lucide-react v0.462.0 - ISC 174 * 175 * This source code is licensed under the ISC license. 176 * See the LICENSE file in the root directory of this source tree. 177 */const t1=Q("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 178 * @license lucide-react v0.462.0 - ISC 179 * 180 * This source code is licensed under the ISC license. 181 * See the LICENSE file in the root directory of this source tree. 182 */const Fs=Q("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 183 * @license lucide-react v0.462.0 - ISC 184 * 185 * This source code is licensed under the ISC license. 186 * See the LICENSE file in the root directory of this source tree. 187 */const Go=Q("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 188 * @license lucide-react v0.462.0 - ISC 189 * 190 * This source code is licensed under the ISC license. 191 * See the LICENSE file in the root directory of this source tree. 192 */const ui=Q("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 193 * @license lucide-react v0.462.0 - ISC 194 * 195 * This source code is licensed under the ISC license. 196 * See the LICENSE file in the root directory of this source tree. 197 */const r1=Q("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/** 198 * @license lucide-react v0.462.0 - ISC 199 * 200 * This source code is licensed under the ISC license. 201 * See the LICENSE file in the root directory of this source tree. 202 */const ji=Q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 203 * @license lucide-react v0.462.0 - ISC 204 * 205 * This source code is licensed under the ISC license. 206 * See the LICENSE file in the root directory of this source tree. 207 */const s1=Q("FileVideo",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]]);/** 208 * @license lucide-react v0.462.0 - ISC 209 * 210 * This source code is licensed under the ISC license. 211 * See the LICENSE file in the root directory of this source tree. 212 */const n1=Q("Film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);/** 213 * @license lucide-react v0.462.0 - ISC 214 * 215 * This source code is licensed under the ISC license. 216 * See the LICENSE file in the root directory of this source tree. 217 */const yr=Q("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** 218 * @license lucide-react v0.462.0 - ISC 219 * 220 * This source code is licensed under the ISC license. 221 * See the LICENSE file in the root directory of this source tree. 222 */const Sf=Q("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** 223 * @license lucide-react v0.462.0 - ISC 224 * 225 * This source code is licensed under the ISC license. 226 * See the LICENSE file in the root directory of this source tree. 227 */const Ef=Q("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** 228 * @license lucide-react v0.462.0 - ISC 229 * 230 * This source code is licensed under the ISC license. 231 * See the LICENSE file in the root directory of this source tree. 232 */const fo=Q("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/** 233 * @license lucide-react v0.462.0 - ISC 234 * 235 * This source code is licensed under the ISC license. 236 * See the LICENSE file in the root directory of this source tree. 237 */const a1=Q("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 238 * @license lucide-react v0.462.0 - ISC 239 * 240 * This source code is licensed under the ISC license. 241 * See the LICENSE file in the root directory of this source tree. 242 */const i1=Q("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** 243 * @license lucide-react v0.462.0 - ISC 244 * 245 * This source code is licensed under the ISC license. 246 * See the LICENSE file in the root directory of this source tree. 247 */const ki=Q("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/** 248 * @license lucide-react v0.462.0 - ISC 249 * 250 * This source code is licensed under the ISC license. 251 * See the LICENSE file in the root directory of this source tree. 252 */const Cf=Q("Headset",[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]]);/** 253 * @license lucide-react v0.462.0 - ISC 254 * 255 * This source code is licensed under the ISC license. 256 * See the LICENSE file in the root directory of this source tree. 257 */const Ma=Q("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 258 * @license lucide-react v0.462.0 - ISC 259 * 260 * This source code is licensed under the ISC license. 261 * See the LICENSE file in the root directory of this source tree. 262 */const o1=Q("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"}]]);/** 263 * @license lucide-react v0.462.0 - ISC 264 * 265 * This source code is licensed under the ISC license. 266 * See the LICENSE file in the root directory of this source tree. 267 */const l1=Q("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** 268 * @license lucide-react v0.462.0 - ISC 269 * 270 * This source code is licensed under the ISC license. 271 * See the LICENSE file in the root directory of this source tree. 272 */const Tf=Q("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 273 * @license lucide-react v0.462.0 - ISC 274 * 275 * This source code is licensed under the ISC license. 276 * See the LICENSE file in the root directory of this source tree. 277 */const c1=Q("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"}]]);/** 278 * @license lucide-react v0.462.0 - ISC 279 * 280 * This source code is licensed under the ISC license. 281 * See the LICENSE file in the root directory of this source tree. 282 */const Pf=Q("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** 283 * @license lucide-react v0.462.0 - ISC 284 * 285 * This source code is licensed under the ISC license. 286 * See the LICENSE file in the root directory of this source tree. 287 */const Tu=Q("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** 288 * @license lucide-react v0.462.0 - ISC 289 * 290 * This source code is licensed under the ISC license. 291 * See the LICENSE file in the root directory of this source tree. 292 */const d1=Q("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 293 * @license lucide-react v0.462.0 - ISC 294 * 295 * This source code is licensed under the ISC license. 296 * See the LICENSE file in the root directory of this source tree.
297 */const xa=Q("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 298 * @license lucide-react v0.462.0 - ISC 299 * 300 * This source code is licensed under the ISC license. 301 * See the LICENSE file in the root directory of this source tree. 302 */const u1=Q("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/** 303 * @license lucide-react v0.462.0 - ISC 304 * 305 * This source code is licensed under the ISC license. 306 * See the LICENSE file in the root directory of this source tree. 307 */const h1=Q("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** 308 * @license lucide-react v0.462.0 - ISC 309 * 310 * This source code is licensed under the ISC license. 311 * See the LICENSE file in the root directory of this source tree. 312 */const m1=Q("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** 313 * @license lucide-react v0.462.0 - ISC 314 * 315 * This source code is licensed under the ISC license. 316 * See the LICENSE file in the root directory of this source tree. 317 */const Mt=Q("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 318 * @license lucide-react v0.462.0 - ISC 319 * 320 * This source code is licensed under the ISC license. 321 * See the LICENSE file in the root directory of this source tree. 322 */const hi=Q("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"}]]);/** 323 * @license lucide-react v0.462.0 - ISC 324 * 325 * This source code is licensed under the ISC license. 326 * See the LICENSE file in the root directory of this source tree. 327 */const va=Q("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 328 * @license lucide-react v0.462.0 - ISC 329 * 330 * This source code is licensed under the ISC license. 331 * See the LICENSE file in the root directory of this source tree. 332 */const Ds=Q("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 333 * @license lucide-react v0.462.0 - ISC 334 * 335 * This source code is licensed under the ISC license. 336 * See the LICENSE file in the root directory of this source tree. 337 */const Af=Q("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** 338 * @license lucide-react v0.462.0 - ISC 339 * 340 * This source code is licensed under the ISC license. 341 * See the LICENSE file in the root directory of this source tree. 342 */const Xc=Q("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 343 * @license lucide-react v0.462.0 - ISC 344 * 345 * This source code is licensed under the ISC license. 346 * See the LICENSE file in the root directory of this source tree. 347 */const br=Q("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 348 * @license lucide-react v0.462.0 - ISC 349 * 350 * This source code is licensed under the ISC license. 351 * See the LICENSE file in the root directory of this source tree. 352 */const If=Q("MessageSquareReply",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"m10 7-3 3 3 3",key:"1eugdv"}],["path",{d:"M17 13v-1a2 2 0 0 0-2-2H7",key:"ernfh3"}]]);/** 353 * @license lucide-react v0.462.0 - ISC 354 * 355 * This source code is licensed under the ISC license. 356 * See the LICENSE file in the root directory of this source tree. 357 */const Kc=Q("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 358 * @license lucide-react v0.462.0 - ISC 359 * 360 * This source code is licensed under the ISC license. 361 * See the LICENSE file in the root directory of this source tree. 362 */const Rf=Q("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** 363 * @license lucide-react v0.462.0 - ISC 364 * 365 * This source code is licensed under the ISC license. 366 * See the LICENSE file in the root directory of this source tree. 367 */const Mf=Q("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** 368 * @license lucide-react v0.462.0 - ISC 369 * 370 * This source code is licensed under the ISC license. 371 * See the LICENSE file in the root directory of this source tree. 372 */const Vl=Q("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** 373 * @license lucide-react v0.462.0 - ISC 374 * 375 * This source code is licensed under the ISC license. 376 * See the LICENSE file in the root directory of this source tree. 377 */const p1=Q("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** 378 * @license lucide-react v0.462.0 - ISC 379 * 380 * This source code is licensed under the ISC license. 381 * See the LICENSE file in the root directory of this source tree. 382 */const f1=Q("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** 383 * @license lucide-react v0.462.0 - ISC 384 * 385 * This source code is licensed under the ISC license. 386 * See the LICENSE file in the root directory of this source tree. 387 */const Of=Q("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** 388 * @license lucide-react v0.462.0 - ISC 389 * 390 * This source code is licensed under the ISC license. 391 * See the LICENSE file in the root directory of this source tree. 392 */const g1=Q("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);/** 393 * @license lucide-react v0.462.0 - ISC 394 * 395 * This source code is licensed under the ISC license. 396 * See the LICENSE file in the root directory of this source tree. 397 */const x1=Q("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7
397a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/** 398 * @license lucide-react v0.462.0 - ISC 399 * 400 * This source code is licensed under the ISC license. 401 * See the LICENSE file in the root directory of this source tree. 402 */const Qc=Q("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 403 * @license lucide-react v0.462.0 - ISC 404 * 405 * This source code is licensed under the ISC license. 406 * See the LICENSE file in the root directory of this source tree. 407 */const mn=Q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 408 * @license lucide-react v0.462.0 - ISC 409 * 410 * This source code is licensed under the ISC license. 411 * See the LICENSE file in the root directory of this source tree. 412 */const on=Q("RefreshCw",[["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"}]]);/** 413 * @license lucide-react v0.462.0 - ISC 414 * 415 * This source code is licensed under the ISC license. 416 * See the LICENSE file in the root directory of this source tree. 417 */const Ni=Q("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 418 * @license lucide-react v0.462.0 - ISC 419 * 420 * This source code is licensed under the ISC license. 421 * See the LICENSE file in the root directory of this source tree. 422 */const v1=Q("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 423 * @license lucide-react v0.462.0 - ISC 424 * 425 * This source code is licensed under the ISC license. 426 * See the LICENSE file in the root directory of this source tree. 427 */const zl=Q("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 428 * @license lucide-react v0.462.0 - ISC 429 * 430 * This source code is licensed under the ISC license. 431 * See the LICENSE file in the root directory of this source tree. 432 */const ed=Q("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 433 * @license lucide-react v0.462.0 - ISC 434 * 435 * This source code is licensed under the ISC license. 436 * See the LICENSE file in the root directory of this source tree. 437 */const y1=Q("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** 438 * @license lucide-react v0.462.0 - ISC 439 * 440 * This source code is licensed under the ISC license. 441 * See the LICENSE file in the root directory of this source tree. 442 */const ya=Q("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 443 * @license lucide-react v0.462.0 - ISC 444 * 445 * This source code is licensed under the ISC license. 446 * See the LICENSE file in the root directory of this source tree. 447 */const b1=Q("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
447y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 448 * @license lucide-react v0.462.0 - ISC 449 * 450 * This source code is licensed under the ISC license. 451 * See the LICENSE file in the root directory of this source tree. 452 */const Pn=Q("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** 453 * @license lucide-react v0.462.0 - ISC 454 * 455 * This source code is licensed under the ISC license. 456 * See the LICENSE file in the root directory of this source tree. 457 */const _1=Q("Siren",[["path",{d:"M7 18v-6a5 5 0 1 1 10 0v6",key:"pcx96s"}],["path",{d:"M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z",key:"1b4s83"}],["path",{d:"M21 12h1",key:"jtio3y"}],["path",{d:"M18.5 4.5 18 5",key:"g5sp9y"}],["path",{d:"M2 12h1",key:"1uaihz"}],["path",{d:"M12 2v1",key:"11qlp1"}],["path",{d:"m4.929 4.929.707.707",key:"1i51kw"}],["path",{d:"M12 12v6",key:"3ahymv"}]]);/** 458 * @license lucide-react v0.462.0 - ISC 459 * 460 * This source code is licensed under the ISC license. 461 * See the LICENSE file in the root directory of this source tree. 462 */const w1=Q("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** 463 * @license lucide-react v0.462.0 - ISC 464 * 465 * This source code is licensed under the ISC license. 466 * See the LICENSE file in the root directory of this source tree. 467 */const Bt=Q("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 468 * @license lucide-react v0.462.0 - ISC 469 * 470 * This source code is licensed under the ISC license. 471 * See the LICENSE file in the root directory of this source tree. 472 */const j1=Q("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 473 * @license lucide-react v0.462.0 - ISC 474 * 475 * This source code is licensed under the ISC license. 476 * See the LICENSE file in the root directory of this source tree. 477 */const Df=Q("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"}]]);/** 478 * @license lucide-react v0.462.0 - ISC 479 * 480 * This source code is licensed under the ISC license. 481 * See the LICENSE file in the root directory of this source tree. 482 */const mi=Q("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** 483 * @license lucide-react v0.462.0 - ISC 484 * 485 * This source code is licensed under the ISC license. 486 * See the LICENSE file in the root directory of this source tree. 487 */const k1=Q("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** 488 * @license lucide-react v0.462.0 - ISC 489 * 490 * This source code is licensed under the ISC license. 491 * See the LICENSE file in the root directory of this source tree. 492 */const N1=Q("Ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);/** 493 * @license lucide-react v0.462.0 - ISC 494 * 495 * This source code is licensed under the ISC license. 496 * See the LICENSE file in the root directory of this source tree. 497 */const S1=Q("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** 498 * @license lucide-react v0.462.0 - ISC 499 * 500 * This source code is licensed under the ISC license. 501 * See the LICENSE file in the root directory of this source tree. 502 */const Lf=Q("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 503 * @license lucide-react v0.462.0 - ISC 504 * 505 * This source code is licensed under the ISC license. 506 * See the LICENSE file in the root directory of this source tree. 507 */const td=Q("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 508 * @license lucide-react v0.462.0 - ISC 509 * 510 * This source code is licensed under the ISC license. 511 * See the LICENSE file in the root directory of this source tree. 512 */const E1=Q("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** 513 * @license lucide-react v0.462.0 - ISC 514 * 515 * This source code is licensed under the ISC license. 516 * See the LICENSE file in the root directory of this source tree. 517 */const C1=Q("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 518 * @license lucide-react v0.462.0 - ISC 519 * 520 * This source code is licensed under the ISC license. 521 * See the LICENSE file in the root directory of this source tree. 522 */const $f=Q("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}
vendor: 8,940 bytes, lines 522-557
522],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** 523 * @license lucide-react v0.462.0 - ISC 524 * 525 * This source code is licensed under the ISC license. 526 * See the LICENSE file in the root directory of this source tree. 527 */const go=Q("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 528 * @license lucide-react v0.462.0 - ISC 529 * 530 * This source code is licensed under the ISC license. 531 * See the LICENSE file in the root directory of this source tree. 532 */const ur=Q("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 533 * @license lucide-react v0.462.0 - ISC 534 * 535 * This source code is licensed under the ISC license. 536 * See the LICENSE file in the root directory of this source tree. 537 */const Dt=Q("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** 538 * @license lucide-react v0.462.0 - ISC 539 * 540 * This source code is licensed under the ISC license. 541 * See the LICENSE file in the root directory of this source tree. 542 */const T1=Q("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** 543 * @license lucide-react v0.462.0 - ISC 544 * 545 * This source code is licensed under the ISC license. 546 * See the LICENSE file in the root directory of this source tree. 547 */const Ff=Q("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/** 548 * @license lucide-react v0.462.0 - ISC 549 * 550 * This source code is licensed under the ISC license. 551 * See the LICENSE file in the root directory of this source tree. 552 */const lt=Q("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 553 * @license lucide-react v0.462.0 - ISC 554 * 555 * This source code is licensed under the ISC license. 556 * See the LICENSE file in the root directory of this source tree. 557 */const _r=Q("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),rd="-",P1=r=>{const e=I1(r),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=r;return{getClassGroupId:o=>{const l=o.split(rd);return l[0]===""&&l.length!==1&&l.shift(),Vf(l,e)||A1(o)},getConflictingClassGroupIds:(o,l)=>{const d=t[o]||[];return l&&n[o]?[...d,...n[o]]:d}}},Vf=(r,e)=>{if(r.length===0)return e.classGroupId;const t=r[0],n=e.nextPart.get(t),a=n?Vf(r.slice(1),n):void 0;if(a)return a;if(e.validators.length===0)return;const i=r.join(rd);return e.validators.find(({validator:o})=>o(i))?.classGroupId},Pu=/^\[(.+)\]$/,A1=r=>{if(Pu.test(r)){const e=Pu.exec(r)[1],t=e?.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},I1=r=>{const{theme:e,prefix:t}=r,n={nextPart:new Map,validators:[]};return M1(Object.entries(r.classGroups),t).forEach(([i,o])=>{Hl(o,n,i,e)}),n},Hl=(r,e,t,n)=>{r.forEach(a=>{if(typeof a=="string"){const i=a===""?e:Au(e,a);i.classGroupId=t;return}if(typeof a=="function"){if(R1(a)){Hl(a(n),e,t,n);return}e.validators.push({validator:a,classGroupId:t});return}Object.entries(a).forEach(([i,o])=>{Hl(o,Au(e,i),t,n)})})},Au=(r,e)=>{let t=r;return e.split(rd).forEach(n=>{t.nextPart.has(n)||t.nextPart.set(n,{nextPart:new Map,validators:[]}),t=t.nextPart.get(n)}),t},R1=r=>r.isThemeGetter,M1=(r,e)=>e?r.map(([t,n])=>{const a=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[e+o,l])):i);return[t,a]}):r,O1=r=>{if(r<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,n=new Map;const a=(i,o)=>{t.set(i,o),e++,e>r&&(e=0,n=t,t=new Map)};return{get(i){let o=t.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){t.has(i)?t.set(i,o):a(i,o)}}},zf="!",D1=r=>{const{separator:e,experimentalParseClassName:t}=r,n=e.length===1,a=e[0],i=e.length,o=l=>{const d=[];let c=0,h=0,m;for(let g=0;g<l.length;g++){let b=l[g];if(c===0){if(b===a&&(n||l.slice(g,g+i)===e)){d.push(l.slice(h,g)),h=g+i;continue}if(b==="/"){m=g;continue}}b==="["?c++:b==="]"&&c--}const f=d.length===0?l:l.substring(h),p=f.startsWith(zf),v=p?f.substring(1):f,x=m&&m>h?m-h:void 0;return{modifiers:d,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:x}};return t?l=>t({className:l,parseClassName:o}):o},L1=r=>{if(r.length<=1)return r;const e=[];let t=[];return r.forEach(n=>{n[0]==="["?(e.push(...t.sort(),n),t=[]):t.push(n)}),e.push(...t.sort()),e},$1=r=>({cache:O1(r.cacheSize),parseClassName:D1(r),...P1(r)}),F1=/\s+/,V1=(r,e)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:a}=e,i=[],o=r.trim().split(F1);let l="";for(let d=o.length-1;d>=0;d-=1){const c=o[d],{modifiers:h,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:p}=t(c);let v=!!p,x=n(v?f.substring(0,p):f);if(!x){if(!v){l=c+(l.length>0?" "+l:l);continue}if(x=n(f),!x){l=c+(l.length>0?" "+l:l);continue}v=!1}const g=L1(h).join(":"),b=m?g+zf:g,j=b+x;if(i.includes(j))continue;i.push(j);const k=a(x,v);for(let y=0;y<k.length;++y){const w=k[y];i.push(b+w)}l=c+(l.length>0?" "+l:l)}return l};function z1(){let r=0,e,t,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=Hf(e))&&(n&&(n+=" "),n+=t);return n}const Hf=r=>{if(typeof r=="string")return r;let e,t="";for(let n=0;n<r.length;n++)r[n]&&(e=Hf(r[n]))&&(t&&(t+=" "),t+=e);return t};function H1(r,...e){let t,n,a,i=o;function o(d){const c=e.reduce((h,m)=>m(h),r());return t=$1(c),n=t.cache.get,a=t.cache.set,i=l,l(d)}function l(d){const c=n(d);if(c)return c;const h=V1(d,t);return a(d,h),h}return function(){return i(z1.apply(null,arguments))}}const at=r=>{const e=t=>t[r]||[];return e.isThemeGetter=!0,e},Uf=/^\[(?:([a-z-]+):)?(.+)\]$/i,U1=/^\d+\/\d+$/,B1=new Set(["px","full","screen"]),q1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,W1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,G1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Y1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Z1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lr=r=>ln(r)||B1.has(r)||U1.test(r),ss=r=>An(r,"length",s_),ln=r=>!!r&&!Number.isNaN(Number(r)),Yo=r=>An(r,"number",ln),Ln=r=>!!r&&Number.isInteger(Number(r)),J1=r=>r.endsWith("%")&&ln(r.slice(0,-1)),Ie=r=>Uf.test(r),ns=r=>q1.test(r),X1=new Set(["length","size","percentage"]),K1=r=>An(r,X1,Bf),Q1=r=>An(r,"position",Bf),e_=new Set(["image","url"]),t_=r=>An(r,e_,a_),r_=r=>An(r,"",n_),$n=()=>!0,An=(r,e,t)=>{const n=Uf.exec(r);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):t(n[2]):!1},s_=r=>W1.test(r)&&!G1.test(r),Bf=()=>!1,n_=r=>Y1.test(r),a_=r=>Z1.test(r),i_=()=>{const r=at("colors"),e=at("spacing"),t=at("blur"),n=at("brightness"),a=at("borderColor"),i=at("borderRadius"),o=at("borderSpacing"),l=at("borderWidth"),d=at("contrast"),c=at("grayscale"),h=at("hueRotate"),m=at("invert"),f=at("gap"),p=at("gradientColorStops"),v=at("gradientColorStopPositions"),x=at("inset"),g=at("margin"),b=at("opacity"),j=at("padding"),k=at("saturate"),y=at("scale"),w=at("sepia"),S=at("skew"),N=at("space"),_=at("translate"),C=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",Ie,e],M=()=>[Ie,e],L=()=>["",Lr,ss],A=()=>["auto",ln,Ie],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",Ie],P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>[ln,Ie];return{cacheSize:500,separator:":",theme:{colors:[$n],spacing:[Lr,ss],blur:["none","",ns,Ie],brightness:E(),borderColor:[r],borderRadius:["none","","full",ns,Ie],borderSpacing:M(),borderWidth:L(),contrast:E(),grayscale:Z(),hueRotate:E(),invert:Z(),gap:M(),gradientColorStops:[r],gradientColorStopPositions:[J1,ss],inset:R(),margin:R(),opacity:E(),padding:M(),saturate:E(),scale:E(),sepia:Z(),skew:E(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",Ie]}
vendor: 11,184 bytes, line 557
557],container:["container"],columns:[{columns:[ns]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),Ie]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ln,Ie]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ie]}],grow:[{grow:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",Ln,Ie]}],"grid-cols":[{"grid-cols":[$n]}],"col-start-end":[{col:["auto",{span:["full",Ln,Ie]},Ie]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[$n]}],"row-start-end":[{row:["auto",{span:[Ln,Ie]},Ie]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ie]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...re()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...re(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...re(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ie,e]}],"min-w":[{"min-w":[Ie,e,"min","max","fit"]}],"max-w":[{"max-w":[Ie,e,"none","full","min","max","fit","prose",{screen:[ns]},ns]}],h:[{h:[Ie,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ie,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ie,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ie,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ns,ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yo]}],"font-family":[{font:[$n]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ie]}],"line-clamp":[{"line-clamp":["none",ln,Yo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Lr,Ie]}],"list-image":[{"list-image":["none",Ie]}],"list-style-type":[{list:["none","disc","decimal",Ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Lr,ss]}],"underline-offset":[{"underline-offset":["auto",Lr,Ie]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),Q1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",K1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},t_]}],"bg-color":[{bg:[r]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:G()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[Lr,Ie]}],"outline-w":[{outline:[Lr,ss]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Lr,ss]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",ns,r_]}],"shadow-color":[{shadow:[$n]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[n]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",ns,Ie]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[m]}],saturate:[{saturate:[k]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ie]}],duration:[{duration:E()}],ease:[{ease:["linear","in","out","in-out",Ie]}],delay:[{delay:E()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Ln,Ie]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ie]}],accent:[{accent:["auto",r]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
557],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ie]}],fill:[{fill:[r,"none"]}],"stroke-w":[{stroke:[Lr,ss,Yo]}],stroke:[{stroke:[r,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},o_=H1(i_);function Y(...r){return o_(Up(r))}const l_=Ub,qf=u.forwardRef(({className:r,...e},t)=>s.jsx(pf,{ref:t,className:Y("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",r),...e}));qf.displayName=pf.displayName;const c_=mo("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Wf=u.forwardRef(({className:r,variant:e,...t},n)=>s.jsx(ff,{ref:n,className:Y(c_({variant:e}),r),...t}));Wf.displayName=ff.displayName;const d_=u.forwardRef(({className:r,...e},t)=>s.jsx(vf,{ref:t,className:Y("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",r),...e}));d_.displayName=vf.displayName;const Gf=u.forwardRef(({className:r,...e},t)=>s.jsx(yf,{ref:t,className:Y("absolute right-2 top-2 rounded-md p-1 text-foreground
557/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",r),"toast-close":"",...e,children:s.jsx(lt,{className:"h-4 w-4"})}));Gf.displayName=yf.displayName;const Yf=u.forwardRef(({className:r,...e},t)=>s.jsx(gf,{ref:t,className:Y("text-sm font-semibold",r),...e}));Yf.displayName=gf.displayName;const Zf=u.forwardRef(({className:r,...e},t)=>s.jsx(xf,{ref:t,className:Y("text-sm opacity-90",r),...e}));Zf.displayName=xf.displayName;function u_(){const{toasts:r}=Nb();return s.jsxs(l_,{children:[r.map(function({id:e,title:t,description:n,action:a,...i}){return s.jsxs(Wf,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[t&&s.jsx(Yf,{children:t}),n&&s.jsx(Zf,{children:n})]}),a,s.jsx(Gf,{})]},e)}),s.jsx(qf,{})]})}var Si=["light","dark"],sd="(prefers-color-scheme: dark)",h_=typeof window>"u",nd=u.createContext(void 0),m_={setTheme:r=>{},themes:[]},ad=()=>{var r;return(r=u.useContext(nd))!=null?r:m_},p_=r=>u.useContext(nd)?r.children:u.createElement(g_,{...r}),f_=["light","dark"],g_=({forcedTheme:r,disableTransitionOnChange:e=!1,enableSystem:t=!0,enableColorScheme:n=!0,storageKey:a="theme",themes:i=f_,defaultTheme:o=t?"system":"light",attribute:l="data-theme",value:d,children:c,nonce:h})=>{let[m,f]=u.useState(()=>Iu(a,o)),[p,v]=u.useState(()=>Iu(a)),x=d?Object.values(d):i,g=u.useCallback(y=>{let w=y;if(!w)return;y==="system"&&t&&(w=Ru());let S=d?d[w]:w,N=e?v_():null,_=document.documentElement;if(l==="class"?(_.classList.remove(...x),S&&_.classList.add(S)):S?_.setAttribute(l,S):_.removeAttribute(l),n){let C=Si.includes(o)?o:null,O=Si.includes(w)?w:C;_.style.colorScheme=O}N?.()},[]),b=u.useCallback(y=>{let w=typeof y=="function"?y(y):y;f(w);try{localStorage.setItem(a,w)}catch{}},[r]),j=u.useCallback(y=>{let w=Ru(y);v(w),m==="system"&&t&&!r&&g("system")},[m,r]);u.useEffect(()=>{let y=window.matchMedia(sd);return y.addListener(j),j(y),()=>y.removeListener(j)},[j]),u.useEffect(()=>{let y=w=>{if(w.key!==a)return;let S=w.newValue||o;b(S)};return window.addEventListener("storage",y),()=>window.removeEventListener("storage",y)},[b]),u.useEffect(()=>{g(r??m)},[r,m]);let k=u.useMemo(()=>({theme:m,setTheme:b,forcedTheme:r,resolvedTheme:m==="system"?p:m,themes:t?[...i,"system"]:i,systemTheme:t?p:void 0}),[m,b,r,p,t,i]);return u.createElement(nd.Provider,{value:k},u.createElement(x_,{forcedTheme:r,disableTransitionOnChange:e,enableSystem:t,enableColorScheme:n,storageKey:a,themes:i,defaultTheme:o,attribute:l,value:d,children:c,attrs:x,nonce:h}),c)},x_=u.memo(({forcedTheme:r,storageKey:e,attribute:t,enableSystem:n,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:d})=>{let c=i==="system",h=t==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${t}',s='setAttribute';`,m=a?Si.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(v,x=!1,g=!0)=>{let b=o?o[v]:v,j=x?v+"|| ''":`'${b}'`,k="";return a&&g&&!x&&Si.includes(v)&&(k+=`d.style.colorScheme = '${v}';`),t==="class"?x||b?k+=`c.add(${j})`:k+="null":b&&(k+=`d[s](n,${j})`),k},p=r?`!function(){${h}${f(r)}}()`:n?`!function(){try{${h}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${sd}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${c?"":"else{"+f(i,!1,!1)+"}"}${m}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${m}}catch(t){}}();`;return u.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:p}})}),Iu=(r,e)=>{if(h_)return;let t;try{t=localStorage.getItem(r)||void 0}catch{}return t||e},v_=()=>{let r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(r)},1)}},Ru=r=>
557(r||(r=window.matchMedia(sd)),r.matches?"dark":"light"),y_=r=>{switch(r){case"success":return w_;case"info":return k_;case"warning":return j_;case"error":return N_;default:return null}},b_=Array(12).fill(0),__=({visible:r,className:e})=>$.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":r},$.createElement("div",{className:"sonner-spinner"},b_.map((t,n)=>$.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),w_=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.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"})),j_=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},$.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"})),k_=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.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"})),N_=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.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"})),S_=$.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"},$.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),$.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),E_=()=>{let[r,e]=$.useState(document.hidden);return $.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),r},Ul=1,C_=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=>{var t;let{message:n,...a}=e,i=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ul++,o=this.toasts.find(d=>d.id===i),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(d=>d.id===i?(this.publish({...d,...e,id:i,title:n}),{...d,...e,id:i,dismissible:l,title:n}):d):this.addToast({title:n,...a,dismissible:l,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,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)=>
557this.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"?t.description:void 0}));let a=e instanceof Promise?e:e(),i=n!==void 0,o,l=a.then(async c=>{if(o=["resolve",c],$.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(P_(c)&&!c.ok){i=!1;let h=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,m=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:h,description:m})}else if(t.success!==void 0){i=!1;let h=typeof t.success=="function"?await t.success(c):t.success,m=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:h,description:m})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){i=!1;let h=typeof t.error=="function"?await t.error(c):t.error,m=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:h,description:m})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),d=()=>new Promise((c,h)=>l.then(()=>o[0]==="reject"?h(o[1]):c(o[1])).catch(h));return typeof n!="string"&&typeof n!="number"?{unwrap:d}:Object.assign(n,{unwrap:d})},this.custom=(e,t)=>{let n=t?.id||Ul++;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}},Gt=new C_,T_=(r,e)=>{let t=e?.id||Ul++;return Gt.addToast({title:r,...e,id:t}),t},P_=r=>r&&typeof r=="object"&&"ok"in r&&typeof r.ok=="boolean"&&"status"in r&&typeof r.status=="number",A_=T_,I_=()=>Gt.toasts,R_=()=>Gt.getActiveToasts(),ne=Object.assign(A_,{success:Gt.success,info:Gt.info,warning:Gt.warning,error:Gt.error,custom:Gt.custom,message:Gt.message,promise:Gt.promise,dismiss:Gt.dismiss,loading:Gt.loading},{getHistory:I_,getToasts:R_});function M_(r,{insertAt:e}={}){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r))}M_(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
557left: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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
557:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
557--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)} 558`);function Ga(r){return r.label!==void 0}var O_=3,D_="32px",L_="16px",Mu=4e3,$_=356,F_=14,V_=20,z_=200;function gr(...r){return r.filter(Boolean).join(" ")}function H_(r){let[e,t]=r.split("-"),n=[];return e&&n.push(e),t&&n.push(t),n}var U_=r=>{var e,t,n,a,i,o,l,d,c,h,m;let{invert:f,toast:p,unstyled:v,interacting:x,setHeights:g,visibleToasts:b,heights:j,index:k,toasts:y,expanded:w,removeToast:S,defaultRichColors:N,closeButton:_,style:C,cancelButtonStyle:O,actionButtonStyle:R,className:M="",descriptionClassName:L="",duration:A,position:V,gap:G,loadingIcon:se,expandByDefault:re,classNames:Z,icons:P,closeButtonAriaLabel:E="Close toast",pauseWhenPageIsHidden:U}=r,[J,te]=$.useState(null),[D,ee]=$.useState(null),[T,z]=$.useState(!1),[q,ce]=$.useState(!1),[pe,ke]=$.useState(!1),[de,_e]=$.useState(!1),[$e,st]=$.useState(!1),[Ae,We]=$.useState(0),[He,et]=$.useState(0),At=$.useRef(p.duration||A||Mu),Kt=$.useRef(null),qt=$.useRef(null),Dr=k===0,Nr=k+1<=b,xt=p.type,Vt=p.dismissible!==!1,Qt=p.className||"",Ge=p.descriptionClassName||"",er=$.useMemo(()=>j.findIndex(K=>
558K.toastId===p.id)||0,[j,p.id]),Tt=$.useMemo(()=>{var K;return(K=p.closeButton)!=null?K:_},[p.closeButton,_]),tr=$.useMemo(()=>p.duration||A||Mu,[p.duration,A]),Wt=$.useRef(0),pr=$.useRef(0),Sr=$.useRef(0),Er=$.useRef(null),[Mn,Ne]=V.split("-"),Fe=$.useMemo(()=>j.reduce((K,X,ue)=>ue>=er?K:K+X.height,0),[j,er]),Ye=E_(),Ze=p.invert||f,Ve=xt==="loading";pr.current=$.useMemo(()=>er*G+Fe,[er,Fe]),$.useEffect(()=>{At.current=tr},[tr]),$.useEffect(()=>{z(!0)},[]),$.useEffect(()=>{let K=qt.current;if(K){let X=K.getBoundingClientRect().height;return et(X),g(ue=>[{toastId:p.id,height:X,position:p.position},...ue]),()=>g(ue=>ue.filter(we=>we.toastId!==p.id))}},[g,p.id]),$.useLayoutEffect(()=>{if(!T)return;let K=qt.current,X=K.style.height;K.style.height="auto";let ue=K.getBoundingClientRect().height;K.style.height=X,et(ue),g(we=>we.find(ze=>ze.toastId===p.id)?we.map(ze=>ze.toastId===p.id?{...ze,height:ue}:ze):[{toastId:p.id,height:ue,position:p.position},...we])},[T,p.title,p.description,g,p.id]);let ct=$.useCallback(()=>{ce(!0),We(pr.current),g(K=>K.filter(X=>X.toastId!==p.id)),setTimeout(()=>{S(p)},z_)},[p,S,g,pr]);$.useEffect(()=>{if(p.promise&&xt==="loading"||p.duration===1/0||p.type==="loading")return;let K;return w||x||U&&Ye?(()=>{if(Sr.current<Wt.current){let X=new Date().getTime()-Wt.current;At.current=At.current-X}Sr.current=new Date().getTime()})():At.current!==1/0&&(Wt.current=new Date().getTime(),K=setTimeout(()=>{var X;(X=p.onAutoClose)==null||X.call(p,p),ct()},At.current)),()=>clearTimeout(K)},[w,x,p,xt,U,Ye,ct]),$.useEffect(()=>{p.delete&&ct()},[ct,p.delete]);function jt(){var K,X,ue;return P!=null&&P.loading?$.createElement("div",{className:gr(Z?.loader,(K=p?.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":xt==="loading"},P.loading):se?$.createElement("div",{className:gr(Z?.loader,(X=p?.classNames)==null?void 0:X.loader,"sonner-loader"),"data-visible":xt==="loading"},se):$.createElement(__,{className:gr(Z?.loader,(ue=p?.classNames)==null?void 0:ue.loader),visible:xt==="loading"})}return $.createElement("li",{tabIndex:0,ref:qt,className:gr(M,Qt,Z?.toast,(e=p?.classNames)==null?void 0:e.toast,Z?.default,Z?.[xt],(t=p?.classNames)==null?void 0:t[xt]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:N,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":T,"data-promise":!!p.promise,"data-swiped":$e,"data-removed":q,"data-visible":Nr,"data-y-position":Mn,"data-x-position":Ne,"data-index":k,"data-front":Dr,"data-swiping":pe,"data-dismissible":Vt,"data-type":xt,"data-invert":Ze,"data-swipe-out":de,"data-swipe-direction":D,"data-expanded":!!(w||re&&T),style:{"--index":k,"--toasts-before":k,"--z-index":y.length-k,"--offset":`${q?Ae:pr.current}px`,"--initial-height":re?"auto":`${He}px`,...C,...p.style},onDragEnd:()=>{ke(!1),te(null),Er.current=null},onPointerDown:K=>{Ve||!Vt||(Kt.current=new Date,We(pr.current),K.target.setPointerCapture(K.pointerId),K.target.tagName!=="BUTTON"&&(ke(!0),Er.current={x:K.clientX,y:K.clientY}))},onPointerUp:()=>{var K,X,ue,we;if(de||!Vt)return;Er.current=null;let ze=Number(((K=qt.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Pt=Number(((X=qt.current)==null?void 0:X.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Cr=new Date().getTime()-((ue=Kt.current)==null?void 0:ue.getTime()),fr=J==="x"?ze:Pt,rs=Math.abs(fr)/Cr;if(Math.abs(fr)>=V_||rs>.11){We(pr.current),(we=p.onDismiss)==null||we.call(p,p),ee(J==="x"?ze>0?"right":"left":Pt>0?"down":"up"),ct(),_e(!0),st(!1);return}ke(!1),te(null)},onPointerMove:K=>{var X,ue,we,ze;if(!Er.current||!Vt||((X=window.getSelection())==null?void 0:X.toString().length)>0)return;let Pt=K.clientY-Er.current.y,Cr=K.clientX-Er.current.x,fr=(ue=r.swipeDirections)!=null?ue:H_(V);!J&&(Math.abs(Cr)>1||Math.abs(Pt)>1)&&te(Math.abs(Cr)>Math.abs(Pt)?"x":"y");let rs={x:0,y:0};J==="y"?(fr.includes("top")||fr.includes("bottom"))&&(fr.includes("top")&&Pt<0||fr.includes("bottom")&&Pt>0)&&(rs.y=Pt):J==="x"&&(fr.includes("left")||fr.includes("right"))&&(fr.includes("left")&&Cr<0||fr.includes("right")&&Cr>0)&&(rs.x=Cr),(Math.abs(rs.x)>0||Math.abs(rs.y)>0)&&st(!0),(we=qt.current)==null||we.style.setProperty("--swipe-amount-x",`${rs.x}px`),(ze=qt.current)==null||ze.style.setProperty("--swipe-amount-y",`${rs.y}px`)}},Tt&&!p.jsx?$.createElement("button",{"aria-label":E,"data-disabled":Ve,"data-close-button":!0,onClick:Ve||!Vt?()=>{}:()=>{var K;ct(),(K=p.onDismiss)==null||K.call(p,p)},className:gr(Z?.closeButton,(a=p?.classNames)==null?void 0:a.closeButton)},(i=P?.close)!=null?i:S_):null,p.jsx||u.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:$.createElement($.Fragment,null,xt||p.icon||p.promise?$.createElement("div",{"data-icon":"",className:gr(Z?.icon,(o=p?.classNames)==null?void 0:o.icon)}
558,p.promise||p.type==="loading"&&!p.icon?p.icon||jt():null,p.type!=="loading"?p.icon||P?.[xt]||y_(xt):null):null,$.createElement("div",{"data-content":"",className:gr(Z?.content,(l=p?.classNames)==null?void 0:l.content)},$.createElement("div",{"data-title":"",className:gr(Z?.title,(d=p?.classNames)==null?void 0:d.title)},typeof p.title=="function"?p.title():p.title),p.description?$.createElement("div",{"data-description":"",className:gr(L,Ge,Z?.description,(c=p?.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),u.isValidElement(p.cancel)?p.cancel:p.cancel&&Ga(p.cancel)?$.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||O,onClick:K=>{var X,ue;Ga(p.cancel)&&Vt&&((ue=(X=p.cancel).onClick)==null||ue.call(X,K),ct())},className:gr(Z?.cancelButton,(h=p?.classNames)==null?void 0:h.cancelButton)},p.cancel.label):null,u.isValidElement(p.action)?p.action:p.action&&Ga(p.action)?$.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||R,onClick:K=>{var X,ue;Ga(p.action)&&((ue=(X=p.action).onClick)==null||ue.call(X,K),!K.defaultPrevented&&ct())},className:gr(Z?.actionButton,(m=p?.classNames)==null?void 0:m.actionButton)},p.action.label):null))};function Ou(){if(typeof window>"u"||typeof document>"u")return"ltr";let r=document.documentElement.getAttribute("dir");return r==="auto"||!r?window.getComputedStyle(document.documentElement).direction:r}function B_(r,e){let t={};return[r,e].forEach((n,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?L_:D_;function d(c){["top","right","bottom","left"].forEach(h=>{t[`${o}-${h}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?d(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?t[`${o}-${c}`]=l:t[`${o}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):d(l)}),t}var q_=u.forwardRef(function(r,e){let{invert:t,position:n="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:d,mobileOffset:c,theme:h="light",richColors:m,duration:f,style:p,visibleToasts:v=O_,toastOptions:x,dir:g=Ou(),gap:b=F_,loadingIcon:j,icons:k,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:w}=r,[S,N]=$.useState([]),_=$.useMemo(()=>Array.from(new Set([n].concat(S.filter(U=>U.position).map(U=>U.position)))),[S,n]),[C,O]=$.useState([]),[R,M]=$.useState(!1),[L,A]=$.useState(!1),[V,G]=$.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),se=$.useRef(null),re=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),Z=$.useRef(null),P=$.useRef(!1),E=$.useCallback(U=>{N(J=>{var te;return(te=J.find(D=>D.id===U.id))!=null&&te.delete||Gt.dismiss(U.id),J.filter(({id:D})=>D!==U.id)})},[]);return $.useEffect(()=>Gt.subscribe(U=>{if(U.dismiss){N(J=>J.map(te=>te.id===U.id?{...te,delete:!0}:te));return}setTimeout(()=>{hy.flushSync(()=>{N(J=>{let te=J.findIndex(D=>D.id===U.id);return te!==-1?[...J.slice(0,te),{...J[te],...U},...J.slice(te+1)]:[U,...J]})})})}),[]),$.useEffect(()=>{if(h!=="system"){G(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:J})=>{G(J?"dark":"light")})}catch{U.addListener(({matches:te})=>{try{G(te?"dark":"light")}catch(D){console.error(D)}})}},[h]),$.useEffect(()=>{S.length<=1&&M(!1)},[S]),$.useEffect(()=>{let U=J=>{var te,D;a.every(ee=>J[ee]||J.code===ee)&&(M(!0),(te=se.current)==null||te.focus()),J.code==="Escape"&&(document.activeElement===se.current||(D=se.current)!=null&&D.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[a]),$.useEffect(()=>{if(se.current)return()=>{Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null,P.current=!1)}},[se.current]),$.createElement("section",{ref:e,"aria-label":`${y} ${re}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((U,J)=>{var te;let[D,ee]=U.split("-");return S.length?$.createElement("ol",{key:U,dir:g==="auto"?Ou():g,tabIndex:-1,ref:se,className:l,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":D,"data-lifted":R&&S.length>1&&!i,"data-x-position":ee,style:{"--front-toast-height":`${((te=C[0])==null?void 0:te.height)||0}px`,"--width":`${$_}px`,"--gap":`${b}px`,...p,...B_(d,c)},onBlur:T=>{P.current&&!T.currentTarget.contains(T.relatedTarget)&&(P.current=!1,Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null))},onFocus:T=>{T.target instanceof HTMLElement&&T.target.dataset.dismissible==="false"||P.current||(P.current=!0,Z.current=T.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{L||M(!1)},onDragEnd:()=>M(!1),onPointerDown:T=>{T.target instanceof HTMLElement&&T.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},S.filter(T=>!T.position&&J===0||T.position===U).map((T,z)=>{var q,ce;return $.createElement(U_,{key:T.id,icons:k,index:z,toast:T,defaultRichColors:m,duration:(q=x?.duration)!=null?q:f,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:t,visibleToasts:v,closeButton:(ce=x?.closeButton)!=null?ce:o,interacting:L,position:U,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,removeToast:E,toasts:S.filter(pe=>pe.position==T.position),heights:C.filter(pe=>pe.position==T.position),setHeights:O,expandByDefault:i,gap:b,loadingIcon:j,expanded:R,pauseWhenPageIsHidden:w,swipeDirections:r.swipeDirections})})):null}))});const W_=({...r})=>{const{theme:e="system"}=ad();return s.jsx(q_,{theme:e,position:"top-center",richColors:!0,expand:!1,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"}},...r})},xo=my,Ht=py,Ut=fy,$t=u.forwardRef(({className:r,sideOffset:e=4,...t},n)=>s.jsx(xp,{ref:n,sideOffset:e,className:Y("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
558de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...t}));$t.displayName=xp.displayName;const Bl="vidacious_consent",Jf=365*24*60*60,id="1.0",Xf="vidacious_consent_backup";function G_(r){try{const e=JSON.stringify(r);return btoa(e)}catch(e){return console.error("[CookieConsent] Failed to serialize consent:",e),""}}function Du(r){try{const e=atob(r),t=JSON.parse(e);return typeof t.essential!="boolean"||typeof t.functional!="boolean"||typeof t.analytics!="boolean"||typeof t.marketing!="boolean"||typeof t.timestamp!="number"||typeof t.version!="string"?(console.warn("[CookieConsent] Invalid consent structure"),null):(t.essential=!0,t)}catch(e){return console.error("[CookieConsent] Failed to parse consent:",e),null}}function Y_(r){const e=document.cookie.split(";");for(const t of e){const[n,a]=t.trim().split("=");if(n===r)return decodeURIComponent(a)}return null}function Kf(r,e,t){const a=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${r}=${encodeURIComponent(e)}; max-age=${t}; path=/; SameSite=Lax${a}`}function Oa(){const r=Y_(Bl);if(r){const e=Du(r);if(e)return e}try{const e=localStorage.getItem(Xf);if(e){const t=Du(e);if(t)return Kf(Bl,e,Jf),t}}catch(e){console.warn("[CookieConsent] localStorage not available:",e)}return null}function Z_(r){const e=G_(r);if(e){Kf(Bl,e,Jf);try{localStorage.setItem(Xf,e)}catch(t){console.warn("[CookieConsent] Failed to backup to localStorage:",t)}console.log("[CookieConsent] Consent stored:",r)}}function J_(){return Oa()!==null}function Lu(){const r=Oa();return r?r.version===id:!1}function $u(){return{essential:!0,functional:!1,analytics:!1,marketing:!1,timestamp:Date.now(),version:id}}function X_(){return{essential:!0,functional:!0,analytics:!0,marketing:!0,timestamp:Date.now(),version:id}}function Jt(){return Oa()?.analytics===!0}function Qf(){return Oa()?.marketing===!0}function vo(){return typeof window.clarity=="function"}function K_(r,e){if(!Jt()){console.log("[Clarity] User identification blocked - no analytics consent");return}vo()&&(window.clarity("identify",r,e),console.log("[Clarity] User identified:",r))}function eg(r,e){Jt()&&vo()&&window.clarity("set",r,e)}function Q_(r){Jt()&&vo()&&(window.clarity("event",r),console.log("[Clarity] Event tracked:",r))}function Fu(r){vo()&&window.clarity("consent",r)}var H=typeof window<"u"?window:void 0,Ot=typeof globalThis<"u"?globalThis:H;typeof self>"u"&&(Ot.self=Ot),typeof File>"u"&&(Ot.File=function(){});var tg=Array.prototype,Vu=tg.forEach,zu=tg.indexOf,sr=Ot?.navigator,he=Ot?.document,Rt=Ot?.location,ql=Ot?.fetch,Wl=Ot!=null&&Ot.XMLHttpRequest&&"withCredentials"in new Ot.XMLHttpRequest?Ot.XMLHttpRequest:void 0,Hu=Ot?.AbortController,Yt=sr?.userAgent,je=H??{},Br={DEBUG:!1,LIB_VERSION:"1.339.1"};function Uu(r,e,t,n,a,i,o){try{var l=r[i](o),d=l.value}catch(c){return void t(c)}l.done?e(d):Promise.resolve(d).then(n,a)}function en(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function o(d){Uu(i,n,a,o,l,"next",d)}function l(d){Uu(i,n,a,o,l,"throw",d)}o(void 0)})}}function ge(){return ge=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},ge.apply(null,arguments)}function rg(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}var ew=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Bu=function(r,e){if(e===void 0&&(e=[]),!r)return!1;var t=r.toLowerCase();return ew.concat(e).some(n=>{var a=n.toLowerCase();return t.indexOf(a)!==-1})},tw=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function De(r,e){return r.indexOf(e)!==-1}var yo=function(r){return r.trim()},Gl=function(r){return r.replace(/^\$/,"")},rw=Array.isArray,sg=Object.prototype,ng=sg.hasOwnProperty,bo=sg.toString,Je=rw||function(r){return bo.call(r)==="[object Array]"},fs=r=>typeof r=="function",St=r=>r===Object(r)&&!Je(r),tn=r=>
vendor: 9,285 bytes, lines 558-559
558{if(St(r)){for(var e in r)if(ng.call(r,e))return!1;return!0}return!1},me=r=>r===void 0,Et=r=>bo.call(r)=="[object String]",Yl=r=>Et(r)&&r.trim().length===0,jr=r=>r===null,Le=r=>me(r)||jr(r),Kr=r=>bo.call(r)=="[object Number]"&&r==r,Xs=r=>Kr(r)&&r>0,Xr=r=>bo.call(r)==="[object Boolean]",sw=r=>r instanceof FormData,nw=r=>De(tw,r);function Zl(r){return r===null||typeof r!="object"}function Ei(r,e){return Object.prototype.toString.call(r)==="[object "+e+"]"}function ag(r){return!me(Event)&&function(e,t){try{return e instanceof t}catch{return!1}}(r,Event)}var aw=[!0,"true",1,"1","yes"],Zo=r=>De(aw,r),iw=[!1,"false",0,"0","no"];function Ar(r,e,t,n,a){return e>t&&(n.warn("min cannot be greater than max."),e=t),Kr(r)?r>t?(n.warn(" cannot be greater than max: "+t+". Using max value instead."),t):r<e?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):r:(n.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+a),Ar(a||t,e,t,n))}class ow{constructor(e){this.t={},this.i=e.i,this.o=Ar(e.bucketSize,0,100,e.h),this.m=Ar(e.refillRate,0,this.o,e.h),this.$=Ar(e.refillInterval,0,864e5,e.h)}S(e,t){var n=t-e.lastAccess,a=Math.floor(n/this.$);if(a>0){var i=a*this.m;e.tokens=Math.min(e.tokens+i,this.o),e.lastAccess=e.lastAccess+a*this.$}}consumeRateLimit(e){var t,n=Date.now(),a=String(e),i=this.t[a];return i?this.S(i,n):(i={tokens:this.o,lastAccess:n},this.t[a]=i),i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.i)==null||t.call(this,e)),i.tokens===0)}stop(){this.t={}}}var cr="Mobile",Ci="iOS",Zr="Android",ba="Tablet",ig=Zr+" "+ba,og="iPad",lg="Apple",cg=lg+" Watch",_a="Safari",pn="BlackBerry",dg="Samsung",ug=dg+"Browser",hg=dg+" Internet",Vs="Chrome",lw=Vs+" OS",mg=Vs+" "+Ci,od="Internet Explorer",pg=od+" "+cr,ld="Opera",cw=ld+" Mini",cd="Edge",fg="Microsoft "+cd,cn="Firefox",gg=cn+" "+Ci,wa="Nintendo",ja="PlayStation",dn="Xbox",xg=Zr+" "+cr,vg=cr+" "+_a,Kn="Windows",Jl=Kn+" Phone",qu="Nokia",Xl="Ouya",yg="Generic",dw=yg+" "+cr.toLowerCase(),bg=yg+" "+ba.toLowerCase(),Kl="Konqueror",zt="(\\d+(\\.\\d+)?)",Jo=new RegExp("Version/"+zt),uw=new RegExp(dn,"i"),hw=new RegExp(ja+" \\w+","i"),mw=new RegExp(wa+" \\w+","i"),dd=new RegExp(pn+"|PlayBook|BB10","i"),pw={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Ya,Wu,Xo,fw=(r,e)=>e&&De(e,lg)||function(t){return De(t,_a)&&!De(t,Vs)&&!De(t,Zr)}(r),_g=function(r,e){return e=e||"",De(r," OPR/")&&De(r,"Mini")?cw:De(r," OPR/")?ld:dd.test(r)?pn:De(r,"IE"+cr)||De(r,"WPDesktop")?pg:De(r,ug)?hg:De(r,cd)||De(r,"Edg/")?fg:De(r,"FBIOS")?"Facebook "+cr:De(r,"UCWEB")||De(r,"UCBrowser")?"UC Browser":De(r,"CriOS")?mg:De(r,"CrMo")||De(r,Vs)?Vs:De(r,Zr)&&De(r,_a)?xg:De(r,"FxiOS")?gg:De(r.toLowerCase(),Kl.toLowerCase())?Kl:fw(r,e)?De(r,cr)?vg:_a:De(r,cn)?cn:De(r,"MSIE")||De(r,"Trident/")?od:De(r,"Gecko")?cn:""},gw={[pg]:[new RegExp("rv:"+zt)],[fg]:[new RegExp(cd+"?\\/"+zt)],[Vs]:[new RegExp("("+Vs+"|CrMo)\\/"+zt)],[mg]:[new RegExp("CriOS\\/"+zt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+zt)],[_a]:[Jo],[vg]:[Jo],[ld]:[new RegExp("(Opera|OPR)\\/"+zt)],[cn]:[new RegExp(cn+"\\/"+zt)],[gg]:[new RegExp("FxiOS\\/"+zt)],[Kl]:[new RegExp("Konqueror[:/]?"+zt,"i")],[pn]:[new RegExp(pn+" "+zt),Jo],[xg]:[new RegExp("android\\s"+zt,"i")],[hg]:[new RegExp(ug+"\\/"+zt)],[od]:[new RegExp("(rv:|MSIE )"+zt)],Mozilla:[new RegExp("rv:"+zt)]},xw=function(r,e){var t=_g(r,e),n=gw[t];if(me(n))return null;for(var a=0;a<n.length;a++){var i=n[a],o=r.match(i);if(o)return parseFloat(o[o.length-2])}return null},Gu=[[new RegExp(dn+"; "+dn+" (.*?)[);]","i"),r=>[dn,r&&r[1]||""]],[new RegExp(wa,"i"),[wa,""]],[new RegExp(ja,"i"),[ja,""]],[dd,[pn,""]],[new RegExp(Kn,"i"),(r,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Jl,""];if(new RegExp(cr).test(e)&&!/IEMobile\b/.test(e))return[Kn+" "+cr,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var n=t[1],a=pw[n]||"";return/arm/i.test(e)&&(a="RT"),[Kn,a]}return[Kn,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,r=>{if(r&&r[3]){var e=[r[3],r[4],r[5]||"0"];return[Ci,e.join(".")]}return[Ci,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,r=>{var e="";return r&&r.length>=3&&(e=me(r[2])?r[3]:r[2]),["watchOS",e]}],[new RegExp("("+Zr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Zr+")","i"),r=>{if(r&&r[2]){var e=[r[2],r[3],r[4]||"0"];return[Zr,e.join(".")]}return[Zr,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,r=>{var e=["Mac OS X",""];if(r&&r[1]){var t=[r[1],r[2],r[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[lw,""]],[/Linux|debian/i,["Linux",""]]],Yu=function(r){return mw.test(r)?wa:hw.test(r)?ja:uw.test(r)?dn:new RegExp(Xl,"i").test(r)?Xl:new RegExp("("+Jl+"|WPDesktop)","i").test(r)?Jl:/iPad/.test(r)?og:/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r)?cg:dd.test(r)?pn:/(kobo)\s(ereader|touch)/i.test(r)?"Kobo":new RegExp(qu,"i").test(r)?qu:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r)||/(kf[a-z]+)( bui|\)).+silk\//i.test(r)?"Kindle Fire":/(Android|ZTE)/i.test(r)?new RegExp(cr).test(r)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r)||/pixel[\daxl ]{1,6}/i.test(r)&&!/pixel c/i.test(r)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r)||/lmy47v/i.test(r)&&!/QTAQZ3/i.test(r)?Zr:ig:new RegExp("(pda|"+cr+")","i").test(r)?dw:new RegExp(ba,"i").test(r)&&!new RegExp(ba+" pc","i").test(r)?bg:""},vw=r=>r instanceof Error;function yw(r){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return Xo&&t.length===Wu||(Wu=t.length,Xo=t.reduce((n,a)=>{Ya||(Ya={});var i=Ya[a];if(i)n[i[0]]=i[1];else for(var o=r(a),l=o.length-1;l>=0;l--){var d=o[l],c=d?.filename,h=e[a];if(c&&h){n[c]=h,Ya[a]=[c,h];break}}return n},{})),Xo}}class bw{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:"generic"},a=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(),o=this.parseStacktrace(a,i);return{$exception_list:this.convertToExceptionList(o,n),$exception_level:"error"}}modifyFrames(e){var t=this;return en(function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&Je(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)==null?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var n,a;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(a=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),ge({},e,{cause:n,stack:a})}applyChunkIds(e,t){return e.map(n=>(n.filename&&t&&(n.chunk_id=t[n.filename]),n))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return en(function*(){var n=e;for(var a of t.modifiers)n=yield a(n);return n})()}convertToExceptionList(e,t){var n,a,i,o={type:e.type,value:e.value,mechanism:{type:(n=t.type)!==null&&n!==void 0?n:"generic",handled:(a=t.handled)===null||a===void 0||a,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var l=[o];return e.cause!=null&&l.push(...this.convertToExceptionList(e.cause,ge({},t,{handled:!0}))),l}buildParsingContext(){return{chunkIdMap:yw(this.stackParser)}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var a=(i,o)=>{if(o<=4){var l=this.buildCoercingContext(e,t,o);return this.applyCoercers(i,l)}};return ge({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:i=>a(i,n),next:i=>a(i,n+1)})}}var fn="?";function Ql(r,e,t,n,a){var i={platform:r,filename:e,function:t==="<anonymous>"?fn:t,in_app:!0};return me(n)||(i.lineno=n),me(a)||(i.colno=a),i}var wg=(r,e)=>{var t=r.indexOf("safari-extension")!==-1,n=r.indexOf("safari-web-extension")!==-1;return t||n?[r.indexOf("@")!==-1?r.split("@")[0]:fn,t?"safari-extension:"+e:"safari-web-extension:"+e]:[r,e]},_w=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ww=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,jw=/\((\S*)(?::(\d+))(?::(\d+))\)/,kw=(r,e)=>{var t=_w.exec(r);if(t){var[,n,a,i]=t;return Ql(e,n,fn,+a,+i)}var o=ww.exec(r);if(o){if(o[2]&&o[2].indexOf("eval")===0){var l=jw.exec(o[2]);l&&(o[2]=l[1],o[3]=l[2],o[4]=l[3])}var[d,c]=wg(o[1]||fn,o[2]);return Ql(e,c,d,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Nw=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Sw=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ew=(r,e)=>{var t=Nw.exec(r);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=Sw.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var a=t[3],i=t[1]||fn;return[i,a]=wg(i,a),Ql(e,a,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Zu=/\(error: (.*)\)/,Ju=50;function Cw(){return function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return function(a,i){i===void 0&&(i=0);for(var o=[],l=a.split(` 559`),d=i;d<l.length;d++){var c=l[d];if(!(c.length>1024)){var h=Zu.test(c)?c.replace(Zu,"$1"):c;
559if(!h.match(/\S*Error: /)){for(var m of t){var f=m(h,r);if(f){o.push(f);break}}if(o.length>=Ju)break}}}return function(p){if(!p.length)return[];var v=Array.from(p);return v.reverse(),v.slice(0,Ju).map(x=>{return ge({},x,{filename:x.filename||(g=v,g[g.length-1]||{}).filename,function:x.function||fn});var g})}(o)}}("web:javascript",kw,Ew)}class Tw{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=Et(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return Ei(e,"DOMException")}isDOMError(e){return Ei(e,"DOMError")}}class Pw{match(e){return(t=>t instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var n=e.message;return n.error&&typeof n.error.message=="string"?String(n.error.message):String(n)}getStack(e){return e.stacktrace||e.stack||void 0}}class Aw{constructor(){}match(e){return Ei(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var n,a=t.apply(e.error);return a||{type:"ErrorEvent",value:e.message,stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}}var Iw=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Rw{match(e){return typeof e=="string"}coerce(e,t){var n,[a,i]=this.getInfos(e);return{type:a??"Error",value:i??e,stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}getInfos(e){var t="Error",n=e,a=e.match(Iw);return a&&(t=a[1],n=a[2]),[t,n]}}var Mw=["fatal","error","warning","log","info","debug"];function jg(r,e){e===void 0&&(e=40);var t=Object.keys(r);if(t.sort(),!t.length)return"[object has no keys]";for(var n=t.length;n>0;n--){var a=t.slice(0,n).join(", ");if(!(a.length>e))return n===t.length||a.length<=e?a:a.slice(0,e)+"..."}return""}class Ow{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var n,a=this.getErrorPropertyFromObject(e);return a?t.apply(a):{type:this.getType(e),value:this.getValue(e),stack:(n=t.syntheticException)==null?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return ag(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var t="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&typeof e.message=="string")return e.message;var n=this.getObjectClassName(e);return(n&&n!=="Object"?"'"+n+"'":"Object")+" captured as exception with keys: "+jg(e)}isSeverityLevel(e){return Et(e)&&!Yl(e)&&Mw.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];if(vw(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class Dw{match(e){return ag(e)}coerce(e,t){var n,a=e.constructor.name;return{type:a,value:a+" captured as exception with keys: "+jg(e),stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}}class Lw{match(e){return Zl(e)}coerce(e,t){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}}class $w{match(e){return Ei(e,"PromiseRejectionEvent")}coerce(e,t){var n,a=this.getUnhandledRejectionReason(e);return Zl(a)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(a),stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}:t.apply(a)}getUnhandledRejectionReason(e){if(Zl(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var kg=function(r,e){var{debugEnabled:t}=e===void 0?{}:e,n={k:function(a){if(H&&(Br.DEBUG||je.POSTHOG_DEBUG||t)&&!me(H.console)&&H.console){for(var i=("__rrweb_original__"in H.console[a])?H.console[a].__rrweb_original__:H.console[a],o=arguments.length,l=new Array(o>1?o-1:0),d=1;d<o;d++)l[d-1]=arguments[d];i(r,...l)}},info:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];n.k("log",...i)},warn:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];n.k("warn",...i)},error:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];n.k("error",...i)},critical:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];console.error(r,...i)},uninitializedWarning:a=>{n.error("You must initialize PostHog before calling "+a)},createLogger:(a,i)=>kg(r+" "+a,i)};return n},fe=kg("[PostHog.js]"),gt=fe.createLogger,Fw=gt("[ExternalScriptsLoader]"),Xu=(r,e,t)=>{if(r.config.disable_external_dependency_loading)return Fw.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var n=he?.querySelectorAll("script");
vendor: 44,967 bytes, line 559
559if(n){for(var a,i=function(){if(n[o].src===e){var d=n[o];return d.__posthog_loading_callback_fired?{v:t()}:(d.addEventListener("load",c=>{d.__posthog_loading_callback_fired=!0,t(void 0,c)}),d.onerror=c=>t(c),{v:void 0})}},o=0;o<n.length;o++)if(a=i())return a.v}var l=()=>{if(!he)return t("document not found");var d=he.createElement("script");if(d.type="text/javascript",d.crossOrigin="anonymous",d.src=e,d.onload=m=>{d.__posthog_loading_callback_fired=!0,t(void 0,m)},d.onerror=m=>t(m),r.config.prepare_external_dependency_script&&(d=r.config.prepare_external_dependency_script(d)),!d)return t("prepare_external_dependency_script returned null");if(r.config.external_scripts_inject_target==="head")he.head.appendChild(d);else{var c,h=he.querySelectorAll("body > script");h.length>0?(c=h[0].parentNode)==null||c.insertBefore(d,h[0]):he.body.appendChild(d)}};he!=null&&he.body?l():he?.addEventListener("DOMContentLoaded",l)};je.__PosthogExtensions__=je.__PosthogExtensions__||{},je.__PosthogExtensions__.loadExternalDependency=(r,e,t)=>{var n="/static/"+e+".js?v="+r.version;if(e==="remote-config"&&(n="/array/"+r.config.token+"/config.js"),e==="toolbar"){var a=3e5;n=n+"&t="+Math.floor(Date.now()/a)*a}var i=r.requestRouter.endpointFor("assets",n);Xu(r,i,t)},je.__PosthogExtensions__.loadSiteApp=(r,e,t)=>{var n=r.requestRouter.endpointFor("api",e);Xu(r,n,t)};var Ti={};function gs(r,e,t){if(Je(r)){if(Vu&&r.forEach===Vu)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var n=0,a=r.length;n<a;n++)if(n in r&&e.call(t,r[n],n)===Ti)return}}}function nt(r,e,t){if(!Le(r)){if(Je(r))return gs(r,e,t);if(sw(r)){for(var n of r.entries())if(e.call(t,n[1],n[0])===Ti)return}else for(var a in r)if(ng.call(r,a)&&e.call(t,r[a],a)===Ti)return}}var vt=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return gs(t,function(a){for(var i in a)a[i]!==void 0&&(r[i]=a[i])}),r},In=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return gs(t,function(a){gs(a,function(i){r.push(i)})}),r};function pi(r){for(var e=Object.keys(r),t=e.length,n=new Array(t);t--;)n[t]=[e[t],r[e[t]]];return n}var Ku=function(r){try{return r()}catch{return}},Vw=function(r){return function(){try{for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.apply(this,t)}catch(a){fe.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),fe.critical(a)}}},ud=function(r){var e={};return nt(r,function(t,n){(Et(t)&&t.length>0||Kr(t))&&(e[n]=t)}),e};function zw(r,e){return t=r,n=i=>Et(i)&&!jr(e)?i.slice(0,e):i,a=new Set,function i(o,l){return o!==Object(o)?n?n(o,l):o:a.has(o)?void 0:(a.add(o),Je(o)?(d=[],gs(o,c=>{d.push(i(c))})):(d={},nt(o,(c,h)=>{a.has(c)||(d[h]=i(c,h))})),d);var d}(t);var t,n,a}var Hw=["herokuapp.com","vercel.app","netlify.app"];function Uw(r){var e=r?.hostname;if(!Et(e))return!1;var t=e.split(".").slice(-2).join(".");for(var n of Hw)if(t===n)return!1;return!0}function Ng(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return r[t]}function wt(r,e,t,n){var{capture:a=!1,passive:i=!0}=n??{};r?.addEventListener(e,t,{capture:a,passive:i})}var Sg="$people_distinct_id",Qn="__alias",ea="__timers",Qu="$autocapture_disabled_server_side",ec="$heatmaps_enabled_server_side",eh="$exception_capture_enabled_server_side",tc="$error_tracking_suppression_rules",th="$error_tracking_capture_extension_exceptions",rh="$web_vitals_enabled_server_side",Eg="$dead_clicks_enabled_server_side",sh="$product_tours_enabled_server_side",nh="$web_vitals_allowed_metrics",Ko="$session_recording_remote_config",Pi="$sesid",Cg="$session_is_sampled",rn="$enabled_feature_flags",ta="$early_access_features",rc="$feature_flag_details",ra="$stored_person_properties",Rs="$stored_group_properties",sc="$surveys",Ai="$flag_call_reported",qr="$user_state",nc="$client_session_props",ac="$capture_rate_limit",ic="$initial_campaign_params",oc="$initial_referrer_info",Ii="$initial_person_info",Ri="$epp",Tg="__POSTHOG_TOOLBAR__",Fn="$posthog_cookieless",Bw=[Sg,Qn,"__cmpns",ea,"$session_recording_enabled_server_side",ec,Pi,rn,tc,qr,ta,rc,Rs,ra,sc,Ai,nc,ac,ic,oc,Ri,Ii,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function ah(r){return r instanceof Element&&(r.id===Tg||!(r.closest==null||!r.closest(".toolbar-global-fade-container")))}function _o(r){return!!r&&r.nodeType===1}function xs(r,e){return!!r&&!!r.tagName&&r.tagName.toLowerCase()===e.toLowerCase()}function Pg(r){return!!r&&r.nodeType===3}function Ag(r){return!!r&&r.nodeType===11}function hd(r){return r?yo(r).split(/\s+/):[]}function ih(r){var e=H?.location.href;return!!(e&&r&&r.some(t=>e.match(t)))}function Mi(r){var e="";switch(typeof r.className){case"string":e=r.className;break;case"object":e=(r.className&&"baseVal"in r.className?r.className.baseVal:null)||r.getAttribute("class")||"";break;default:e=""}return hd(e)}function Ig(r){return Le(r)?null:yo(r).split(/(\s+)/).filter(e=>ka(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Da(r){var e="";return lc(r)&&!Lg(r)&&r.childNodes&&r.childNodes.length&&nt(r.childNodes,function(t){var n;Pg(t)&&t.textContent&&(e+=(n=Ig(t.textContent))!==null&&n!==void 0?n:"")}),yo(e)}function Rg(r){return me(r.target)?r.srcElement||null:(e=r.target)!=null&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;var e}var md=["a","button","form","input","select","textarea","label"];function Mg(r,e){if(me(e))return!0;var t,n=function(i){if(e.some(o=>i.matches(o)))return{v:!0}};for(var a of r)if(t=n(a))return t.v;return!1}function Og(r){var e=r.parentNode;return!(!e||!_o(e))&&e}var qw=["next","previous","prev",">","<"],oh=10,lh=[".ph-no-rageclick",".ph-no-capture"];function Ww(r,e){if(!H||pd(r))return!1;var t,n,a;if(Xr(e)?(t=!!e&&lh,n=void 0):(t=(a=e?.css_selector_ignorelist)!==null&&a!==void 0?a:lh,n=e?.content_ignorelist),t===!1)return!1;var{targetElementList:i}=Dg(r,!1);return!function(o,l){if(o===!1||me(o))return!1;var d;if(o===!0)d=qw;else{if(!Je(o))return!1;if(o.length>oh)return fe.error("[PostHog] content_ignorelist array cannot exceed "+oh+" items. Use css_selector_ignorelist for more complex matching."),!1;d=o.map(c=>c.toLowerCase())}return l.some(c=>{var{safeText:h,ariaLabel:m}=c;return d.some(f=>h.includes(f)||m.includes(f))})}(n,i.map(o=>{var l;return{safeText:Da(o).toLowerCase(),ariaLabel:((l=o.getAttribute("aria-label"))==null?void 0:l.toLowerCase().trim())||""}}))&&!Mg(i,t)}var pd=r=>!r||xs(r,"html")||!_o(r),Dg=(r,e)=>{if(!H||pd(r))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,n=[r],a=r;a.parentNode&&!xs(a,"body");)if(Ag(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var i=Og(a);if(!i)break;if(e||md.indexOf(i.tagName.toLowerCase())>-1)t=!0;else{var o=H.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(t=!0)}n.push(i),a=i}return{parentIsUsefulElement:t,targetElementList:n}};function Gw(r,e,t,n,a){var i,o,l,d;if(t===void 0&&(t=void 0),!H||pd(r)||(i=t)!=null&&i.url_allowlist&&!ih(t.url_allowlist)||(o=t)!=null&&o.url_ignorelist&&ih(t.url_ignorelist))return!1;if((l=t)!=null&&l.dom_event_allowlist){var c=t.dom_event_allowlist;if(c&&!c.some(v=>e.type===v))return!1}var{parentIsUsefulElement:h,targetElementList:m}=Dg(r,n);if(!function(v,x){var g=x?.element_allowlist;if(me(g))return!0;var b,j=function(y){if(g.some(w=>y.tagName.toLowerCase()===w))return{v:!0}};for(var k of v)if(b=j(k))return b.v;return!1}(m,t)||!Mg(m,(d=t)==null?void 0:d.css_selector_allowlist))return!1;var f=H.getComputedStyle(r);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=r.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(a||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(a||["change","click"]).indexOf(e.type)>=0;default:return h?(a||["click"]).indexOf(e.type)>=0:(a||["click"]).indexOf(e.type)>=0&&(md.indexOf(p)>-1||r.getAttribute("contenteditable")==="true")}}function lc(r){for(var e=r;e.parentNode&&!xs(e,"body");e=e.parentNode){var t=Mi(e);if(De(t,"ph-sensitive")||De(t,"ph-no-capture"))return!1}if(De(Mi(r),"ph-include"))return!0;var n=r.type||"";if(Et(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var a=r.name||r.id||"";return!(Et(a)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,"")))}function Lg(r){return!!(xs(r,"input")&&!["button","checkbox","submit","reset"].includes(r.type)||xs(r,"select")||xs(r,"textarea")||r.getAttribute("contenteditable")==="true")}var $g="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Yw=new RegExp("^(?:"+$g+")$"),Zw=new RegExp($g),Fg="\\d{3}-?\\d{2}-?\\d{4}",Jw=new RegExp("^("+Fg+")$"),Xw=new RegExp("("+Fg+")");function ka(r,e){return e===void 0&&(e=!0),!(Le(r)||Et(r)&&(r=yo(r),(e?Yw:Zw).test((r||"").replace(/[- ]/g,""))||(e?Jw:Xw).test(r)))}function Vg(r){var e=Da(r);return ka(e=(e+" "+zg(r)).trim())?e:""}function zg(r){var e="";return r&&r.childNodes&&r.childNodes.length&&nt(r.childNodes,function(t){var n;if(t&&((n=t.tagName)==null?void 0:n.toLowerCase())==="span")try{var a=Da(t);e=(e+" "+a).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+zg(t)).trim())}catch(i){fe.error("[AutoCapture]",i)}}),e}function Kw(r){return function(e){var t=e.map(n=>{var a,i,o="";if(n.tag_name&&(o+=n.tag_name),n.attr_class)for(var l of(n.attr_class.sort(),n.attr_class))o+="."+l.replace(/"/g,"");var d=ge({},n.text?{text:n.text}:{},{"nth-child":(a=n.nth_child)!==null&&a!==void 0?a:0,"nth-of-type":(i=n.nth_of_type)!==null&&i!==void 0?i:0},n.href?{href:n.href}:{},n.attr_id?{attr_id:n.attr_id}:{},n.attributes),c={};return pi(d).sort((h,m)=>{var[f]=h,[p]=m;return f.localeCompare(p)}).forEach(h=>{var[m,f]=h;return c[ch(m.toString())]=ch(f.toString())}),o+=":",o+=pi(c).map(h=>{var[m,f]=h;return m+'="'+f+'"'}).join("")});return t.join(";")}(function(e){return e.map(t=>{var n,a,i={text:(n=t.$el_text)==null?void 0:n.slice(0,400),tag_name:t.tag_name,href:(a=t.attr__href)==null?void 0:a.slice(0,2048),attr_class:Qw(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return pi(t).filter(o=>{var[l]=o;return l.indexOf("attr__")===0}).forEach(o=>{var[l,d]=o;return i.attributes[l]=d}),i})}(r))}function ch(r){return r.replace(/"|\\"/g,'\\"')}function Qw(r){var e=r.attr__class;return e?Je(e)?e:hd(e):void 0}class Hg{constructor(e){this.disabled=e===!1;var t=St(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;var a=this.clicks[this.clicks.length-1];if(a&&Math.abs(e-a.x)+Math.abs(t-a.y)<this.thresholdPx&&n-a.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}var Oi=r=>{var e=he?.createElement("a");return me(e)?null:(e.href=r,e)},e2=function(r,e){var t,n;e===void 0&&(e="&");var a=[];return nt(r,function(i,o){me(i)||me(o)||o==="undefined"||(t=encodeURIComponent((l=>l instanceof File)(i)?i.name:i.toString()),n=encodeURIComponent(o),a[a.length]=n+"="+t)}),a.join(e)},Di=function(r,e){for(var t,n=((r.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),a=0;a<n.length;a++){var i=n[a].split("=");if(i[0]===e){t=i;break}}if(!Je(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{fe.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},La=function(r,e,t){if(!r||!e||!e.length)return r;for(var n=r.split("#"),a=n[0]||"",i=n[1],o=a.split("?"),l=o[1],d=o[0],c=(l||"").split("&"),h=[],m=0;m<c.length;m++){var f=c[m].split("=");Je(f)&&(e.includes(f[0])?h.push(f[0]+"="+t):h.push(c[m]))}var p=d;return l!=null&&(p+="?"+h.join("&")),i!=null&&(p+="#"+i),p},Li=function(r,e){var t=r.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Qo="$copy_autocapture",dh=gt("[AutoCapture]");function el(r,e){return e.length>r?e.slice(0,r)+"...":e}function t2(r){if(r.previousElementSibling)return r.previousElementSibling;var e=r;do e=e.previousSibling;while(e&&!_o(e));return e}function r2(r,e,t,n){var a=r.tagName.toLowerCase(),i={tag_name:a};md.indexOf(a)>-1&&!t&&(a.toLowerCase()==="a"||a.toLowerCase()==="button"?i.$el_text=el(1024,Vg(r)):i.$el_text=el(1024,Da(r)));var o=Mi(r);o.length>0&&(i.classes=o.filter(function(h){return h!==""})),nt(r.attributes,function(h){var m;if((!Lg(r)||["name","id","class","aria-label"].indexOf(h.name)!==-1)&&(n==null||!n.includes(h.name))&&!e&&ka(h.value)&&(m=h.name,!Et(m)||m.substring(0,10)!=="_ngcontent"&&m.substring(0,7)!=="_nghost")){var f=h.value;h.name==="class"&&(f=hd(f).join(" ")),i["attr__"+h.name]=el(1024,f)}});for(var l=1,d=1,c=r;c=t2(c);)l++,c.tagName===r.tagName&&d++;return i.nth_child=l,i.nth_of_type=d,i}function s2(r,e){for(var t,n,{e:a,maskAllElementAttributes:i,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:d}=e,c=[r],h=r;h.parentNode&&!xs(h,"body");)Ag(h.parentNode)?(c.push(h.parentNode.host),h=h.parentNode.host):(c.push(h.parentNode),h=h.parentNode);var m,f=[],p={},v=!1,x=!1;if(nt(c,y=>{var w=lc(y);y.tagName.toLowerCase()==="a"&&(v=y.getAttribute("href"),v=w&&v&&ka(v)&&v),De(Mi(y),"ph-no-capture")&&(x=!0),f.push(r2(y,i,o,l));var S=function(N){if(!lc(N))return{};var _={};return nt(N.attributes,function(C){if(C.name&&C.name.indexOf("data-ph-capture-attribute")===0){var O=C.name.replace("data-ph-capture-attribute-",""),R=C.value;O&&R&&ka(R)&&(_[O]=R)}}),_}(y);vt(p,S)}),x)return{props:{},explicitNoCapture:x};if(o||(r.tagName.toLowerCase()==="a"||r.tagName.toLowerCase()==="button"?f[0].$el_text=Vg(r):f[0].$el_text=Da(r)),v){var g,b;f[0].attr__href=v;var j=(g=Oi(v))==null?void 0:g.host,k=H==null||(b=H.location)==null?void 0:b.host;j&&k&&j!==k&&(m=v)}return{props:vt({$event_type:a.type,$ce_version:1},d?{}:{$elements:f},{$elements_chain:Kw(f)},(t=f[0])!=null&&t.$el_text?{$el_text:(n=f[0])==null?void 0:n.$el_text}:{},m&&a.type==="click"?{$external_click_url:m}:{},p)}}class n2{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new Hg(e.config.rageclick),this.C=null}get R(){var e,t,n=St(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map(a=>new RegExp(a)),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map(a=>new RegExp(a)),n}F(){if(this.isBrowserSupported()){if(H&&he){var e=n=>{n=n||H?.event;try{this.O(n)}catch(a){dh.error("Failed to capture event",a)}};if(wt(he,"submit",e,{capture:!0}),wt(he,"change",e,{capture:!0}),wt(he,"click",e,{capture:!0}),this.R.capture_copied_text){var t=n=>{n=n||H?.event,this.O(n,Qo)};wt(he,"copy",t,{capture:!0}),wt(he,"cut",t,{capture:!0})}}}else dh.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Qu]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var t,n=[];return(t=this.C)==null||t.forEach(a=>{var i=he?.querySelectorAll(a);i?.forEach(o=>{e===o&&n.push(a)})}),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[Qu],a=this.T;if(jr(a)&&!Xr(n)&&!this.instance.M())return!1;var i=(t=this.T)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!i}O(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,a=Rg(e);Pg(a)&&(a=a.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&Ww(a,this.instance.config.rageclick)&&this.O(e,"$rageclick");var i=t===Qo;if(a&&Gw(a,e,this.R,i,i?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=s2(a,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(l)return!1;var d=this.getElementSelectors(a);if(d&&d.length>0&&(o.$element_selectors=d),t===Qo){var c,h=Ig(H==null||(c=H.getSelection())==null?void 0:c.toString()),m=e.type||"clipboard";if(!h)return!1;o.$selected_content=h,o.$copy_type=m}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return fs(he?.querySelectorAll)}}Math.trunc||(Math.trunc=function(r){return r<0?Math.ceil(r):Math.floor(r)}),Number.isInteger||(Number.isInteger=function(r){return Kr(r)&&isFinite(r)&&Math.floor(r)===r});var uh="0123456789abcdef";class $i{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,a){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(a)||e<0||t<0||n<0||a<0||e>0xffffffffffff||t>4095||n>1073741823||a>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=a>>>24,i[13]=a>>>16,i[14]=a>>>8,i[15]=a,new $i(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+uh.charAt(this.bytes[t]>>>4)+uh.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new $i(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}}class a2{constructor(){this.A=0,this.j=0,this.D=new i2}generate(){var e=this.generateOrAbort();if(me(e)){this.A=0;var t=this.generateOrAbort();if(me(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.j++,this.j>4398046511103&&(this.A++,this.L())}return $i.fromFieldsV7(this.A,Math.trunc(this.j/Math.pow(2,30)),this.j&Math.pow(2,30)-1,this.D.nextUint32())}L(){this.j=1024*this.D.nextUint32()+(1023&this.D.nextUint32())}}var hh,Ug=r=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<r.length;e++)r[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return r};H&&!me(H.crypto)&&crypto.getRandomValues&&(Ug=r=>crypto.getRandomValues(r));class i2{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(Ug(this.N),this.U=0),this.N[this.U++]}}var ms=()=>o2().toString(),o2=()=>(hh||(hh=new a2)).generate(),Vn="",l2=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function c2(r,e){if(e){var t=function(a,i){if(i===void 0&&(i=he),Vn)return Vn;if(!i||["localhost","127.0.0.1"].includes(a))return"";for(var o=a.split("."),l=Math.min(o.length,8),d="dmn_chk_"+ms();!Vn&&l--;){var c=o.slice(l).join("."),h=d+"=1;domain=."+c+";path=/";i.cookie=h+";max-age=3",i.cookie.includes(d)&&(i.cookie=h+";max-age=0",Vn=c)}return Vn}(r);if(!t){var n=(a=>{var i=a.match(l2);return i?i[0]:""})(r);n!==t&&fe.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}var Pr={H:()=>!!he,B:function(r){fe.error("cookieStore error: "+r)},q:function(r){if(he){try{for(var e=r+"=",t=he.cookie.split(";").filter(i=>i.length),n=0;n<t.length;n++){for(var a=t[n];a.charAt(0)==" ";)a=a.substring(1,a.length);if(a.indexOf(e)===0)return decodeURIComponent(a.substring(e.length,a.length))}}catch{}return null}},W:function(r){var e;try{e=JSON.parse(Pr.q(r))||{}}catch{}return e},G:function(r,e,t,n,a){if(he)try{var i="",o="",l=c2(he.location.hostname,n);if(t){var d=new Date;d.setTime(d.getTime()+24*t*60*60*1e3),i="; expires="+d.toUTCString()}a&&(o="; secure");var c=r+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&fe.warn("cookieStore warning: large cookie, len="+c.length),he.cookie=c,c}catch{return}},V:function(r,e){if(he!=null&&he.cookie)try{Pr.G(r,"",-1,e)}catch{return}}},tl=null,ut={H:function(){if(!jr(tl))return tl;var r=!0;if(me(H))r=!1;else try{var e="__mplssupport__";ut.G(e,"xyz"),ut.q(e)!=='"xyz"'&&(r=!1),ut.V(e)}catch{r=!1}return r||fe.error("localStorage unsupported; falling back to cookie store"),tl=r,r},B:function(r){fe.error("localStorage error: "+r)},q:function(r){try{return H?.localStorage.getItem(r)}catch(e){ut.B(e)}return null},W:function(r){try{return JSON.parse(ut.q(r))||{}}catch{}return null},G:function(r,e){try{H?.localStorage.setItem(r,JSON.stringify(e))}catch(t){ut.B(t)}},V:function(r){try{H?.localStorage.removeItem(r)}catch(e){ut.B(e)}}},d2=["$device_id","distinct_id",Pi,Cg,Ri,Ii],Za={},u2={H:function(){return!0},B:function(r){fe.error("memoryStorage error: "+r)},q:function(r){return Za[r]||null},W:function(r){return Za[r]||null},G:function(r,e){Za[r]=e},V:function(r){delete Za[r]}},Cs=null,It={H:function(){if(!jr(Cs))return Cs;if(Cs=!0,me(H))Cs=!1;else try{var r="__support__";It.G(r,"xyz"),It.q(r)!=='"xyz"'&&(Cs=!1),It.V(r)}catch{Cs=!1}return Cs},B:function(r){fe.error("sessionStorage error: ",r)},q:function(r){try{return H?.sessionStorage.getItem(r)}catch(e){It.B(e)}return null},W:function(r){try{return JSON.parse(It.q(r))||null}catch{}return null},G:function(r,e){try{H?.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){It.B(t)}},V:function(r){try{H?.sessionStorage.removeItem(r)}catch(e){It.B(e)}}},Wr=function(r){return r[r.PENDING=-1]="PENDING",r[r.DENIED=0]="DENIED",r[r.GRANTED=1]="GRANTED",r}({});class h2{constructor(e){this._instance=e}get R(){return this._instance.config}get consent(){return this.J()?Wr.DENIED:this.K}isOptedOut(){return this.R.cookieless_mode==="always"||this.consent===Wr.DENIED||this.consent===Wr.PENDING&&(this.R.opt_out_capturing_by_default||this.R.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Wr.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie)}reset(){this.Y.V(this.X,this.R.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Zo(e)?Wr.GRANTED:De(iw,e)?Wr.DENIED:Wr.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?ut:Pr;var t=e==="localStorage"?Pr:ut;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Zo(t.q(this.X))),t.V(this.X,this.R.cross_subdomain_cookie))}return this.Z}J(){return!!this.R.respect_dnt&&!!Ng([sr?.doNotTrack,sr?.msDoNotTrack,je.doNotTrack],e=>Zo(e))}}var Ja=gt("[Dead Clicks]"),m2=()=>!0,p2=r=>{var e,t=!((e=r.instance.persistence)==null||!e.get_property(Eg)),n=r.instance.config.capture_dead_clicks;return Xr(n)?n:!!St(n)||t};class Bg{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Eg]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it(()=>{this.et()})}it(e){var t,n;(t=je.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",a=>{a?Ja.error("failed to load script",a):e()})}et(){var e;if(he){if(!this.tt&&(e=je.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=St(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=je.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(he),Ja.info("starting...")}}else Ja.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Ja.info("stopping..."))}}var zn=gt("[ExceptionAutocapture]");class f2{constructor(e){var t,n,a;this.rt=()=>{var i;if(H&&this.isEnabled&&(i=je.__PosthogExtensions__)!=null&&i.errorWrappingFunctions){var o=je.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,l=je.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,d=je.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=o(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=l(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=d(this.captureException.bind(this)))}catch(c){zn.error("failed to start",c),this.ut()}}},this._instance=e,this.ht=!((t=this._instance.persistence)==null||!t.props[eh]),this.dt=new ow({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(a=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:10,refillInterval:1e4,h:zn}),this.R=this.vt(),this.startIfEnabledOrStop()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return St(e)?t=ge({},t,e):(me(e)?this.ht:e)&&(t=ge({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(zn.info("enabled"),this.ut(),this.it(this.rt)):this.ut()}it(e){var t,n;(t=je.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",a=>{if(a)return zn.error("failed to load script",a);e()})}ut(){var e,t,n;(e=this.st)==null||e.call(this),this.st=void 0,(t=this.nt)==null||t.call(this),this.nt=void 0,(n=this.ot)==null||n.call(this),this.ot=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ht=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[eh]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop()}onConfigChange(){this.R=this.vt()}captureException(e){var t,n,a=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.dt.consumeRateLimit(a)?zn.info("Skipping exception capture because of client rate limiting.",{exception:a}):this._instance.exceptions.sendExceptionEvent(e)}}function mh(r,e,t){try{if(!(e in r))return()=>{};var n=r[e],a=t(n);return fs(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0}})),r[e]=a,()=>{r[e]=n}}catch{return()=>{}}}class g2{constructor(e){var t;this._instance=e,this.ct=(H==null||(t=H.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(fe.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ft&&this.ft(),this.ft=void 0,fe.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(H&&H.history){var n=this;(e=H.history.pushState)!=null&&e.__posthog_wrapped__||mh(H.history,"pushState",a=>function(i,o,l){a.call(this,i,o,l),n._t("pushState")}),(t=H.history.replaceState)!=null&&t.__posthog_wrapped__||mh(H.history,"replaceState",a=>function(i,o,l){a.call(this,i,o,l),n._t("replaceState")}),this.bt()}}_t(e){try{var t,n=H==null||(t=H.location)==null?void 0:t.pathname;if(!n)return;n!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=n}catch(a){fe.error("Error capturing "+e+" pageview",a)}}bt(){if(!this.ft){var e=()=>{this._t("popstate")};wt(H,"popstate",e),this.ft=()=>{H&&H.removeEventListener("popstate",e)}}}}var rl=gt("[SegmentIntegration]");function x2(r,e){var t=r.config.segment;if(!t)return e();(function(n,a){var i=n.config.segment;if(!i)return a();var o=d=>{var c=()=>d.anonymousId()||ms();n.config.get_device_id=c,d.id()&&(n.register({distinct_id:d.id(),$device_id:c()}),n.persistence.set_property(qr,"identified")),a()},l=i.user();"then"in l&&fs(l.then)?l.then(o):o(l)})(r,()=>{t.register((n=>{Promise&&Promise.resolve||rl.warn("This browser does not have Promise support, and can not use the segment integration");var a=(i,o)=>{if(!o)return i;i.event.userId||i.event.anonymousId===n.get_distinct_id()||(rl.info("No userId set, resetting PostHog"),n.reset()),i.event.userId&&i.event.userId!==n.get_distinct_id()&&(rl.info("UserId set, identifying with PostHog"),n.identify(i.event.userId));var l=n.calculateEventProperties(o,i.event.properties);return i.event.properties=Object.assign({},l,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:i=>a(i,i.event.event),page:i=>a(i,"$pageview"),identify:i=>a(i,"$identify"),screen:i=>a(i,"$screen")}})(r)).then(()=>{e()})})}var qg="posthog-js";function Wg(r,e){var{organization:t,projectId:n,prefix:a,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}=e===void 0?{}:e;return l=>{var d,c,h,m,f;if(!(i==="*"||i.includes(l.level))||!r.__loaded)return l;l.tags||(l.tags={});var p=r.requestRouter.endpointFor("ui","/project/"+r.config.token+"/person/"+r.get_distinct_id());l.tags["PostHog Person URL"]=p,r.sessionRecordingStarted()&&(l.tags["PostHog Recording URL"]=r.get_session_replay_url({withTimestamp:!0}));var v=((d=l.exception)==null?void 0:d.values)||[],x=v.map(b=>ge({},b,{stacktrace:b.stacktrace?ge({},b.stacktrace,{type:"raw",frames:(b.stacktrace.frames||[]).map(j=>ge({},j,{platform:"web:javascript"}))}):void 0})),g={$exception_message:((c=v[0])==null?void 0:c.value)||l.message,$exception_type:(h=v[0])==null?void 0:h.type,$exception_level:l.level,$exception_list:x,$sentry_event_id:l.event_id,$sentry_exception:l.exception,$sentry_exception_message:((m=v[0])==null?void 0:m.value)||l.message,$sentry_exception_type:(f=v[0])==null?void 0:f.type,$sentry_tags:l.tags};return t&&n&&(g.$sentry_url=(a||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+l.event_id),o&&r.exceptions.sendExceptionEvent(g),l}}class v2{constructor(e,t,n,a,i,o){this.name=qg,this.setupOnce=function(l){l(Wg(e,{organization:t,projectId:n,prefix:a,severityAllowList:i,sendExceptionsToPostHog:o==null||o}))}}}var y2=H!=null&&H.location?Li(H.location.hash,"__posthog")||Li(location.hash,"state"):null,ph="_postHogToolbarParams",fh=gt("[Toolbar]"),cs=function(r){return r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.LOADING=1]="LOADING",r[r.LOADED=2]="LOADED",r}(cs||{});class b2{constructor(e){this.instance=e}yt(e){je.ph_toolbar_state=e}wt(){var e;return(e=je.ph_toolbar_state)!==null&&e!==void 0?e:cs.UNINITIALIZED}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),!H||!he)return!1;e=e??H.location,n=n??H.history;try{if(!t){try{H.localStorage.setItem("test","test"),H.localStorage.removeItem("test")}catch{return!1}t=H?.localStorage}var a,i=y2||Li(e.hash,"__posthog")||Li(e.hash,"state"),o=i?Ku(()=>JSON.parse(atob(decodeURIComponent(i))))||Ku(()=>JSON.parse(decodeURIComponent(i))):null;return o&&o.action==="ph_authorize"?((a=o).source="url",a&&Object.keys(a).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((a=JSON.parse(t.getItem(ph)||"{}")).source="localstorage",delete a.userIntent),!(!a.token||this.instance.config.token!==a.token)&&(this.loadToolbar(a),!0)}catch{return!1}}xt(e){var t=je.ph_load_toolbar||je.ph_load_editor;!Le(t)&&fs(t)?t(e,this.instance):fh.warn("No toolbar load function found")}loadToolbar(e){var t=!(he==null||!he.getElementById(Tg));if(!H||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,a=ge({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(H.localStorage.setItem(ph,JSON.stringify(ge({},a,{source:void 0}))),this.wt()===cs.LOADED)this.xt(a);else if(this.wt()===cs.UNINITIALIZED){var i;this.yt(cs.LOADING),(i=je.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",o=>{if(o)return fh.error("[Toolbar] Failed to load",o),void this.yt(cs.UNINITIALIZED);this.yt(cs.LOADED),this.xt(a)}),wt(H,"turbolinks:load",()=>{this.yt(cs.UNINITIALIZED),this.loadToolbar(a)})}return!0}Et(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}var _2=gt("[TracingHeaders]");class w2{constructor(e){this.$t=void 0,this.St=void 0,this.rt=()=>{var t,n;me(this.$t)&&((t=je.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),me(this.St)&&((n=je.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,n;(t=je.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",a=>{if(a)return _2.error("failed to load script",a);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.$t)==null||e.call(this),(t=this.St)==null||t.call(this),this.$t=void 0,this.St=void 0)}}var Xa="https?://(.*)",Rn=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],j2=In(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Rn),$a="<masked>",k2=["li_fat_id"];function Gg(r,e,t){if(!he)return{};var n,a=e?In([],Rn,t||[]):[],i=Yg(La(he.URL,a,$a),r),o=(n={},nt(k2,function(l){var d=Pr.q(l);n[l]=d||null}),n);return vt(o,i)}function Yg(r,e){var t=j2.concat(e||[]),n={};return nt(t,function(a){var i=Di(r,a);n[a]=i||null}),n}function Zg(r){var e=function(i){return i?i.search(Xa+"google.([^/?]*)")===0?"google":i.search(Xa+"bing.com")===0?"bing":i.search(Xa+"yahoo.com")===0?"yahoo":i.search(Xa+"duckduckgo.com")===0?"duckduckgo":null:null}(r),t=e!="yahoo"?"q":"p",n={};if(!jr(e)){n.$search_engine=e;var a=he?Di(he.referrer,t):"";a.length&&(n.ph_keyword=a)}return n}function gh(){return navigator.language||navigator.userLanguage}function Jg(){return he?.referrer||"$direct"}function Xg(r,e){var t=r?In([],Rn,e||[]):[],n=Rt?.href.substring(0,1e3);return{r:Jg().substring(0,1e3),u:n?La(n,t,$a):void 0}}function Kg(r){var e,{r:t,u:n}=r,a={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Oi(t))==null?void 0:e.host};if(n){a.$current_url=n;var i=Oi(n);a.$host=i?.host,a.$pathname=i?.pathname;var o=Yg(n);vt(a,o)}if(t){var l=Zg(t);vt(a,l)}return a}function Qg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function N2(){try{return new Date().getTimezoneOffset()}catch{return}}function S2(r,e){if(!Yt)return{};var t,n,a,i=r?In([],Rn,e||[]):[],[o,l]=function(d){for(var c=0;c<Gu.length;c++){var[h,m]=Gu[c],f=h.exec(d),p=f&&(fs(m)?m(f,d):m);if(p)return p}return["",""]}(Yt);return vt(ud({$os:o,$os_version:l,$browser:_g(Yt,navigator.vendor),$device:Yu(Yt),$device_type:(n=Yt,a=Yu(n),a===og||a===ig||a==="Kobo"||a==="Kindle Fire"||a===bg?ba:a===wa||a===dn||a===ja||a===Xl?"Console":a===cg?"Wearable":a?cr:"Desktop"),$timezone:Qg(),$timezone_offset:N2()}),{$current_url:La(Rt?.href,i,$a),$host:Rt?.host,$pathname:Rt?.pathname,$raw_user_agent:Yt.length>1e3?Yt.substring(0,997)+"...":Yt,$browser_version:xw(Yt,navigator.vendor),$browser_language:gh(),$browser_language_prefix:(t=gh(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:H?.screen.height,$screen_width:H?.screen.width,$viewport_height:H?.innerHeight,$viewport_width:H?.innerWidth,$lib:"web",$lib_version:Br.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var as=gt("[Web Vitals]"),xh=9e5;class E2{constructor(e){var t;this.kt=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((n,a)=>ge({},n,{["$web_vitals_"+a.name+"_event"]:ge({},a),["$web_vitals_"+a.name+"_value"]:a.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.It=n=>{var a,i=(a=this._instance.sessionManager)==null?void 0:a.checkAndGetSessionAndWindowId(!0);if(me(i))as.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this.Ct();me(o)||(Le(n?.name)||Le(n?.value)?as.error("Invalid metric received",n):this.Rt&&n.value>=this.Rt?as.error("Ignoring metric with value >= "+this.Rt,n):(this.N.url!==o&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),me(this.N.url)&&(this.N.url=o),this.N.firstMetricTimestamp=me(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.N.metrics.push(ge({},n,{$current_url:o,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()))}},this.rt=()=>{if(!this.P){var n,a,i,o,l=je.__PosthogExtensions__;me(l)||me(l.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:a,onFCP:i,onINP:o}=l.postHogWebVitalsCallbacks),n&&a&&i&&o?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&a(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this.It.bind(this)),this.P=!0):as.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.kt=!((t=this._instance.persistence)==null||!t.props[rh]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=St(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return Le(n)?((t=this._instance.persistence)==null?void 0:t.props[nh])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(St(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=St(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get Rt(){var e=St(this._instance.config.capture_performance)&&Kr(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:xh;return 0<e&&e<=6e4?xh:e}get isEnabled(){var e=Rt?.protocol;if(e!=="http:"&&e!=="https:")return as.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=St(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Xr(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Xr(t)?t:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(as.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var t=St(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=St(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[rh]:t}),this._instance.persistence.register({[nh]:n})),this.kt=t,this.startIfEnabled()}it(e){var t,n;if((t=je.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks)e();else{var a=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,a,i=>{i?as.error("failed to load script",i):e()})}}Ct(){var e=H?H.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,a=t?In([],Rn,n||[]):[];return La(e,a,$a)}as.error("Could not determine current URL")}}var C2=gt("[Heatmaps]");function vh(r){return St(r)&&"clientX"in r&&"clientY"in r&&Kr(r.clientX)&&Kr(r.clientY)}class T2{constructor(e){var t;this.kt=!1,this.P=!1,this.Ft=null,this.instance=e,this.kt=!((t=this.instance.persistence)==null||!t.props[ec]),this.rageclicks=new Hg(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return St(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Le(this.instance.config.capture_heatmaps)?Le(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;C2.info("starting..."),this.Ot(),this.Mt()}else{var e;clearInterval((e=this.Ft)!==null&&e!==void 0?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ec]:t}),this.kt=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}jt(e){this.Dt(e.originalEvent,"deadclick")}Mt(){this.Ft&&clearInterval(this.Ft),this.Ft=function(e){return e?.visibilityState==="visible"}(he)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null}Ot(){H&&he&&(this.Nt=this.Lt.bind(this),wt(H,"beforeunload",this.Nt),this.Ut=e=>this.Dt(e||H?.event),wt(he,"click",this.Ut,{capture:!0}),this.zt=e=>this.Ht(e||H?.event),wt(he,"mousemove",this.zt,{capture:!0}),this.Bt=new Bg(this.instance,m2,this.jt.bind(this)),this.Bt.startIfEnabled(),this.qt=this.Mt.bind(this),wt(he,"visibilitychange",this.qt),this.P=!0)}At(){var e;H&&he&&(this.Nt&&H.removeEventListener("beforeunload",this.Nt),this.Ut&&he.removeEventListener("click",this.Ut,{capture:!0}),this.zt&&he.removeEventListener("mousemove",this.zt,{capture:!0}),this.qt&&he.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),(e=this.Bt)==null||e.stop(),this.P=!1)}Gt(e,t){var n=this.instance.scrollManager.scrollY(),a=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(l,d,c){for(var h=l;h&&_o(h)&&!xs(h,"body");){if(h===c)return!1;if(De(d,H?.getComputedStyle(h).position))return!0;h=Og(h)}return!1}(Rg(e),["fixed","sticky"],i);return{x:e.clientX+(o?0:a),y:e.clientY+(o?0:n),target_fixed:o,type:t}}Dt(e,t){var n;if(t===void 0&&(t="click"),!ah(e.target)&&vh(e)){var a=this.Gt(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Vt(ge({},a,{type:"rageclick"})),this.Vt(a)}}Ht(e){!ah(e.target)&&vh(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout(()=>{this.Vt(this.Gt(e,"mousemove"))},500))}Vt(e){if(H){var t=H.location.href,n=this.instance.config.mask_personal_data_properties,a=this.instance.config.custom_personal_data_properties,i=n?In([],Rn,a||[]):[],o=La(t,i,$a);this.N=this.N||{},this.N[o]||(this.N[o]=[]),this.N[o].push(e)}}Lt(){this.N&&!tn(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class yh{constructor(e){this.Jt=(t,n,a)=>{a&&(a.noSessionId||a.activityTimeout||a.sessionPastMaximumLength)&&(fe.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:a}),this.Kt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Yt()}Yt(){var e;this.Xt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Jt)}destroy(){var e;(e=this.Xt)==null||e.call(this),this.Xt=void 0}doPageView(e,t){var n,a=this.Qt(e,t);return this.Kt={pathname:(n=H?.location.pathname)!==null&&n!==void 0?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),a}doPageLeave(e){var t;return this.Qt(e,(t=this.Kt)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Kt)==null?void 0:e.pageViewId}}Qt(e,t){var n=this.Kt;if(!n)return{$pageview_id:t};var a={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:l,maxScrollY:d,maxContentHeight:c,lastContentY:h,maxContentY:m}=i;if(!(me(o)||me(l)||me(d)||me(c)||me(h)||me(m))){o=Math.ceil(o),l=Math.ceil(l),d=Math.ceil(d),c=Math.ceil(c),h=Math.ceil(h),m=
vendor: 4,352 bytes, line 559
559Math.ceil(m);var f=o<=1?1:Ar(l/o,0,1,fe),p=o<=1?1:Ar(d/o,0,1,fe),v=c<=1?1:Ar(h/c,0,1,fe),x=c<=1?1:Ar(m/c,0,1,fe);a=vt(a,{$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:d,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:m,$prev_pageview_max_content_percentage:x})}}return n.pathname&&(a.$prev_pageview_pathname=n.pathname),n.timestamp&&(a.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),a}}var Yr=function(r){return r.GZipJS="gzip-js",r.Base64="base64",r}({}),dr=Uint8Array,Zt=Uint16Array,gn=Uint32Array,fd=new dr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),gd=new dr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),bh=new dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e0=function(r,e){for(var t=new Zt(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];var a=new gn(t[30]);for(n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)a[i]=i-t[n]<<5|n;return[t,a]},t0=e0(fd,2),P2=t0[0],cc=t0[1];P2[28]=258,cc[258]=28;for(var _h=e0(gd,0)[1],r0=new Zt(32768),it=0;it<32768;++it){var Ts=(43690&it)>>>1|(21845&it)<<1;Ts=(61680&(Ts=(52428&Ts)>>>2|(13107&Ts)<<2))>>>4|(3855&Ts)<<4,r0[it]=((65280&Ts)>>>8|(255&Ts)<<8)>>>1}var pa=function(r,e,t){for(var n=r.length,a=0,i=new Zt(e);a<n;++a)++i[r[a]-1];var o,l=new Zt(e);for(a=0;a<e;++a)l[a]=l[a-1]+i[a-1]<<1;for(o=new Zt(n),a=0;a<n;++a)o[a]=r0[l[r[a]-1]++]>>>15-r[a];return o},zs=new dr(288);for(it=0;it<144;++it)zs[it]=8;for(it=144;it<256;++it)zs[it]=9;for(it=256;it<280;++it)zs[it]=7;for(it=280;it<288;++it)zs[it]=8;var Fi=new dr(32);for(it=0;it<32;++it)Fi[it]=5;var A2=pa(zs,9),I2=pa(Fi,5),s0=function(r){return(r/8>>0)+(7&r&&1)},n0=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var n=new(r instanceof Zt?Zt:r instanceof gn?gn:dr)(t-e);return n.set(r.subarray(e,t)),n},$r=function(r,e,t){t<<=7&e;var n=e/8>>0;r[n]|=t,r[n+1]|=t>>>8},Hn=function(r,e,t){t<<=7&e;var n=e/8>>0;r[n]|=t,r[n+1]|=t>>>8,r[n+2]|=t>>>16},sl=function(r,e){for(var t=[],n=0;n<r.length;++n)r[n]&&t.push({s:n,f:r[n]});var a=t.length,i=t.slice();if(!a)return[new dr(0),0];if(a==1){var o=new dr(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(w,S){return w.f-S.f}),t.push({s:-1,f:25001});var l=t[0],d=t[1],c=0,h=1,m=2;for(t[0]={s:-1,f:l.f+d.f,l,r:d};h!=a-1;)l=t[t[c].f<t[m].f?c++:m++],d=t[c!=h&&t[c].f<t[m].f?c++:m++],t[h++]={s:-1,f:l.f+d.f,l,r:d};var f=i[0].s;for(n=1;n<a;++n)i[n].s>f&&(f=i[n].s);var p=new Zt(f+1),v=dc(t[h-1],p,0);if(v>e){n=0;var x=0,g=v-e,b=1<<g;for(i.sort(function(w,S){return p[S.s]-p[w.s]||w.f-S.f});n<a;++n){var j=i[n].s;if(!(p[j]>e))break;x+=b-(1<<v-p[j]),p[j]=e}for(x>>>=g;x>0;){var k=i[n].s;p[k]<e?x-=1<<e-p[k]++-1:++n}for(;n>=0&&x;--n){var y=i[n].s;p[y]==e&&(--p[y],++x)}v=e}return[new dr(p),v]},dc=function(r,e,t){return r.s==-1?Math.max(dc(r.l,e,t+1),dc(r.r,e,t+1)):e[r.s]=t},wh=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Zt(++e),n=0,a=r[0],i=1,o=function(d){t[n++]=d},l=1;l<=e;++l)if(r[l]==a&&l!=e)++i;else{if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(a);i=1,a=r[l]}return[t.subarray(0,n),e]},Un=function(r,e){for(var t=0,n=0;n<e.length;++n)t+=r[n]*e[n];return t},uc=function(r,e,t){var n=t.length,a=s0(e+2);r[a]=255&n,r[a+1]=n>>>8,r[a+2]=255^r[a],r[a+3]=255^r[a+1];for(var i=0;i<n;++i)r[a+i+4]=t[i];return 8*(a+4+n)},jh=function(r,e,t,n,a,i,o,l,d,c,h){$r(e,h++,t),++a[256];for(var m=sl(a,15),f=m[0],p=m[1],v=sl(i,15),x=v[0],g=v[1],b=wh(f),j=b[0],k=b[1],y=wh(x),w=y[0],S=y[1],N=new Zt(19),_=0;_<j.length;++_)N[31&j[_]]++;for(_=0;_<w.length;++_)N[31&w[_]]++;for(var C=sl(N,7),O=C[0],R=C[1],M=19;M>4&&!O[bh[M-1]];--M);var L,A,V,G,se=c+5<<3,re=Un(a,zs)+Un(i,Fi)+o,Z=Un(a,f)+Un(i,x)+o+14+3*M+Un(N,O)+(2*N[16]+3*N[17]+7*N[18]);if(se<=re&&se<=Z)return uc(e,h,r.subarray(d,d+c));if($r(e,h,1+(Z<re)),h+=2,Z<re){L=pa(f,p),A=f,V=pa(x,g),G=x;var P=pa(O,R);for($r(e,h,k-257),$r(e,h+5,S-1),$r(e,h+10,M-4),h+=14,_=0;_<M;++_)$r(e,h+3*_,O[bh[_]]);h+=3*M;for(var E=[j,w],U=0;U<2;++U){var J=E[U];for(_=0;_<J.length;++_){var te=31&J[_];$r(e,h,P[te]),h+=O[te],te>15&&($r(e,h,J[_]>>>5&127),h+=J[_]>>>12)}}}else L=A2,A=zs,V=I2,G=Fi;for(_=0;_<l;++_)if(n[_]>255){te=n[_]>>>18&31,Hn(e,h,L[te+257]),h+=A[te+257],te>
vendor: 19,755 bytes, lines 559-561
5597&&($r(e,h,n[_]>>>23&31),h+=fd[te]);var D=31&n[_];Hn(e,h,V[D]),h+=G[D],D>3&&(Hn(e,h,n[_]>>>5&8191),h+=gd[D])}else Hn(e,h,L[n[_]]),h+=A[n[_]];return Hn(e,h,L[256]),h+A[256]},R2=new gn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),M2=function(){for(var r=new gn(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(1&t&&3988292384)^t>>>1;r[e]=t}return r}(),O2=function(r,e,t,n,a){return function(i,o,l,d,c,h){var m=i.length,f=new dr(d+m+5*(1+Math.floor(m/7e3))+c),p=f.subarray(d,f.length-c),v=0;if(!o||m<8)for(var x=0;x<=m;x+=65535){var g=x+65535;g<m?v=uc(p,v,i.subarray(x,g)):(p[x]=h,v=uc(p,v,i.subarray(x,m)))}else{for(var b=R2[o-1],j=b>>>13,k=8191&b,y=(1<<l)-1,w=new Zt(32768),S=new Zt(y+1),N=Math.ceil(l/3),_=2*N,C=function(Ae){return(i[Ae]^i[Ae+1]<<N^i[Ae+2]<<_)&y},O=new gn(25e3),R=new Zt(288),M=new Zt(32),L=0,A=0,V=(x=0,0),G=0,se=0;x<m;++x){var re=C(x),Z=32767&x,P=S[re];if(w[Z]=P,S[re]=Z,G<=x){var E=m-x;if((L>7e3||V>24576)&&E>423){v=jh(i,p,0,O,R,M,A,V,se,x-se,v),V=L=A=0,se=x;for(var U=0;U<286;++U)R[U]=0;for(U=0;U<30;++U)M[U]=0}var J=2,te=0,D=k,ee=Z-P&32767;if(E>2&&re==C(x-ee))for(var T=Math.min(j,E)-1,z=Math.min(32767,x),q=Math.min(258,E);ee<=z&&--D&&Z!=P;){if(i[x+J]==i[x+J-ee]){for(var ce=0;ce<q&&i[x+ce]==i[x+ce-ee];++ce);if(ce>J){if(J=ce,te=ee,ce>T)break;var pe=Math.min(ee,ce-2),ke=0;for(U=0;U<pe;++U){var de=x-ee+U+32768&32767,_e=de-w[de]+32768&32767;_e>ke&&(ke=_e,P=de)}}}ee+=(Z=P)-(P=w[Z])+32768&32767}if(te){O[V++]=268435456|cc[J]<<18|_h[te];var $e=31&cc[J],st=31&_h[te];A+=fd[$e]+gd[st],++R[257+$e],++M[st],G=x+J,++L}else O[V++]=i[x],++R[i[x]]}}v=jh(i,p,h,O,R,M,A,V,se,x-se,v)}return n0(f,0,d+s0(v)+c)}(r,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,t,n,!0)},nl=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8};function D2(r,e){e===void 0&&(e={});var t=function(){var l=4294967295;return{p:function(d){for(var c=l,h=0;h<d.length;++h)c=M2[255&c^d[h]]^c>>>8;l=c},d:function(){return 4294967295^l}}}(),n=r.length;t.p(r);var a,i=O2(r,e,10+((a=e).filename&&a.filename.length+1||0),8),o=i.length;return function(l,d){var c=d.filename;if(l[0]=31,l[1]=139,l[2]=8,l[8]=d.level<2?4:d.level==9?2:0,l[9]=3,d.mtime!=0&&nl(l,4,Math.floor(new Date(d.mtime||Date.now())/1e3)),c){l[3]=8;for(var h=0;h<=c.length;++h)l[h+10]=c.charCodeAt(h)}}(i,e),nl(i,o-8,t.d()),nl(i,o-4,n),i}var L2=function(r){var e,t,n,a,i="";for(e=t=0,n=(r=(r+"").replace(/\r\n/g,` 560`).replace(/\r/g,` 561`)).length,a=0;a<n;a++){var o=r.charCodeAt(a),l=null;o<128?t++:l=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),jr(l)||(t>e&&(i+=r.substring(e,t)),i+=l,e=t=a+1)}return t>e&&(i+=r.substring(e,r.length)),i},$2=!!Wl||!!ql,kh="text/plain",Vi=function(r,e,t){var n;t===void 0&&(t=!0);var[a,i]=r.split("?"),o=ge({},e),l=(n=i?.split("&").map(c=>{var h,[m,f]=c.split("="),p=t&&(h=o[m])!==null&&h!==void 0?h:f;return delete o[m],m+"="+p}))!==null&&n!==void 0?n:[],d=e2(o);return d&&l.push(d),a+"?"+l.join("&")},sa=(r,e)=>JSON.stringify(r,(t,n)=>typeof n=="bigint"?n.toString():n,e),al=r=>{var{data:e,compression:t}=r;if(e){if(t===Yr.GZipJS){var n=D2(function(d,c){var h=d.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(d);for(var m=new dr(d.length+(d.length>>>1)),f=0,p=function(b){m[f++]=b},v=0;v<h;++v){if(f+5>m.length){var x=new dr(f+8+(h-v<<1));x.set(m),m=x}var g=d.charCodeAt(v);g<128||c?p(g):g<2048?(p(192|g>>>6),p(128|63&g)):g>55295&&g<57344?(p(240|(g=65536+(1047552&g)|1023&d.charCodeAt(++v))>>>18),p(128|g>>>12&63),p(128|g>>>6&63),p(128|63&g)):(p(224|g>>>12),p(128|g>>>6&63),p(128|63&g))}return n0(m,0,f)}(sa(e)),{mtime:0}),a=new Blob([n],{type:kh});return{contentType:kh,body:a,estimatedSize:a.size}}if(t===Yr.Base64){var i=function(d){var c,h,m,f,p,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",x=0,g=0,b="",j=[];if(!d)return d;d=L2(d);do c=(p=d.charCodeAt(x++)<<16|d.charCodeAt(x++)<<8|d.charCodeAt(x++))>>18&63,h=p>>12&63,m=p>>6&63,f=63&p,j[g++]=v.charAt(c)+v.charAt(h)+v.charAt(m)+v.charAt(f);while(x<d.length);switch(b=j.join(""),d.length%3){case 1:b=b.slice(0,-2)+"==";break;case 2:b=b.slice(0,-1)+"="}return b}(sa(e)),o=(d=>"data="+encodeURIComponent(typeof d=="string"?d:sa(d)))(i);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=sa(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},fi=[];ql&&fi.push({transport:"fetch",method:r=>{var e,t,{contentType:n,body:a,estimatedSize:i}=(e=al(r))!==null&&e!==void 0?e:{},o=new Headers;nt(r.headers,function(h,m){o.append(m,h)}),n&&o.append("Content-Type",n);var l=r.url,d=null;if(Hu){var c=new Hu;d={signal:c.signal,timeout:setTimeout(()=>c.abort(),r.timeout)}}ql(l,ge({method:r?.method||"GET",headers:o,keepalive:r.method==="POST"&&(i||0)<52428.8,body:a,signal:(t=d)==null?void 0:t.signal},r.fetchOptions)).then(h=>h.text().then(m=>{var f={statusCode:h.status,text:m};if(h.status===200)try{f.json=JSON.parse(m)}catch(p){fe.error(p)}r.callback==null||r.callback(f)})).catch(h=>{fe.error(h),r.callback==null||r.callback({statusCode:0,text:h})}).finally(()=>d?clearTimeout(d.timeout):null)}}),Wl&&fi.push({transport:"XHR",method:r=>{var e,t=new Wl;t.open(r.method||"GET",r.url,!0);var{contentType:n,body:a}=(e=al(r))!==null&&e!==void 0?e:{};nt(r.headers,function(i,o){t.setRequestHeader(o,i)}),n&&t.setRequestHeader("Content-Type",n),r.timeout&&(t.timeout=r.timeout),r.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var i={statusCode:t.status,text:t.responseText};if(t.status===200)try{i.json=JSON.parse(t.responseText)}catch{}r.callback==null||r.callback(i)}},t.send(a)}}),sr!=null&&sr.sendBeacon&&fi.push({transport:"sendBeacon",method:r=>{var e=Vi(r.url,{beacon:"1"});try{var t,{contentType:n,body:a}=(t=al(r))!==null&&t!==void 0?t:{},i=typeof a=="string"?new Blob([a],{type:n}):a;sr.sendBeacon(e,i)}catch{}}});var zi=function(r,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(r)}catch{return!1}};function Nh(r,e,t){return sa({distinct_id:r,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var a0={exact:(r,e)=>e.some(t=>r.some(n=>t===n)),is_not:(r,e)=>e.every(t=>r.every(n=>t!==n)),regex:(r,e)=>e.some(t=>r.some(n=>zi(t,n))),not_regex:(r,e)=>e.every(t=>r.every(n=>!zi(t,n))),icontains:(r,e)=>e.map(Ka).some(t=>r.map(Ka).some(n=>t.includes(n))),not_icontains:(r,e)=>e.map(Ka).every(t=>r.map(Ka).every(n=>!t.includes(n))),gt:(r,e)=>e.some(t=>{var n=parseFloat(t);return!isNaN(n)&&r.some(a=>n>parseFloat(a))}),lt:(r,e)=>e.some(t=>{var n=parseFloat(t);return!isNaN(n)&&r.some(a=>n<parseFloat(a))})},Ka=r=>r.toLowerCase();function i0(r,e){return!r||Object.entries(r).every(t=>{var[n,a]=t,i=e?.[n];if(me(i)||jr(i))return!1;var o=[String(i)],l=a0[a.operator];return!!l&&l(a.values,o)})}var il=gt("[Error tracking]");class F2{constructor(e){var t,n;this.Zt=[],this.ti=new bw([new Tw,new $w,new Aw,new Pw,new Dw,new Ow,new Rw,new Lw],Cw()),this._instance=e,this.Zt=(t=(n=this._instance.persistence)==null?void 0:n.get_property(tc))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,a,i=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],o=(a=e.errorTracking)==null?void 0:a.captureExtensionExceptions;this.Zt=i,this._instance.persistence&&this._instance.persistence.register({[tc]:this.Zt,[th]:o})}get ii(){var e,t=!!this._instance.get_property(th),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.ti.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ei(t)){if(this.ri(t))return void il.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(t))return void il.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(t))return void il.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ri(e){if(e.length===0)return!1;var t=e.reduce((n,a)=>{var{type:i,value:o}=a;return Et(i)&&i.length>0&&n.$exception_types.push(i),Et(o)&&o.length>0&&n.$exception_values.push(o),n},{$exception_types:[],$exception_values:[]});return this.Zt.some(n=>{var a=n.values.map(i=>{var o,l=a0[i.operator],d=Je(i.value)?i.value:[i.value],c=(o=t[i.key])!==null&&o!==void 0?o:[];return d.length>0&&l(d,c)});return n.type==="OR"?a.some(Boolean):a.every(Boolean)})}si(e){return e.flatMap(t=>{var n,a;return(n=(a=t.stacktrace)==null?void 0:a.frames)!==null&&n!==void 0?n:[]}).some(t=>t.filename&&t.filename.startsWith("chrome-extension://"))}ni(e){if(e.length>0){var t,n,a,i,o=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],l=o[o.length-1];return(a=l==null||(i=l.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&a!==void 0&&a}return!1}ei(e){return!Le(e)&&Je(e)}}var rr=gt("[FeatureFlags]"),Bn=gt("[FeatureFlags]",{debugEnabled:!0}),ol="$active_feature_flags",Gs="$override_feature_flags",Sh="$feature_flag_payloads",qn="$override_feature_flag_payloads",Eh="$feature_flag_request_id",Ch="$feature_flag_evaluated_at",Th=r=>{var e={};for(var[t,n]of pi(r||{}))n&&(e[t]=n);return e},V2=r=>{var e=r.flags;return e?(r.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var n;return[t,(n=e[t].variant)!==null&&n!==void 0?n:e[t].enabled]})),r.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var n;return(n=e[t].metadata)==null?void 0:n.payload}).map(t=>{var n;return[t,(n=e[t].metadata)==null?void 0:n.payload]}))):rr.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),r},z2=function(r){return r.FeatureFlags="feature_flags",r.Recordings="recordings",r}({});class H2{constructor(e){this.oi=!1,this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.ci=!1,this._instance=e,this.featureFlagEventHandlers=[]}fi(){var e,t=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ci||(rr.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ci=!0),t!=null&&t.length?t.filter(n=>{var a=n&&typeof n=="string"&&n.trim().length>0;return a||rr.error("Invalid evaluation context found:",n,"Expected non-empty string"),a}):[]}pi(){return this.fi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.di=!0;else{var e=!this.gi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.mi({disableFlags:e})}}get hasLoadedFlags(){return this.ai}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(rc),t=this._instance.get_property(Gs),n=this._instance.get_property(qn);if(!n&&!t)return e||{};var a=vt({},e||{}),i=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var o of i){var l,d,c=a[o],h=t?.[o],m=me(h)?(l=c?.enabled)!==null&&l!==void 0&&l:!!h,f=me(h)?c.variant:typeof h=="string"?h:void 0,p=n?.[o],v=ge({},c,{enabled:m,variant:m?f??c?.variant:void 0});m!==c?.enabled&&(v.original_enabled=c?.enabled),f!==c?.variant&&(v.original_variant=c?.variant),p&&(v.metadata=ge({},c?.metadata,{payload:p,original_payload:c==null||(d=c.metadata)==null?void 0:d.payload})),a[o]=v}return this.oi||(rr.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:a}),this.oi=!0),a}getFlagVariants(){var e=this._instance.get_property(rn),t=this._instance.get_property(Gs);if(!t)return e||{};for(var n=vt({},e),a=Object.keys(t),i=0;i<a.length;i++)n[a[i]]=t[a[i]];return this.oi||(rr.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.oi=!0),n}getFlagPayloads(){var e=this._instance.get_property(Sh),t=this._instance.get_property(qn);if(!t)return e||{};for(var n=vt({},e||{}),a=Object.keys(t),i=0;i<a.length;i++)n[a[i]]=t[a[i]];return this.oi||(rr.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.oi=!0),n}reloadFeatureFlags(){this.ui||this._instance.config.advanced_disable_feature_flags||this.gi||(this.gi=setTimeout(()=>{this.mi()},5))}bi(){clearTimeout(this.gi),this.gi=void 0}ensureFlagsLoaded(){this.ai||this.li||this.gi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ui=e}mi(e){var t;if(this.bi(),!this._instance.M())if(this.li)this.hi=!0;else{var n=this._instance.config.token,a=this._instance.get_property("$device_id"),i={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:ge({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(ra)||{}),group_properties:this._instance.get_property(Rs)};jr(a)||me(a)||(i.$device_id=a),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.pi()&&(i.evaluation_contexts=this.fi());var o=this._instance.config.__preview_remote_config,l=o?"/flags/?v=2":"/flags/?v=2&config=true",d=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",c=this._instance.requestRouter.endpointFor("flags",l+d);o&&(i.timezone=Qg()),this.li=!0,this._instance._send_request({method:"POST",url:c,data:i,compression:this._instance.config.disable_compression?void 0:Yr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:h=>{var m,f,p=!0;if(h.statusCode===200&&(this.hi||(this.$anon_distinct_id=void 0),p=!1),this.li=!1,this.di||(this.di=!0,this._instance.yi((f=h.json)!==null&&f!==void 0?f:{})),!i.disable_flags||this.hi)if(this.vi=!p,h.json&&(m=h.json.quotaLimited)!=null&&m.includes(z2.FeatureFlags))rr.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var v;i.disable_flags||this.receivedFeatureFlags((v=h.json)!==null&&v!==void 0?v:{},p),this.hi&&(this.hi=!1,this.mi())}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),this.ai||this.getFlags()&&this.getFlags().length>0){var a=this.getFeatureFlagResult(e,t);return(n=a?.variant)!==null&&n!==void 0?n:a?.enabled}rr.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),this.ai||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants(),a=e in n,i=n[e],o=this.getFlagPayloads()[e],l=String(i),d=this._instance.get_property(Eh)||void 0,c=this._instance.get_property(Ch)||void 0,h=this._instance.get_property(Ai)||{};if((t.send_event||!("send_event"in t))&&(!(e in h)||!h[e].includes(l))){var m,f,p,v,x,g,b,j,k;Je(h[e])?h[e].push(l):h[e]=[l],(m=this._instance.persistence)==null||m.register({[Ai]:h});var y=this.getFeatureFlagDetails(e),w={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:o||null,$feature_flag_request_id:d,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((f=this._instance.config.bootstrap)==null||(f=f.featureFlags)==null?void 0:f[e])||null,$feature_flag_bootstrapped_payload:((p=this._instance.config.bootstrap)==null||(p=p.featureFlagPayloads)==null?void 0:p[e])||null,$used_bootstrap_value:!this.vi};me(y==null||(v=y.metadata)==null?void 0:v.version)||(w.$feature_flag_version=y.metadata.version);var S,N=(x=y==null||(g=y.reason)==null?void 0:g.description)!==null&&x!==void 0?x:y==null||(b=y.reason)==null?void 0:b.code;N&&(w.$feature_flag_reason=N),y!=null&&(j=y.metadata)!=null&&j.id&&(w.$feature_flag_id=y.metadata.id),me(y?.original_variant)&&me(y?.original_enabled)||(w.$feature_flag_original_response=me(y.original_variant)?y.original_enabled:y.original_variant),y!=null&&(k=y.metadata)!=null&&k.original_payload&&(w.$feature_flag_original_payload=y==null||(S=y.metadata)==null?void 0:S.original_payload),this._instance.capture("$feature_flag_called",w)}if(a){var _=o;if(!me(o))try{_=JSON.parse(o)}catch{}return{key:e,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:_}}}else rr.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,t){var n=this._instance.config.token,a={distinct_id:this._instance.get_distinct_id(),token:n};this.pi()&&(a.evaluation_contexts=this.fi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:a,compression:this._instance.config.disable_compression?void 0:Yr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var o,l=(o=i.json)==null?void 0:o.featureFlagPayloads;t(l?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this.ai||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return me(n)?void 0:!!n}rr.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.ai=!0;var n=this.getFlagVariants(),a=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(o,l,d,c,h){d===void 0&&(d={}),c===void 0&&(c={}),h===void 0&&(h={});var m=V2(o),f=m.flags,p=m.featureFlags,v=m.featureFlagPayloads;if(p){var x=o.requestId,g=o.evaluatedAt;if(Je(p)){rr.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var b={};if(p)for(var j=0;j<p.length;j++)b[p[j]]=!0;l&&l.register({[ol]:p,[rn]:b})}else{var k=p,y=v,w=f;if(o.errorsWhileComputingFlags)if(f){var S=new Set(Object.keys(f).filter(N=>{var _;return!((_=f[N])!=null&&_.failed)}));k=ge({},d,Object.fromEntries(Object.entries(k).filter(N=>{var[_]=N;return S.has(_)}))),y=ge({},c,Object.fromEntries(Object.entries(y||{}).filter(N=>{var[_]=N;return S.has(_)}))),w=ge({},h,Object.fromEntries(Object.entries(w||{}).filter(N=>{var[_]=N;return S.has(_)})))}else k=ge({},d,k),y=ge({},c,y),w=ge({},h,w);l&&l.register(ge({[ol]:Object.keys(Th(k)),[rn]:k||{},[Sh]:y||{},[rc]:w||{}},x?{[Eh]:x}:{},g?{[Ch]:g}:{}))}}})(e,this._instance.persistence,n,a,i),this.wi(t)}}override(e,t){t===void 0&&(t=!1),rr.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return rr.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Gs),this._instance.persistence.unregister(qn),this.wi(),Bn.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.oi=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(Gs),Bn.info("Flag overrides cleared");else if(n.flags){if(Je(n.flags)){for(var a={},i=0;i<n.flags.length;i++)a[n.flags[i]]=!0;this._instance.persistence.register({[Gs]:a})}else this._instance.persistence.register({[Gs]:n.flags});Bn.info("Fl
561ag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this._instance.persistence.unregister(qn),Bn.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[qn]:n.payloads}),Bn.info("Payload overrides set",{payloads:n.payloads}))),void this.wi()}this.wi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ai){var{flags:t,flagVariants:n}=this.xi();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var a,i=(this._instance.get_property(ta)||[]).find(c=>c.flagKey===e),o={["$feature_enrollment/"+e]:t},l={$feature_flag:e,$feature_enrollment:t,$set:o};i&&(l.$early_access_feature_name=i.name),n&&(l.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(o,!1);var d=ge({},this.getFlagVariants(),{[e]:t});(a=this._instance.persistence)==null||a.register({[ol]:Object.keys(Th(d)),[rn]:d}),this.wi()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var a=this._instance.get_property(ta),i=n?"&"+n.map(o=>"stage="+o).join("&"):"";if(a&&!t)return e(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+i),method:"GET",callback:o=>{var l,d;if(o.json){var c=o.json.earlyAccessFeatures;return(l=this._instance.persistence)==null||l.unregister(ta),(d=this._instance.persistence)==null||d.register({[ta]:c}),e(c)}}})}xi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,a)=>(n[a]=t[a],n),{})}}wi(e){var{flags:t,flagVariants:n}=this.xi();this.featureFlagEventHandlers.forEach(a=>a(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(ra)||{};this._instance.register({[ra]:ge({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ra)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(Rs)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(a=>{n[a]=ge({},n[a],e[a]),delete e[a]}),this._instance.register({[Rs]:ge({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Rs)||{};this._instance.register({[Rs]:ge({},t,{[e]:{}})})}else this._instance.unregister(Rs)}reset(){this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.$anon_distinct_id=void 0,this.bi(),this.oi=!1}}var U2=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class ll{constructor(e,t){this.R=e,this.props={},this.Ei=!1,this.$i=(n=>{var a="";return n.token&&(a=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+a+"_posthog"})(e),this.Y=this.Si(e),this.load(),e.debug&&fe.info("Persistence loaded",e.persistence,ge({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.ki}Si(e){U2.indexOf(e.persistence.toLowerCase())===-1&&(fe.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=function(a){a===void 0&&(a=[]);var i=[...d2,...a];return ge({},ut,{W:function(o){try{var l={};try{l=Pr.W(o)||{}}catch{}var d=vt(l,JSON.parse(ut.q(o)||"{}"));return ut.G(o,d),d}catch{}return null},G:function(o,l,d,c,h,m){try{ut.G(o,l,void 0,void 0,m);var f={};i.forEach(p=>{l[p]&&(f[p]=l[p])}),Object.keys(f).length&&Pr.G(o,f,d,c,h,m)}catch(p){ut.B(p)}},V:function(o,l){try{H?.localStorage.removeItem(o),Pr.V(o,l)}catch(d){ut.B(d)}}})}(e.cookie_persisted_properties||[]),n=e.persistence.toLowerCase();return n==="localstorage"&&ut.H()?ut:n==="localstorage+cookie"&&t.H()?t:n==="sessionstorage"&&It.H()?It:n==="memory"?u2:n==="cookie"?Pr:t.H()?t:Pr}properties(){var e={};return nt(this.props,function(t,n){if(n===rn&&St(t))for(var a=Object.keys(t),i=0;i<a.length;i++)e["$feature/"+a[i]]=t[a[i]];else l=n,d=!1,(jr(o=Bw)?d:zu&&o.indexOf===zu?o.indexOf(l)!=-1:(nt(o,function(c){if(d||(d=c===l))return Ti}),d))||(e[n]=t);var o,l,d}),e}load(){if(!this.ki){var e=this.Y.W(this.$i);e&&(this.props=vt({},e))}}save(){this.ki||this.Y.G(this.$i,this.props,this.Pi,this.Ti,this.Ii,this.R.debug)}remove(){this.Y.V(this.$i,!1),this.Y.V(this.$i,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(St(e)){me(t)&&(t="None"),this.Pi=me(n)?this.Ci:n;var a=!1;if(nt(e,(i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==t||(this.props[o]=i,a=!0)}),a)return this.save(),!0}return!1}register(e,t){if(St(e)){this.Pi=me(t)?this.Ci:t;var n=!1;if(nt(e,(a,i)=>{e.hasOwnProperty(i)&&this.props[i]!==a&&(this.props[i]=a,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Ei){var e=Gg(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);tn(ud(e))||this.register(e),this.Ei=!0}}update_search_keyword(){var e;this.register((e=he?.referrer)?Zg(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Jg(),$referring_domain:he!=null&&he.referrer&&((e=Oi(he.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[ic]||this.props[oc]||this.register_once({[Ii]:Xg(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};nt([oc,ic],o=>{var l=this.props[o];l&&nt(l,function(d,c){e["$initial_"+Gl(c)]=d})});var t,n,a=this.props[Ii];if(a){var i=(t=Kg(a),n={},nt(t,function(o,l){n["$initial_"+Gl(l)]=o}),n);vt(e,i)}return e}
vendor: 80,264 bytes, line 561
561safe_merge(e){return nt(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){if(this.Ci=this.Pi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((o,l)=>{if(o.length!==l.length)return!1;var d=[...o].sort(),c=[...l].sort();return d.every((h,m)=>h===c[m])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var a=this.Si(e),i=this.props;this.clear(),this.Y=a,this.props=i,this.save()}}set_disabled(e){this.ki=e,this.ki?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ti&&(this.Ti=e,this.remove(),this.save())}set_secure(e){e!==this.Ii&&(this.Ii=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[ea]||{};n[e]=t,this.props[ea]=n,this.save()}remove_event_timer(e){var t=(this.props[ea]||{})[e];return me(t)||(delete this.props[ea][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var Ph=gt("[Product Tours]"),cl="ph_product_tours";class B2{constructor(e){this.Ri=null,this.Fi=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[sh]:!(e==null||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,t;this.Ri||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(sh)||this.it(()=>this.Oi())}it(e){var t,n;(t=je.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",a=>{a?Ph.error("Could not load product tours script",a):e()})}Oi(){var e;!this.Ri&&(e=je.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ri=je.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Je(this.Fi)||t){var n=this._instance.persistence;if(n){var a=n.props[cl];if(Je(a)&&!t)return this.Fi=a,void e(a,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:i=>{var o=i.statusCode;if(o!==200||!i.json){var l="Product Tours API could not be loaded, status: "+o;return Ph.error(l),void e([],{isLoaded:!1,error:l})}var d=Je(i.json.product_tours)?i.json.product_tours:[];this.Fi=d,n&&n.register({[cl]:d}),e(d,{isLoaded:!0})}})}else e(this.Fi,{isLoaded:!0})}getActiveProductTours(e){Le(this.Ri)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ri.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ri)==null||t.showTourById(e)}previewTour(e){this.Ri?this.Ri.previewTour(e):this.it(()=>{var t;this.Oi(),(t=this.Ri)==null||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Ri)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ri)==null||e.nextStep()}previousStep(){var e;(e=this.Ri)==null||e.previousStep()}clearCache(){var e;this.Fi=null,(e=this._instance.persistence)==null||e.unregister(cl)}resetTour(e){var t;(t=this.Ri)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Ri)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ri)==null||t.cancelPendingTour(e)}}var Wn=function(r){return r.Activation="events",r.Cancellation="cancelEvents",r}({});(function(r){return r.Button="button",r.Tab="tab",r.Selector="selector",r})({});(function(r){return r.TopLeft="top_left",r.TopRight="top_right",r.TopCenter="top_center",r.MiddleLeft="middle_left",r.MiddleRight="middle_right",r.MiddleCenter="middle_center",r.Left="left",r.Center="center",r.Right="right",r.NextToTrigger="next_to_trigger",r})({});(function(r){return r.Top="top",r.Left="left",r.Right="right",r.Bottom="bottom",r})({});var dl=function(r){return r.Popover="popover",r.API="api",r.Widget="widget",r.ExternalSurvey="external_survey",r}({});(function(r){return r.Open="open",r.MultipleChoice="multiple_choice",r.SingleChoice="single_choice",r.Rating="rating",r.Link="link",r})({});(function(r){return r.NextQuestion="next_question",r.End="end",r.ResponseBased="response_based",r.SpecificQuestion="specific_question",r})({});(function(r){return r.Once="once",r.Recurring="recurring",r.Always="always",r})({});var na=function(r){return r.SHOWN="survey shown",r.DISMISSED="survey dismissed",r.SENT="survey sent",r.ABANDONED="survey abandoned",r}({}),ul=function(r){return r.SURVEY_ID="$survey_id",r.SURVEY_NAME="$survey_name",r.SURVEY_RESPONSE="$survey_response",r.SURVEY_ITERATION="$survey_iteration",r.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",r.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",r.SURVEY_SUBMISSION_ID="$survey_submission_id",r.SURVEY_QUESTIONS="$survey_questions",r.SURVEY_COMPLETED="$survey_completed",r.PRODUCT_TOUR_ID="$product_tour_id",r.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",r}({}),hc=function(r){return r.Popover="popover",r.Inline="inline",r}({}),tt=gt("[Surveys]"),o0="seenSurvey_",q2=(r,e)=>{var t="$survey_"+e+"/"+r.id;return r.current_iteration&&r.current_iteration>0&&(t="$survey_"+e+"/"+r.id+"/"+r.current_iteration),t},Ah=r=>((e,t)=>{var n=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(n=""+e+t.id+"_"+t.current_iteration),n})(o0,r),W2=[dl.Popover,dl.Widget,dl.API],G2={ignoreConditions:!1,ignoreDelay:!1,displayType:hc.Popover};class xd{constructor(){this.Mi={},this.Mi={}}on(e,t){return this.Mi[e]||(this.Mi[e]=[]),this.Mi[e].push(t),()=>{this.Mi[e]=this.Mi[e].filter(n=>n!==t)}}emit(e,t){for(var n of this.Mi[e]||[])n(t);for(var a of this.Mi["*"]||[])a(e,t)}}function Ys(r,e,t){if(Le(r))return!1;switch(t){case"exact":return r===e;case"contains":var n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(r);case"regex":try{return new RegExp(e).test(r)}catch{return!1}default:return!1}}class Y2{constructor(e){this.Ai=new xd,this.ji=(t,n)=>this.Di(t,n)&&this.Li(t,n)&&this.Ni(t,n)&&this.Ui(t,n),this.Di=(t,n)=>n==null||!n.event||t?.event===n?.event,this._instance=e,this.zi=new Set,this.Hi=new Set}init(){var e;if(!me((e=this._instance)==null?void 0:e._addCaptureHook)){var t;(t=this._instance)==null||t._addCaptureHook((n,a)=>{this.on(n,a)})}}register(e){var t,n;if(!me((t=this._instance)==null?void 0:t._addCaptureHook)&&(e.forEach(o=>{var l,d;(l=this.Hi)==null||l.add(o),(d=o.steps)==null||d.forEach(c=>{var h;(h=this.zi)==null||h.add(c?.event||"")})}),(n=this._instance)!=null&&n.autocapture)){var a,i=new Set;e.forEach(o=>{var l;(l=o.steps)==null||l.forEach(d=>{d!=null&&d.selector&&i.add(d?.selector)})}),(a=this._instance)==null||a.autocapture.setElementSelectors(i)}}on(e,t){var n;t!=null&&e.length!=0&&(this.zi.has(e)||this.zi.has(t?.event))&&this.Hi&&((n=this.Hi)==null?void 0:n.size)>0&&this.Hi.forEach(a=>{this.Bi(t,a)&&this.Ai.emit("actionCaptured",a.name)})}qi(e){this.onAction("actionCaptured",t=>e(t))}Bi(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.ji(e,n))return!0;return!1}onAction(e,t){return this.Ai.on(e,t)}Li(e,t){if(t!=null&&t.url){var n,a=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!a||typeof a!="string"||!Ys(a,t.url,t.url_matching||"contains"))return!1}return!0}Ni(e,t){return!!this.Wi(e,t)&&!!this.Gi(e,t)&&!!this.Vi(e,t)}Wi(e,t){var n;if(t==null||!t.href)return!0;var a=this.Ji(e);if(a.length>0)return a.some(l=>Ys(l.href,t.href,t.href_matching||"exact"));var i,o=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!o&&Ys((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",t.href,t.href_matching||"exact")}Gi(e,t){var n;if(t==null||!t.text)return!0;var a=this.Ji(e);if(a.length>0)return a.some(c=>Ys(c.text,t.text,t.text_matching||"exact")||Ys(c.$el_text,t.text,t.text_matching||"exact"));var i,o,l,d=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!d&&(i=function(c){for(var h,m=[],f=/(?::|")text="(.*?)"/g;!Le(h=f.exec(c));)m.includes(h[1])||m.push(h[1]);return m}(d),o=t.text,l=t.text_matching||"exact",i.some(c=>Ys(c,o,l)))}Vi(e,t){var n,a;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var o=(e==null||(a=e.properties)==null?void 0:a.$elements_chain)||"";if(t.selector_regex&&o)try{return new RegExp(t.selector_regex).test(o)}catch{return!1}return!1}Ji(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}Ui(e,t){return t==null||!t.properties||t.properties.length===0||i0(t.properties.reduce((n,a)=>{var i=Je(a.value)?a.value.map(String):a.value!=null?[String(a.value)]:[];return n[a.key]={values:i,operator:a.operator||"exact"},n},{}),e?.properties)}}class Z2{constructor(e){this._instance=e,this.Ki=new Map,this.Yi=new Map,this.Xi=new Map}Qi(e,t){return!!e&&i0(e.propertyFilters,t?.properties)}Zi(e,t){var n=new Map;return e.forEach(a=>{var i;(i=a.conditions)==null||(i=i[t])==null||(i=i.values)==null||i.forEach(o=>{if(o!=null&&o.name){var l=n.get(o.name)||[];l.push(a.id),n.set(o.name,l)}})}),n}te(e,t,n){var a=(n===Wn.Activation?this.Ki:this.Yi).get(e),i=[];return this.ie(o=>{i=o.filter(l=>a?.includes(l.id))}),i.filter(o=>{var l,d=(l=o.conditions)==null||(l=l[n])==null||(l=l.values)==null?void 0:l.find(c=>c.name===e);return this.Qi(d,t)})}register(e){var t;me((t=this._instance)==null?void 0:t._addCaptureHook)||(this.ee(e),this.re(e))}re(e){var t=e.filter(n=>{var a,i;return((a=n.conditions)==null?void 0:a.actions)&&((i=n.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0});t.length!==0&&(this.se==null&&(this.se=new Y2(this._instance),this.se.init(),this.se.qi(n=>{this.onAction(n)})),t.forEach(n=>{var a,i,o,l,d;n.conditions&&(a=n.conditions)!=null&&a.actions&&(i=n.conditions)!=null&&(i=i.actions)!=null&&i.values&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((l=this.se)==null||l.register(n.conditions.actions.values),(d=n.conditions)==null||(d=d.actions)==null||(d=d.values)==null||d.forEach(c=>{if(c&&c.name){var h=this.Xi.get(c.name);h&&h.push(n.id),this.Xi.set(c.name,h||[n.id])}}))}))}ee(e){var t,n=e.filter(i=>{var o,l;return((o=i.conditions)==null?void 0:o.events)&&((l=i.conditions)==null||(l=l.events)==null||(l=l.values)==null?void 0:l.length)>0}),a=e.filter(i=>{var o,l;return((o=i.conditions)==null?void 0:o.cancelEvents)&&((l=i.conditions)==null||(l=l.cancelEvents)==null||(l=l.values)==null?void 0:l.length)>0});(n.length!==0||a.length!==0)&&((t=this._instance)==null||t._addCaptureHook((i,o)=>{this.onEvent(i,o)}),this.Ki=this.Zi(e,Wn.Activation),this.Yi=this.Zi(e,Wn.Cancellation))}onEvent(e,t){var n,a=this.ne(),i=this.oe(),o=this.ae(),l=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[i])||[];if(o===e&&t&&l.length>0){var d,c;a.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:l});var h=(t==null||(d=t.properties)==null?void 0:d.$survey_id)||(t==null||(c=t.properties)==null?void 0:c.$product_tour_id);if(h){var m=l.indexOf(h);m>=0&&(l.splice(m,1),this.le(l))}}else{if(this.Yi.has(e)){var f=this.te(e,t,Wn.Cancellation);f.length>0&&(a.info("cancel event matched, cancelling items",{event:e,itemsToCancel:f.map(v=>v.id)}),f.forEach(v=>{var x=l.indexOf(v.id);x>=0&&l.splice(x,1),this.ue(v.id)}),this.le(l))}if(this.Ki.has(e)){a.info("event name matched",{event:e,eventPayload:t,items:this.Ki.get(e)});var p=this.te(e,t,Wn.Activation);this.le(l.concat(p.map(v=>v.id)||[]))}}}onAction(e){var t,n=this.oe(),a=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[];this.Xi.has(e)&&this.le(a.concat(this.Xi.get(e)||[]))}le(e){var t,n=this.ne(),a=this.oe(),i=[...new Set(e)].filter(o=>!this.he(o));n.info("updating activated items",{activatedItems:i}),(t=this._instance)==null||(t=t.persistence)==null||t.register({[a]:i})}getActivatedIds(){var e,t=this.oe(),n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t];return n||[]}getEventToItemsMap(){return this.Ki}de(){return this.se}}class J2 extends Z2{constructor(e){super(e)}oe(){return"$surveys_activated"}ae(){return na.SHOWN}ie(e){var t;(t=this._instance)==null||t.getSurveys(e)}ue(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}ne(){return tt}he(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class X2{constructor(e){this.ve=void 0,this._surveyManager=null,this.ce=!1,this.fe=[],this.pe=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(Le(t))return tt.warn("Flags not loaded yet. Not loading surveys.");var n=Je(t);this.ve=n?t.length>0:t,tt.info("flags response received, isSurveysEnabled: "+this.ve),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(o0)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(a=>localStorage.removeItem(a))}loadIfEnabled(){if(!this._surveyManager)if(this.ce)tt.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)tt.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())tt.info("Not loading surveys in cookieless mode without consent.");else{var e=je?.__PosthogExtensions__;if(e){if(!me(this.ve)||this._instance.config.advanced_enable_surveys){var t=this.ve||this._instance.config.advanced_enable_surveys;this.ce=!0;try{var n=e.generateSurveys;if(n)return void this.ge(n,t);var a=e.loadExternalDependency;if(!a)return void this._e("PostHog loadExternalDependency extension not found.");a(this._instance,"surveys",i=>{i||!e.generateSurveys?this._e("Could not load surveys script",i):this.ge(e.generateSurveys,t)})}catch(i){throw this._e("Error initializing surveys",i),i}finally{this.ce=!1}}}else tt.error("PostHog Extensions not found.")}}ge(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new J2(this._instance),tt.info("Surveys loaded successfully"),this.me({isLoaded:!0})}_e(e,t){tt.error(e,t),this.me({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.fe.push(e),this._surveyManager&&this.me({isLoaded:!0}),()=>{this.fe=this.fe.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return tt.info("Disabled. Not loading surveys."),e([]);var n,a=this._instance.get_property(sc);if(a&&!t)return e(a,{isLoaded:!0});typeof Promise<"u"&&this.pe?this.pe.then(i=>{var{surveys:o,context:l}=i;return e(o,l)}):(typeof Promise<"u"&&(this.pe=new Promise(i=>{n=i})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var o;this.pe=null;var l=i.statusCode;if(l!==200||!i.json){var d="Surveys API could not be loaded, status: "+l;tt.error(d);var c={isLoaded:!1,error:d};return e([],c),void(n==null||n({surveys:[],context:c}))}var h,m=i.json.surveys||[],f=m.filter(v=>function(x){return!(!x.start_date||x.end_date)}(v)&&(function(x){var g;return!((g=x.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)}(v)||function(x){var g;return!((g=x.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)}(v)));f.length>0&&((h=this._surveyEventReceiver)==null||h.register(f)),(o=this._instance.persistence)==null||o.register({[sc]:m});var p={isLoaded:!0};e(m,p),n?.({surveys:m,context:p})}}))}me(e){for(var t of this.fe)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){tt.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!Le(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);tt.warn("init was not called")}be(e){var t=null;return this.getSurveys(n=>{var a;t=(a=n.find(i=>i.id===e))!==null&&a!==void 0?a:null}),t}ye(e){if(Le(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.be(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Le(this._surveyManager))return tt.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ye(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Le(this._surveyManager)?(tt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(n=>{this.getSurveys(a=>{var i,o=(i=a.find(d=>d.id===e))!==null&&i!==void 0?i:null;if(o){var l=this.ye(o);n({visible:l.eligible,disabledReason:l.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,n){var a;if(Le(this._surveyManager))tt.warn("init was not called");else{var i=typeof e=="string"?this.be(e):e;if(i!=null&&i.id)if(W2.includes(i.type)){var o=he?.querySelector(t);if(o)return(a=i.appearance)!=null&&a.surveyPopupDelaySeconds?(tt.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var l,d;tt.info("Rendering survey "+i.id+" with delay of "+((l=i.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(d=this._surveyManager)==null||d.renderSurvey(i,o,n),tt.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o,n);tt.warn("Survey element not found")}else tt.warn("Surveys of type "+i.type+" cannot be rendered in the app");else tt.warn("Survey not found")}}displaySurvey(e,t){var n;if(Le(this._surveyManager))tt.warn("init was not called");else{var a=this.be(e);if(a){var i=a;if((n=a.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=ge({},a,{appearance:ge({},a.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==hc.Popover&&t.initialResponses&&tt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var o=this.canRenderSurvey(a);if(!o.visible)return void tt.warn("Survey is not eligible to be displayed: ",o.disabledReason)}t.displayType!==hc.Inline?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}else tt.warn("Survey not found")}}cancelPendingSurvey(e){Le(this._surveyManager)?tt.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}var Fr=gt("[Conversations]");class K2{constructor(e){this.we=void 0,this._conversationsManager=null,this.xe=!1,this.Ee=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Le(t)||(Xr(t)?this.we=t:(this.we=t.enabled,this.Ee=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.we=void 0,this.Ee=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xe&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=je?.__PosthogExtensions__;if(e&&!me(this.we)&&this.we)if(this.Ee&&this.Ee.token){this.xe=!0;try{var t=e.initConversations;if(t)return this.$e(t),void(this.xe=!1);var n=e.loadExternalDependency;if(!n)return void this.Se("PostHog loadExternalDependency extension not found.");n(this._instance,"conversations",a=>{a||!e.initConversations?this.Se("Could not load conversations script",a):this.$e(e.initConversations),this.xe=!1})}catch(a){this.Se("Error initializing conversations",a),this.xe=!1}}else Fr.error("Conversations enabled but missing token in remote config.")}}$e(e){if(this.Ee)try{this._conversationsManager=e(this.Ee,this._instance),Fr.info("Conversations loaded successfully")}catch(t){this.Se("Error completing conversations initialization",t)}else Fr.error("Cannot complete initialization: remote config is null")}Se(e,t){Fr.error(e,t),this._conversationsManager=null,this.xe=!1}show(){this._conversationsManager?this._conversationsManager.show():Fr.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.we===!0&&!jr(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var a=this;return en(function*(){return a._conversationsManager?a._conversationsManager.sendMessage(e,t,n):(Fr.warn("Conversations not available yet."),null)})()}getMessages(e,t){var n=this;return en(function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(Fr.warn("Conversations not available yet."),null)})()}markAsRead(e){var t=this;return en(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Fr.warn("Conversations not available yet."),null)})()}getTickets(e){var t=this;return en(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Fr.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}}class Q2{constructor(e){var t;this.ke=!1,this.Pe=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.ke=!0)}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!Le(n)&&n&&(this.ke=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.ke&&!this.Pe){var e=gt("[logs]"),t=je?.__PosthogExtensions__;if(t){var n=t.loadExternalDependency;n?n(this._instance,"logs",a=>{var i;a||(i=t.logs)==null||!i.initializeLogs?e.error("Could not load logs script",a):(t.logs.initializeLogs(this._instance),this.Pe=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var Ih=gt("[RateLimiter]");class ej{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var n=t.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(a=>{Ih.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void Ih.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,n,a;e===void 0&&(e=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:o}=this,l=new Date().getTime(),d=(t=(n=this.instance.persistence)==null?void 0:n.get_property(ac))!==null&&t!==void 0?t:{tokens:i,last:l};d.tokens+=(l-d.last)/1e3*o,d.last=l,d.tokens>i&&(d.tokens=i);var c=d.tokens<1;return c||e||(d.tokens=Math.max(0,d.tokens-1)),!c||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=c,(a=this.instance.persistence)==null||a.set_property(ac,d),{isRateLimited:c,remainingTokens:d.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var Ps=gt("[RemoteConfig]");class tj{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=je._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Te(e){var t,n;(t=je.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(Ps.error("PostHog Extensions not found. Cannot load remote config."),e())}Ie(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return Ps.info("Using preloaded remote config",this.remoteConfig),void this.yi(this.remoteConfig);if(this._instance.M())return void Ps.warn("Remote config is disabled. Falling back to local config.");this.Te(e=>{if(!e)return Ps.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ie(t=>{this.yi(t)});this.yi(e)})}catch(e){Ps.error("Error loading remote config",e)}}yi(e){e?this._instance.config.__preview_remote_config?(this._instance.yi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):Ps.info("__preview_remote_config is disabled. Logging config instead",e):Ps.error("Failed to fetch remote config from PostHog.")}}var mc=3e3;class rj{constructor(e,t){this.Ce=!0,this.Re=[],this.Fe=Ar(t?.flush_interval_ms||mc,250,5e3,fe.createLogger("flush interval"),mc),this.Oe=e}enqueue(e){this.Re.push(e),this.Me||this.Ae()}unload(){this.je();var e=this.Re.length>0?this.De():{},t=Object.values(e);[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.Oe(ge({},n,{transport:"sendBeacon"}))})}enable(){this.Ce=!1,this.Ae()}Ae(){var e=this;this.Ce||(this.Me=setTimeout(()=>{if(this.je(),this.Re.length>0){var t=this.De(),n=function(){var i=t[a],o=new Date().getTime();i.data&&Je(i.data)&&nt(i.data,l=>{l.offset=Math.abs(l.timestamp-o),delete l.timestamp}),e.Oe(i)};for(var a in t)n()}},this.Fe))}je(){clearTimeout(this.Me),this.Me=void 0}De(){var e={};return nt(this.Re,t=>{var n,a=t,i=(a?a.batchKey:null)||a.url;me(e[i])&&(e[i]=ge({},a,{data:[]})),(n=e[i].data)==null||n.push(a.data)}),this.Re=[],e}}var sj=["retriesPerformedSoFar"];class nj{constructor(e){this.Le=!1,this.Ne=3e3,this.Re=[],this._instance=e,this.Re=[],this.Ue=!0,!me(H)&&"onLine"in H.navigator&&(this.Ue=H.navigator.onLine,this.ze=()=>{this.Ue=!0,this.Lt()},this.He=()=>{this.Ue=!1},wt(H,"online",this.ze),wt(H,"offline",this.He))}get length(){return this.Re.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=rg(e,sj);Xs(t)&&(n.url=Vi(n.url,{retry_count:t})),this._instance._send_request(ge({},n,{callback:a=>{a.statusCode!==200&&(a.statusCode<400||a.statusCode>=500)&&(t??0)<10?this.Be(ge({retriesPerformedSoFar:t},n)):n.callback==null||n.callback(a)}}))}Be(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(o){var l=3e3*Math.pow(2,o),d=l/2,c=Math.min(18e5,l),h=(Math.random()-.5)*(c-d);return Math.ceil(c+h)}(t),a=Date.now()+n;this.Re.push({retryAt:a,requestOptions:e});var i="Enqueued failed request for retry in "+n;navigator.onLine||(i+=" (Browser is offline)"),fe.warn(i),this.Le||(this.Le=!0,this.qe())}qe(){if(this.We&&clearTimeout(this.We),this.Re.length===0)return this.Le=!1,void(this.We=void 0);this.We=setTimeout(()=>{this.Ue&&this.Re.length>0&&this.Lt(),this.qe()},this.Ne)}Lt(){var e=Date.now(),t=[],n=this.Re.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.Re=t,n.length>0)for(var{requestOptions:a}of n)this.retriableRequest(a)}unload(){for(var{requestOptions:e}of(this.We&&(clearTimeout(this.We),this.We=void 0),this.Le=!1,me(H)||(this.ze&&(H.removeEventListener("online",this.ze),this.ze=void 0),this.He&&(H.removeEventListener("offline",this.He),this.He=void 0)),this.Re))try{this._instance._send_request(ge({},e,{transport:"sendBeacon"}))}catch(t){fe.error(t)}this.Re=[]}}class aj{constructor(e){this.Ge=()=>{var t,n,a,i;this.Ve||(this.Ve={});var o=this.scrollElement(),l=this.scrollY(),d=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=l+(o?.clientHeight||0),h=o?.scrollHeight||0;this.Ve.lastScrollY=Math.ceil(l),this.Ve.maxScrollY=Math.max(l,(t=this.Ve.maxScrollY)!==null&&t!==void 0?t:0),this.Ve.maxScrollHeight=Math.max(d,(n=this.Ve.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ve.lastContentY=c,this.Ve.maxContentY=Math.max(c,(a=this.Ve.maxContentY)!==null&&a!==void 0?a:0),this.Ve.maxContentHeight=Math.max(h,(i=this.Ve.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}getContext(){return this.Ve}resetContext(){var e=this.Ve;return setTimeout(this.Ge,0),e}startMeasuringScrollPosition(){wt(H,"scroll",this.Ge,{capture:!0}),wt(H,"scrollend",this.Ge,{capture:!0}),wt(H,"resize",this.Ge)}scrollElement(){if(!this._instance.config.scroll_root_selector)return H?.document.documentElement;var e=Je(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var n=H?.document.querySelector(t);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return H&&(H.scrollY||H.pageYOffset||H.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return H&&(H.scrollX||H.pageXOffset||H.document.documentElement.scrollLeft)||0}}var ij=r=>Xg(r?.config.mask_personal_data_properties,r?.config.custom_personal_data_properties);class Rh{constructor(e,t,n,a){this.Je=i=>{var o=this.Ke();if(!o||o.sessionId!==i){var l={sessionId:i,props:this.Ye(this._instance)};this.Xe.register({[nc]:l})}},this._instance=e,this.Qe=t,this.Xe=n,this.Ye=a||ij,this.Qe.onSessionId(this.Je)}Ke(){return this.Xe.props[nc]}getSetOnceProps(){var e,t=(e=this.Ke())==null?void 0:e.props;return t?"r"in t?Kg(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return nt(ud(this.getSetOnceProps()),(t,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+Gl(n)]=t}),e}}var hl=gt("[SessionId]");class Mh{on(e,t){return this.Ze.on(e,t)}constructor(e,t,n){var a;if(this.tr=[],this.ir=void 0,this.Ze=new xd,this.er=(h,m)=>!(!Xs(h)||!Xs(m))&&Math.abs(h-m)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.R=e.config,this.Xe=e.persistence,this.rr=void 0,this.sr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.nr=t||ms,this.ar=n||ms;var i=this.R.persistence_name||this.R.token,o=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Ar(o,60,36e3,hl.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lr(),this.ur="ph_"+i+"_window_id",this.hr="ph_"+i+"_primary_window_exists",this.dr()){var l=It.W(this.ur),d=It.W(this.hr);l&&!d?this.rr=l:It.V(this.ur),It.G(this.hr,!0)}if((a=this.R.bootstrap)!=null&&a.sessionID)try{var c=(h=>{var m=h.replace(/-/g,"");if(m.length!==32)throw new Error("Not a valid UUID");if(m[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(m.substring(0,12),16)})(this.R.bootstrap.sessionID);this.vr(this.R.bootstrap.sessionID,new Date().getTime(),c)}catch(h){hl.error("Invalid sessionID in bootstrap",h)}this.cr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return me(this.tr)&&(this.tr=[]),this.tr.push(e),this.sr&&e(this.sr,this.rr),()=>{this.tr=this.tr.filter(t=>t!==e)}}dr(){return this.R.persistence!=="memory"&&!this.Xe.ki&&It.H()}pr(e){e!==this.rr&&(this.rr=e,this.dr()&&It.G(this.ur,e))}gr(){return this.rr?this.rr:this.dr()?It.W(this.ur):null}vr(e,t,n){e===this.sr&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.sr=e,this.Xe.register({[Pi]:[t,e,n]}))}_r(){var e=this.Xe.props[Pi];return Je(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.vr(null,null,null)}destroy(){clearTimeout(this.mr),this.mr=void 0,this.ir&&H&&(H.removeEventListener("beforeunload",this.ir,{capture:!1}),this.ir=void 0),this.tr=[]}cr(){this.ir=()=>{this.dr()&&It.V(this.hr)},wt(H,"beforeunload",this.ir,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.R.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var n=t||new Date().getTime(),[a,i,o]=this._r(),l=this.gr(),d=Xs(o)&&Math.abs(n-o)>864e5,c=!1,h=!i,m=!h&&!e&&this.er(n,a);h||m||d?(i=this.nr(),l=this.ar(),hl.info("new session ID generated",{sessionId:i,windowId:l,changeReason:{noSessionId:h,activityTimeout:m,sessionPastMaximumLength:d}}),o=n,c=!0):l||(l=this.ar(),c=!0);var f=Xs(a)&&e&&!d?a:n,p=Xs(o)?o:new Date().getTime();return this.pr(l),this.vr(i,f,p),e||this.lr(),c&&this.tr.forEach(v=>v(i,l,c?{noSessionId:h,activityTimeout:m,sessionPastMaximumLength:d}:void 0)),{sessionId:i,windowId:l,sessionStartTimestamp:p,changeReason:c?{noSessionId:h,activityTimeout:m,sessionPastMaximumLength:d}:void 0,lastActivityTimestamp:a}}lr(){clearTimeout(this.mr),this.mr=setTimeout(()=>{var[e]=this._r();if(this.er(new Date().getTime(),e)){var t=this.sr;this.resetSessionId(),this.Ze.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var oj=["$set_once","$set"],is=gt("[SiteApps]");class lj{constructor(e){this._instance=e,this.br=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}yr(e,t){if(t){var n=this.globalsForEvent(t);this.br.push(n),this.br.length>1e3&&(this.br=this.br.slice(10))}}get siteAppLoaders(){var e;return(e=je._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.yr.bind(this));this.wr=()=>{e(),this.br=[],this.wr=void 0}}}globalsForEvent(e){var t,n,a,i,o,l,d;if(!e)throw new Error("Event payload is required");var c={},h=this._instance.get_property("$groups")||[],m=this._instance.get_property("$stored_group_properties")||{};for(var[f,p]of Object.entries(m))c[f]={id:h[f],type:f,properties:p};var{$set_once:v,$set:x}=e;return{event:ge({},rg(e,oj),{properties:ge({},e.properties,x?{$set:ge({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},x)}:{},v?{$set_once:ge({},(a=(i=e.properties)==null?void 0:i.$set_once)!==null&&a!==void 0?a:{},v)}:{}),elements_chain:(o=(l=e.properties)==null?void 0:l.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(d=e.properties)==null?void 0:d.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var l;!t.errored&&this.br.length&&(is.info("Processing "+this.br.length+" events for site app with id "+e.id),this.br.forEach(d=>t.processEvent==null?void 0:t.processEvent(d)),t.processedBuffer=!0),Object.values(this.apps).every(d=>d.processedBuffer||d.errored)&&((l=this.wr)==null||l.call(this))},a=!1,i=l=>{t.errored=!l,t.loaded=!0,is.info("Site app with id "+e.id+" "+(l?"loaded":"errored")),a&&n()};try{var{processEvent:o}=e.init({posthog:this._instance,callback:l=>{i(l)}});o&&(t.processEvent=o),a=!0}catch(l){is.error("Error while initializing PostHog app with config id "+e.id,l),i(!1)}if(a&&t.loaded)try{n()}catch(l){is.error("Error while processing buffered events PostHog app with config id "+e.id,l),t.errored=!0}}Er(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}$r(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(a){is.error("Error while processing event "+e.event+" for site app "+n.id,a)}}}onRemoteConfig(e){var t,n,a,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Er(),void this._instance.on("eventCaptured",c=>this.$r(c))):void is.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.wr)==null||n.call(this),(a=e.siteApps)!=null&&a.length)if(this.isEnabled){var o=function(c){var h;je["__$$ph_site_app_"+c]=i._instance,(h=je.__PosthogExtensions__)==null||h.loadSiteApp==null||h.loadSiteApp(i._instance,d,m=>{if(m)return is.error("Error while initializing PostHog app with config id "+c,m)})};for(var{id:l,url:d}of e.siteApps)o(l)}else is.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var l0=function(r,e){if(!r)return!1;var t=r.userAgent;if(t&&Bu(t,e))return!0;try{var n=r?.userAgentData;if(n!=null&&n.brands&&n.brands.some(a=>Bu(a?.brand,e)))return!0}catch{}return!!r.webdriver},aa=function(r){return r.US="us",r.EU="eu",r.CUSTOM="custom",r}({}),Oh="i.posthog.com";class cj{constructor(e){this.Sr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Oh,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Sr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=aa.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=aa.EU:this.Sr[this.apiHost]=aa.CUSTOM),this.Sr[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(e==="flags")return this.flagsApiHost+t;if(this.region===aa.CUSTOM)return this.apiHost+t;var n=Oh+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var dj={icontains:(r,e)=>!!H&&e.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:(r,e)=>!!H&&e.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:(r,e)=>!!H&&zi(e.href,r),not_regex:(r,e)=>!!H&&!zi(e.href,r),exact:(r,e)=>e.href===r,is_not:(r,e)=>e.href!==r};class Lt{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),t.getWebExperiments(a=>{Lt.kr("retrieved web experiments from the server"),t.Pr=new Map,a.forEach(i=>{if(i.feature_flag_key){var o;t.Pr&&(Lt.kr("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=t.Pr)==null||o.set(i.feature_flag_key,i));var l=t._instance.getFeatureFlag(i.feature_flag_key);Et(l)&&i.variants[l]&&t.Tr(i.name,l,i.variants[l].transforms)}else if(i.variants)for(var d in i.variants){var c=i.variants[d];Lt.Ir(c)&&t.Tr(i.name,d,c.transforms)}})},n)},this._instance=e,this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}onFeatureFlags(e){if(this._is_bot())Lt.kr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Le(this.Pr))return this.Pr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Lt.kr("applying feature flags",e),e.forEach(t=>{var n;if(this.Pr&&(n=this.Pr)!=null&&n.has(t)){var a,i=this._instance.getFeatureFlag(t),o=(a=this.Pr)==null?void 0:a.get(t);i&&o!=null&&o.variants[i]&&this.Tr(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){var e=Lt.getWindowLocation();if(e!=null&&e.search){var t=Di(e?.search,"__experiment_id"),n=Di(e?.search,"__experiment_variant");t&&n&&(Lt.kr("previewing web experiments "+t+" && "+n),this.getWebExperiments(a=>{this.Cr(parseInt(t),n,a)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var a=this._instance.get_property("$web_experiments");if(a&&!t)return e(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(i.statusCode!==200||!i.json)return e([]);var o=i.json.experiments||[];return e(o)}})}Cr(e,t,n){var a=n.filter(i=>i.id===e);a&&a.length>0&&(Lt.kr("Previewing web experiment ["+a[0].name+"] with variant ["+t+"]"),this.Tr(a[0].name,t,a[0].variants[t].transforms))}static Ir(e){return!Le(e.conditions)&&Lt.Rr(e)&&Lt.Fr(e)}static Rr(e){var t;if(Le(e.conditions)||Le((t=e.conditions)==null?void 0:t.url))return!0;var n,a,i,o=Lt.getWindowLocation();return!!o&&((n=e.conditions)==null||!n.url||dj[(a=(i=e.conditions)==null?void 0:i.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,o))}static getWindowLocation(){return H?.location}static Fr(e){var t;if(Le(e.conditions)||Le((t=e.conditions)==null?void 0:t.utm))return!0;var n=Gg();if(n.utm_source){var a,i,o,l,d,c,h,m,f=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==n.utm_campaign,p=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_source)==n.utm_source,v=(d=e.conditions)==null||(d=d.utm)==null||!d.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==n.utm_medium,x=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((m=e.conditions)==null||(m=m.utm)==null?void 0:m.utm_term)==n.utm_term;return f&&v&&x&&p}return!1}static kr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];fe.info("[WebExperiments] "+e,n)}Tr(e,t,n){this._is_bot()?Lt.kr("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?n.forEach(a=>{if(a.selector){var i;Lt.kr("applying transform of variant "+t+" for experiment "+e+" ",a);var o=(i=document)==null?void 0:i.querySelectorAll(a.selector);o?.forEach(l=>{var d=l;a.html&&(d.innerHTML=a.html),a.css&&d.setAttribute("style",a.css)})}}):Lt.kr("Control variants leave the page unmodified.")}_is_bot(){return sr&&this._instance?l0(sr,this._instance.config.custom_blocked_useragents):void 0}}var uj=gt("[PostHog ExternalIntegrations]"),hj={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class mj{constructor(e){this._instance=e}it(e,t){var n;(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,a=>{if(a)return uj.error("failed to load script",a);t()})}startIfEnabledOrStop(){var e=this,t=function(o){var l,d,c;!a||(l=je.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]||e.it(hj[o],()=>{var h;(h=je.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[o])==null||h.start(e._instance)}),!a&&(d=je.__PosthogExtensions__)!=null&&(d=d.integrations)!=null&&d[o]&&((c=je.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.stop())};for(var[n,a]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;t(n)}}}var pc="[SessionRecording]",Gn=gt(pc);class Dh{get started(){var e;return!((e=this.Or)==null||!e.isStarted)}get status(){return this.Or?this.Or.status:this.Mr&&!this.Ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Mr=!1,this.jr=void 0,this._instance=e,!this._instance.sessionManager)throw Gn.error("started without valid sessionManager"),new Error(pc+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(pc+' cannot be used with cookieless_mode="always"')}get Ar(){var e,t=!((e=this._instance.get_property(Ko))==null||!e.enabled),n=!this._instance.config.disable_session_recording,a=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return H&&t&&n&&!a}startIfEnabledOrStop(e){var t;if(!this.Ar||(t=this.Or)==null||!t.isStarted){var n=!me(Object.assign)&&!me(Array.from);this.Ar&&n?(this.Dr(e),Gn.info("starting")):this.stopRecording()}}Dr(e){var t,n,a;this.Ar&&(je!=null&&(t=je.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=je.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Lr(e):(a=je.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this._instance,this.Nr,i=>{if(i)return Gn.error("could not load recorder",i);this.Lr(e)}))}stopRecording(){var e,t;(e=this.jr)==null||e.call(this),this.jr=void 0,(t=this.Or)==null||t.stop()}Ur(){var e;(e=this._instance.persistence)==null||e.unregister(Cg)}zr(e){if(this._instance.persistence){var t,n,a=this._instance.persistence,i=()=>{var o=e.sessionRecording===!1?void 0:e.sessionRecording,l=o?.sampleRate,d=Le(l)?null:parseFloat(l);Le(d)&&this.Ur();var c=o?.minimumDurationMilliseconds;a.register({[Ko]:ge({enabled:!!o},o,{networkPayloadCapture:ge({capturePerformance:e.capturePerformance},o?.networkPayloadCapture),canvasRecording:{enabled:o?.recordCanvas,fps:o?.canvasFps,quality:o?.canvasQuality},sampleRate:d,minimumDurationMilliseconds:me(c)?null:c,endpoint:o?.endpoint,triggerMatchType:o?.triggerMatchType,masking:o?.masking,urlTriggers:o?.urlTriggers})})};i(),(t=this.jr)==null||t.call(this),this.jr=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(i)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.zr(e),this.Mr=!0,this.startIfEnabledOrStop()):this.Mr=!0:Gn.info("skipping remote config with no sessionRecording",e)}log(e,t){var n;t===void 0&&(t="log"),(n=this.Or)!=null&&n.log?this.Or.log(e,t):Gn.warn("log called before recorder was ready")}get Nr(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Ko);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Lr(e){var t,n;if((t=je.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Or||(this.Or=(n=je.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.Or._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Or.start(e)}onRRwebEmit(e){var t;(t=this.Or)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Or||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.Or)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Or||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.Or)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.Or||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.Or)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.Or)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.Or)==null||!n.tryAddCustomEvent(e,t))}}var fa={},fc=()=>{},Ks="posthog",c0=!$2&&Yt?.indexOf("MSIE")===-1&&Yt?.indexOf("Mozilla")===-1,Lh=r=>{var e;return ge({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Uw(he?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:fc,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:r??"unset",__preview_deferred_init_extensions:!1,debug:Rt&&Et(Rt?.search)&&Rt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(H==null||(e=H.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;fe.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:mc},error_tracking:{},_onCapture:fc,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(r))},$h=r=>{var e={};me(r.process_person)||(e.person_profiles=r.process_person),me(r.xhr_headers)||(e.request_headers=r.xhr_headers),me(r.cookie_name)||(e.persistence_name=r.cookie_name),me(r.disable_cookie)||(e.disable_persistence=r.disable_cookie),me(r.store_google)||(e.save_campaign_params=r.store_google),me(r.verbose)||(e.debug=r.verbose);var t=vt({},e,r);return Je(r.property_blacklist)&&(me(r.property_denylist)?t.property_denylist=r.property_blacklist:Je(r.property_denylist)?t.property_denylist=[...r.property_blacklist,...r.property_denylist]:fe.error("Invalid value for property_denylist config: "+r.property_denylist)),t};class pj{constructor(){this.__forceAllowLocalhost=!1}get Hr(){return this.__forceAllowLocalhost}set Hr(e){fe.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class wo{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new pj,this.Br=!1,this.version=Br.LIB_VERSION,this.qr=new xd,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Lh(),this.SentryIntegration=v2,this.sentryIntegration=e=>function(t,n){var a=Wg(t,n);return{name:qg,processEvent:i=>a(i)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wr=!1,this.Gr=null,this.Vr=null,this.Jr=null,this.featureFlags=new H2(this),this.toolbar=new b2(this),this.scrollManager=new aj(this),this.pageViewManager=new yh(this),this.surveys=new X2(this),this.conversations=new K2(this),this.logs=new Q2(this),this.experiments=new Lt(this),this.exceptions=new F2(this),this.rateLimiter=new ej(this),this.requestRouter=new cj(this),this.consent=new h2(this),this.externalIntegrations=new mj(this),this.people={set:(e,t,n)=>{var a=Et(e)?{[e]:t}:e;this.setPersonProperties(a),n?.({})},set_once:(e,t,n)=>{var a=Et(e)?{[e]:t}:e;this.setPersonProperties(void 0,a),n?.({})}},this.on("eventCaptured",e=>fe.info('send "'+e?.event+'"',e))}init(e,t,n){if(n&&n!==Ks){var a,i=(a=fa[n])!==null&&a!==void 0?a:new wo;return i._init(e,t,n),fa[n]=i,fa[Ks][n]=i,i}return this._init(e,t,n)}_init(e,t,n){var a;if(t===void 0&&(t={}),me(e)||Yl(e))return fe.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Kr(t.debug),this.Yr=t,this.Xr=[],t.person_profiles&&(this.Vr=t.person_profiles),this.set_config(vt({},Lh(t.defaults),$h(t),{name:n,token:e})),this.config.on_xhr_error&&fe.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Yr.GZipJS;var i=this.Qr();this.persistence=new ll(this.config,i),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ll(ge({},this.config,{persistence:"sessionStorage"}),i);var o=ge({},this.persistence.props),l=ge({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zr=new rj(j=>this.ts(j),this.config.request_queue_config),this.es=new nj(this),this.__request_queue=[];var d=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(d||(this.sessionManager=new Mh(this),this.sessionPropsManager=new Rh(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(fe.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.rs(d)},0)):(fe.info("Initializing extensions synchronously"),this.rs(d)),Br.DEBUG=Br.DEBUG||this.config.debug,Br.DEBUG&&fe.info("Starting in debug mode",{this:this,config:t,thisC:ge({},this.config),p:o,s:l}),((a=t.bootstrap)==null?void 0:a.distinctID)!==void 0){var c,h,m=this.config.get_device_id(ms()),f=(c=t.bootstrap)!=null&&c.isIdentifiedID?m:t.bootstrap.distinctID;this.persistence.set_property(qr,(h=t.bootstrap)!=null&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:f})}if(this.ss()){var p,v,x=Object.keys(((p=t.bootstrap)==null?void 0:p.featureFlags)||{}).filter(j=>{var k;return!((k=t.bootstrap)==null||(k=k.featureFlags)==null||!k[j])}).reduce((j,k)=>{var y;return j[k]=((y=t.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[k])||!1,j},{}),g=Object.keys(((v=t.bootstrap)==null?void 0:v.featureFlagPayloads)||{}).filter(j=>x[j]).reduce((j,k)=>{var y,w;return(y=t.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[k]&&(j[k]=(w=t.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[k]),j},{});this.featureFlags.receivedFeatureFlags({featureFlags:x,featureFlagPayloads:g})}if(d)this.register_once({distinct_id:Fn,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(ms());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(qr,"anonymous")}return wt(H,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?x2(this,()=>this.ns()):this.ns(),fs(this.config._onCapture)&&this.config._onCapture!==fc&&(fe.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",j=>this.config._onCapture(j.event,j))),this.config.ip&&fe.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}rs(e){var t=performance.now();this.historyAutocapture=new g2(this),this.historyAutocapture.startIfEnabled();var n=[];n.push(()=>{new w2(this).startIfEnabledOrStop()}),n.push(()=>{var a;this.siteApps=new lj(this),(a=this.siteApps)==null||a.init()}),e||n.push(()=>{this.sessionRecording=new Dh(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||n.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),n.push(()=>{this.autocapture=new n2(this),this.autocapture.startIfEnabled()}),n.push(()=>{this.surveys.loadIfEnabled()}),n.push(()=>{this.logs.loadIfEnabled()}),n.push(()=>{this.conversations.loadIfEnabled()}),n.push(()=>{this.productTours=new B2(this),this.productTours.loadIfEnabled()}),n.push(()=>{this.heatmaps=new T2(this),this.heatmaps.startIfEnabled()}),n.push(()=>{this.webVitalsAutocapture=new E2(this)}),n.push(()=>{this.exceptionObserver=new f2(this),this.exceptionObserver.startIfEnabledOrStop()}),n.push(()=>{this.deadClicksAutocapture=new Bg(this,p2),this.deadClicksAutocapture.startIfEnabled()}),n.push(()=>{if(this.os){var a=this.os;this.os=void 0,this.yi(a)}}),this.ls(n,t)}ls(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.ls(e,t)},0);var n=e.shift();if(n)try{n()}catch(i){fe.error("Error initializing extension:",i)}}var a=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:a}),this.config.__preview_deferred_init_extensions&&fe.info("PostHog extensions initialized ("+a+"ms)")}yi(e){var t,n,a,i,o,l,d,c,h;if(!he||!he.body)return fe.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.yi(e)},500);this.config.__preview_deferred_init_extensions&&(this.os=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=De(e.supportedCompression,Yr.GZipJS)?Yr.GZipJS:De(e.supportedCompression,Yr.Base64)?Yr.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Vr?this.Vr:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(a=this.sessionRecording)==null||a.onRemoteConfig(e),(i=this.autocapture)==null||i.onRemoteConfig(e),(o=this.heatmaps)==null||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),(l=this.productTours)==null||l.onRemoteConfig(e),(d=this.webVitalsAutocapture)==null||d.onRemoteConfig(e),(c=this.exceptionObserver)==null||c.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(h=this.deadClicksAutocapture)==null||h.onRemoteConfig(e)}ns(){try{this.config.loaded(this)}catch(n){fe.critical("`loaded` function failed",n)}if(this.us(),this.config.test_user_hostname&&Rt!=null&&Rt.hostname){var e=Rt.hostname,t=this.config.test_user_hostname;(typeof t=="string"?e===t:t.test(e))&&this.setTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.hs()},1),new tj(this).load(),this.featureFlags.flags()}us(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Zr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&gs(this.__request_queue,e=>this.ts(e)),this.__request_queue=[],this.us()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this.ds()&&this.capture("$pageleave"),(e=this.Zr)==null||e.unload(),(t=this.es)==null||t.unload()):this.ds()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(c0?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Vi(e.url,{ip:this.config.ip?1:0}),e.headers=ge({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var n,a,i,o=ge({},t);o.timeout=o.timeout||6e4,o.url=Vi(o.url,{_:new Date().getTime().toString(),ver:Br.LIB_VERSION,compression:o.compression});var l=(n=o.transport)!==null&&n!==void 0?n:"fetch",d=fi.filter(h=>!o.disableTransport||!h.transport||!o.disableTransport.includes(h.transport)),c=(a=(i=Ng(d,h=>h.transport===l))==null?void 0:i.method)!==null&&a!==void 0?a:d[0].method;if(!c)throw new Error("No available transport method");c(o)})(ge({},e,{callback:t=>{var n,a;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(a=this.config).on_request_error)==null||n.call(a,t)),e.callback==null||e.callback(t)}}))))}ts(e){this.es?this.es.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,n=[],a=[],i=[];gs(e,l=>{l&&(t=l[0],Je(t)?i.push(l):fs(l)?l.call(this):Je(l)&&t==="alias"?n.push(l):Je(l)&&t.indexOf("capture")!==-1&&fs(this[t])?i.push(l):a.push(l))});var o=function(l,d){gs(l,function(c){if(Je(c[0])){var h=d;nt(c,function(m){h=h[m[0]].apply(h,m.slice(1))})}else this[c[0]].apply(this,c.slice(1))},d)};o(n,this),o(a,this),o(i,this)}ss(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zr){if(this.is_capturing())if(!me(e)&&Et(e)){var i=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(i&&!this.config.__preview_capture_bot_pageviews)){var o=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){t!=null&&t.$current_url&&!Et(t?.$current_url)&&(fe.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,d=n?.timestamp||l,c=ms(),h={uuid:c,event:e,properties:this.calculateEventProperties(e,t||{},d,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&i&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),o&&(h.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),n?.$set&&(h.$set=n?.$set);var m,f=e!=="$groupidentify",p=this.vs(n?.$set_once,f);if(p&&(h.$set_once=p),(h=zw(h,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=d,me(n?.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=l),e===na.DISMISSED||e===na.SENT){var v=t?.[ul.SURVEY_ID],x=t?.[ul.SURVEY_ITERATION];m={id:v,current_iteration:x},localStorage.getItem(Ah(m))||localStorage.setItem(Ah(m),"true"),h.$set=ge({},h.$set,{[q2({id:v,current_iteration:x},e===na.SENT?"responded":"dismissed")]:!0})}else e===na.SHOWN&&(h.$set=ge({},h.$set,{[ul.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var g=ge({},h.properties.$set,h.$set);if(tn(g)||this.setPersonPropertiesForFlags(g),!Le(this.config.before_send)){var b=this.cs(h);if(!b)return;h=b}this.qr.emit("eventCaptured",h);var j={method:"POST",url:(a=n?._url)!==null&&a!==void 0?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:n?._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.ts(j):this.Zr.enqueue(j),h}fe.critical("This capture call is ignored due to client rate limiting.")}}else fe.error("No event name provided to posthog.capture")}else fe.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,n,a,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var o=i?void 0:this.persistence.remove_event_timer(e),l=ge({},t);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(l.$cookieless_mode=!0),e==="$snapshot"){var d=ge({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=d.distinct_id,(!Et(l.distinct_id)&&!Kr(l.distinct_id)||Yl(l.distinct_id))&&fe.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var c,h=S2(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:m,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime());l.$session_id=m,l.$window_id=f}this.sessionPropsManager&&vt(l,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&vt(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(p=this.es)==null?void 0:p.length}catch(b){l.$sdk_debug_error_capturing_properties=String(b)}if(this.requestRouter.region===aa.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,a),l=vt(l,c),e==="$pageview"&&he&&(l.title=he.title),!me(o)){var v=n.getTime()-o;l.$duration=parseFloat((v/1e3).toFixed(3))}Yt&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=vt({},h,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),Je(this.config.property_denylist)?nt(this.config.property_denylist,function(b){delete l[b]}):fe.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(fe.error("sanitize_properties is deprecated. Use before_send instead"),l=x(l,e));var g=this.fs();return l.$process_person_profile=g,g&&!i&&this.ps("_calculate_event_properties"),l}vs(e,t){var n;if(t===void 0&&(t=!0),!this.persistence||!this.fs()||this.Br)return e;var a=this.persistence.get_initial_props(),i=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=vt({},a,i||{},e||{}),l=this.config.sanitize_properties;return l&&(fe.error("sanitize_properties is deprecated. Use before_send instead"),o=l(o,"$set_once")),t&&(this.Br=!0),tn(o)?void 0:o}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var a;(a=this.persistence)==null||a.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}gs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,n){var a=n!=null&&n.merge?this.featureFlags.getFlagVariants():{},i=n!=null&&n.merge?this.featureFlags.getFlagPayloads():{},o=ge({},a,e),l=ge({},i,t),d={};for(var[c,h]of Object.entries(o)){var m=typeof h=="string";d[c]={key:c,enabled:!!m||!!h,variant:m?h:void 0,reason:void 0,metadata:me(l?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}}}this.featureFlags.receivedFeatureFlags({flags:d})}updateEarlyAccessFeatureEnrollment(e,t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.qr.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){t===void 0&&(t=G2),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,n){if(!this.__loaded||!this.persistence)return fe.uninitializedWarning("posthog.identify");if(Kr(e)&&(e=e.toString(),fe.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))fe.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==Fn){if(this.ps("posthog.identify")){var a=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==a&&e!==this.get_property(Qn)&&(this.unregister(Qn),this.register({distinct_id:e}));var o=(this.persistence.get_property(qr)||"anonymous")==="anonymous";e!==a&&o?(this.persistence.set_property(qr,"identified"),this.setPersonPropertiesForFlags(ge({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:a},{$set:t||{},$set_once:n||{}}),this.Jr=Nh(e,t,n),this.featureFlags.setAnonymousDistinctId(a)):(t||n)&&this.setPersonProperties(t,n),e!==a&&(this.reloadFeatureFlags(),this.unregister(Ai))}}else fe.critical('The string "'+Fn+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else fe.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.ps("posthog.setPersonProperties")){var n=Nh(this.get_distinct_id(),e,t);this.Jr!==n?(this.setPersonPropertiesForFlags(ge({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Jr=n):fe.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,n){if(e&&t){var a=this.getGroups();a[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ge({},a,{[e]:t})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),a[e]===t||n||this.reloadFeatureFlags()}else fe.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.ps("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,a,i;if(fe.info("reset"),!this.__loaded)return fe.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(a=this.persistence)==null||a.set_property(qr,"anonymous"),(i=this.sessionManager)==null||i.resetSessionId(),this.Jr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Fn,$device_id:null},"");else{var l=this.config.get_device_id(ms());this.register_once({distinct_id:l,$device_id:e?l:o},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),a=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&n){var i,o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!n)return a;a+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-o,0)}return a}alias(e,t){return e===this.get_property(Sg)?(fe.critical("Attempting to create alias for existing People user - aborting."),-2):this.ps("posthog.alias")?(me(t)&&(t=this.get_distinct_id()),e!==t?(this.gs(Qn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(fe.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=ge({},this.config);if(St(e)){var n,a,i,o,l,d,c;vt(this.config,$h(e));var h=this.Qr();(n=this.persistence)==null||n.update_config(this.config,t,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ll(ge({},this.config,{persistence:"sessionStorage"}),h);var m=this.Kr(this.config.debug);Xr(m)&&(this.config.debug=m),Xr(this.config.debug)&&(this.config.debug?(Br.DEBUG=!0,ut.H()&&ut.G("ph_debug","true"),fe.info("set_config",{config:e,oldConfig:t,newConfig:ge({},this.config)})):(Br.DEBUG=!1,ut.H()&&ut.V("ph_debug"))),(a=this.exceptionObserver)==null||a.onConfigChange(),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(l=this.heatmaps)==null||l.startIfEnabled(),(d=this.exceptionObserver)==null||d.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._s(),(c=this.externalIntegrations)==null||c.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,n={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var a,i,o,l,d;(a=this.sessionManager)==null||a.checkAndGetSessionAndWindowId(),n.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),n.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),n.url_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("url")),n.event_trigger&&((d=this.sessionRecording)==null||d.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var n=new Error("PostHog syntheticException"),a=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(ge({},a,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Ks;return t!==Ks&&(t=Ks+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(qr))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(qr))==="identified"}fs(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&tn(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Qn])&&((t=this.persistence)==null||(t=t.props)==null||!t[Ri]))}ds(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.fs()||this.ps("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setTestUser(){this.ps("posthog.setTestUser")&&this.setPersonProperties({$test_user:!0})}ps(e){return this.config.person_profiles==="never"?(fe.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.gs(Ri,!0),!0)}Qr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!t}_s(){var e,t,n,a,i=this.Qr();return((e=this.persistence)==null?void 0:e.ki)!==i&&((n=this.persistence)==null||n.set_disabled(i)),((t=this.sessionPersistence)==null?void 0:t.ki)!==i&&((a=this.sessionPersistence)==null||a.set_disabled(i)),i}opt_in_capturing(e){var t;if(this.config.cookieless_mode!=="always"){var n,a,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(n=this.sessionManager)==null||n.destroy(),(a=this.pageViewManager)==null||a.destroy(),this.sessionManager=new Mh(this),this.pageViewManager=new yh(this),this.persistence&&(this.sessionPropsManager=new Rh(this,this.sessionManager,this.persistence)),this.sessionRecording=new Dh(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this._s(),this.us(),(t=this.sessionRecording)==null||t.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(me(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e?.captureEventName)!==null&&i!==void 0?i:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.hs()}else fe.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._s(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Fn,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(t=this.pageViewManager)==null||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.hs())):fe.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Wr.GRANTED?"granted":e===Wr.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._s()}_is_bot(){return sr?l0(sr,this.config.custom_blocked_useragents):void 0}hs(){he&&(he.visibilityState==="visible"?this.Wr||(this.Wr=!0,this.capture("$pageview",{title:he.title},{send_instantly:!0}),this.Gr&&(he.removeEventListener("visibilitychange",this.Gr),this.Gr=null)):this.Gr||(this.Gr=this.hs.bind(this),wt(he,"visibilitychange",this.Gr)))}debug(e){e===!1?(H?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(H?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}M(){var e,t,n,a,i,o,l,d=this.Yr||{};return"advanced_disable_flags"in d?!!d.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(fe.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(n="advanced_disable_decide",a=!1,i=fe,o=(t="advanced_disable_flags")in(e=d)&&!Le(e[t]),l=n in e&&!Le(e[n]),o?e[t]:l?(i&&i.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n]):a)}cs(e){if(Le(this.config.before_send))return e;var t=Je(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var a of t){if(n=a(n),Le(n)){var i="Event '"+e.event+"' was rejected in beforeSend function";return nw(e.event)?fe.warn(i+". This can cause unexpected behavior."):fe.info(i),null}n.properties&&!tn(n.properties)||fe.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;
561return(e=this.pageViewManager.Kt)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Kr(e){var t=Xr(e)&&!e,n=ut.H()&&ut.q("ph_debug")==="true";return!t&&(!!n||e)}}(function(r,e){for(var t=0;t<e.length;t++)r.prototype[e[t]]=Vw(r.prototype[e[t]])})(wo,["identify"]);var Fh,Ct=(Fh=fa[Ks]=new wo,function(){function r(){r.done||(r.done=!0,c0=!1,nt(fa,function(e){e._dom_loaded()}))}he!=null&&he.addEventListener?he.readyState==="complete"?r():wt(he,"DOMContentLoaded",r,{capture:!1}):H&&fe.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Fh);const fj="phc_iE0V8T7SgYT8XxyLp6hFbhXbDkQqn60WsICyATMPaQ3",gj="https://eu.i.posthog.com";let Hi=!1;const ia=[];function ks(){return Hi&&typeof Ct<"u"}function Vh(){if(Hi){console.log("[PostHog] Already initialized");return}try{Ct.init(fj,{api_host:gj,persistence:"memory",disable_session_recording:!0,capture_pageview:!1,autocapture:!1,property_denylist:["$ip"],mask_all_text:!0,mask_all_element_attributes:!0,opt_out_capturing_by_default:!1,disable_surveys:!0,loaded:()=>{console.log("[PostHog] Initialized in anonymous mode (Tier 1)");const r=window.__VID_EXP__;if(r&&(Ct.register({vid_did:r.distinct_id,experiments:r.experiments}),console.log("[PostHog] Experiment super properties registered")),ia.length>0)for(console.log(`[PostHog] Flushing ${ia.length} queued events`);ia.length>0;){const e=ia.shift(),t=e.immediate?{transport:"sendBeacon"}:void 0;Ct.capture(e.eventName,e.properties,t)}Jt()&&(console.log("[PostHog] Previous consent detected, upgrading to Tier 2"),d0())}}),Hi=!0,window.addEventListener("beforeunload",()=>{try{Ct.capture("$pageleave",{},{transport:"sendBeacon"})}catch{}})}catch(r){console.error("[PostHog] Initialization failed:",r)}}function d0(){try{Ct.opt_in_capturing(),Ct.set_config({persistence:"localStorage+cookie",disable_session_recording:!1}),Ct.startSessionRecording(),console.log("[PostHog] Upgraded to full tracking (Tier 2)")}catch(r){console.error("[PostHog] Upgrade to Tier 2 failed:",r)}}function xj(){try{Ct.stopSessionRecording(),Ct.opt_out_capturing(),Ct.reset(),console.log("[PostHog] Downgraded to anonymous mode (Tier 1)")}catch(r){console.error("[PostHog] Downgrade to Tier 1 failed:",r)}}function vj(r){if(!ks()){console.warn("[PostHog] Not available for consent update");return}r?d0():xj()}function u0(r,e){if(!Jt()){console.log("[PostHog] User identification blocked - no analytics consent");return}if(!ks()){console.warn("[PostHog] Not available for user identification");return}try{Ct.identify(r,e),console.log("[PostHog] User identified:",r)}catch(t){console.error("[PostHog] User identification failed:",t)}}function _t(r,e,t){if(!Hi){ia.push({eventName:r,properties:e,immediate:t?.immediate}),console.log(`[PostHog] Queued event (pre-init): ${r}`);return}try{const n=t?.immediate?{transport:"sendBeacon"}:void 0;Ct.capture(r,e,n),console.log("[PostHog] Event captured:",r)}catch(n){console.error("[PostHog] Event capture failed:",n)}}function h0(r){if(ks())try{Ct.capture("$pageview",{$current_url:window.location.href,$pathname:r||window.location.pathname})}catch(e){console.error("[PostHog] Page view capture failed:",e)}}function bA(r,e){Jt()&&ks()&&Ct.people.set({[r]:e})}function _A(r){Jt()&&ks()&&Ct.register(r)}function wA(){if(ks())try{Ct.reset(),console.log("[PostHog] Identity reset")}catch(r){console.error("[PostHog] Reset failed:",r)}}function yj(){return ks()?Ct:null}function zh(r){if(Jt()&&ks())try{Ct.people.set(r),console.log("[PostHog] Person properties set:",Object.keys(r))}catch(e){console.error("[PostHog] Failed to set person properties:",e)}}function jA(r,e){const t=r/100;return e?t/12:t}const vd=mo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 active:scale-[0.98]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 hover:translate-y-[-1px] shadow-md hover:shadow-lg",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 hover:translate-y-[-1px] shadow-sm hover:shadow-md",outline:"border border-border bg-background/50 hover:bg-secondary hover:border-primary/50 hover:translate-y-[-1px] shadow-sm hover:shadow-md",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 hover:translate-y-[-1px] shadow-sm hover:shadow-md",ghost:"hover:bg-secondary hover:text-foreground",link:"text-primary underline-offset-4 hover:underline",hero:"relative bg-gradient-to-r from-primary via-[hsl(220,80%,55%)] to-accent text-white font-semibold shadow-[0_4px_20px_-4px_hsl(190_75%_45%/0.5)] hover:shadow-[0_8px_30px_-4px_hsl(190_75%_45%/0.7)] hover:scale-[1.02] hover:translate-y-[-2px] active:scale-[0.98] before:absolute before:inset-0 before:rounded-lg before:bg-gradient-to-r before:from-white/20 before:to-transparent before:opacity-0 hover:before:opacity-100 before:transition-opacity",glass:"bg-secondary/50 backdrop-blur-sm text-foreground hover:bg-secondary/70 border border-border/50 hover:border-primary/30 hover:translate-y-[-1px] shadow-sm hover:shadow-md",gradient:"bg-gradient-to-r from-primary via-accent to-primary bg-[length:200%_100%] animate-gradient text-primary-foreground font-semibold shadow-md hover:shadow-lg",warm:"bg-gradient-to-r from-warm to-[hsl(25,90%,55%)] text-white font-semibold hover:translate-y-[-1px] shadow-[0_4px_20px_-4px_hsl(16_90%_55%/0.5)] hover:shadow-[0_8px_30px_-4px_hsl(16_90%_55%/0.6)]",success:"bg-gradient-to-r from-success to-[hsl(155,70%,45%)] text-white font-semibold hover:translate-y-[-1px] shadow-[0_4px_20px_-4px_hsl(var(--success)/0.5)] hover:shadow-[0_8px_30px_-4px_hsl(var(--success)/0.6)]",accent:"bg-gradient-to-r from-accent to-[hsl(280,80%,55%)] text-white font-semibold shadow-[0_4px_20px_-4px_hsl(260_80%_60%/0.5)] hover:shadow-[0_8px_30px_-4px_hsl(260_80%_60%/0.7)] hover:scale-[1.02] hover:translate-y-[-2px] active:scale-[0.98]"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-12 rounded-lg px-8 text-base",xl:"h-14 roun
561ded-xl px-10 text-lg",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ie=u.forwardRef(({className:r,variant:e,size:t,asChild:n=!1,...a},i)=>{const o=n?gy:"button";return s.jsx(o,{className:Y(vd({variant:e,size:t,className:r})),ref:i,...a})});ie.displayName="Button";function yd(){return u.useContext(j0)}function bj(){const{showBanner:r,acceptAll:e,rejectAll:t,openPreferences:n}=yd();return s.jsx(pt,{children:r&&s.jsx(ae.div,{initial:{y:"100%",opacity:0},animate:{y:0,opacity:1},exit:{y:"100%",opacity:0},transition:{type:"spring",damping:25,stiffness:300,duration:.4},role:"dialog","aria-labelledby":"cookie-consent-title","aria-describedby":"cookie-consent-description",className:"fixed bottom-0 left-0 right-0 z-50 p-4 md:p-6",children:s.jsx("div",{className:"mx-auto max-w-4xl",children:s.jsx("div",{className:"rounded-xl border border-border bg-card/95 backdrop-blur-md shadow-2xl overflow-hidden",children:s.jsx("div",{className:"p-4 md:p-6",children:s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:gap-6",children:[s.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[s.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:s.jsx(Qb,{className:"w-5 h-5 text-primary"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h2",{id:"cookie-consent-title",className:"text-base font-semibold text-foreground mb-1",children:"We use cookies"}),s.jsx("p",{id:"cookie-consent-description",className:"text-sm text-muted-foreground leading-relaxed",children:"We use cookies to improve your experience, analyze site traffic, and personalize content. You can choose which cookies to accept."})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-3 flex-shrink-0",children:[s.jsx(ie,{variant:"outline",size:"sm",onClick:t,className:"w-full sm:w-auto order-2 sm:order-1",children:"Reject All"}),s.jsx(ie,{variant:"default",size:"sm",onClick:e,className:"w-full sm:w-auto order-1 sm:order-2",children:"Accept All"}),s.jsxs(ie,{variant:"ghost",size:"sm",onClick:n,className:"w-full sm:w-auto order-3 gap-1.5",children:[s.jsx(ya,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Manage"}),s.jsx("span",{className:"sm:hidden",children:"Preferences"})]})]})]})})})})})})}const m0=co,_j=uo,wj=lo,kA=Pa,p0=u.forwardRef(({className:r,...e},t)=>s.jsx(Nn,{ref:t,className:Y("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",r),...e}));p0.displayName=Nn.displayName;const bd=u.forwardRef(({className:r,children:e,...t},n)=>s.jsxs(wj,{children:[s.jsx(p0,{}),s.jsxs(Sn,{ref:n,className:Y("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-4 sm:p-6 shadow-lg duration-200","max-h-[calc(100dvh-2rem)] overflow-y-auto","rounded-lg","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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",r),style:{paddingBottom:"max(1rem, env(safe-area-inset-bottom))"},...t,children:[e,s.jsxs(Pa,{className:`absolute z-10 flex items-center justify-center w-8 h-8 rounded-full transition-all 562 right-[max(0.5rem,env(safe-area-inset-right))] top-[max(0.5rem,env(safe-area-inset-top))] 563 sm:right-4 sm:top-4 sm:w-9 sm:h-9 564 bg-black/60 backdrop-blur-sm ring-1 ring-white/20 565 text-white hover:bg-black/80 hover:ring-white/40 566 focus:outline-none focus:ring-2 focus:ring-white/50 567 disabled:pointer-events-none`,children:[s.jsx(lt,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bd.displayName=Sn.displayName;const _d=u.forwardRef(({className:r,...e},t)=>s.jsx("div",{ref:t,className:Y("flex flex-col space-y-1.5 text-center sm:text-left",r),...e}));_d.displayName="DialogHeader";const f0=u.forwardRef(({className:r,...e},t)=>s.jsx("div",{ref:t,className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...e}));f0.displayName="DialogFooter";const wd=u.forwardRef(({className:r,...e},t)=>s.jsx(En,{ref:t,className:Y("text-lg font-semibold leading-none tracking-tight",r),...e}));wd.displayName=En.displayName;const g0=u.forwardRef(({className:r,...e},t)=>s.jsx(Cn,{ref:t,className:Y("text-sm text-muted-foreground",r),...e}));g0.displayName=Cn.displayName;var jo="Switch",[jj]=js(jo),[kj,Nj]=jj(jo),x0=u.forwardRef((r,e)=>{const{__scopeSwitch:t,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:d="on",onCheckedChange:c,form:h,...m}=r,[f,p]=u.useState(null),v=Ft(e,k=>p(k)),x=u.useRef(!1),g=f?h||!!f.closest("form"):!0,[b,j]=kn({prop:a,defaultProp:i??!1,onChange:c,caller:jo});return s.jsxs(kj,{scope:t,checked:b,disabled:l,children:[s.jsx(ft.button,{type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":_0(b),"data-disabled":l?"":void 0,disabled:l,value:d,...m,ref:v,onClick:mt(r.onClick,k=>{j(y=>!y),g&&(x.current=k.isPropagationStopped(),x.current||k.stopPropagation())})}),g&&s.jsx(b0,{control:f,bubbles:!x.current,name:n,value:d,checked:b,required:o,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});x0.displayName=jo;var v0="SwitchThumb",y0=u.forwardRef((r,e)=>{const{__scopeSwitch:t,...n}=r,a=Nj(v0,t);return s.jsx(ft.span,{"data-state":_0(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:e})});y0.displayName=v0;var Sj="SwitchBubbleInput",b0=u.forwardRef(({__scopeSwitch:r,control:e,checked:t,bubbles:n=!0,...a},i)=>{const o=u.useRef(null),l=Ft(o,i),d=vp(t),c=yp(e);return u.useEffect(()=>{const h=o.current;if(!h)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"checked").set;if(d!==t&&p){const v=new Event("click",{bubbles:n});p.call(h,t),h.dispatchEvent(v)}},[d,t,n]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:l,style:{...a.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});b0.displayName=Sj;function _0(r){return r?"checked":"unchecked"}var w0=x0,Ej=y0;const jd=u.forwardRef(({className:r,...e},t)=>s.jsx(w0,{className:Y("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",r),...e,ref:t,children:s.jsx(Ej,{className:Y("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}
567));jd.displayName=w0.displayName;const Cj=[{id:"essential",name:"Essential Cookies",description:"Required for authentication, security, and core functionality. Cannot be disabled.",icon:hi,locked:!0},{id:"functional",name:"Functional Cookies",description:"Remember your preferences like theme, language, and personalization settings.",icon:y1},{id:"analytics",name:"Analytics Cookies",description:"Help us understand how you use our platform, including page views, feature usage, session recordings, and behavioral analytics to improve the user experience.",icon:po},{id:"marketing",name:"Marketing Cookies",description:"Used to show you relevant ads and measure ad campaign effectiveness.",icon:Af}];function Tj(){const{consent:r,showPreferences:e,closePreferences:t,updatePreferences:n}=yd(),[a,i]=u.useState({functional:!1,analytics:!1,marketing:!1});u.useEffect(()=>{e&&r?i({functional:r.functional,analytics:r.analytics,marketing:r.marketing}):e&&!r&&i({functional:!1,analytics:!1,marketing:!1})},[e,r]);const o=m=>{i(f=>({...f,[m]:!f[m]}))},l=()=>{n(a)},d=()=>{i({functional:!0,analytics:!0,marketing:!0}),n({functional:!0,analytics:!0,marketing:!0})},c=()=>{i({functional:!1,analytics:!1,marketing:!1}),n({functional:!1,analytics:!1,marketing:!1})},h=m=>m==="essential"?!0:a[m];return s.jsx(m0,{open:e,onOpenChange:m=>!m&&t(),children:s.jsxs(bd,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[s.jsxs(_d,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:s.jsx(Pn,{className:"w-4 h-4 text-primary"})}),s.jsx(wd,{children:"Cookie Preferences"})]}),s.jsx(g0,{children:"Manage your cookie preferences. Essential cookies are required for the site to function and cannot be disabled."})]}),s.jsx("div",{className:"space-y-4 py-4",children:Cj.map(m=>{const f=m.icon,p=h(m.id),v=m.locked;return s.jsxs("div",{className:`flex items-start gap-4 p-4 rounded-lg border transition-colors ${p?"border-primary/20 bg-primary/5":"border-border bg-card"}`,children:[s.jsx("div",{className:`flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center ${p?"bg-primary/10":"bg-muted"}`,children:s.jsx(f,{className:`w-5 h-5 ${p?"text-primary":"text-muted-foreground"}`})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("h3",{className:"text-sm font-medium text-foreground",children:m.name}),v&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:"Required"})]}),s.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:m.description})]}),s.jsx("div",{className:"flex-shrink-0",children:v?s.jsx("div",{className:"h-6 px-2 flex items-center text-xs text-muted-foreground bg-muted rounded",children:"Always on"}):s.jsx(jd,{checked:p,onCheckedChange:()=>o(m.id),"aria-label":`Toggle ${m.name}`})})]},m.id)})}),s.jsxs(f0,{className:"flex-col sm:flex-row gap-2",children:[s.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[s.jsx(ie,{variant:"outline",size:"sm",onClick:c,className:"flex-1 sm:flex-none",children:"Reject All"}),s.jsx(ie,{variant:"outline",size:"sm",onClick:d,className:"flex-1 sm:flex-none",children:"Accept All"})]}),s.jsx(ie,{variant:"default",size:"sm",onClick:l,className:"w-full sm:w-auto",children:"Save Preferences"})]})]})})}const j0=u.createContext(null);function Hh(r){typeof window.gtag=="function"?(window.gtag("consent","update",{ad_storage:r.marketing?"granted":"denied",ad_user_data:r.marketing?"granted":"denied",ad_personalization:r.marketing?"granted":"denied",analytics_storage:r.analytics?"granted":"denied",functionality_storage:r.functional?"granted":"denied",personalization_storage:r.functional?"granted":"denied"}),console.log("[CookieConsent] Consent Mode v2 updated:",r)):console.warn("[CookieConsent] gtag not available")}function Pj({children:r}){const[e,t]=u.useState(null),[n,a]=u.useState(!1),[i,o]=u.useState(!1),[l,d]=u.useState(!1);u.useEffect(()=>{const g=Oa();g&&Lu()?(t(g),Hh(g),Fu(g.analytics),a(!1)):(g&&!Lu()&&t(g),a(!0)),d(!0)},[]);const c=u.useCallback(g=>{Z_(g),t(g),Hh(g),Fu(g.analytics),vj(g.analytics),a(!1),o(!1)},[]),h=u.useCallback(()=>{const g=X_();c(g)},[c]),m=u.useCallback(()=>{const g=$u();c(g)},[c]),f=u.useCallback(g=>{const j={...e||$u(),...g,essential:!0,timestamp:Date.now()};c(j)},[e,c]),p=u.useCallback(()=>{o(!0)},[]),v=u.useCallback(()=>{o(!1)},[]),x={consent:e,hasConsented:J_(),showBanner:n,showPreferences:i,acceptAll:h,rejectAll:m,updatePreferences:f,openPreferences:p,closePreferences:v};return s.jsxs(j0.Provider,{value:x,children:[r,l&&s.jsxs(s.Fragment,{children:[s.jsx(bj,{}),s.jsx(Tj,{})]})]})}const Aj="https://cnocqjydxkzeytrirrsn.supabase.co",Ij="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNub2NxanlkeGt6ZXl0cmlycnNuIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjgwMzE3ODcsImV4cCI6MjA4MzYwNzc4N30.ncqGehJ5dzMckPVIFu3TJtfHzUrKVT1CnzbtqDLDVKI",W=Vy(Aj,Ij,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),kd="vidacious_remember_me",gi="vidacious_session_active",Qa=r=>{try{localStorage.setItem(kd,r?"true":"false")}catch(e){console.warn("Could not save remember me preference:",e)}},k0=()=>{try{localStorage.removeItem(kd)}catch{}},Rj=()=>{try{return localStorage.getItem(kd)==="false"}catch{return!1}},Mj=()=>
567{if(!(typeof window>"u"))try{const r=window.location.pathname;if(r.includes("/checkout/success")||r.includes("/payment-success")||window.location.search.includes("session_id=")){sessionStorage.setItem(gi,"true");return}if(Rj()){if(!sessionStorage.getItem(gi)){const a=[];for(let i=0;i<localStorage.length;i++){const o=localStorage.key(i);o&&o.startsWith("sb-")&&o.endsWith("-auth-token")&&a.push(o)}a.forEach(i=>{localStorage.removeItem(i)}),a.length>0&&k0()}sessionStorage.setItem(gi,"true")}}catch(r){console.warn("Session persistence check failed:",r)}},Oj=()=>{try{k0(),sessionStorage.removeItem(gi)}catch{}},Vr=20;function NA(){const{user:r}=Ee(),[e,t]=u.useState(null),[n,a]=u.useState([]),[i,o]=u.useState([]),[l,d]=u.useState([]),[c,h]=u.useState(!0),[m,f]=u.useState(null),[p,v]=u.useState({connected:!1,details_submitted:!1,payouts_enabled:!1}),[x,g]=u.useState({total:0,limit:Vr,offset:0,hasMore:!1}),[b,j]=u.useState({total:0,limit:Vr,offset:0,hasMore:!1}),[k,y]=u.useState({total:0,limit:Vr,offset:0,hasMore:!1}),w=u.useCallback(async(L,A={})=>{const{data:V,error:G}=await W.functions.invoke("affiliate-actions",{body:{action:L,...A}});if(G)throw new Error(G.message);if(!V.success)throw new Error(V.error||"Action failed");return V},[]),S=u.useCallback(async()=>{if(!r){h(!1);return}try{h(!0);const L=await w("get_or_create_profile");t(L.affiliate);const A=await w("get_stats",{referralsLimit:Vr,referralsOffset:0,commissionsLimit:Vr,commissionsOffset:0,payoutsLimit:Vr,payoutsOffset:0});if(a(A.referrals||[]),o(A.commissions||[]),d(A.payouts||[]),A.pagination){const G=A.pagination.referrals||{},se=A.pagination.commissions||{},re=A.pagination.payouts||{};g({total:G.total||A.referrals?.length||0,limit:G.limit||Vr,offset:G.offset||0,hasMore:(G.offset||0)+(A.referrals?.length||0)<(G.total||0)}),j({total:se.total||A.commissions?.length||0,limit:se.limit||Vr,offset:se.offset||0,hasMore:(se.offset||0)+(A.commissions?.length||0)<(se.total||0)}),y({total:re.total||A.payouts?.length||0,limit:re.limit||Vr,offset:re.offset||0,hasMore:(re.offset||0)+(A.payouts?.length||0)<(re.total||0)})}const V=await w("check_account_status");v({connected:V.connected,details_submitted:V.details_submitted,payouts_enabled:V.payouts_enabled})}catch(L){console.error("Error fetching affiliate data:",L)}finally{h(!1)}},[r,w]);u.useEffect(()=>{S()},[S]);const N=u.useCallback(async()=>{try{const L=await w("create_connect_account");return L.url&&window.open(L.url,"_blank"),L}catch(L){throw ne.error(L.message),L}},[w]),_=u.useCallback(async()=>{try{const L=await w("request_payout");return ne.success("Payout initiated successfully!"),await S(),L}catch(L){throw ne.error(L.message),L}},[w,S]),C=u.useCallback((L="/")=>e?.referral_code?`https://vidacious.ai${L}?ref=${e.referral_code}`:"",[e?.referral_code]),O=u.useCallback(async()=>{if(!(!x.hasMore||m)){f("referrals");try{const L=x.offset+x.limit,A=await w("get_stats",{referralsLimit:x.limit,referralsOffset:L,commissionsLimit:0,commissionsOffset:0,payoutsLimit:0,payoutsOffset:0});if(A?.referrals?.length>0){a(G=>[...G,...A.referrals]);const V=A.pagination?.referrals||{};g({total:V.total||x.total,limit:x.limit,offset:L,hasMore:L+A.referrals.length<(V.total||x.total)})}else g(V=>({...V,hasMore:!1}))}
567catch(L){console.error("Error loading more referrals:",L)}finally{f(null)}}},[x,m,w]),R=u.useCallback(async()=>{if(!(!b.hasMore||m)){f("commissions");try{const L=b.offset+b.limit,A=await w("get_stats",{referralsLimit:0,referralsOffset:0,commissionsLimit:b.limit,commissionsOffset:L,payoutsLimit:0,payoutsOffset:0});if(A?.commissions?.length>0){o(G=>[...G,...A.commissions]);const V=A.pagination?.commissions||{};j({total:V.total||b.total,limit:b.limit,offset:L,hasMore:L+A.commissions.length<(V.total||b.total)})}else j(V=>({...V,hasMore:!1}))}catch(L){console.error("Error loading more commissions:",L)}finally{f(null)}}},[b,m,w]),M=u.useCallback(async()=>{if(!(!k.hasMore||m)){f("payouts");try{const L=k.offset+k.limit,A=await w("get_stats",{referralsLimit:0,referralsOffset:0,commissionsLimit:0,commissionsOffset:0,payoutsLimit:k.limit,payoutsOffset:L});if(A?.payouts?.length>0){d(G=>[...G,...A.payouts]);const V=A.pagination?.payouts||{};y({total:V.total||k.total,limit:k.limit,offset:L,hasMore:L+A.payouts.length<(V.total||k.total)})}else y(V=>({...V,hasMore:!1}))}catch(L){console.error("Error loading more payouts:",L)}finally{f(null)}}},[k,m,w]);return{affiliate:e,referrals:n,commissions:i,payouts:l,loading:c,loadingMore:m,connectStatus:p,setupStripeConnect:N,requestPayout:_,getReferralLink:C,refresh:S,referralsPagination:x,commissionsPagination:b,payoutsPagination:k,loadMoreReferrals:O,loadMoreCommissions:R,loadMorePayouts:M}}function Dj(){u.useEffect(()=>{if(typeof window>"u")return;const e=new URLSearchParams(window.location.search).get("ref");if(e){const t=new Date;t.setDate(t.getDate()+60),localStorage.setItem("vidacious_referral_code",e),localStorage.setItem("vidacious_referral_expiry",t.toISOString()),console.log("[Referral] Stored referral code:",e)}},[])}function Lj(){typeof window>"u"||(localStorage.removeItem("vidacious_referral_code"),localStorage.removeItem("vidacious_referral_expiry"))}const Nd="vidacious_attribution",Sd="vidacious_attribution_expiry",ko="vidacious_attribution_oauth",$j=30,Fj=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],Vj=["gclid","fbclid","ttclid","msclkid","twclid","li_fat_id"],zj=[...Fj,...Vj];function Ed(){try{const r=localStorage.getItem(Sd);if(r&&new Date(r)<new Date)return N0(),null;const e=localStorage.getItem(Nd);return e?JSON.parse(e):null}catch(r){return console.error("[Attribution] Error reading stored attribution:",r),null}}function N0(){try{localStorage.removeItem(Nd),localStorage.removeItem(Sd),sessionStorage.removeItem(ko)}catch(r){console.error("[Attribution] Error clearing attribution:",r)}}function Uh(){try{const r=Ed();r&&(sessionStorage.setItem(ko,JSON.stringify(r)),console.log("[Attribution] Preserved for OAuth:",r))}catch(r){console.error("[Attribution] Error preserving for OAuth:",r)}}function Hj(){try{const r=sessionStorage.getItem(ko);return r?JSON.parse(r):null}catch(r){return console.error("[Attribution] Error reading session attribution:",r),null}}function Uj(){try{sessionStorage.removeItem(ko)}catch(r){console.error("[Attribution] Error clearing session attribution:",r)}}function SA(r){if(!r)return"Direct";const{utm_source:e,gclid:t,fbclid:n,ttclid:a,referred_by:i}=r,o=e?.toLowerCase();return a?"TikTok Ads":n?"Facebook/IG Ads":t?"Google Ads":o==="(direct)"||o==="direct"?"Direct":o==="youtube"?"YouTube":o==="tiktok"?"TikTok":o==="instagram"||o==="ig"?"Instagram":o==="facebook"||o==="fb"?"Facebook":o==="linkedin"?"LinkedIn":o==="twitter"||o==="x"?"Twitter/X":o==="google"?"Google":o==="bing"||o==="microsoft"?"Bing":e?e.charAt(0).toUpperCase()+e.slice(1):i?"Referral":"Direct"}function EA(r){switch(r){case"Google Ads":case"Google":return"bg-blue-500/20 text-blue-600 dark:text-blue-400 border-blue-500/30";case"TikTok Ads":case"TikTok":return"bg-pink-500/20 text-pink-600 dark:text-pink-400 border-pink-500/30";case"Facebook/IG Ads":case"Facebook":case"Instagram":case"Meta":return"bg-indigo-500/20 text-indigo-600 dark:text-indigo-400 border-indigo-500/30";case"YouTube":return"bg-red-500/20 text-red-600 dark:text-red-400 border-red-500/30";case"LinkedIn Ads":case"LinkedIn":return"bg-sky-500/20 text-sky-600 dark:text-sky-400 border-sky-500/30";case"Twitter/X Ads":case"Twitter/X":return"bg-slate-500/20 text-slate-600 dar
567k:text-slate-400 border-slate-500/30";case"Bing Ads":case"Bing":return"bg-teal-500/20 text-teal-600 dark:text-teal-400 border-teal-500/30";case"Referral":return"bg-purple-500/20 text-purple-600 dark:text-purple-400 border-purple-500/30";case"Direct / Unknown":case"Direct":return"bg-muted text-muted-foreground";default:return"bg-muted text-muted-foreground"}}function Bj(){const[r]=Tn();u.useEffect(()=>{try{const e=Ed();if(e){console.log("[Attribution] Existing attribution found, preserving first-touch:",e);return}const t={};let n=!1;for(const l of zj){const d=r.get(l);d&&(t[l]=d,n=!0)}const a=window.location.pathname+window.location.search,i=document.referrer||void 0,o=i&&!i.includes(window.location.hostname);if(n||o){t.captured_at=new Date().toISOString(),t.landing_page=a,t.referrer_url=i;const l=new Date;l.setDate(l.getDate()+$j),localStorage.setItem(Nd,JSON.stringify(t)),localStorage.setItem(Sd,l.toISOString()),console.log("[Attribution] Captured and stored:",t)}}catch(e){console.error("[Attribution] Error capturing attribution:",e)}},[r])}const No=1e4,Bh=new Map,qh=new Map,Wh=new Map,Gh=new Map,Na=()=>(window.dataLayer=window.dataLayer||[],window.dataLayer),gc=r=>{if(!Jt()){console.log("[Analytics] Auth tracking blocked - no analytics consent");return}const{authMethod:e,authType:t}=r,n=`${t}_${e}`,a=Bh.get(n),i=Date.now();if(a&&i-a<No){console.log("[Analytics] Auth event deduplicated (within 10s window):",n);return}Bh.set(n,i);const o=`vid_${t}_${e}`,l=`${t.charAt(0).toUpperCase()+t.slice(1)} ${e.charAt(0).toUpperCase()+e.slice(1)}`,d={event:"form_submit",eventModel:{form_id:o,form_name:l,auth_method:e,auth_type:t}};console.log("[Analytics] Tracking auth event:",d),Na().push(d)},CA=r=>{if(!Jt()&&!Qf()){console.log("[Analytics] Subscription tracking blocked - no consent");return}const e=`subscription_${r.planName||"unknown"}`,t=qh.get(e),n=Date.now();if(t&&n-t<No){console.log("[Analytics] Subscription event deduplicated (within 10s window):",e);return}qh.set(e,n);const a={event:"subscription_completed",eventModel:{product:"vidacious_subscription",plan_name:r.planName,value:r.value,currency:r.currency?.toUpperCase(),is_test_mode:r.isTestMode}};console.log("[Analytics] Tracking subscription:",a),Na().push(a)},qj=r=>{if(!Jt()){console.log("[Analytics] Registration tracking blocked - no analytics consent");return}const e=`registration_${r}`,t=Wh.get(e),n=Date.now();if(t&&n-t<No){console.log("[Analytics] Registration event deduplicated (within 10s window):",e);return}Wh.set(e,n);const a={event:"registrationComplete",authentication_method:r};console.log("[Analytics] Tracking registration complete:",a),Na().push(a)},TA=r=>{if(!Jt()&&!Qf()){console.log("[Analytics] Purchase conversion tracking blocked - no consent");return}const{transactionId:e,value:t,currency:n,items:a,coupon:i}=r,o=Gh.get(e),l=Date.now();if(o&&l-o<No){console.log("[Analytics] Purchase event deduplicated (within 10s window):",e);return}Gh.set(e,l),Na().push({ecommerce:null});const d={event:"purchase",ecommerce:{transaction_id:e,value:t,currency:n.toUpperCase(),...i&&{coupon:i},items:a}};console.log("[Analytics] Tracking purchase conversion:",d),Na().push(d)},S0=u.createContext(void 0);function Wj({children:r}){const[e,t]=u.useState(null),[n,a]=u.useState(null),[i,o]=u.useState(null),[l,d]=u.useState(!0),c=async x=>{const{data:g,error:b}=await W.from("profiles").select("*").eq("user_id",x).maybeSingle();!b&&g&&(o(g),eg("plan_type",g.plan||"free"))},h=async()=>{e&&await c(e.id)};u.useEffect(()=>{const{data:{subscription:x}}=W.auth.onAuthStateChange((b,j)=>{if(console.log("[Auth] onAuthStateChange:",b,j?.user?.email),a(j),t(j?.user??null),b==="PASSWORD_RECOVERY"&&(console.log("[Auth] PASSWORD_RECOVERY event detected - session established for password update"),window.dispatchEvent(new CustomEvent("password_recovery_ready"))),b==="SIGNED_IN"&&j?.user){const k=j.user.app_metadata?.provider;k==="google"&&setTimeout(()=>{const y=new Date(j.user.created_at),S=(new Date().getTime()-y.getTime())/1e3,N=S<60;gc({authMethod:"google",authType:N?"signup":"login"});const _=Intl.DateTimeFormat().resolvedOptions().timeZone,C=Intl.DateTimeFormat().resolvedOptions().locale;N&&(qj("Google"),_t("user_signed_up",{signup_method:"google",email:j.user.email||null,user_timezone:_,user_locale:C}),zh({subscription_status:"free",plan_type:"free",is_paid_user:!1,signup_date:new Date().toISOString(),user_timezone:_,user_locale:C})),u0(j.user.id,{email:j.user.email||null,user_timezone:_}),W.from("profiles").update({user_timezone:_,user_locale:C}).eq("user_id",j.user.id).then(()=>{}),console.log("[Auth] Google OAuth tracked:",{isNewUser:N,ageInSeconds:S,provider:k,userTimezone:_});const O=sessionStorage.getItem("google_auth_redirect");if(O&&(sessionStorage.removeItem("google_auth_redirect"),O.startsWith("/")&&!O.startsWith("//"))){window.location.href=O;return}},100),setTimeout(()=>{K_(j.user.id)},100)}j?.user?setTimeout(()=>{c(j.user.id)},0):o(null)}),g=new Promise((b,j)=>setTimeout(()=>j(new Error("Session restoration timed out")),1e4));return Promise.race([W.auth.getSession(),g]).then(({data:{session:b}})=>{a(b),t(b?.user??null),b?.user&&c(b.user.id),d(!1)}).catch(b=>{console.warn("[Auth] Session restoration failed/timed out:",b.message),a(null),t(null),o(null),d(!1)}),()=>x.unsubscribe()},[]);const m=async(x,g,b,j,k)=>{const y=j||null,w=Ed();let S,N;try{const _=await W.auth.signUp({email:x,password:g,options:{data:{...b?{display_name:b}:{},...y?{referral_code:y}:{},...k?{signup_context:k}:{},...w?.utm_source?{utm_source:w.utm_source}:{},...w?.utm_medium?{utm_medium:w.utm_medium}:{},...w?.utm_campaign?{utm_campaign:w.utm_campaign}:{},...w?.utm_term?{utm_term:w.utm_term}:{},...w?.utm_content?{utm_content:w.utm_content}:{},...w?.gclid?{gclid:w.gclid}:{},...w?.fbclid?{fbclid:w.fbclid}:{},...w?.ttclid?{ttclid:w.ttclid}:{},...w?.msclkid?{msclkid:w.msclkid}:{},...w?.twclid?{twclid:w.twclid}:{},...w?.li_fat_id?{li_fat_id:w.li_fat_id}:{},...w?.landing_page?{landing_page:w.landing_page}:{},...w?.referrer_url?{referrer_url:w.referrer_url}:{}}}});S=_.data,N=_.error}catch(_){return console.error("[Auth] Sign-up network error:",_),{error:new Error("Unable to connect. Please check your internet connection and try again.")}}if(!N&&S.user){y&&Lj(),w&&N0();const _=Intl.DateTimeFormat().resolvedOptions().timeZone,C=Intl.DateTimeFormat().resolvedOptions().locale;_t("user_signed_up",{signup_method:"email",email:x,user_timezone:_,user_locale:C}),zh({subscription_status:"free",plan_type:"free",is_paid_user:!1,signup_date:new Date().toISOString(),user_timezone:_,user_locale:C}),W.from("profiles").update({user_timezone:_,user_locale:C}).eq("user_id",S.user.id).then(()=>{})}return{error:N}},f=async x=>{try{const{data:{session:g}}=await W.auth.getSession();if(!g?.access_token)return{error:new Error("Not authenticated. Please sign in again.")};const{data:b,error:j}=await W.functions.invoke("resend-verification-email",{headers:{Authorization:`Bearer ${g.access_token}`}});if(j)return{error:new Error(j.message||"Failed to resend verification email")};if(b?.error){const k=new Error(b.error);return b.retryAfter&&(k.retryAfter=b.retryAfter),{error:k}}return{error:null}}catch(g){return{error:g}}},p=async(x,g)=>{try{const{error:b}=await W.auth.signInWithPassword({email:x,password:g});return{error:b}}catch(b){return console.error("[Auth] Sign-in network error:",b),{error:new Error("Unable to connect. Please check your internet connection and try again.")}}},v=async()=>{localStorage.removeItem("testModeBannerDismissed"),Oj(),await W.auth.signOut(),t(null),a(null),o(null)};return s.jsx(S0.Provider,{value:{user:e,session:n,profile:i,isLoading:l,signUp:m,signIn:p,signOut:v,refreshProfile:h,resendVerificationEmail
567:f},children:r})}function Ee(){const r=u.useContext(S0);if(r===void 0)throw new Error("useAuth must be used within an AuthProvider");return r}const ei="test_mode_override",E0=u.createContext(void 0);function Gj({children:r}){const{user:e,isLoading:t}=Ee(),[n,a]=u.useState(!1),[i,o]=u.useState(()=>typeof window<"u"?localStorage.getItem(ei)==="true":!1),[l,d]=u.useState(!0),[c,h]=u.useState(()=>typeof window<"u"?sessionStorage.getItem("was_ever_authenticated")==="true":!1),m=u.useCallback(async()=>{if(!e){a(!1),d(!1);return}try{const{count:g,error:b}=await W.from("user_roles").select("*",{count:"exact",head:!0}).eq("user_id",e.id).in("role",["admin","superadmin","tester"]);b?(console.error("Error checking test mode eligibility:",b),a(!1)):a((g??0)>0)}catch(g){console.error("Error checking test mode eligibility:",g),a(!1)}finally{d(!1)}},[e]);u.useEffect(()=>{m()},[m]),u.useEffect(()=>{e&&(h(!0),sessionStorage.setItem("was_ever_authenticated","true"))},[e]),u.useEffect(()=>{if(!t&&!e&&c){const g=new URLSearchParams(window.location.search);g.has("success")||g.has("canceled")||(o(!1),localStorage.removeItem(ei),h(!1),sessionStorage.removeItem("was_ever_authenticated"))}},[e,t,c]);const f=u.useCallback(g=>{o(g),g?localStorage.setItem(ei,"true"):localStorage.removeItem(ei)},[]),p=u.useCallback(()=>{f(!i)},[i,f]),v=n&&!i;return s.jsx(E0.Provider,{value:{isEligible:n,isLiveModeOverride:i,isTestMode:v,isBannerVisible:!1,toggleMode:p,setLiveModeOverride:f,isLoading:l},children:r})}function ir(){const r=u.useContext(E0);if(r===void 0)throw new Error("useTestModeToggle must be used within a TestModeProvider");return r}const Oe={standard5:{price:50,yearlyPrice:500,credits:50,videos:5},standard10:{price:100,yearlyPrice:1e3,credits:100,videos:10},standard20:{price:200,yearlyPrice:2e3,credits:200,videos:20},standard30:{price:300,yearlyPrice:3e3,credits:300,videos:30},standard40:{price:400,yearlyPrice:4e3,credits:400,videos:40},standard50:{price:500,yearlyPrice:5e3,credits:500,videos:50},standard60:{price:600,yearlyPrice:6e3,credits:600,videos:60},standard80:{price:800,yearlyPrice:8e3,credits:800,videos:80},standard100:{price:1e3,yearlyPrice:1e4,credits:1e3,videos:100}},Xe={volume120:{price:1140,yearlyPrice:11400,credits:1200,videos:120,pricePerVideo:9.5},volume200:{price:1800,yearlyPrice:18e3,credits:2e3,videos:200,pricePerVideo:9},volume300:{price:2700,yearlyPrice:27e3,credits:3e3,videos:300,pricePerVideo:9},volume400:{price:3600,yearlyPrice:36e3,credits:4e3,videos:400,pricePerVideo:9},volume500:{price:4500,yearlyPrice:45e3,credits:5e3,videos:500,pricePerVideo:9},volume750:{price:6750,yearlyPrice:67500,credits:7500,videos:750,pricePerVideo:9},volume1000:{price:9e3,yearlyPrice:9e4,credits:1e4,videos:1e3,pricePerVideo:9}},yt={free:{price:0,yearlyPrice:0,credits:30},starter:{price:110,yearlyPrice:1100,credits:100},creator:{price:200,yearlyPrice:2e3,credits:200},pro500:{price:500,yearlyPrice:5e3,credits:500},pro1000:{price:1e3,yearlyPrice:1e4,credits:1e3},pro2000:{price:2e3,yearlyPrice:2e4,credits:2e3}},Yj={standard5:{monthly:{priceId:"price_1Sr6KJ4J1lTyTuE5cFa84Ai7",productId:"prod_TojnPVuk4i4hCh"},yearly:{priceId:"price_1Sr6Kh4J1lTyTuE56CnMO98j",productId:"prod_TojoXhsiO0KKlQ"}},standard10:{monthly:{priceId:"price_1Sr6L84J1lTyTuE58PJSAMq5",productId:"prod_TojoV3mIYSdqMd"},yearly:{priceId:"price_1Sr6Ld4J1lTyTuE5o87J67Ke",productId:"prod_TojpVqt16nekKW"}},standard20:{monthly:{priceId:"price_1Sr6Ls4J1lTyTuE599FHhZWy",productId:"prod_TojprZzt7emhLC"},yearly:{priceId:"price_1Sr6M94J1lTyTuE52idrzUZs",productId:"prod_TojpC5NOf7kLHn"}},standard30:{monthly:{priceId:"price_1Sr6MR4J1lTyTuE5H1dpw2gm",productId:"prod_Tojq8iDmHrnvKi"},yearly:{priceId:"price_1Sr6Mc4J1lTyTuE5r5N3TVWG",productId:"prod_Tojq2A1Omco43N"}},standard40:{monthly:{priceId:"price_1Sr6Mg4J1lTyTuE5eLd3czmD",productId:"prod_TojqUPbNjBvkOO"},yearly:{priceId:"price_1Sr6Mi4J1lTyTuE5h8GRGl5X",productId:"prod_Tojq7nSF1Tb7jU"}},standard50:{monthly:{priceId:"price_1Sr6Mj4J1lTyTuE5Uozl16uX",productId:"prod_Tojqz5IyE1AN7o"},yearly:{priceId:"price_1Sr6Ml4J1lTyTuE55mKF6BeD",productId:"prod_TojqOgC12T00rG"}},standard60:{monthly:{priceId:"price_1Sr6Mm4J1lTyTuE5GRSEnP4A",productId:"prod_TojqNLJBnm8Bwf"},yearly:{priceId:"price_1Sr6Mo4J1lTyTuE5EHoxSyOf",productId:"prod_TojqHv2aJjFnL6"}},standard80:{monthly:{priceId:"price_1Sr6Mp4J1lTyTuE56slriRND",productId:"prod_TojqpkIzQCyVXA"},yearly:{priceId:"price_1Sr6Mr4J1lTyTuE5y8V6q0DA",productId:"prod_Tojq9RA5Qf9PdR"}},standard100:{monthly:{priceId:"price_1Sr6Ms4J1lTyTuE5slqvN5KV",productId:"prod_Tojq5mb174k5NF"},yearly:{priceId:"price_1Sr6Mt4J1lTyTuE5AD2tOBPA",productId:"prod_TojqE9nlELwcuG"}},volume120:{monthly:{priceId:"price_1Sr6My4J1lTyTuE50Xq5PTM3",productId:"prod_Tojq3Sc5jEOA33"},yearly:{priceId:"price_1Sr6N04J1lTyTuE5ZBl4rnQo",productId:"prod_Tojq1jQqmuPX43"}},volume200:{monthly:{priceId:"price_1Sr6N24J1lTyTuE5wvyhdvR6",productId:"prod_TojqAHCz1zdrtM"},yearly:{priceId:"price_1Sr6N34J1lTyTuE5a9oARYBe",productId:"prod_TojqYrTXFvXryZ"}},volume300:{monthly:{priceId:"price_1Sr6N54J1lTyTuE5pxieuCn1",productId:"prod_TojqE43Q7CQmtL"},yearly:{priceId:"price_1Sr6N64J1lTyTuE5ow3aEb7u",productId:"prod_TojqO86C32e90r"}},volume400:{monthly:{priceId:"price_1Sr6N84J1lTyTuE5rwaUeYSk",productId:"prod_TojqFeN3avJgly"},yearly:{priceId:"price_1Sr6NA4J1lTyTuE5Ournk1B7",productId:"prod_TojqAosbz4aAov"}},volume500:{monthly:{priceId:"price_1Sr6NB4J1lTyTuE5H7KuCtdE",productId:"prod_TojqH0KOB8dc6F"},yearly:{priceId:"price_1Sr6ND4J1lTyTuE5zSTPaaZH",productId:"prod_TojqG4aj8DMQP2"}},volume750:{monthly:{priceId:"price_1Sr6NE4J1lTyTuE5Pio3Xjli",productId:"prod_TojqigNJ71GhAW"},yearly:{priceId:"price_1Sr6NG4J1lTyTuE5tLSWcIxq",productId:"prod_TojqOKvHFXXogV"}},volume1000:{monthly:{priceId:"price_1Sr6NI4J1lTyTuE5hcrdbh17",productId:"prod_Tojq7cxrajgjpt"},yearly:{priceId:"price_1Sr6NJ4J1lTyTuE5g74HwD7M",productId:"prod_TojrA2NVhk5V1M"}}},Zj={starter:{monthly:{priceId:"price_1SpMx84J1lTyTuE5G5WHOwsz",productId:"prod_TmwqjVb95lYGHx"},yearly:{priceId:"price_1SpMxI4J1lTyTuE5P7g52USs",productId:"prod_TmwrMQi6kC0ssq"}},creator:{monthly:{priceId:"price_1SpMxT4J1lTyTuE5gcp7uAEL",productId:"prod_TmwrOdleuA9OX0"},yearly:{priceId:"price_1SpMxd4J1lTyTuE5MYyxzlJg",productId:"prod_TmwrihWKMFU9Gr"}},pro500:{monthly:{priceId:"price_1SpMxn4J1lTyTuE5v2rN2rEE",productId:"prod_Tmwr6SQT8PotZG"},yearly:{priceId:"price_1SpMxy4J1lTyTuE5ma6U6gYG",productId:"prod_TmwrTD0aibGUSQ"}},pro1000:{monthly:{priceId:"price_1SpMyD4J1lTyTuE5qjPbA5SO",productId:"prod_Tmwr4V0HMzaxqI"},yearly:{priceId:"price_1SpxPh4J1lTyTuE53jRmkVcX",productId:"prod_TnYW2g41WtrmUm"}},pro2000:{monthly:{priceId:"price_1SpMyc4J1lTyTuE5EKcsK9id",productId:"prod_Tmwsbtm31g47xO"},yearly:{priceId:"price_1SpMym4J1lTyTuE5KnrGwjad",productId:"prod_TmwsXYWX5rBhYT"}}},Jj={starter:{monthly:{priceId:"price_1SpBNu4J1lTyTuE5Za7oRayD",productId:"prod_Tmktn1nh2CU4RN"},yearly:{priceId:"price_1SpBO44J1lTyTuE52XezC8iQ",productId:"prod_TmktMHINRYB9dz"}},creator:{monthly:{priceId:"price_1SpBOH4J1lTyTuE5mlSk3DEZ",productId:"prod_TmkuWCGZjTjGMu"},yearly:{priceId:"price_1SpBOa4J1lTyTuE5HkH5Qn9w",productId:"prod_TmkuzaB7oLIEf3"}},pro500:{monthly:{priceId:"price_1SpBOk4J1lTyTuE5dBUWySam",productId:"prod_Tmku9OHVt9pYbk"},yearly:{priceId:"price_1SpBOv4J1lTyTuE5fMHIksDK",productId:"prod_TmkuecyCQtV8Tu"}},pro1000:{monthly:{priceId:"price_1SpBPl4J1lTyTuE5JZIK0x6n",productId:"prod_Tmkv6xfN4nwlCK"},yearly:{priceId:"price_1SpBRl4J1lTyTuE5gsPijuNm",productId:"prod_TmkxXTJIWM05By"}},pro2000:{monthly:{priceId:"price_1SpBRw4J1lTyTuE5OZHKI0Qm",productId:"prod_TmkxHj7LuuigVG"},yearly:{priceId:"price_1SpBSC4J1lTyTuE5kNP0tykA",productId:"prod_TmkyzWGBIziBzO"}}},Xj={standard5:{monthly:{priceId:"price_1Srbgm4J1lTyTuE5gOQPfjjH",productId:"prod_TpGDNmxdBAGP5T"},yearly:{priceId:"price_1Srbgn4J1lTyTuE5mKSi2aDA",productId:"prod_TpGDdm4bLCJLHu"}},standard10:{monthly:{priceId:"price_1Srbgn4J1lTyTuE5lmyYLiMY",productId:"prod_TpGDtJqhliDwM3"},yearly:{priceId:"price_1Srbgo4J1lTyTuE55va0ciDb",productId:"prod_TpGD2j44DgtQam"}},standard20:{monthly:{priceId:"price_1Srbgo4J1lTyTuE5I7nKHTm5",productId:"prod_TpGD9YFRkN80WB"},yearly:{priceId:"price_1Srbgp4J1lTyTuE5ChDWIg1w",productId:"prod_TpGD0DCYQc3Y0I"}},standard30:{monthly:{priceId:"price_1Srbgp4J1lTyTuE5bqN2OEe1",productId:"prod_TpGDXbbrN8PcNP"},yearly:{priceId:"price_1Srbgq4J1lTyTuE5wjIRrNBE",productId:"prod_TpGDruzrbyCGaR"}},standard40:{monthly:{priceId:"price_1Srbgq4J1lTyTuE5diK6sBHp",productId:"prod_TpGDDUYOasVGcA"},yearly:{priceId:"price_1Srbgr4J1lTyTuE52WROSM2X",productId:"prod_TpGDKAydCflmeX"}}
567,standard50:{monthly:{priceId:"price_1Srbgr4J1lTyTuE5lNSTsfWC",productId:"prod_TpGD2bOHc4kaDl"},yearly:{priceId:"price_1Srbgs4J1lTyTuE5UaCDtfcy",productId:"prod_TpGDbvK8wztAMz"}},standard60:{monthly:{priceId:"price_1Srbgs4J1lTyTuE5lZpO4lIG",productId:"prod_TpGDZd8mb2327j"},yearly:{priceId:"price_1Srbgt4J1lTyTuE55R8eTf3c",productId:"prod_TpGDOSD9DfP0PI"}},standard80:{monthly:{priceId:"price_1Srbgt4J1lTyTuE5VVpHmE1r",productId:"prod_TpGDZCONDuiXuI"},yearly:{priceId:"price_1Srbgu4J1lTyTuE5g9jemCNr",productId:"prod_TpGDuC3FAKgTgW"}},standard100:{monthly:{priceId:"price_1Srbgu4J1lTyTuE5UiOTp9ao",productId:"prod_TpGD8nercis8kc"},yearly:{priceId:"price_1Srbgv4J1lTyTuE5eu9y6ah0",productId:"prod_TpGDjuAsYcBYFB"}},volume120:{monthly:{priceId:"price_1Srbgv4J1lTyTuE54FnsBMct",productId:"prod_TpGDDd8mdTe0eY"},yearly:{priceId:"price_1Srbgw4J1lTyTuE50gkdZjEI",productId:"prod_TpGDtGmO5rkOAw"}},volume200:{monthly:{priceId:"price_1Srbgw4J1lTyTuE5kXH9Ggpd",productId:"prod_TpGDvHvUeYoBsC"},yearly:{priceId:"price_1Srbgx4J1lTyTuE5OIqXa1Q6",productId:"prod_TpGDOR6CY9q4wY"}},volume300:{monthly:{priceId:"price_1Srbgx4J1lTyTuE5IG1DVDsJ",productId:"prod_TpGD77bH6Xk1q9"},yearly:{priceId:"price_1Srbgy4J1lTyTuE539WSeOY5",productId:"prod_TpGDXDbkK0YYih"}},volume400:{monthly:{priceId:"price_1Srbgy4J1lTyTuE5tKUOihG3",productId:"prod_TpGDzRX8PWoAUW"},yearly:{priceId:"price_1Srbgz4J1lTyTuE5a7yoidEa",productId:"prod_TpGDaxoId68HNz"}},volume500:{monthly:{priceId:"price_1Srbgz4J1lTyTuE5hlsLawFo",productId:"prod_TpGDM9WQ3GXcWq"},yearly:{priceId:"price_1Srbh04J1lTyTuE5ytzMxi7D",productId:"prod_TpGDQdhs3N2TZI"}},volume750:{monthly:{priceId:"price_1Srbh04J1lTyTuE5tkOxWieX",productId:"prod_TpGDhwyfCmGk8j"},yearly:{priceId:"price_1Srbh04J1lTyTuE5FTT2To9N",productId:"prod_TpGDoHuKmVXegA"}},volume1000:{monthly:{priceId:"price_1Srbh14J1lTyTuE52KNcFe5F",productId:"prod_TpGDnV8ELjsWoT"},yearly:{priceId:"price_1Srbh14J1lTyTuE581GcFx6g",productId:"prod_TpGDKdkxjrmjQG"}}};function Ui(r){const e=r?Jj:Zj,t=r?Xj:Yj;return{standard5:{monthly:{...t.standard5.monthly,price:Oe.standard5.price,credits:Oe.standard5.credits},yearly:{...t.standard5.yearly,price:Oe.standard5.yearlyPrice,credits:Oe.standard5.credits*12}},standard10:{monthly:{...t.standard10.monthly,price:Oe.standard10.price,credits:Oe.standard10.credits},yearly:{...t.standard10.yearly,price:Oe.standard10.yearlyPrice,credits:Oe.standard10.credits*12}},standard20:{monthly:{...t.standard20.monthly,price:Oe.standard20.price,credits:Oe.standard20.credits},yearly:{...t.standard20.yearly,price:Oe.standard20.yearlyPrice,credits:Oe.standard20.credits*12}},standard30:{monthly:{...t.standard30.monthly,price:Oe.standard30.price,credits:Oe.standard30.credits},yearly:{...t.standard30.yearly,price:Oe.standard30.yearlyPrice,credits:Oe.standard30.credits*12}},standard40:{monthly:{...t.standard40.monthly,price:Oe.standard40.price,credits:Oe.standard40.credits},yearly:{...t.standard40.yearly,price:Oe.standard40.yearlyPrice,credits:Oe.standard40.credits*12}},standard50:{monthly:{...t.standard50.monthly,price:Oe.standard50.price,credits:Oe.standard50.credits},yearly:{...t.standard50.yearly,price:Oe.standard50.yearlyPrice,credits:Oe.standard50.credits*12}},standard60:{monthly:{...t.standard60.monthly,price:Oe.standard60.price,credits:Oe.standard60.credits},yearly:{...t.standard60.yearly,price:Oe.standard60.yearlyPrice,credits:Oe.standard60.credits*12}},standard80:{monthly:{...t.standard80.monthly,price:Oe.standard80.price,credits:Oe.standard80.credits},yearly:{...t.standard80.yearly,price:Oe.standard80.yearlyPrice,credits:Oe.standard80.credits*12}},standard100:{monthly:{...t.standard100.monthly,price:Oe.standard100.price,credits:Oe.standard100.credits},yearly:{...t.standard100.yearly,price:Oe.standard100.yearlyPrice,credits:Oe.standard100.credits*12}},volume120:{monthly:{...t.volume120.monthly,price:Xe.volume120.price,credits:Xe.volume120.credits},yearly:{...t.volume120.yearly,price:Xe.volume120.yearlyPrice,credits:Xe.volume120.credits*12}},volume200:{monthly:{...t.volume200.monthly,price:Xe.volume200.price,credits:Xe.volume200.credits},yearly:{...t.volume200.yearly,price:Xe.volume200.yearlyPrice,credits:Xe.volume200.credits*12}},volume300:{monthly:{...t.volume300.monthly,price:Xe.volume300.price,credits:Xe.volume300.credits},yearly:{...t.volume300.yearly,price:Xe.volume300.yearlyPrice,credits:Xe.volume300.credits*12}},volume400:{monthly:{...t.volume400.monthly,price:Xe.volume400.price,credits:Xe.volume400.credits},yearly:{...t.volume400.yearly,price:Xe.volume400.yearlyPrice,credits:Xe.volume400.credits*12}},volume500:{monthly:{...t.volume500.monthly,price:Xe.volume500.price,credits:Xe.volume500.credits},yearly:{...t.volume500.yearly,price:Xe.volume500.yearlyPrice,credits:Xe.volume500.credits*12}},volume750:{monthly:{...t.volume750.monthly,price:Xe.volume750.price,credits:Xe.volume750.credits},yearly:{...t.volume750.yearly,price:Xe.volume750.yearlyPrice,credits:Xe.volume750.credits*12}},volume1000:{monthly:{...t.volume1000.monthly,price:Xe.volume1000.price,credits:Xe.volume1000.credits},yearly:{...t.volume1000.yearly,price:Xe.volume1000.yearlyPrice,credits:Xe.volume1000.credits*12}},starter:{monthly:{...e.starter.monthly,price:yt.starter.price,credits:yt.starter.credits},yearly:{...e.starter.yearly,price:yt.starter.yearlyPrice,credits:yt.starter.credits}},creator:{monthly:{...e.creator.monthly,price:yt.creator.price,credits:yt.creator.credits},yearly:{...e.creator.yearly,price:yt.creator.yearlyPrice,credits:yt.creator.credits}},pro500:{monthly:{...e.pro500.monthly,price:yt.pro500.price,credits:yt.pro500.credits},yearly:{...e.pro500.yearly,price:yt.pro500.yearlyPrice,credits:yt.pro500.credits}},pro1000:{monthly:{...e.pro1000.monthly,price:yt.pro1000.price,credits:yt.pro1000.credits},yearly:{...e.pro1000.yearly,price:yt.pro1000.yearlyPrice,credits:yt.pro1000.credits}},pro2000:{monthly:{...e.pro2000.monthly,price:yt.pro2000.price,credits:yt.pro2000.credits},yearly:{...e.pro2000.yearly,price:yt.pro2000.yearlyPrice,credits:yt.pro2000.credits}}}}const Kj=Ui(!1),oa={free:0,standard5:5,standard10:10,standard20:20,standard30:30,standard40:40,standard50:50,standard60:60,standard80:80,standard100:100,volume120:120,volume200:200,volume300:300,volume400:400,volume500:500,volume750:750,volume1000:1e3,starter:10,creator:20,pro500:50,pro1000:100,pro2000:200},Qj=(r,e)=>{const t=oa[r]??0,n=Math.floor(e/10);return Math.max(t,n)},ek=(r,e,t)=>r||e>10&&t!=="free",ml={subscribed:!1,plan:"free",credits:0,creditAllocation:0,creditPackPurchases:0,freeTrialUsed:!1,subscriptionEnd:null,priceId:null,isYearly:!1,isTestMode:!1,stripeUnavailable:!1,stripeError:null,paidCredits:0,promoCredits:0,bonusCredits:0,freeCredits:0,freeCreditsLastReset:null,effectiveTier:0,hasActiveEntitlement:!1},C0=u.createContext(void 0);function tk({children:r}){const{session:e}=Ee(),{isTestMode:t,isLiveModeOverride:n}=ir(),[a,i]=u.useState(ml),[o,l]=u.useState(!0),d=u.useCallback(async(m=!1,f=!1)=>
567{if(!e?.access_token){i(ml),l(!1);return}try{const{data:p,error:v}=await W.functions.invoke("check-subscription",{headers:{Authorization:`Bearer ${e.access_token}`},body:{forceLiveMode:n}});if(v){const S=v.message||String(v),N=/401|auth|session|token|jwt|expired|unauthorized/i.test(S);if(N&&!f){console.debug("Subscription check: attempting session refresh");const{error:_}=await W.auth.refreshSession();if(!_)return d(m,!0)}if(m&&N){console.debug("Subscription check: skipping due to token refresh");return}throw v}n&&p?.stripe_unavailable&&p?.is_test_mode&&ne.warning(p?.stripe_error||"Live mode isn't configured. Checkout will fail until a live Stripe key is added.",{duration:6e3});const x=Kj[p.plan],g=p.credit_allocation||x?.monthly?.credits||10,b=p.plan||"free",j=p.subscribed||!1,k=Qj(b,g),y=ek(j,g,b),w={subscribed:j,plan:b,credits:p.credits??0,creditAllocation:g,creditPackPurchases:p.credit_pack_purchases??0,freeTrialUsed:p.free_trial_used||!1,subscriptionEnd:p.subscription_end||null,priceId:p.price_id||null,isYearly:p.is_yearly||!1,isTestMode:p.is_test_mode||!1,stripeUnavailable:p.stripe_unavailable||!1,stripeError:p.stripe_error||null,paidCredits:p.paid_credits??0,promoCredits:p.promo_credits??0,bonusCredits:p.bonus_credits??0,freeCredits:p.free_credits??0,freeCreditsLastReset:p.free_credits_last_reset??null,effectiveTier:k,hasActiveEntitlement:y};i(S=>S.subscribed!==w.subscribed||S.plan!==w.plan||S.credits!==w.credits||S.creditAllocation!==w.creditAllocation||S.freeTrialUsed!==w.freeTrialUsed||S.subscriptionEnd!==w.subscriptionEnd||S.isTestMode!==w.isTestMode||S.paidCredits!==w.paidCredits||S.promoCredits!==w.promoCredits||S.bonusCredits!==w.bonusCredits||S.freeCredits!==w.freeCredits?w:S)}catch(p){console.error("Error checking subscription:",p),m||i(ml)}finally{l(!1)}},[e?.access_token,n]),c=async(m,f,p)=>
567{if(!e?.access_token)throw new Error("Must be logged in to subscribe");if(a.stripeUnavailable&&n)throw new Error(a.stripeError||"Live mode is not configured. Please switch back to Test Mode or contact support.");const{data:v,error:x}=await W.auth.refreshSession();if(x||!v.session?.access_token)throw console.error("Session refresh failed:",x),new Error("Session expired. Please log in again.");const g=v.session.access_token,b=t&&!n,j=n,y=Ui(b)[m];if(!y)throw new Error(`Invalid plan: ${m}`);const w=f?y.yearly.priceId:y.monthly.priceId;console.log(`Starting checkout with price: ${w} (${b?"TEST":"LIVE"} mode, override: ${j})`),_t("checkout_started",{plan_type:m,price:f?y.yearly.price:y.monthly.price,billing_cycle:f?"yearly":"monthly"});const{data:S,error:N}=await W.functions.invoke("create-checkout",{headers:{Authorization:`Bearer ${g}`},body:{priceId:w,isTestMode:b,forceLiveMode:j,mode:"subscription",acquisitionSource:"pricing_page",...p?.intent&&{intent:p.intent},...p?.intentJobId&&{intentJobId:p.intentJobId},...p?.returnTo&&{returnTo:p.returnTo}}});if(N)throw _t("payment_failed",{reason:N.message||"checkout_error",plan_type:m}),N;if(S?.error)throw _t("payment_failed",{reason:S.error,plan_type:m}),new Error(S.error);if(!S?.url)throw new Error("No checkout URL received from server");window.self!==window.top?window.open(S.url,"_blank"):window.location.href=S.url},h=async()=>
567{if(!e?.access_token)throw new Error("Must be logged in to manage subscription");const{data:m,error:f}=await W.functions.invoke("customer-portal",{headers:{Authorization:`Bearer ${e.access_token}`},body:{forceLiveMode:n}});if(f)throw f;if(m?.error)throw new Error(m.error);if(!m?.url)throw new Error("No portal URL received from server");window.self!==window.top?window.open(m.url,"_blank"):window.location.href=m.url};return u.useEffect(()=>{d()},[d]),u.useEffect(()=>{if(!e)return;const m=setInterval(()=>d(!0),12e4);return()=>clearInterval(m)},[e,d]),u.useEffect(()=>{if(!e?.user?.id)return;const m=W.channel("credits-realtime").on("postgres_changes",{event:"UPDATE",schema:"public",table:"profiles",filter:`user_id=eq.${e.user.id}`},()=>{setTimeout(()=>d(!0),500)}).subscribe();return()=>{W.removeChannel(m)}},[e?.user?.id,d]),s.jsx(C0.Provider,{value:{subscription:a,isLoading:o,checkSubscription:d,startCheckout:c,openCustomerPortal:h},children:r})}function Ns(){const r=u.useContext(C0);if(r===void 0)throw new Error("useSubscription must be used within a SubscriptionProvider");return r}function rk(r){if(!r.is_active)return!1;const e=!!r.heygen_avatar_id,t=!!r.preview_video_url;if(!e&&!t)return!1;if(e){const n=r.heygen_training_status;if(n&&n!=="completed")return!1}return!0}const T0=u.createContext(void 0),sk=5*60*1e3,nk=2*60*1e3;let xi=null,vi=null,la=null,ca=null;function ak({children:r}){const[e,t]=u.useState(!1),[n,a]=u.useState([]),[i,o]=u.useState(!0),[l,d]=u.useState(null),c=u.useCallback(async(y=!1,w=e)=>{const S=w?vi:xi,N=w?ca:la,_=Date.now();if(!y&&S&&N&&_-N<sk){console.log(`[ActorsCache] Using ${w?"TEST":"LIVE"} cache (age: ${Math.round((_-N)/1e3)}s)`),a(S),o(!1);return}o(!0),d(null);try{console.log(`[ActorsCache] Fetching ${w?"TEST":"LIVE"} mode actors...`);const{data:{session:C}}=await W.auth.getSession(),O=C?.user?.id,R=` 568 id, name, style, image_url, preview_video_url, 569 is_active, is_featured, is_hero_featured, is_demo_featured, is_test_mode, 570 gender, age_group, demographic, emotion, skin_tone, situation, tags, 571 aspect_ratio, showcase_order, showcase_categories, display_order, 572 hero_order, demo_order, creator_id, creator_page_order, is_creator_page_featured, 573 heygen_avatar_id, heygen_voice_id, heygen_training_status, elevenlabs_voice_id, 574 view_count, created_at, owner_id, is_private, creation_method, actor_type, 575 heygen_motion_avatar_id, motion_status, motion_prompt, motion_type, motion_error, 576 accessories, ethnicity, region 577 `,M=1e3;let L=[],A=0,V=!0;for(;V;){const se=A*M,re=se+M-1;let Z=W.from("actors").select(R).eq("is_active",!0).eq("is_test_mode",w);O?Z=Z.or(`is_private.eq.false,is_private.is.null,owner_id.eq.${O}`):Z=Z.or("is_private.eq.false,is_private.is.null");const{data:P,error:E}=await Z.order("showcase_order",{ascending:!0,nullsFirst:!1}).order("is_featured",{ascending:!1}).order("name",{ascending:!0}).range(se,re);if(E)throw E;const U=P||[];L=L.concat(U),V=U.length===M,A++}const G=L;w?(vi=G,ca=Date.now()):(xi=G,la=Date.now()),console.log(`[ActorsCache] Loaded ${G.length} ${w?"TEST":"LIVE"} actors`),a(G)}catch(C){console.error("Error fetching actors:",C),d(C instanceof Error?C:new Error("Failed to fetch actors"))}finally{o(!1)}},[e]);u.useEffect(()=>{c(!1,e)},[e,c]);const h=u.useMemo(()=>{const y=new Map;return n.forEach(w=>y.set(w.id,w)),y},[n]),m=u.useCallback(y=>h.get(y),[h]),f=u.useMemo(()=>n.filter(y=>y.is_featured),[n]),p=u.useMemo(()=>n.filter(y=>y.is_active&&y.preview_video_url),[n]),v=u.useMemo(()=>n.filter(rk),[n]),x=u.useCallback(async(y=nk)=>{const w=e?ca:la,S=Date.now();(!w||S-w>=y)&&(console.log(`[ActorsCache] ${e?"TEST":"LIVE"} cache stale (age: ${w?Math.round((S-w)/1e3):"never"}s), refreshing...`),await c(!0,e))},[c,e]),g=u.useMemo(()=>{const y=e?ca:la;return y?Date.now()-y:null},[n,e]),b=u.useCallback(y=>{console.log(`[ActorsCache] Switching to ${y?"TEST":"LIVE"} mode`),t(y)},[]),j=u.useCallback(y=>{const w=y;a(S=>{if(S.some(_=>_.id===w.id))return S;const N=[...S,w];return e?vi=N:xi=N,N})},[e]),k=u.useMemo(()=>({actors:n,isLoading:i,error:l,refetch:()=>c(!0,e),refreshIfStale:x,getActorById:m,featuredActors:f,activeActors:p,generationReadyActors:v,cac
577heAge:g,isTestMode:e,setTestMode:b,addActorToCache:j}),[n,i,l,c,x,m,f,p,v,g,e,b,j]);return s.jsx(T0.Provider,{value:k,children:r})}function PA(){const r=u.useContext(T0);if(r===void 0)throw new Error("useActorsCache must be used within an ActorsCacheProvider");return r}function AA(){xi=null,vi=null,la=null,ca=null}let zr=null,Ms=null;const ik=5*60*1e3,P0=u.createContext(null);function ok({children:r}){const{user:e}=Ee(),{isTestMode:t}=ir(),[n,a]=u.useState(zr),[i,o]=u.useState(!zr&&!!e),[l,d]=u.useState(null),c=u.useCallback(async(v=!1)=>{if(!e){a(null),o(!1);return}if(!v&&zr&&Ms&&Date.now()-Ms<ik){a(zr),o(!1);return}try{o(!0),d(null);const{data:x,error:g}=await W.from("creator_profiles").select("*").eq("user_id",e.id).maybeSingle();if(g)throw g;if(x){const b=x;zr=b,Ms=Date.now(),a(b)}else zr=null,Ms=null,a(null)}catch(x){console.error("[CreatorProfileCache] Error fetching profile:",x),d(x instanceof Error?x:new Error("Failed to fetch creator profile"))}finally{o(!1)}},[e]),h=u.useCallback(v=>{if(!n)return;const x={...n,...v};zr=x,Ms=Date.now(),a(x)},[n]),m=u.useCallback(()=>{zr=null,Ms=null,a(null)},[]);u.useEffect(()=>{e?c():m()},[e,c,m]);const f=u.useMemo(()=>{if(!n)return null;const v=n;return{...n,available_balance:t?v.test_available_balance??0:n.available_balance??0,pending_balance:t?v.test_pending_balance??0:n.pending_balance??0,total_earnings:t?v.test_total_earnings??0:n.total_earnings??0,total_usages:t?v.test_total_usages??0:n.total_usages??0}},[n,t]),p=u.useMemo(()=>({profile:f,isLoading:i,error:l,refetch:c,updateProfile:h,invalidateCache:m}),[f,i,l,c,h,m]);return s.jsx(P0.Provider,{value:p,children:r})}function IA(){const r=u.useContext(P0);if(!r)throw new Error("useCreatorProfile must be used within a CreatorProfileProvider");return r}function RA(){zr=null,Ms=null}const Yh=new Map;function Pe({children:r}){const{user:e,isLoading:t}=Ee(),n=ot(),[a,i]=u.useState(!e),[o,l]=u.useState(()=>e?Yh.get(e.id)??null:null),d=u.useRef(!1),c=u.useRef(null);if(u.useEffect(()=>{if(d.current)return;if(d.current=!0,e){i(!1);return}(async()=>{try{await W.auth.getSession()}catch(m){console.error("Session verification error:",m)}finally{i(!1)}})()},[e]),u.useEffect(()=>{const{data:{subscription:h}}=W.auth.onAuthStateChange((m,f)=>{f&&i(!1)});return()=>h.unsubscribe()},[]),u.useEffect(()=>{e&&(async()=>{if(!e){l(null),c.current=null;return}if(c.current!==e.id){c.current=e.id;try{const{data:m,error:f}=await W.from("profiles").select("is_suspended").eq("user_id",e.id).single();if(f){console.error("Error checking suspension status:",f),l(!1);return}const p=m?.is_suspended??!1;Yh.set(e.id,p),l(p)}catch(m){console.error("Error checking suspension status:",m),l(!1)}}})()},[e]),t||a)return s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-primary border-t-transparent rounded-full"})});if(!e){const h=encodeURIComponent(`${n.pathname}${n.search}${n.hash}`);return s.jsx(Se,{to:`/auth?redirect=${h}`,replace:!0})}return o===null?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-primary border-t-transparent rounded-full"})}):o?s.jsx(Se,{to:"/account-suspended",replace:!0}):s.jsx(s.Fragment,{children:r})}function Ss(){const{user:r}=Ee(),[e,t]=u.useState("user"),[n,a]=u.useState(!0),i=u.useCallback(async()=>{if(!r){t("user"),a(!1);return}try{const{data:o,error:l}=await W.from("user_roles").select("role").eq("user_id",r.id);if(l)console.error("Error fetching user roles:",l),t("user");else{const d=o?.map(c=>c.role)||[];d.includes("superadmin")?t("superadmin"):d.includes("admin")?t("admin"):d.includes("mod")?t("mod"):d.includes("tester")?t("tester"):t("user")}}catch(o){console.error("Error fetching user role:",o),t("user")}finally{a(!1)}},[r]);return u.useEffect(()=>{i()},[i]),{role:e,isSuperAdmin:e==="superadmin",isAdmin:e==="admin",isMod:e==="mod",isTester:e==="tester",isAdminOrAbove:e==="superadmin"||e==="admin",canAccessSupport:["superadmin","admin","mod"].includes(e),isLoading:n,refetch:i}}function pl({children:r,allowedRoles:e,fallback:t="/dashboard"}){const{user:n}=Ee(),{role:a,isLoading:i}=Ss();return i||!n?s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx(Mt,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):e.includes(a)?s.jsx(s.Fragment,{children:r}):s.jsx(Se,{to:t,replace:!0})}function lk(){const{pathname:r}=ot();return u.useEffect(()=>{window.location.hash||window.scrollTo({top:0,left:0,behavior:"instant"})},[r]),null}function ck(){const r=ot(),[e,t]=u.useState(!1),[n,a]=u.useState(0),i=u.useRef(r.pathname);return u.useEffect(()=>{if(i.current!==r.pathname){i.current=r.pathname,t(!0),a(0);const o=setTimeout(()=>a(40),50),l=setTimeout(()=>
577a(70),150),d=setTimeout(()=>a(100),300),c=setTimeout(()=>{t(!1),a(0)},500);return()=>{clearTimeout(o),clearTimeout(l),clearTimeout(d),clearTimeout(c)}}},[r.pathname]),s.jsx(pt,{children:e&&s.jsx(ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},className:"fixed top-0 left-0 right-0 z-[100] h-0.5 bg-primary/20",children:s.jsx(ae.div,{className:"h-full bg-gradient-to-r from-primary to-accent shadow-[0_0_10px_hsl(var(--primary))]",initial:{width:"0%"},animate:{width:`${n}%`},transition:{duration:.15,ease:"easeOut"}})})})}const sn=u.memo(function({children:e,instant:t=!1}){return t?s.jsx(s.Fragment,{children:e}):s.jsx(ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeOut"},children:e})});async function Zh(r){const{data:e,error:t}=await W.from("site_campaigns").select("id, name, code, discount_percent, banner_title, banner_subtitle, banner_cta_text, banner_cta_url, show_countdown, target_audience, starts_at, ends_at, applies_to_subscriptions, applies_to_packs, is_test_mode").eq("is_active",!0).eq("is_test_mode",r).or("ends_at.is.null,ends_at.gt.now()").gte("starts_at",new Date(Date.now()-2592e6).toISOString()).order("created_at",{ascending:!1}).limit(1).maybeSingle();return t?(console.error("Error fetching campaign:",t),null):e}function Fa(){const{user:r,isLoading:e}=Ee(),{subscription:t,isLoading:n}=Ns(),{isTestMode:a,isEligible:i,isLoading:o}=ir(),[l,d]=u.useState(null),c=i&&a,{data:h=null,isLoading:m}=Pl({queryKey:["site-campaign",c],queryFn:()=>Zh(c),enabled:!o,staleTime:5*60*1e3,gcTime:10*60*1e3}),f=c&&h===null&&!m,{data:p=null,isLoading:v}=Pl({queryKey:["site-campaign",!1],queryFn:()=>Zh(!1),enabled:f,staleTime:5*60*1e3,gcTime:10*60*1e3}),x=h??(f?p:null),g=u.useMemo(()=>!x||new Date(x.starts_at)>new Date?null:x,[x]),b=m||o||f&&v;u.useEffect(()=>{if(!g?.ends_at||!g.show_countdown){d(null);return}const k=()=>{const w=new Date().getTime(),N=new Date(g.ends_at).getTime()-w;if(N<=0){d(null);return}d({days:Math.floor(N/(1e3*60*60*24)),hours:Math.floor(N%(1e3*60*60*24)/(1e3*60*60)),minutes:Math.floor(N%(1e3*60*60)/(1e3*60)),seconds:Math.floor(N%(1e3*60)/1e3)})};k();const y=setInterval(k,1e3);return()=>clearInterval(y)},[g?.ends_at,g?.show_countdown]);const j=u.useMemo(()=>{if(!g||e||n||o||g.is_test_mode&&!i||g.ends_at&&new Date(g.ends_at)<new Date||new Date(g.starts_at)>new Date)return!1;switch(g.target_audience){case"all":return!0;case"guests_only":return!r;case"non_subscribers":return!t?.subscribed;case"non_purchasers":return!t?.subscribed&&(t?.creditPackPurchases??0)===0;case"new_users":if(!r)return!1;const y=r.created_at;if(!y)return!1;const w=new Date(Date.now()-7*24*60*60*1e3);return new Date(y)>w;default:return!0}},[g,e,n,o,i,r,t]);return{campaign:g,isLoading:b,shouldShowBanner:j,timeRemaining:l}}const xc="promoBannerDismissedSession",dk="--promo-banner-height",A0=["/verify-email","/auth","/dashboard","/create","/settings"];function uk(){const{user:r,isLoading:e}=Ee(),{isBannerVisible:t}=ir(),{campaign:n}=Fa(),a=ot(),i=u.useRef(null),[o,l]=u.useState(()=>sessionStorage.getItem(xc)==="true"),d=u.useMemo(()=>A0.some(f=>a.pathname.startsWith(f)),[a.pathname]),c=u.useMemo(()=>!e&&!r&&!t&&!o&&!d,[e,r,t,o,d]),h=()=>{sessionStorage.setItem(xc,"true"),l(!0),window.dispatchEvent(new CustomEvent("promo-banner-dismissed"))},m=f=>{document.documentElement.style.setProperty(dk,`${f}px`)};return u.useLayoutEffect(()=>{if(!c){m(0);return}const f=i.current;if(!f)return;const p=()=>{requestAnimationFrame(()=>{const x=i.current?.offsetHeight??0;m(x)})};p();const v=new ResizeObserver(()=>p());return v.observe(f),window.addEventListener("resize",p),()=>{v.disconnect(),window.removeEventListener("resize",p)}},[c]),u.useEffect(()=>{c||m(0)},[c]),c?s.jsx(pt,{children:s.jsx(ae.div,{ref:i,initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"fixed top-0 left-0 right-0 z-[60] bg-gradient-to-r from-primary via-accent to-primary",children:s.jsxs("div",{className:"container px-4 py-2.5 flex items-center justify-between",children:[s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-medium text-banner-foreground",children:[s.jsx(Dt,{className:"w-4 h-4"}),n?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"hidden sm:inline font-bold text-base",children:["3 videos/month + ",n.discount_percent,"% OFF all plans!"]}),s.jsxs("span",{className:"sm:hidden font-bold text-base",children:["3 videos/mo + ",n.discount_percent,"% OFF!"]}),s.jsx("span",{className:"hidden sm:inline opacity-90",children:"â Limited time"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-bold text-base",children:"3 videos/month"}),s.jsx("span",{className:"hidden sm:inline opacity-90",children:"â resets monthly ⢠2-min delivery"}),s.jsx("span",{className:"sm:hidden opacity-80",children:"⢠Resets monthly"})]})]}),s.jsx(ie,{size:"sm",variant:"secondary",className:"h-7 px-3 text-xs font-semibold bg-background text-foreground hover:bg-background/90",asChild:!0,children:s.jsxs(be,{to:"/auth?mode=signup",children:["Create Now",s.jsx(nr,{className:"w-3 h-3 ml-1"})]})})]}),s.jsx("div",{className:"flex-1 flex justify-end",children:s.jsx(ie,{variant:"ghost",size:"sm",onClick:h,className:"h-6 w-6 p-0 text-banner-foreground
577/80 hover:text-banner-foreground hover:bg-white/10","aria-label":"Dismiss banner",children:s.jsx(lt,{className:"w-4 h-4"})})})]})})}):null}function hk(){const{user:r,isLoading:e}=Ee(),{isBannerVisible:t}=ir(),n=ot(),[a,i]=u.useState(()=>sessionStorage.getItem(xc)==="true");u.useEffect(()=>{const l=()=>{i(!0)};return window.addEventListener("promo-banner-dismissed",l),()=>window.removeEventListener("promo-banner-dismissed",l)},[]);const o=u.useMemo(()=>A0.some(l=>n.pathname.startsWith(l)),[n.pathname]);return!e&&!r&&!t&&!a&&!o}function So(r){const[e,t]=u.useState(!1),[n,a]=u.useState(!1),[i,o]=u.useState("draft"),[l,d]=u.useState("not_started"),[c,h]=u.useState(null),[m,f]=u.useState(0),[p,v]=u.useState(!0),x=u.useCallback(async()=>{if(!r){v(!1),t(!1),h(null);return}v(!0);try{const{data:g,error:b}=await W.from("creator_profiles").select("*").eq("user_id",r).maybeSingle();b?(console.error("Error checking creator status:",b),t(!1),h(null)):g?(t(!0),h(g),a(g.profile_status==="active"),o(g.profile_status||"draft"),d(g.heygen_verification_status||"not_started"),f(Number(g.available_balance)||0)):(t(!1),h(null))}catch(g){console.error("Error checking creator status:",g),t(!1),h(null)}finally{v(!1)}},[r]);return u.useEffect(()=>{x()},[x]),{isCreator:e,isVerified:n,profileStatus:i,heygenStatus:l,creatorProfile:c,availableBalance:m,isLoading:p,refetch:x}}const I0=u.createContext(void 0),As="vidacious_workspace",mk={studio:"/dashboard",creator:"/creator-dashboard",moderator:"/moderator-dashboard",admin:"/admin"};function pk({children:r}){const{user:e}=Ee(),{isCreator:t,isLoading:n,refetch:a}=So(e?.id),{isAdminOrAbove:i,canAccessSupport:o,isLoading:l}=Ss(),d=Xt(),c=ot(),h=!n&&!l,m=u.useRef(!1),[f,p]=u.useState(()=>{const y=localStorage.getItem(As);return y&&["studio","creator","moderator","admin"].includes(y)?y:"studio"}),v=!h,x=["/creators/onboarding","/creators/become","/creators/submissions","/creators/earnings","/creators/insights","/creators/payouts","/creators/settings","/creators/avatar-setup","/creators/content","/creators/academy","/creators/my-clone"],b=c.pathname==="/creator-dashboard"||x.some(y=>c.pathname.startsWith(y)),j=$.useMemo(()=>{const y=["studio"];return t&&y.push("creator"),i?(y.push("moderator"),y.push("admin")):o&&y.push("moderator"),y},[t,i,o]);u.useEffect(()=>{if(h&&(m.current=!0,!j.includes(f))){const y=c.pathname==="/creators/onboarding"||c.pathname==="/creators/avatar-setup"||c.pathname.startsWith("/creators/become")||c.pathname==="/creators/my-clone";if(f==="creator"&&y)return;console.log("[Workspace] User lacks access to",f,"- switching to Studio"),p("studio"),localStorage.setItem(As,"studio"),f==="creator"&&c.pathname==="/creator-dashboard"&&d("/dashboard",{replace:!0})}},[j,f,h,c.pathname,d]),u.useEffect(()=>{c.pathname.startsWith("/admin")?i&&f!=="admin"&&(p("admin"),localStorage.setItem(As,"admin")):c.pathname.startsWith("/moderator-dashboard")?(i||o)&&f!=="moderator"&&(p("moderator"),localStorage.setItem(As,"moderator")):((c.pathname==="/creators/onboarding"||c.pathname==="/creators/avatar-setup"||c.pathname==="/creators/my-clone")&&f!=="creator"||b&&t&&f!=="creator")&&(p("creator"),localStorage.setItem(As,"creator"))},[c.pathname,i,o,f,b,t,d]);const k=u.useCallback(y=>{if(!j.includes(y))return;p(y),localStorage.setItem(As,y),localStorage.setItem("workspace_explicitly_set","true");const w=mk[y];c.pathname!==w&&d(w)},[j,d,c.pathname]);return s.jsx(I0.Provider,{value:{currentWorkspace:f,availableWorkspaces:j,switchWorkspace:k,refetchCreatorStatus:a,isLoading:v},children:r})}function Eo(){const r=u.useContext(I0);if(r===void 0)throw new Error("useWorkspaceContext must be used within a WorkspaceProvider");return r}const vc=vy,yc=yy,Bi=u.forwardRef(({className:r,align:e="center",sideOffset:t=4,...n},a)=>s.jsx(xy,{children:s.jsx(bp,{ref:a,align:e,sideOffset:t,className:Y("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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]:sli
577de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...n})}));Bi.displayName=bp.displayName;function fk(r){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",e.appendChild(t),t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}const R0=$.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Va=()=>{const r=$.useContext(R0);if(!r)throw new Error("useDrawerContext must be used within a Drawer.Root");return r};fk(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( 578[data-state=closed] 579){opacity:0}
579[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const gk=24,xk=typeof window<"u"?u.useLayoutEffect:u.useEffect;function Jh(...r){return(...e)=>{for(let t of r)typeof t=="function"&&t(...e)}}function vk(){return Cd(/^Mac/)}function yk(){return Cd(/^iPhone/)}function Xh(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function bk(){return Cd(/^iPad/)||vk()&&navigator.maxTouchPoints>1}function M0(){return yk()||bk()}function Cd(r){return typeof window<"u"&&window.navigator!=null?r.test(window.navigator.platform):void 0}const fl=typeof document<"u"&&window.visualViewport;function Kh(r){let e=window.getComputedStyle(r);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function O0(r){for(Kh(r)&&(r=r.parentElement);r&&!Kh(r);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}const _k=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let ti=0,gl;function wk(r={}){let{isDisabled:e}=r;xk(()=>{if(!e)return ti++,ti===1&&M0()&&(gl=jk()),()=>{ti--,ti===0&&gl?.()}},[e])}function jk(){let r,e=0,t=m=>{r=O0(m.target),!(r===document.documentElement&&r===document.body)&&(e=m.changedTouches[0].pageY)},n=m=>{if(!r||r===document.documentElement||r===document.body){m.preventDefault();return}let f=m.changedTouches[0].pageY,p=r.scrollTop,v=r.scrollHeight-r.clientHeight;v!==0&&((p<=0&&f>e||p>=v&&f<e)&&m.preventDefault(),e=f)},a=m=>{let f=m.target;bc(f)&&f!==document.activeElement&&(m.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=m=>{let f=m.target;bc(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",fl&&(fl.height<window.innerHeight?requestAnimationFrame(()=>{Qh(f)}):fl.addEventListener("resize",()=>Qh(f),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},l=window.pageXOffset,d=window.pageYOffset,c=Jh(kk(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let h=Jh(Yn(document,"touchstart",t,{passive:!1,capture:!0}),Yn(document,"touchmove",n,{passive:!1,capture:!0}),Yn(document,"touchend",a,{passive:!1,capture:!0}),Yn(document,"focus",i,!0),Yn(window,"scroll",o));return()=>{c(),h(),window.scrollTo(l,d)}}function kk(r,e,t){let n=r.style[e];return r.style[e]=t,()=>{r.style[e]=n}}function Yn(r,e,t,n){return r.addEventListener(e,t,n),()=>{r.removeEventListener(e,t,n)}}function Qh(r){let e=document.scrollingElement||document.documentElement;for(;r&&r!==e;){let t=O0(r);if(t!==document.documentElement&&t!==document.body&&t!==r){let n=t.getBoundingClientRect().top,a=r.getBoundingClientRect().top,i=r.getBoundingClientRect().bottom;const o=t.getBoundingClientRect().bottom+gk;i>o&&(t.scrollTop+=a-n)}r=t.parentElement}}function bc(r){return r instanceof HTMLInputElement&&!_k.has(r.type)||r instanceof HTMLTextAreaElement||r instanceof HTMLElement&&r.isContentEditable}
579function Nk(r,e){typeof r=="function"?r(e):r!=null&&(r.current=e)}function Sk(...r){return e=>r.forEach(t=>Nk(t,e))}function D0(...r){return u.useCallback(Sk(...r),r)}const L0=new WeakMap;function kt(r,e,t=!1){if(!r||!(r instanceof HTMLElement))return;let n={};Object.entries(e).forEach(([a,i])=>{if(a.startsWith("--")){r.style.setProperty(a,i);return}n[a]=r.style[a],r.style[a]=i}),!t&&L0.set(r,n)}function Ek(r,e){if(!r||!(r instanceof HTMLElement))return;let t=L0.get(r);t&&(r.style[e]=t[e])}const Nt=r=>{switch(r){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return r}};function ri(r,e){if(!r)return null;const t=window.getComputedStyle(r),n=t.transform||t.webkitTransform||t.mozTransform;let a=n.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[Nt(e)?13:12]):(a=n.match(/^matrix\((.+)\)$/),a?parseFloat(a[1].split(", ")[Nt(e)?5:4]):null)}function Ck(r){return 8*(Math.log(r+1)-2)}function xl(r,e){if(!r)return()=>{};const t=r.style.cssText;return Object.assign(r.style,e),()=>{r.style.cssText=t}}function Tk(...r){return(...e)=>{for(const t of r)typeof t=="function"&&t(...e)}}const dt={DURATION:.5,EASE:[.32,.72,0,1]},$0=.4,Pk=.25,Ak=100,F0=8,Is=16,_c=26,vl="vaul-dragging";function V0(r){const e=$.useRef(r);return $.useEffect(()=>{e.current=r}),$.useMemo(()=>(...t)=>e.current==null?void 0:e.current.call(e,...t),[])}function Ik({defaultProp:r,onChange:e}){const t=$.useState(r),[n]=t,a=$.useRef(n),i=V0(e);return $.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),t}function z0({prop:r,defaultProp:e,onChange:t=()=>{}}){const[n,a]=Ik({defaultProp:e,onChange:t}),i=r!==void 0,o=i?r:n,l=V0(t),d=$.useCallback(c=>{if(i){const m=typeof c=="function"?c(r):c;m!==r&&l(m)}else a(c)},[i,r,a,l]);return[o,d]}function Rk({activeSnapPointProp:r,setActiveSnapPointProp:e,snapPoints:t,drawerRef:n,overlayRef:a,fadeFromIndex:i,onSnapPointChange:o,direction:l="bottom",container:d,snapToSequentialPoint:c}){const[h,m]=z0({prop:r,defaultProp:t?.[0],onChange:e}),[f,p]=$.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);$.useEffect(()=>{function N(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[]);const v=$.useMemo(()=>h===t?.[t.length-1]||null,[t,h]),x=$.useMemo(()=>t?.findIndex(N=>N===h),[t,h]),g=t&&t.length>0&&(i||i===0)&&!Number.isNaN(i)&&t[i]===h||!t,b=$.useMemo(()=>{const N=d?{width:d.getBoundingClientRect().width,height:d.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var _;return(_=t?.map(C=>{const O=typeof C=="string";let R=0;if(O&&(R=parseInt(C,10)),Nt(l)){const L=O?R:f?C*N.height:0;return f?l==="bottom"?N.height-L:-N.height+L:L}const M=O?R:f?C*N.width:0;return f?l==="right"?N.width-M:-N.width+M:M}))!=null?_:[]},[t,f,d]),j=$.useMemo(()=>x!==null?b?.[x]:null,[b,x]),k=$.useCallback(N=>{var _;const C=(_=b?.findIndex(O=>O===N))!=null?_:null;o(C),kt(n.current,{transition:`transform ${dt.DURATION}s cubic-bezier(${dt.EASE.join(",")})`,transform:Nt(l)?`translate3d(0, ${N}px, 0)`:`translate3d(${N}px, 0, 0)`}),b&&C!==b.length-1&&C!==i&&C<i?kt(a.current,{transition:`opacity ${dt.DURATION}s cubic-bezier(${dt.EASE.join(",")})`,opacity:"0"}):kt(a.current,{transition:`opacity ${dt.DURATION}s cubic-bezier(${dt.EASE.join(",")})`,opacity:"1"}),m(t?.[Math.max(C,0)])},[n.current,t,b,i,a,m]);$.useEffect(()=>{if(h||r){var N;const _=(N=t?.findIndex(C=>C===r||C===h))!=null?N:-1;b&&_!==-1&&typeof b[_]=="number"&&k(b[_])}},[h,r,t,b,k]);function y({draggedDistance:N,closeDrawer:_,velocity:C,dismissible:O}){if(i===void 0)return;const R=l==="bottom"||l==="right"?(j??0)-N:(j??0)+N,M=x===i-1,L=x===0,A=N>0;if(M&&kt(a.current,{transition:`opacity ${dt.DURATION}s cubic-bezier(${dt.EASE.join(",")})`}),!c&&C>2&&!A){O?_():k(b[0]);return}if(!c&&C>2&&A&&b&&t){k(b[t.length-1]);return}const V=b?.reduce((se,re)=>typeof se!="number"||typeof re!="number"?se:Math.abs(re-R)<Math.abs(se-R)?re:se),G=Nt(l)?window.innerHeight:window.innerWidth;if(C>$0&&Math.abs(N)<G*.4){const se=A?1:-1;if(se>0&&v){k(b[t.length-1]);return}if(L&&se<0&&O&&_(),x===null)return;k(b[x+se]);return}k(V)}function w({draggedDistance:N}){if(j===null)return;const _=l==="bottom"||l==="right"?j-N:j+N;(l==="bottom"||l==="right")&&_<b[b.length-1]||(l==="top"||l==="left")&&_>b[b.length-1]||kt(n.current,{transform:Nt(l)?`translate3d(0, ${_}px, 0)`:`translate3d(${_}px, 0, 0)`})}function S(N,_){if(!t||typeof x!="number"||!b||i===void 0)return null;const C=x===i-1;if(x>=i&&_)return 0;if(C&&!_)return 1;if(!g&&!C)return null;const R=C?x+1:x-1,M=C?b[R]-b[R-1]:b[R+1]-b[R],L=N/Math.abs(M);return C?1-L:L}return{isLastSnapPoint:v,activeSnapPoint:h,shouldFade:g,getPercentageDragged:S,setActiveSnapPoint:m,activeSnapPointIndex:x,onRelease:y,onDrag:w,snapPointsOffset:b}}const Mk=()=>()=>{};
579function Ok(){const{direction:r,isOpen:e,shouldScaleBackground:t,setBackgroundColorOnScale:n,noBodyStyles:a}=Va(),i=$.useRef(null),o=u.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-_c)/window.innerWidth}$.useEffect(()=>{if(e&&t){i.current&&clearTimeout(i.current);const d=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!d)return;Tk(n&&!a?xl(document.body,{background:"black"}):Mk,xl(d,{transformOrigin:Nt(r)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${dt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${dt.EASE.join(",")})`}));const c=xl(d,{borderRadius:`${F0}px`,overflow:"hidden",...Nt(r)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),i.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},dt.DURATION*1e3)}}},[e,t,o])}let Zn=null;function Dk({isOpen:r,modal:e,nested:t,hasBeenOpened:n,preventScrollRestoration:a,noBodyStyles:i}){const[o,l]=$.useState(()=>typeof window<"u"?window.location.href:""),d=$.useRef(0),c=$.useCallback(()=>{if(Xh()&&Zn===null&&r&&!i){Zn={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:m,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-d.current}px`,left:`${-m}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=f-window.innerHeight;p&&d.current>=f&&(document.body.style.top=`${-(d.current+p)}px`)}),300)}},[r]),h=$.useCallback(()=>{if(Xh()&&Zn!==null&&!i){const m=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Zn),window.requestAnimationFrame(()=>{if(a&&o!==window.location.href){l(window.location.href);return}window.scrollTo(f,m)}),Zn=null}},[o]);return $.useEffect(()=>{function m(){d.current=window.scrollY}return m(),window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m)}},[]),$.useEffect(()=>{t||!n||(r?(!window.matchMedia("(display-mode: standalone)").matches&&c(),e||window.setTimeout(()=>{h()},500)):h())},[r,n,o,e,t,c,h]),{restorePositionSetting:h}}function Lk({open:r,onOpenChange:e,children:t,onDrag:n,onRelease:a,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:l=!0,closeThreshold:d=Pk,scrollLockTimeout:c=Ak,dismissible:h=!0,handleOnly:m=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:v,fixed:x,modal:g=!0,onClose:b,nested:j,noBodyStyles:k,direction:y="bottom",defaultOpen:w=!1,disablePreventScroll:S=!0,snapToSequentialPoint:N=!1,preventScrollRestoration:_=!1,repositionInputs:C=!0,onAnimationEnd:O,container:R,autoFocus:M=!1}){var L,A;const[V=!1,G]=z0({defaultProp:w,prop:r,onChange:Ne=>{e?.(Ne),!Ne&&!j&&xt(),setTimeout(()=>{O?.(Ne)},dt.DURATION*1e3),Ne&&!g&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Ne||(document.body.style.pointerEvents="auto")}}),[se,re]=$.useState(!1),[Z,P]=$.useState(!1),[E,U]=$.useState(!1),J=$.useRef(null),te=$.useRef(null),D=$.useRef(null),ee=$.useRef(null),T=$.useRef(null),z=$.useRef(!1),q=$.useRef(null),ce=$.useRef(0),pe=$.useRef(!1),ke=$.useRef(0),de=$.useRef(null),_e=$.useRef(((L=de.current)==null?void 0:L.getBoundingClientRect().height)||0),$e=$.useRef(((A=de.current)==null?void 0:A.getBoundingClientRect().width)||0),st=$.useRef(0),Ae=$.useCallback(Ne=>{i&&Ne===Kt.length-1&&(te.current=new Date)},[]),{activeSnapPoint:We,activeSnapPointIndex:He,setActiveSnapPoint:et,onRelease:At,snapPointsOffset:Kt,onDrag:qt,shouldFade:Dr,getPercentageDragged:Nr}=Rk({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:v,drawerRef:de,fadeFromIndex:f,overlayRef:J,onSnapPointChange:Ae,direction:y,container:R,snapToSequentialPoint:N});wk({isDisabled:!V||Z||!g||E||!se||!C||!S});const{restorePositionSetting:xt}=Dk({isOpen:V,modal:g,nested:j,hasBeenOpened:se,preventScrollRestoration:_,noBodyStyles:k});function Vt(){return(window.innerWidth-_c)/window.innerWidth}function Qt(Ne){var Fe,Ye;
579!h&&!i||de.current&&!de.current.contains(Ne.target)||(_e.current=((Fe=de.current)==null?void 0:Fe.getBoundingClientRect().height)||0,$e.current=((Ye=de.current)==null?void 0:Ye.getBoundingClientRect().width)||0,P(!0),D.current=new Date,M0()&&window.addEventListener("touchend",()=>z.current=!1,{once:!0}),Ne.target.setPointerCapture(Ne.pointerId),ce.current=Nt(y)?Ne.pageY:Ne.pageX)}function Ge(Ne,Fe){var Ye,Ze;let Ve=Ne;const ct=(Ye=window.getSelection())==null?void 0:Ye.toString(),jt=de.current?ri(de.current,y):null,K=new Date;if(Ve.hasAttribute("data-vaul-no-drag")||Ve.closest("[data-vaul-no-drag]"))return!1;if(y==="right"||y==="left")return!0;if(te.current&&K.getTime()-te.current.getTime()<500)return!1;if(jt!==null&&(y==="bottom"?jt>0:jt<0))return!0;if(ct&&ct.length>0)return!1;if(K.getTime()-((Ze=T.current)==null?void 0:Ze.getTime())<c&&jt===0||Fe)return T.current=K,!1;for(;Ve;){if(Ve.scrollHeight>Ve.clientHeight){if(Ve.scrollTop!==0)return T.current=new Date,!1;if(Ve.getAttribute("role")==="dialog")return!0}Ve=Ve.parentNode}return!0}function er(Ne){if(de.current&&Z){const Fe=y==="bottom"||y==="right"?1:-1,Ye=(ce.current-(Nt(y)?Ne.pageY:Ne.pageX))*Fe,Ze=Ye>0,Ve=i&&!h&&!Ze;if(Ve&&He===0)return;const ct=Math.abs(Ye),jt=document.querySelector("[data-vaul-drawer-wrapper]"),K=y==="bottom"||y==="top"?_e.current:$e.current;let X=ct/K;const ue=Nr(ct,Ze);if(ue!==null&&(X=ue),Ve&&X>=1||!z.current&&!Ge(Ne.target,Ze))return;if(de.current.classList.add(vl),z.current=!0,kt(de.current,{transition:"none"}),kt(J.current,{transition:"none"}),i&&qt({draggedDistance:Ye}),Ze&&!i){const ze=Ck(Ye),Pt=Math.min(ze*-1,0)*Fe;kt(de.current,{transform:Nt(y)?`translate3d(0, ${Pt}px, 0)`:`translate3d(${Pt}px, 0, 0)`});return}const we=1-X;if((Dr||f&&He===f-1)&&(n?.(Ne,X),kt(J.current,{opacity:`${we}`,transition:"none"},!0)),jt&&J.current&&o){const ze=Math.min(Vt()+X*(1-Vt()),1),Pt=8-X*8,Cr=Math.max(0,14-X*14);kt(jt,{borderRadius:`${Pt}px`,transform:Nt(y)?`scale(${ze}) translate3d(0, ${Cr}px, 0)`:`scale(${ze}) translate3d(${Cr}px, 0, 0)`,transition:"none"},!0)}if(!i){const ze=ct*Fe;kt(de.current,{transform:Nt(y)?`translate3d(0, ${ze}px, 0)`:`translate3d(${ze}px, 0, 0)`})}}}$.useEffect(()=>{var Ne;function Fe(){if(!de.current||!C)return;const Ye=document.activeElement;if(bc(Ye)||pe.current){var Ze;const Ve=((Ze=window.visualViewport)==null?void 0:Ze.height)||0,ct=window.innerHeight;let jt=ct-Ve;const K=de.current.getBoundingClientRect().height||0,X=K>ct*.8;st.current||(st.current=K);const ue=de.current.getBoundingClientRect().top;if(Math.abs(ke.current-jt)>60&&(pe.current=!pe.current),i&&i.length>0&&Kt&&He){const we=Kt[He]||0;jt+=we}if(ke.current=jt,K>Ve||pe.current){const we=de.current.getBoundingClientRect().height;let ze=we;we>Ve&&(ze=Ve-(X?ue:_c)),x?de.current.style.height=`${we-Math.max(jt,0)}px`:de.current.style.height=`${Math.max(ze,Ve-ue)}px`}else de.current.style.height=`${st.current}px`;i&&i.length>0&&!pe.current?de.current.style.bottom="0px":de.current.style.bottom=`${Math.max(jt,0)}px`}}return(Ne=window.visualViewport)==null||Ne.addEventListener("resize",Fe),()=>{var Ye;return(Ye=window.visualViewport)==null?void 0:Ye.removeEventListener("resize",Fe)}},[He,i,Kt]);function Tt(Ne){Wt(),b?.(),Ne||G(!1),setTimeout(()=>{i&&et(i[0])},dt.DURATION*1e3)}function tr(){if(!de.current)return;const Ne=document.querySelector("[data-vaul-drawer-wrapper]"),Fe=ri(de.current,y);kt(de.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${dt.DURATION}s cubic-bezier(${dt.EASE.join(",")})`}),kt(J.current,{transition:`opacity ${dt.DURATION}s cubic-bezier(${dt.EASE.join(",")})`,opacity:"1"}),o&&Fe&&Fe>0&&V&&kt(Ne,{borderRadius:`${F0}px`,overflow:"hidden",...Nt(y)?{transform:`scale(${Vt()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Vt()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${dt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${dt.EASE.join(",")})`},!0)}function Wt(){!Z||!de.current||(de.current.classList.remove(vl),z.current=!1,P(!1),ee.current=ne
579w Date)}function pr(Ne){if(!Z||!de.current)return;de.current.classList.remove(vl),z.current=!1,P(!1),ee.current=new Date;const Fe=ri(de.current,y);if(!Ge(Ne.target,!1)||!Fe||Number.isNaN(Fe)||D.current===null)return;const Ye=ee.current.getTime()-D.current.getTime(),Ze=ce.current-(Nt(y)?Ne.pageY:Ne.pageX),Ve=Math.abs(Ze)/Ye;if(Ve>.05&&(U(!0),setTimeout(()=>{U(!1)},200)),i){At({draggedDistance:Ze*(y==="bottom"||y==="right"?1:-1),closeDrawer:Tt,velocity:Ve,dismissible:h}),a?.(Ne,!0);return}if(y==="bottom"||y==="right"?Ze>0:Ze<0){tr(),a?.(Ne,!0);return}if(Ve>$0){Tt(),a?.(Ne,!1);return}var ct;const jt=Math.min((ct=de.current.getBoundingClientRect().height)!=null?ct:0,window.innerHeight);var K;const X=Math.min((K=de.current.getBoundingClientRect().width)!=null?K:0,window.innerWidth),ue=y==="left"||y==="right";if(Math.abs(Fe)>=(ue?X:jt)*d){Tt(),a?.(Ne,!1);return}a?.(Ne,!0),tr()}$.useEffect(()=>(V&&(kt(document.documentElement,{scrollBehavior:"auto"}),te.current=new Date),()=>{Ek(document.documentElement,"scrollBehavior")}),[V]);function Sr(Ne){const Fe=Ne?(window.innerWidth-Is)/window.innerWidth:1,Ye=Ne?-Is:0;q.current&&window.clearTimeout(q.current),kt(de.current,{transition:`transform ${dt.DURATION}s cubic-bezier(${dt.EASE.join(",")})`,transform:`scale(${Fe}) translate3d(0, ${Ye}px, 0)`}),!Ne&&de.current&&(q.current=setTimeout(()=>{const Ze=ri(de.current,y);kt(de.current,{transition:"none",transform:Nt(y)?`translate3d(0, ${Ze}px, 0)`:`translate3d(${Ze}px, 0, 0)`})},500))}function Er(Ne,Fe){if(Fe<0)return;const Ye=(window.innerWidth-Is)/window.innerWidth,Ze=Ye+Fe*(1-Ye),Ve=-Is+Fe*Is;kt(de.current,{transform:Nt(y)?`scale(${Ze}) translate3d(0, ${Ve}px, 0)`:`scale(${Ze}) translate3d(${Ve}px, 0, 0)`,transition:"none"})}function Mn(Ne,Fe){const Ye=Nt(y)?window.innerHeight:window.innerWidth,Ze=Fe?(Ye-Is)/Ye:1,Ve=Fe?-Is:0;Fe&&kt(de.current,{transition:`transform ${dt.DURATION}s cubic-bezier(${dt.EASE.join(",")})`,transform:Nt(y)?`scale(${Ze}) translate3d(0, ${Ve}px, 0)`:`scale(${Ze}) translate3d(${Ve}px, 0, 0)`})}return $.createElement(co,{defaultOpen:w,onOpenChange:Ne=>{!h&&!Ne||(Ne?re(!0):Tt(!0),G(Ne))},open:V},$.createElement(R0.Provider,{value:{activeSnapPoint:We,snapPoints:i,setActiveSnapPoint:et,drawerRef:de,overlayRef:J,onOpenChange:e,onPress:Qt,onRelease:pr,onDrag:er,dismissible:h,handleOnly:m,isOpen:V,isDragging:Z,shouldFade:Dr,closeDrawer:Tt,onNestedDrag:Er,onNestedOpenChange:Sr,onNestedRelease:Mn,keyboardIsOpen:pe,modal:g,snapPointsOffset:Kt,direction:y,shouldScaleBackground:o,setBackgroundColorOnScale:l,noBodyStyles:k,container:R,autoFocus:M}},t))}const H0=$.forwardRef(function({...r},e){const{overlayRef:t,snapPoints:n,onRelease:a,shouldFade:i,isOpen:o,modal:l}=Va(),d=D0(e,t),c=n&&n.length>0;return l?$.createElement(Nn,{onMouseUp:a,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":o&&c?"true":"false","data-vaul-snap-points-overlay":o&&i?"true":"false",...r}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});H0.displayName="Drawer.Overlay";const U0=$.forwardRef(function({onPointerDownOutside:r,style:e,onOpenAutoFocus:t,...n},a){const{drawerRef:i,onPress:o,onRelease:l,onDrag:d,keyboardIsOpen:c,snapPointsOffset:h,modal:m,isOpen:f,direction:p,snapPoints:v,container:x,handleOnly:g,autoFocus:b}=Va(),[j,k]=$.useState(!1),y=D0(a,i),w=$.useRef(null),S=$.useRef(null),N=$.useRef(!1),_=v&&v.length>0;Ok();const C=(R,M,L=0)=>{if(N.current)return!0;const A=Math.abs(R.y),V=Math.abs(R.x),G=V>A,se=["bottom","right"].includes(M)?1:-1;if(M==="left"||M==="right"){if(!(R.x*se<0)&&V>=0&&V<=L)return G}else if(!(R.y*se<0)&&A>=0&&A<=L)return!G;return N.current=!0,!0};$.useEffect(()=>{_&&window.requestAnimationFrame(()=>{k(!0)})},[]);function O(R){w.current=null,N.current=!1,l(R)}return $.createElement(Sn,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":j?"true":"false","data-vaul-snap-points":f&&_?"true":"false","data-vaul-custom-container":x?"true":"false",...n,ref:y,style:h&&h.length>0?{"--snap-point-height":`${h[0]}px`,...e}:e,onPointerDown:R=>{g||(n.onPointerDown==null||n.onPointerDown.call(n,R),w.current={x:R.pageX,y:R.pageY},o(R))},onOpenAutoFocus:R=>{t?.(R),b||R.preventDefault()},onPointerDownOutside:R=>{if(r?.(R),!m||R.defaultPrevented){R.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:R=>{if(!m){R.preventDefault();return}},onPointerMove:R=>{if(S.current=R,g||(n.onPointerMove==null||n.onPointerMove.call(n,R),!w.current))return;const M=R.pageY-w.current.y,L=R.pageX-w.current.x,A=R.pointerType==="touch"?10:2;C({x:L,y:M},p,A)?d(R):(Math.abs(L)>A||Math.abs(M)>A)&&(w.current=null)},onPointerUp:R=>{n.onPointerUp==null||n.onPointerUp.call(n,R),w.current=null,N.current=!1,l(R)},onPointerOut:R=>{n.onPointerOut==null||n.onPointerOut.call(n,R),O(S.current)},onContextMenu:R=>{n.onContextMenu==null||n.onContextMenu.call(n,R),O(S.current)}})});U0.displayName="Drawer.Content";const $k=250,Fk=120,Vk=$.forwardRef(function({preventCycle:r=!1,
579children:e,...t},n){const{closeDrawer:a,isDragging:i,snapPoints:o,activeSnapPoint:l,setActiveSnapPoint:d,dismissible:c,handleOnly:h,isOpen:m,onPress:f,onDrag:p}=Va(),v=$.useRef(null),x=$.useRef(!1);function g(){if(x.current){k();return}window.setTimeout(()=>{b()},Fk)}function b(){if(i||r||x.current){k();return}if(k(),(!o||o.length===0)&&c){a();return}if(l===o[o.length-1]&&c){a();return}const w=o.findIndex(N=>N===l);if(w===-1)return;const S=o[w+1];d(S)}function j(){v.current=window.setTimeout(()=>{x.current=!0},$k)}function k(){window.clearTimeout(v.current),x.current=!1}return $.createElement("div",{onClick:g,onPointerCancel:k,onPointerDown:y=>{h&&f(y),j()},onPointerMove:y=>{h&&p(y)},ref:n,"data-vaul-drawer-visible":m?"true":"false","data-vaul-handle":"","aria-hidden":"true",...t},$.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},e))});Vk.displayName="Drawer.Handle";function zk(r){const e=Va(),{container:t=e.container,...n}=r;return $.createElement(lo,{container:t,...n})}const Mr={Root:Lk,Content:U0,Overlay:H0,Trigger:uo,Portal:zk,Title:En,Description:Cn},B0=({shouldScaleBackground:r=!0,...e})=>s.jsx(Mr.Root,{shouldScaleBackground:r,...e});B0.displayName="Drawer";const Hk=Mr.Trigger,Uk=Mr.Portal,q0=u.forwardRef(({className:r,...e},t)=>s.jsx(Mr.Overlay,{ref:t,className:Y("fixed inset-0 z-50 bg-black/80",r),...e}));q0.displayName=Mr.Overlay.displayName;const W0=u.forwardRef(({className:r,children:e,...t},n)=>s.jsxs(Uk,{children:[s.jsx(q0,{}),s.jsxs(Mr.Content,{ref:n,className:Y("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",r),...t,children:[s.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),e]})]}));W0.displayName="DrawerContent";const G0=({className:r,...e})=>s.jsx("div",{className:Y("grid gap-1.5 p-4 text-center sm:text-left",r),...e});G0.displayName="DrawerHeader";const Bk=({className:r,...e})=>s.jsx("div",{className:Y("mt-auto flex flex-col gap-2 p-4",r),...e});Bk.displayName="DrawerFooter";const Y0=u.forwardRef(({className:r,...e},t)=>s.jsx(Mr.Title,{ref:t,className:Y("text-lg font-semibold leading-none tracking-tight",r),...e}));Y0.displayName=Mr.Title.displayName;const qk=u.forwardRef(({className:r,...e},t)=>s.jsx(Mr.Description,{ref:t,className:Y("text-sm text-muted-foreground",r),...e}));qk.displayName=Mr.Description.displayName;function Wk(r,e){return u.useReducer((t,n)=>e[t][n]??t,r)}var Td="ScrollArea",[Z0]=js(Td),[Gk,hr]=Z0(Td),J0=u.forwardRef((r,e)=>{const{__scopeScrollArea:t,type:n="hover",dir:a,scrollHideDelay:i=600,...o}=r,[l,d]=u.useState(null),[c,h]=u.useState(null),[m,f]=u.useState(null),[p,v]=u.useState(null),[x,g]=u.useState(null),[b,j]=u.useState(0),[k,y]=u.useState(0),[w,S]=u.useState(!1),[N,_]=u.useState(!1),C=Ft(e,R=>d(R)),O=_p(a);return s.jsx(Gk,{scope:t,type:n,dir:O,scrollHideDelay:i,scrollArea:l,viewport:c,onViewportChange:h,content:m,onContentChange:f,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:w,onScrollbarXEnabledChange:S,scrollbarY:x,onScrollbarYChange:g,scrollbarYEnabled:N,onScrollbarYEnabledChange:_,onCornerWidthChange:j,onCornerHeightChange:y,children:s.jsx(ft.div,{dir:O,...o,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":k+"px",...r.style}})})});J0.displayName=Td;var X0="ScrollAreaViewport",K0=u.forwardRef((r,e)=>{const{__scopeScrollArea:t,children:n,nonce:a,...i}=r,o=hr(X0,t),l=u.useRef(null),d=Ft(e,l,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(ft.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...r.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});K0.displayName=X0;var Or="ScrollAreaScrollbar",Pd=u.forwardRef((r,e)=>{const{forceMount:t,...n}=r,a=hr(Or,r.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,l=r.orientation==="horizontal";return u.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),a.type==="hover"?s.jsx(Yk,{...n,ref:e,forceMount:t}):a.type==="scroll"?s.jsx(Zk,{...n,ref:e,forceMount:t}):a.type==="auto"?s.jsx(Q0,{...n,ref:e,forceMount:t}):a.type==="always"?s.jsx(Ad,{...n,ref:e}):null});Pd.displayName=Or;var Yk=u.forwardRef((r,e)=>{const{forceMount:t,...n}=r,a=hr(Or,r.__scopeScrollArea),[i,o]=u.useState(!1);return u.useEffect(()=>{const l=a.scrollArea;let d=0;if(l){const c=()=>{window.clearTimeout(d),o(!0)},h=()=>{d=window.setTimeout(()=>
vendor: 4,020 bytes, line 579
579o(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",c),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),l.removeEventListener("pointerenter",c),l.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(Bs,{present:t||i,children:s.jsx(Q0,{"data-state":i?"visible":"hidden",...n,ref:e})})}),Zk=u.forwardRef((r,e)=>{const{forceMount:t,...n}=r,a=hr(Or,r.__scopeScrollArea),i=r.orientation==="horizontal",o=To(()=>d("SCROLL_END"),100),[l,d]=Wk("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return u.useEffect(()=>{if(l==="idle"){const c=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(c)}},[l,a.scrollHideDelay,d]),u.useEffect(()=>{const c=a.viewport,h=i?"scrollLeft":"scrollTop";if(c){let m=c[h];const f=()=>{const p=c[h];m!==p&&(d("SCROLL"),o()),m=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[a.viewport,i,d,o]),s.jsx(Bs,{present:t||l!=="hidden",children:s.jsx(Ad,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:e,onPointerEnter:mt(r.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:mt(r.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Q0=u.forwardRef((r,e)=>{const t=hr(Or,r.__scopeScrollArea),{forceMount:n,...a}=r,[i,o]=u.useState(!1),l=r.orientation==="horizontal",d=To(()=>{if(t.viewport){const c=t.viewport.offsetWidth<t.viewport.scrollWidth,h=t.viewport.offsetHeight<t.viewport.scrollHeight;o(l?c:h)}},10);return xn(t.viewport,d),xn(t.content,d),s.jsx(Bs,{present:n||i,children:s.jsx(Ad,{"data-state":i?"visible":"hidden",...a,ref:e})})}),Ad=u.forwardRef((r,e)=>{const{orientation:t="vertical",...n}=r,a=hr(Or,r.__scopeScrollArea),i=u.useRef(null),o=u.useRef(0),[l,d]=u.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=nx(l.viewport,l.content),h={...n,sizes:l,onSizesChange:d,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:f=>o.current=f};function m(f,p){return t5(f,o.current,l,p)}return t==="horizontal"?s.jsx(Jk,{...h,ref:e,onThumbPositionChange:()=>{if(a.viewport&&i.current){const f=a.viewport.scrollLeft,p=em(f,l,a.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{a.viewport&&(a.viewport.scrollLeft=f)},onDragScroll:f=>{a.viewport&&(a.viewport.scrollLeft=m(f,a.dir))}}):t==="vertical"?s.jsx(Xk,{...h,ref:e,onThumbPositionChange:()=>{if(a.viewport&&i.current){const f=a.viewport.scrollTop,p=em(f,l);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{a.viewport&&(a.viewport.scrollTop=f)},onDragScroll:f=>{a.viewport&&(a.viewport.scrollTop=m(f))}}):null}),Jk=u.forwardRef((r,e)=>{const{sizes:t,onSizesChange:n,...a}=r,i=hr(Or,r.__scopeScrollArea),[o,l]=u.useState(),d=u.useRef(null),c=Ft(e,d,i.onScrollbarXChange);return u.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),s.jsx(tx,{"data-orientation":"horizontal",...a,ref:c,sizes:t,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Co(t)+"px",...r.style},onThumbPointerDown:h=>r.onThumbPointerDown(h.x),onDragScroll:h=>r.onDragScroll(h.x),onWheelScroll:(h,m)=>{if(i.viewport){const f=i.viewport.scrollLeft+h.deltaX;r.onWheelScroll(f),ix(f,m)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Wi(o.paddingLeft),paddingEnd:Wi(o.paddingRight)}})}})}),Xk=u.forwardRef((r,e)=>{const{sizes:t,onSizesChange:n,...a}=r,i=hr(Or,r.__scopeScrollArea),[o,l]=u.useState(),d=u.useRef(null),c=Ft(e,d,i.onScrollbarYChange);return u.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),s.jsx(tx,{"data-orientation":"vertical",...a,ref:c,sizes:t,style:{to
vendor: 6,035 bytes, line 579
579p:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Co(t)+"px",...r.style},onThumbPointerDown:h=>r.onThumbPointerDown(h.y),onDragScroll:h=>r.onDragScroll(h.y),onWheelScroll:(h,m)=>{if(i.viewport){const f=i.viewport.scrollTop+h.deltaY;r.onWheelScroll(f),ix(f,m)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Wi(o.paddingTop),paddingEnd:Wi(o.paddingBottom)}})}})}),[Kk,ex]=Z0(Or),tx=u.forwardRef((r,e)=>{const{__scopeScrollArea:t,sizes:n,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:c,onWheelScroll:h,onResize:m,...f}=r,p=hr(Or,t),[v,x]=u.useState(null),g=Ft(e,C=>x(C)),b=u.useRef(null),j=u.useRef(""),k=p.viewport,y=n.content-n.viewport,w=xr(h),S=xr(d),N=To(m,10);function _(C){if(b.current){const O=C.clientX-b.current.left,R=C.clientY-b.current.top;c({x:O,y:R})}}return u.useEffect(()=>{const C=O=>{const R=O.target;v?.contains(R)&&w(O,y)};return document.addEventListener("wheel",C,{passive:!1}),()=>document.removeEventListener("wheel",C,{passive:!1})},[k,v,y,w]),u.useEffect(S,[n,S]),xn(v,N),xn(p.content,N),s.jsx(Kk,{scope:t,scrollbar:v,hasThumb:a,onThumbChange:xr(i),onThumbPointerUp:xr(o),onThumbPositionChange:S,onThumbPointerDown:xr(l),children:s.jsx(ft.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:mt(r.onPointerDown,C=>{C.button===0&&(C.target.setPointerCapture(C.pointerId),b.current=v.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),_(C))}),onPointerMove:mt(r.onPointerMove,_),onPointerUp:mt(r.onPointerUp,C=>{const O=C.target;O.hasPointerCapture(C.pointerId)&&O.releasePointerCapture(C.pointerId),document.body.style.webkitUserSelect=j.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),qi="ScrollAreaThumb",rx=u.forwardRef((r,e)=>{const{forceMount:t,...n}=r,a=ex(qi,r.__scopeScrollArea);return s.jsx(Bs,{present:t||a.hasThumb,children:s.jsx(Qk,{ref:e,...n})})}),Qk=u.forwardRef((r,e)=>{const{__scopeScrollArea:t,style:n,...a}=r,i=hr(qi,t),o=ex(qi,t),{onThumbPositionChange:l}=o,d=Ft(e,m=>o.onThumbChange(m)),c=u.useRef(void 0),h=To(()=>{c.current&&(c.current(),c.current=void 0)},100);return u.useEffect(()=>{const m=i.viewport;if(m){const f=()=>{if(h(),!c.current){const p=r5(m,l);c.current=p,l()}};return l(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[i.viewport,h,l]),s.jsx(ft.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:mt(r.onPointerDownCapture,m=>{const p=m.target.getBoundingClientRect(),v=m.clientX-p.left,x=m.clientY-p.top;o.onThumbPointerDown({x:v,y:x})}),onPointerUp:mt(r.onPointerUp,o.onThumbPointerUp)})});rx.displayName=qi;var Id="ScrollAreaCorner",sx=u.forwardRef((r,e)=>{const t=hr(Id,r.__scopeScrollArea),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&n?s.jsx(e5,{...r,ref:e}):null});sx.displayName=Id;var e5=u.forwardRef((r,e)=>{const{__scopeScrollArea:t,...n}=r,a=hr(Id,t),[i,o]=u.useState(0),[l,d]=u.useState(0),c=!!(i&&l);return xn(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),xn(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),c?s.jsx(ft.div,{...n,ref:e,style:{width:i,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function Wi(r){return r?parseInt(r,10):0}function nx(r,e){const t=r/e;return isNaN(t)?0:t}function Co(r){const e=nx(r.viewport,r.content),t=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,n=(r.scrollbar.size-t)*e;return Math.max(n,18)}function t5(r,e,t,n="ltr"){const a=Co(t),i=a/2,o=e||i,l=a-o,d=t.scrollbar.paddingStart+o,c=t.scrollbar.size-t.scrollbar.paddingEnd-l,h=t.content-t.viewport,m=n==="ltr"?[0,h]:[h*-1,0];return ax([d,c],m)(r)}function em(r,e,t="ltr"){const n=Co(e),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-a,o=e.content-e.viewport,l=i-n,d=t==="ltr"?[0,o]:[o*-1,0],c=by(r,d);return ax([0,o],[0,l])(c)}function ax(r,e){return t=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const n=(e[1]-e[0])/(r[1]-r[0]);return e[0]+n*(t-r[0])}}function ix(r,e){return r>0&&r<e}var r5=(r,e=()=>{})=>{let t={left:r.scrollLeft,top:r.scrollTop},n=0;return function a(){const i={left:r.scrollLeft,top:r.scrollTop},o=t.left!==i.left,l=t.top!==i.top;(o||l)&&e(),t=i,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function To(r,e){const t=xr(r),n=u.useRef(0);return u.useEffect(()=>()=>window.clearTimeout(n.current),[]),u.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(t,e)},[t,e])}function xn(r,e){const t=xr(e);Bc(()=>{let n=0;if(r){const a=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(t)});return a.observe(r),()=>{window.cancelAnimationFrame(n),a.unobserve(r)}}},[r,t])}var ox=J0,s5=K0,n5=sx;const vn=u.forwardRef(({className:r,children:e,scrollbarOnHover:t=!1,...n},a)=>s.jsxs(ox,{ref:a,className:Y("relative overflow-hidden",t&&"group",r),...n,children:[s.jsx(s5,{className:"h-full w-full rounded-[inherit] overflow-y-auto",children:e}),s.jsx(lx,{className:t?"opacity-0 group-hover:opacity-100 transition-opacity duration-200":""}),s.jsx(n5,{})]}));vn.displayName=ox.displayName;const lx=u.forwardRef(({className:r,orientation:e="vertical",...t},n)=>s.jsx(Pd,{ref:n,orientation:e,className:Y("flex touch-none select-none transition-all duration-200",e==="vertical"&&"h-full w-2 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-[1px]",r),...t,children:s.jsx(rx,{className:Y("relative flex-1 rounded-full","bg-muted-foreground
579/25 hover:bg-muted-foreground/40 active:bg-muted-foreground/50","transition-colors duration-200")})}));lx.displayName=Pd.displayName;const a5=_y,cx=u.forwardRef(({className:r,...e},t)=>s.jsx(wp,{ref:t,className:Y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",r),...e}));cx.displayName=wp.displayName;const wc=u.forwardRef(({className:r,...e},t)=>s.jsx(jp,{ref:t,className:Y("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",r),...e}));wc.displayName=jp.displayName;const jc=u.forwardRef(({className:r,...e},t)=>s.jsx(kp,{ref:t,className:Y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...e}));jc.displayName=kp.displayName;let Zs=null;const i5=()=>{try{return(!Zs||Zs.state==="closed")&&(Zs=new(window.AudioContext||window.webkitAudioContext)),Zs.state==="suspended"&&Zs.resume(),Zs}catch(r){return console.warn("Web Audio API not supported:",r),null}},Gi=(r=.3)=>{const e=i5();if(e)try{const t=e.currentTime,n=e.createGain();n.connect(e.destination),n.gain.setValueAtTime(0,t),n.gain.linearRampToValueAtTime(r,t+.01),n.gain.exponentialRampToValueAtTime(.01,t+.5);const a=e.createOscillator();a.type="sine",a.frequency.setValueAtTime(1047,t),a.connect(n),a.start(t),a.stop(t+.5);const i=e.createGain();i.connect(e.destination),i.gain.setValueAtTime(0,t+.05),i.gain.linearRampToValueAtTime(r*.8,t+.06),i.gain.exponentialRampToValueAtTime(.01,t+.55);const o=e.createOscillator();o.type="sine",o.frequency.setValueAtTime(784,t+.05),o.connect(i),o.start(t+.05),o.stop(t+.55)}catch(t){console.warn("Error playing notification sound:",t)}},tm=()=>typeof window<"u"&&(typeof AudioContext<"u"||typeof window.webkitAudioContext<"u");function o5(r={}){const{enableSound:e=!0,soundVolume:t=.3,limit:n=10,typeFilter:a}=r,{user:i}=Ee(),[o,l]=u.useState([]),[d,c]=u.useState(!0),[h,m]=u.useState(!1),[f,p]=u.useState(!0),v=u.useRef(0),x=u.useRef(!1),g=u.useRef(null),b=u.useRef(0),j=u.useCallback(async(S=!0)=>{if(!i){c(!1),l([]);return}S?(c(!0),b.current=0):m(!0);try{let N=W.from("notifications").select("*").eq("user_id",i.id);a&&a.length>0&&(N=N.in("type",a));const{data:_,error:C}=await N.order("created_at",{ascending:!1}).range(b.current,b.current+n-1);if(C){console.error("Error fetching notifications:",C);return}if(_&&(l(S?_:O=>[...O,..._]),p(_.length===n),b.current+=_.length,S)){const O=_.filter(R=>!R.is_read).length;x.current&&e&&tm()&&O>v.current&&Gi(t),v.current=O,x.current=!0}}catch(N){console.error("Error in fetchNotifications:",N)}finally{c(!1),m(!1)}},[i,n,e,t,a]),k=u.useCallback(async()=>{!f||h||d||await j(!1)},[f,h,d,j]);u.useEffect(()=>{if(i)return j(),g.current=W.channel(`notifications:${i.id}`).on("postgres_changes",{event:"*",schema:"public",table:"notifications",filter:`user_id=eq.${i.id}`},S=>{if(console.log("[Notifications] Real-time update:",S.eventType),S.eventType==="INSERT"){const N=S.new;if(a&&a.length>0&&!a.includes(N.type))return;l(_=>[N,..._]),e&&tm()&&Gi(t),v.current+=1}else if(S.eventType==="UPDATE"){const N=S.new;l(_=>_.map(C=>C.id===N.id?N:C)),l(_=>(v.current=_.filter(C=>!C.is_read).length,_))}else if(S.eventType==="DELETE"){const N=S.old.id;l(_=>_.filter(C=>C.id!==N))}}).subscribe(),()=>{g.current&&(W.removeChannel(g.current),g.current=null)}},[i,j,e,t]);const y=u.useCallback(async S=>{if(i)try{const{error:N}=await W.from("notifications").update({is_read:!0}).eq("id",S).eq("user_id",i.id);if(N){console.error("Error marking notification as read:",N);return}l(_=>_.map(C=>C.id===S?{...C,is_read:!0}:C)),v.current=Math.max(0,v.current-1)}catch(N){console.error("Error in markAsRead:",N)}},[i]),w=u.useCallback(async()=>{if(i)try{const{error:S}=await W.from("notifications").update({is_read:!0}).eq("user_id",i.id).eq("is_read",!1);if(S){console.error("Error marking all notifications as read:",S);return}l(N=>N.map(_=>({..._,is_read:!0}))),v.current=0}catch(S){console.error("Error in markAllAsRead:",S)}},[i]);return{notifications:o,unreadCount:o.filter(S=>!S.is_read).length,isLoading:d,isLoadingMore:h,hasMore:f,loadMore:k,markAsRead:y,markAllAsRead:w,refetch:()=>j(!0)}}function l5(r={}){const{limit:e=20,includeDrafts:t=!1}=r,{user:n}=Ee(),[a,i]=u.useState([]),[o,l]=u.useState(new Set),[d,c]=u.useState(!0),[h,m]=u.useState(!0),f=u.useRef(0),p=u.useCallback(async(_=!0)=>{_&&(c(!0),f.current=0);try{let C=W.from("announcements").select("*").order("published_at",{ascending:!1,nullsFirst:!1}).order("created_at",{ascending:!1}).range(f.current,f.current+e-1);t||(C=C.eq("is_published",!0));const{data:O,error:R}=await C;if(R){console.error("Error fetching announcements:",R);return}O&&(i(_?O:M=>[...M,...O]),m(O.length===e),f.current+=O.length)}catch(C){console.error("Error in fetchAnnouncements:",C)}finally{c(!1)}},[e,t]),v=u.useCallback(async()=>
579{if(n)try{const{data:_,error:C}=await W.from("announcement_reads").select("announcement_id").eq("user_id",n.id);if(C){console.error("Error fetching announcement reads:",C);return}_&&l(new Set(_.map(O=>O.announcement_id)))}catch(_){console.error("Error in fetchReadIds:",_)}},[n]);u.useEffect(()=>{p(),v()},[p,v]);const x=u.useCallback(async()=>{!h||d||await p(!1)},[h,d,p]),g=u.useCallback(async _=>{if(!(!n||o.has(_)))try{const{error:C}=await W.from("announcement_reads").insert({announcement_id:_,user_id:n.id});if(C&&C.code!=="23505"){console.error("Error marking announcement as read:",C);return}l(O=>new Set([...O,_]))}catch(C){console.error("Error in markAsRead:",C)}},[n,o]),b=u.useCallback(async()=>{if(!n)return;const _=a.filter(C=>!o.has(C.id)).map(C=>C.id);if(_.length!==0)try{const C=_.map(R=>({announcement_id:R,user_id:n.id})),{error:O}=await W.from("announcement_reads").upsert(C,{onConflict:"announcement_id,user_id"});if(O){console.error("Error marking all announcements as read:",O);return}l(R=>new Set([...R,..._]))}catch(C){console.error("Error in markAllAsRead:",C)}},[n,a,o]),j=u.useCallback(async _=>{if(!n)return null;try{const{data:C,error:O}=await W.from("announcements").insert({title:_.title||"New Announcement",message:_.message||"",category:_.category||"feature",image_url:_.image_url,link:_.link,link_text:_.link_text||"Learn more",is_published:_.is_published||!1,published_at:_.is_published?new Date().toISOString():null,created_by:n.id}).select().single();return O?(console.error("Error creating announcement:",O),null):(i(R=>[C,...R]),C)}catch(C){return console.error("Error in createAnnouncement:",C),null}},[n]),k=u.useCallback(async(_,C)=>{try{const{error:O}=await W.from("announcements").update({...C,updated_at:new Date().toISOString()}).eq("id",_);return O?(console.error("Error updating announcement:",O),!1):(i(R=>R.map(M=>M.id===_?{...M,...C,updated_at:new Date().toISOString()}:M)),!0)}catch(O){return console.error("Error in updateAnnouncement:",O),!1}},[]),y=u.useCallback(async _=>{try{const{error:C}=await W.from("announcements").delete().eq("id",_);return C?(console.error("Error deleting announcement:",C),!1):(i(O=>O.filter(R=>R.id!==_)),!0)}catch(C){return console.error("Error in deleteAnnouncement:",C),!1}},[]),w=u.useCallback(async _=>k(_,{is_published:!0,published_at:new Date().toISOString()}),[k]),S=u.useCallback(async _=>k(_,{is_published:!1}),[k]),N=a.filter(_=>!o.has(_.id)).length;return{announcements:a,unreadCount:N,isLoading:d,hasMore:h,loadMore:x,markAsRead:g,markAllAsRead:b,refetch:()=>p(!0),createAnnouncement:j,updateAnnouncement:k,deleteAnnouncement:y,publishAnnouncement:w,unpublishAnnouncement:S}}function Qe(r){const e=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&e==="[object Date]"?new r.constructor(+r):typeof r=="number"||e==="[object Number]"||typeof r=="string"||e==="[object String]"?new Date(r):new Date(NaN)}function Qr(r,e){return r instanceof Date?new r.constructor(e):new Date(e)}function c5(r,e){const t=Qe(r);return isNaN(e)?Qr(r,NaN):(e&&t.setDate(t.getDate()+e),t)}const dx=6048e5,d5=864e5,MA=6e4,OA=36e5,si=43200,rm=1440;let u5={};function za(){return u5}function Sa(r,e){const t=za(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,a=Qe(r),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function Yi(r){return Sa(r,{weekStartsOn:1})}function ux(r){const e=Qe(r),t=e.getFullYear(),n=Qr(r,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const a=Yi(n),i=Qr(r,0);i.setFullYear(t,0,4),i.setHours(0,0,0,0);const o=Yi(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function Zi(r){const e=Qe(r);return e.setHours(0,0,0,0),e}function Ji(r){const e=Qe(r),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+r-+t}function h5(r,e){const t=Zi(r),n=Zi(e),a=+t-Ji(t),i=+n-Ji(n);return Math.round((a-i)/d5)}function m5(r){const e=ux(r),t=Qr(r,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),Yi(t)}function yi(r,e){const t=Qe(r),n=Qe(e),a=t.getTime()-n.getTime();return a<0?-1:a>0?1:a}function Rd(r){return Qr(r,Date.now())}function hx(r,e){const t=Zi(r),n=Zi(e);return+t==+n}function p5(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function f5(r){if(!p5(r)&&typeof r!="number")return!1;const e=Qe(r);return!isNaN(Number(e))}function g5(r,e){const t=Qe(r),n=Qe(e),a=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth();return a*12+i}function x5(r){return e=>{const n=(r?Math[r]:Math.trunc)(e);return n===0?0:n}}function v5(r,e){return+Qe(r)-+Qe(e)}function y5(r){const e=Qe(r);return e.setHours(23,59,59,999),e}function b5(r){const e=Qe(r),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function _5(r){const e=Qe(r);return+y5(e)==+b5(e)}function w5(r,e){const t=Qe(r),n=Qe(e),a=yi(t,n),i=Math.abs(g5(t,n));let o;if(i<1)o=0;else{t.getMonth()===1&&t.getDate()>
vendor: 13,749 bytes, line 579
57927&&t.setDate(30),t.setMonth(t.getMonth()-a*i);let l=yi(t,n)===-a;_5(Qe(r))&&i===1&&yi(r,n)===1&&(l=!1),o=a*(i-Number(l))}return o===0?0:o}function j5(r,e,t){const n=v5(r,e)/1e3;return x5(t?.roundingMethod)(n)}function k5(r){const e=Qe(r),t=Qr(r,0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}const N5={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},S5=(r,e,t)=>{let n;const a=N5[r];return typeof a=="string"?n=a:e===1?n=a.one:n=a.other.replace("{{count}}",e.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function yl(r){return(e={})=>{const t=e.width?String(e.width):r.defaultWidth;return r.formats[t]||r.formats[r.defaultWidth]}}const E5={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},C5={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},T5={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P5={date:yl({formats:E5,defaultWidth:"full"}),time:yl({formats:C5,defaultWidth:"full"}),dateTime:yl({formats:T5,defaultWidth:"full"})},A5={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},I5=(r,e,t,n)=>A5[r];function Jn(r){return(e,t)=>{const n=t?.context?String(t.context):"standalone";let a;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,l=t?.width?String(t.width):o;a=r.formattingValues[l]||r.formattingValues[o]}else{const o=r.defaultWidth,l=t?.width?String(t.width):r.defaultWidth;a=r.values[l]||r.values[o]}const i=r.argumentCallback?r.argumentCallback(e):e;return a[i]}}const R5={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},M5={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},O5={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},D5={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},L5={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$5={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},F5=(r,e)=>{const t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},V5={ordinalNumber:F5,era:Jn({values:R5,defaultWidth:"wide"}),quarter:Jn({values:M5,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Jn({values:O5,defaultWidth:"wide"}),day:Jn({values:D5,defaultWidth:"wide"}),dayPeriod:Jn({values:L5,defaultWidth:"wide",formattingValues:$5,defaultFormattingWidth:"wide"})};function Xn(r){return(e,t={})=>{const n=t.width,a=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],l=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],d=Array.isArray(l)?H5(l,m=>m.test(o)):z5(l,m=>m.test(o));let c;c=r.valueCallback?r.valueCallback(d):d,c=t.valueCallback?t.valueCallback(c):c;const h=e.slice(o.length);return{value:c,rest:h}}}function z5(r,e){for(const t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&e(r[t]))return t}function H5(r,e){for(let t=0;t<r.length;t++)if(e(r[t]))return t}function U5(r){return(e,t={})=>{const n=e.match(r.matchPattern);if(!n)return null;const a=n[0],i=e.match(r.parsePattern);if(!i)return null;let o=r.valueCallback?r.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;const l=e.slice(a.length);return{value:o,rest:l}}}const B5=/^(\d+)(th|st|nd|rd)?/i,q5=/\d+/i,W5={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},G5={any:[/^b/i,/^(a|c)/i]},Y5={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Z5={any:[/1/i,/2/i,/3/i,/4/i]},J5={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},X5={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},K5={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Q5={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},eN={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},tN={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},rN={ordinalNumber:U5({matchPattern:B5,parsePattern:q5,valueCallback:r=>parseInt(r,10)}),era:Xn({matchPatterns:W5,defaultMatchWidth:"wide",parsePatterns:G5,defaultParseWidth:"any"}),quarter:Xn({matchPatterns:Y5,defaultMatchWidth:"wide",parsePatterns:Z5,defaultParseWidth:"any",valueCallback:r=>r+1}),month:Xn({matchPatterns:J5,defaultMatchWidth:"wide",parsePatterns:X5,defaultParseWidth:"any"}),day:Xn({matchPatterns:K5,defaultMatchWidth:"wide",parsePatterns:Q5,defaultParseWidth:"any"}),dayPeriod:Xn({matchPatterns:eN,defaultMatchWidth:"any",parsePatterns:tN,defaultParseWidth:"any"})},mx={code:"en-US",formatDistance:S5,formatLong:P5,formatRelative:I5,localize:V5,match:rN,options:{weekStartsOn:0,firstWeekContainsDate:1}};function sN(r){const e=Qe(r);return h5(e,k5(e))+1}function nN(r){const e=Qe(r),t=+Yi(e)-+m5(e);return Math.round(t/dx)+1}function px(r,e){const t=Qe(r),n=t.getFullYear(),a=za(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=Qr(r,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Sa(o,e),d=Qr(r,0);d.setFullYear(n,0,i),d.setHours(0,0,0,0);const c=Sa(d,e);return t.getTime()>=l.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function aN(r,e){const t=za(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,a=px(r,e),i=Qr(r,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),Sa(i,e)}function iN(r,e){const t=Qe(r),n=+Sa(t,e)-+aN(t,e);return Math.round(n/dx)+1}function Ke(r,e){const t=r<0?"-":"",n=Math.abs(r).toString().padStart(e,"0");return t+n}const os={y(r,e){const t=r.getFullYear(),n=t>0?t:1-t;return Ke(e==="yy"?n%100:n,e.length)},M(r,e){const t=r.getMonth();return e==="M"?String(t+1):Ke(t+1,2)},d(r,e){return Ke(r.getDate(),e.length)},a(r,e){const t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(r,e){return Ke(r.getHours()%12||12,e.length)},H(r,e){return Ke(r.getHours(),e.length)},m(r,e){return Ke(r.getMinutes(),e.length)},s(r,e){return Ke(r.getSeconds(),e.length)},S(r,e){const t=e.length,n=r.getMilliseconds(),a=Math.trunc(n*Math.pow(10,t-3));return Ke(a,e.length)}},Js={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sm={G:function(r,e,t){const n=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){const n=r.getFullYear(),a=n>0?n:1-n;return t.ordinalNumber(a,{unit:"year"})}return os.y(r,e)},Y:function(r,e,t,n){const a=px(r,n),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return Ke(o,2)}return e==="Yo"?t.ordinalNumber(i,{unit:"year"}):Ke(i,e.length)},R:function(r,e){const t=ux(r);return Ke(t,e.length)},u:function(r,e){const t=r.getFullYear();return Ke(t,e.length)},Q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return Ke(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return Ke(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){const n=r.getMonth();switch(e){case"M":case"MM":return os.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){const n=r.getMonth();switch(e){case"L":return String(n+1);case"LL":return Ke(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){const a=iN(r,n);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):Ke(a,e.length)},I:function(r,e,t){const n=nN(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):Ke(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):os.d(r,e)},D:function(r,e,t){const n=sN(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):Ke(n,e.length)},E:function(r,e,t){const n=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){const a=r.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Ke(i,2);case"eo":return t.ordinalNumber(i,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});case"eeee":default:return t.day(a,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){const a=r.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Ke(i,e.length);case"co":return t.ordinalNumber(i,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});case"cccc":default:return t.day(a,{width:"wide",context:"standalone"})}},i:function(r,e,t){const n=r.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return Ke(a,e.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){const a=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,e,t){const n=r.getHours();let a;switch(n===12?a=Js.noon:n===0?a=Js.midnight:a=n/12>
vendor: 4,215 bytes, line 579
579=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,e,t){const n=r.getHours();let a;switch(n>=17?a=Js.evening:n>=12?a=Js.afternoon:n>=4?a=Js.morning:a=Js.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let n=r.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return os.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):os.H(r,e)},K:function(r,e,t){const n=r.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):Ke(n,e.length)},k:function(r,e,t){let n=r.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):Ke(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):os.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):os.s(r,e)},S:function(r,e){return os.S(r,e)},X:function(r,e,t){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return am(n);case"XXXX":case"XX":return Os(n);case"XXXXX":case"XXX":default:return Os(n,":")}},x:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"x":return am(n);case"xxxx":case"xx":return Os(n);case"xxxxx":case"xxx":default:return Os(n,":")}},O:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+nm(n,":");case"OOOO":default:return"GMT"+Os(n,":")}},z:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+nm(n,":");case"zzzz":default:return"GMT"+Os(n,":")}},t:function(r,e,t){const n=Math.trunc(r.getTime()/1e3);return Ke(n,e.length)},T:function(r,e,t){const n=r.getTime();return Ke(n,e.length)}};function nm(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=Math.trunc(n/60),i=n%60;return i===0?t+String(a):t+String(a)+e+Ke(i,2)}function am(r,e){return r%60===0?(r>0?"-":"+")+Ke(Math.abs(r)/60,2):Os(r,e)}function Os(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=Ke(Math.trunc(n/60),2),i=Ke(n%60,2);return t+a+e+i}const im=(r,e)=>{switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},fx=(r,e)=>{switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},oN=(r,e)=>{const t=r.match(/(P+)(p+)?/)||[],n=t[1],a=t[2];if(!a)return im(r,e);let i;switch(n){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",im(n,e)).replace("{{time}}",fx(a,e))},lN={p:fx,P:oN},cN=/^D+$/,dN=/^Y+$/,uN=["D","DD","YY","YYYY"];function hN(r){return cN.test(r)}function mN(r){return dN.test(r)}function pN(r,e,t){const n=fN(r,e,t);if(console.warn(n),uN.includes(r))throw new RangeError(n)}function fN(r,e,t){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const gN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vN=/^'([^]*?)'?$/,yN=/''/g,bN=/[a-zA-Z]/;function bl(r,e,t){const n=za(),a=t?.locale??n.locale??mx,i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=Qe(r);if(!f5(l))throw new RangeError("Invalid time value");let d=e.match(xN).map(h=>{const m=h[0];
579if(m==="p"||m==="P"){const f=lN[m];return f(h,a.formatLong)}return h}).join("").match(gN).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:_N(h)};if(sm[m])return{isToken:!0,value:h};if(m.match(bN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:h}});a.localize.preprocessor&&(d=a.localize.preprocessor(l,d));const c={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return d.map(h=>{if(!h.isToken)return h.value;const m=h.value;(!t?.useAdditionalWeekYearTokens&&mN(m)||!t?.useAdditionalDayOfYearTokens&&hN(m))&&pN(m,e,String(r));const f=sm[m[0]];return f(l,m,a.localize,c)}).join("")}function _N(r){const e=r.match(vN);return e?e[1].replace(yN,"'"):r}function wN(r,e,t){const n=za(),a=t?.locale??n.locale??mx,i=2520,o=yi(r,e);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},t,{addSuffix:t?.addSuffix,comparison:o});let d,c;o>0?(d=Qe(e),c=Qe(r)):(d=Qe(r),c=Qe(e));const h=j5(c,d),m=(Ji(c)-Ji(d))/1e3,f=Math.round((h-m)/60);let p;if(f<2)return t?.includeSeconds?h<5?a.formatDistance("lessThanXSeconds",5,l):h<10?a.formatDistance("lessThanXSeconds",10,l):h<20?a.formatDistance("lessThanXSeconds",20,l):h<40?a.formatDistance("halfAMinute",0,l):h<60?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",1,l):f===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",f,l);if(f<45)return a.formatDistance("xMinutes",f,l);if(f<90)return a.formatDistance("aboutXHours",1,l);if(f<rm){const v=Math.round(f/60);return a.formatDistance("aboutXHours",v,l)}else{if(f<i)return a.formatDistance("xDays",1,l);if(f<si){const v=Math.round(f/rm);return a.formatDistance("xDays",v,l)}else if(f<si*2)return p=Math.round(f/si),a.formatDistance("aboutXMonths",p,l)}if(p=w5(c,d),p<12){const v=Math.round(f/si);return a.formatDistance("xMonths",v,l)}else{const v=p%12,x=Math.trunc(p/12);return v<3?a.formatDistance("aboutXYears",x,l):v<9?a.formatDistance("overXYears",x,l):a.formatDistance("almostXYears",x+1,l)}}function Ea(r,e){return wN(r,Rd(r),e)}function jN(r){return hx(r,Rd(r))}function kN(r,e){return c5(r,-e)}function NN(r){return hx(r,kN(Rd(r),1))}const om={transactional:{icon:Dt,className:"bg-primary/10 text-primary"},billing:{icon:qs,className:"bg-amber-500/10 text-amber-500"},creator:{icon:Df,className:"bg-purple-500/10 text-purple-500"},system:{icon:Pn,className:"bg-blue-500/10 text-blue-500"},marketing:{icon:fo,className:"bg-pink-500/10 text-pink-500"},support:{icon:Cf,className:"bg-teal-500/10 text-teal-500"}};function SN(r){const{type:e,email_type:t,title:n,metadata:a}=r,i=n.toLowerCase();return a?.is_support_message?{icon:br,className:"bg-primary/10 text-primary"}:t?.includes("failed")||i.includes("failed")?{icon:kf,className:"bg-destructive/10 text-destructive"}:i.includes("warning")||i.includes("low")?{icon:td,className:"bg-amber-500/10 text-amber-500"}:t?.includes("payout")||i.includes("payout")?{icon:Ra,className:"bg-green-500/10 text-green-500"}:t?.includes("invitation")||i.includes("team")||i.includes("invite")?{icon:ur,className:"bg-blue-500/10 text-blue-500"}:t?.includes("verified")||i.includes("verified")||i.includes("approved")?{icon:jf,className:"bg-green-500/10 text-green-500"}:t?.includes("completed")||t?.includes("ready")?{icon:Dt,className:"bg-primary/10 text-primary"}:om[e]||om.system}function EN(r){const e=r.metadata;return e&&(e.thumbnail_url||e.video_thumbnail||e.hosted_thumbnail_url)||null}function CN(r){return r?r.includes("dashboard")?"View Dashboard":r.includes("create")?"Start Creating":r.includes("videos")?"View Videos":r.includes("settings")?"Open Settings":r.includes("checkout")?"View Checkout":"View":"View"}function TN({notification:r,isExpanded:e=!1,onClick:t,onNavigate:n}){const{icon:a,className:i}=SN(r),o=EN(r),l=Ea(new Date(r.created_at),{addSuffix:!0});return s.jsx(ae.button,{layout:!0,initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,x:20},onClick:t,className:Y("w-full text-left p-3 border-b border-border/50 last:border-0 hover:bg-muted/50 transition-colors",!r.
579is_read&&"bg-muted/20",e&&"bg-muted/30"),children:s.jsxs("div",{className:"flex items-start gap-3",children:[o?s.jsx("div",{className:"flex-shrink-0 h-10 w-10 rounded-lg overflow-hidden bg-muted",children:s.jsx("img",{src:o,alt:"",className:"w-full h-full object-cover",onError:d=>{d.currentTarget.style.display="none"}})}):s.jsx("div",{className:Y("flex-shrink-0 h-10 w-10 rounded-lg flex items-center justify-center",i),children:s.jsx(a,{className:"h-4 w-4"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("p",{className:Y("text-sm font-medium",!e&&"truncate",r.is_read?"text-foreground/80":"text-foreground"),children:r.title}),!r.is_read&&s.jsx("span",{className:"flex-shrink-0 h-2 w-2 rounded-full bg-primary mt-1.5"})]}),s.jsx("p",{className:Y("text-xs mt-0.5",!e&&"line-clamp-2",r.is_read?"text-muted-foreground/70":"text-muted-foreground"),children:r.message}),s.jsx("p",{className:"text-[10px] text-muted-foreground/60 mt-1",children:l}),s.jsx(pt,{children:e&&r.link&&n&&s.jsx(ae.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2},className:"overflow-hidden",children:s.jsxs(ie,{variant:"outline",size:"sm",className:"mt-2 h-7 text-xs gap-1.5",onClick:d=>{d.stopPropagation(),n()},children:[CN(r.link),s.jsx(Fs,{className:"h-3 w-3"})]})})})]})]})})}const PN=mo("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),rt=u.forwardRef(({className:r,variant:e,...t},n)=>s.jsx("div",{ref:n,className:Y(PN({variant:e}),r),...t}));rt.displayName="Badge";const lm={feature:{icon:Bt,label:"New Feature",className:"bg-primary/10 text-primary border-primary/20"},improvement:{icon:_r,label:"Improvement",className:"bg-amber-500/10 text-amber-600 border-amber-500/20"},fix:{icon:_f,label:"Bug Fix",className:"bg-green-500/10 text-green-600 border-green-500/20"},announcement:{icon:Af,label:"Announcement",className:"bg-blue-500/10 text-blue-600 border-blue-500/20"}};function AN({announcement:r,isRead:e,onClick:t}){const n=lm[r.category]||lm.announcement,a=n.icon,i=r.published_at?Ea(new Date(r.published_at),{addSuffix:!0}):Ea(new Date(r.created_at),{addSuffix:!0}),o=()=>{t(),r.link&&window.open(r.link,"_blank")};return s.jsxs(ae.div,{layout:!0,initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,x:20},onClick:o,className:Y("w-full text-left p-4 border-b border-border/50 last:border-0 hover:bg-muted/50 transition-colors cursor-pointer",!e&&"bg-muted/20"),children:[r.image_url&&s.jsx("div",{className:"mb-3 rounded-lg overflow-hidden aspect-video",children:s.jsx("img",{src:r.image_url,alt:"",className:"w-full h-full object-cover object-center"})}),s.jsxs("div",{className:"flex items-start gap-3",children:[!e&&s.jsx("span",{className:"flex-shrink-0 h-2 w-2 rounded-full bg-primary mt-2"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[s.jsxs(rt,{variant:"outline",className:Y("text-[10px] px-1.5 py-0 gap-1",n.className),children:[s.jsx(a,{className:"h-3 w-3"}),n.label]}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:i})]}),s.jsx("h4",{className:Y("text-sm font-semibold",e?"text-foreground/80":"text-foreground"),children:r.title}),s.jsx("p",{className:Y("text-xs line-clamp-3 mt-1",e?"text-muted-foreground/70":"text-muted-foreground"),children:r.message}),r.link&&s.jsxs(ie,{variant:"link",size:"sm",className:"h-auto p-0 mt-2 text-xs text-primary gap-1",onClick:l=>{l.stopPropagation(),window.open(r.link,"_blank")},children:[r.link_text||"Learn more",s.jsx(Fs,{className:"h-3 w-3"})]})]})]})]})}const _l=768;function Es(){const[r,e]=u.useState(void 0);return u.useEffect(()=>{const t=window.matchMedia(`(max-width: ${_l-1}px)`),n=()=>{e(window.innerWidth<_l)};return t.addEventListener("change",n),e(window.innerWidth<_l),()=>t.removeEventListener("change",n)},[]),!!r}function Md({collapsed:r=!1,onItemClick:e,typeFilter:t}){const n=Xt(),a=Es(),{canAccessSupport:i}=Ss(),[o,l]=u.useState(!1),[d,c]=u.useState("notifications"),[h,m]=u.useState(null),{notifications:f,unreadCount:p,isLoading:v,isLoadingMore:x,hasMore:g,loadMore:b,markAsRead:j,markAllAsRead:k}=o5({limit:5,typeFilter:t}),{announcements:y,unreadCount:w,isLoading:S,hasMore:N,loadMore:_,markAsRead:C,markAllAsRead:O}=l5({limit:5}),R=p+w,M=async(E,U,J)=>{await j(E);const te=(J?.is_support_message||J?.is_support_ticket||J?.conversation_id)&&J?.conversation_id,D=U?.includes("moderator-dashboard")&&J?.conversation_id;if(te||D){const ee=J?.conversation_id;
579console.log("[SidebarNotificationBell] Support notification click, staff:",i,"conversation:",ee),l(!1),e?.();const T=window.location.pathname==="/moderator-dashboard";i||T?n(`/moderator-dashboard?conversation=${ee}`):window.dispatchEvent(new CustomEvent("open-support-conversation",{detail:{conversationId:ee}}));return}m(ee=>ee===E?null:E)},L=E=>{l(!1),m(null),e?.(),E&&!E.includes("moderator-dashboard")&&n(E)},A=async E=>{await C(E)},V=async E=>{E.stopPropagation(),d==="notifications"?await k():await O()},G=u.useCallback(E=>{const U=E.currentTarget;U.scrollHeight-U.scrollTop-U.clientHeight<50&&(d==="notifications"&&g&&!x?b():d==="whatsnew"&&N&&_())},[d,g,x,b,N,_]),se=R>99?"99+":R,re=d==="notifications"?p:w,Z=s.jsxs(a5,{value:d,onValueChange:E=>c(E),children:[s.jsxs("div",{className:"border-b border-border",children:[s.jsx("div",{className:"px-3 pt-3",children:s.jsxs(cx,{className:"w-full grid grid-cols-2 h-9",children:[s.jsxs(wc,{value:"notifications",className:"text-xs gap-1.5 relative",children:["Notifications",p>0&&s.jsx("span",{className:"flex h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 text-[9px] font-bold text-destructive-foreground",children:p>99?"99+":p})]}),s.jsxs(wc,{value:"whatsnew",className:"text-xs gap-1.5 relative",children:[s.jsx(Bt,{className:"h-3 w-3"}),"What's New",w>0&&s.jsx("span",{className:"flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[9px] font-bold text-primary-foreground",children:w>99?"99+":w})]})]})}),re>0&&s.jsx("div",{className:"px-3 py-2 flex justify-end",children:s.jsxs(ie,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:V,children:[s.jsx(Ue,{className:"h-3 w-3"}),"Mark all read"]})})]}),s.jsx(jc,{value:"notifications",className:"m-0",children:s.jsx(vn,{className:"h-[50vh] md:h-[400px]",onScrollCapture:G,scrollbarOnHover:!0,children:s.jsx("div",{className:"flex flex-col",children:v?s.jsx("div",{className:"p-6 text-center",children:s.jsx("div",{className:"animate-pulse text-muted-foreground text-sm",children:"Loading..."})}):f.length===0?s.jsxs("div",{className:"p-8 text-center",children:[s.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-muted/50 flex items-center justify-center mb-3",children:s.jsx(jf,{className:"h-6 w-6 text-primary"})}),s.jsx("p",{className:"font-medium text-foreground",children:"All caught up!"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"You have no new notifications"})]}):s.jsxs(s.Fragment,{children:[s.jsx(pt,{mode:"popLayout",children:f.map(E=>s.jsx(TN,{notification:E,isExpanded:h===E.id,onClick:()=>M(E.id,E.link,E.metadata),onNavigate:()=>L(E.link)},E.id))}),x&&s.jsx("div",{className:"p-3 flex justify-center",children:s.jsx(Mt,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!g&&f.length>0&&s.jsx("div",{className:"p-3 text-center text-xs text-muted-foreground",children:"You've reached the end"})]})})})}),s.jsx(jc,{value:"whatsnew",className:"m-0",children:s.jsx(vn,{className:"h-[50vh] md:h-[400px]",onScrollCapture:G,scrollbarOnHover:!0,children:s.jsx("div",{className:"flex flex-col",children:S?s.jsx("div",{className:"p-6 text-center",children:s.jsx("div",{className:"animate-pulse text-muted-foreground text-sm",children:"Loading..."})}):y.length===0?s.jsxs("div",{className:"p-8 text-center",children:[s.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-muted/50 flex items-center justify-center mb-3",children:s.jsx(Bt,{className:"h-6 w-6 text-primary"})}),s.jsx("p",{className:"font-medium text-foreground",children:"No updates yet"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Check back soon for new features"})]}):s.jsxs(s.Fragment,{children:[s.jsx(pt,{mode:"popLayout",children:y.map(E=>s.jsx(AN,{announcement:E,isRead:!1,onClick:()=>A(E.id)},E.id))}),s.jsx("div",{className:"p-3 border-t border-border",children:s.jsx(ie,{variant:"ghost",size:"sm",className:"w-full text-xs text-muted-foreground hover:text-foreground",onClick:()=>{l(!1),n("/dashboard/whats-new")},children:"See all announcements â"})})]})})})})]}),P=s.jsxs("button",{className:Y("relative flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 w-full group/notif",r?"justify-center p-3":"",o?"bg-primary/10 text-primary ring-1 ring-primary/20":R>0?"text-foreground hover:bg-primary/5 hover:text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"),"aria-label":`Notifications${R>0?` (${R} unread)`:""}`,children:[s.jsxs("div",{className:"relative",children:[s.jsx(Gb,{className:Y("w-5 h-5 transition-transform duration-200",R>0&&!r&&"group-hover/notif:scale-110")}),r&&R>0&&s.jsx("span",{className:"absolute -top-2 -right-2 flex h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 text-[9px] font-bold text-destructive-foreground animate-pulse",children:se})]}),!r&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"flex-1 text-left",children:"Notifications"}),R>0&&s.jsx("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1.5 text-[10px] font-bold text-destructive-foreground shadow-sm",children:se})]})]});return a?s.jsxs(B0,{open:o,onOpenChange:l,children:[s.jsx(Hk,{asChild:!0,children:r?s.jsxs(Ht,{delayDuration:0,
579children:[s.jsx(Ut,{asChild:!0,children:P}),s.jsxs($t,{side:"right",sideOffset:10,children:["Notifications ",R>0&&`(${R} unread)`]})]}):P}),s.jsxs(W0,{className:"max-h-[85vh]",children:[s.jsx(G0,{className:"sr-only",children:s.jsx(Y0,{children:"Notifications"})}),Z]})]}):r?s.jsxs(vc,{open:o,onOpenChange:l,children:[s.jsxs(Ht,{delayDuration:0,children:[s.jsx(Ut,{asChild:!0,children:s.jsx(yc,{asChild:!0,children:P})}),s.jsxs($t,{side:"right",sideOffset:10,children:["Notifications ",R>0&&`(${R} unread)`]})]}),s.jsx(Bi,{className:"w-80 sm:w-96 p-0 bg-popover border-border",align:"start",side:"right",sideOffset:8,children:Z})]}):s.jsxs(vc,{open:o,onOpenChange:l,children:[s.jsx(yc,{asChild:!0,children:P}),s.jsx(Bi,{className:"w-80 sm:w-96 p-0 bg-popover border-border",align:"start",side:"right",sideOffset:8,children:Z})]})}var Po="Collapsible",[IN,gx]=js(Po),[RN,Od]=IN(Po),xx=u.forwardRef((r,e)=>{const{__scopeCollapsible:t,open:n,defaultOpen:a,disabled:i,onOpenChange:o,...l}=r,[d,c]=kn({prop:n,defaultProp:a??!1,onChange:o,caller:Po});return s.jsx(RN,{scope:t,disabled:i,contentId:Np(),open:d,onOpenToggle:u.useCallback(()=>c(h=>!h),[c]),children:s.jsx(ft.div,{"data-state":Fd(d),"data-disabled":i?"":void 0,...l,ref:e})})});xx.displayName=Po;var vx="CollapsibleTrigger",Dd=u.forwardRef((r,e)=>{const{__scopeCollapsible:t,...n}=r,a=Od(vx,t);return s.jsx(ft.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":Fd(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:e,onClick:mt(r.onClick,a.onOpenToggle)})});Dd.displayName=vx;var Ld="CollapsibleContent",$d=u.forwardRef((r,e)=>{const{forceMount:t,...n}=r,a=Od(Ld,r.__scopeCollapsible);return s.jsx(Bs,{present:t||a.open,children:({present:i})=>s.jsx(MN,{...n,ref:e,present:i})})});$d.displayName=Ld;var MN=u.forwardRef((r,e)=>{const{__scopeCollapsible:t,present:n,children:a,...i}=r,o=Od(Ld,t),[l,d]=u.useState(n),c=u.useRef(null),h=Ft(e,c),m=u.useRef(0),f=m.current,p=u.useRef(0),v=p.current,x=o.open||l,g=u.useRef(x),b=u.useRef(void 0);return u.useEffect(()=>{const j=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(j)},[]),Bc(()=>{const j=c.current;if(j){b.current=b.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const k=j.getBoundingClientRect();m.current=k.height,p.current=k.width,g.current||(j.style.transitionDuration=b.current.transitionDuration,j.style.animationName=b.current.animationName),d(n)}},[o.open,n]),s.jsx(ft.div,{"data-state":Fd(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!x,...i,ref:h,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...r.style},children:x&&a})});function Fd(r){return r?"open":"closed"}var yx=xx,ON=Dd,DN=$d;const Vd=yx,zd=Dd,Hd=$d;var Ud="Progress",Bd=100,[LN]=js(Ud),[$N,FN]=LN(Ud),bx=u.forwardRef((r,e)=>{const{__scopeProgress:t,value:n=null,max:a,getValueLabel:i=VN,...o}=r;(a||a===0)&&!cm(a)&&console.error(zN(`${a}`,"Progress"));const l=cm(a)?a:Bd;n!==null&&!dm(n,l)&&console.error(HN(`${n}`,"Progress"));const d=dm(n,l)?n:null,c=Xi(d)?i(d,l):void 0;return s.jsx($N,{scope:t,value:d,max:l,children:s.jsx(ft.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Xi(d)?d:void 0,"aria-valuetext":c,role:"progressbar","data-state":jx(d,l),"data-value":d??void 0,"data-max":l,...o,ref:e})})});bx.displayName=Ud;var _x="ProgressIndicator",wx=u.forwardRef((r,e)=>{const{__scopeProgress:t,...n}=r,a=FN(_x,t);return s.jsx(ft.div,{"data-state":jx(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:e})});wx.displayName=_x;function VN(r,e){return`${Math.round(r/e*100)}%`}function jx(r,e){return r==null?"indeterminate":r===e?"complete":"loading"}function Xi(r){return typeof r=="number"}function cm(r){return Xi(r)&&!isNaN(r)&&r>0}function dm(r,e){return Xi(r)&&!isNaN(r)&&r<=e&&r>=0}function zN(r,e){return`Invalid prop \`max\` of value \`${r}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Bd}\`.`}function HN(r,e){return`Invalid prop \`value\` of value \`${r}\` supplied to \`${e}\`. The \`value\` prop must be: 580 - a positive number 581 - less than the value passed to \`max\` (or ${Bd} if no \`max\` prop is set) 582 - \`null\` or \`undefined\` if the progress is indeterminate. 583 584Defaulting to \`null\`.`}var kx=bx,UN=wx;const Ao=u.forwardRef(({className:r,value:e,...t},n)=>s.jsx(kx,{ref:n,className:Y("relative h-4 w-full overflow-hidden rounded-full bg-secondary",r),...t,children:s.jsx(UN,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));Ao.displayName=kx.displayName;const Nx=u.forwardRef(function({isTestMode:e=!1},t){const{subscription:n,isLoading:a}=Ns(),i=n.credits&&n.creditAllocation?Math.min(n.credits/n.creditAllocation*100,100):0;return a?s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-secondary/50 rounded-lg animate-pulse",children:[s.jsx("span",{className:"w-4 h-4 bg-muted rounded"}),s.jsx("span",{className:"w-16 h-4 bg-muted rounded"}),s.jsx("span",{className:"flex-1 h-1.5 bg-muted rounded"}),s.jsx("span",{className:"w-14 h-4 bg-muted rounded"})]}):s.jsxs("div",{ref:t,"data-tour":"credits-display",className:`flex items-center gap-2 px-3 py-2 rounded-lg ${e?"bg-amber-500/10 border border-amber-500/30":"bg-secondary/50"}`,children:[e?s.jsx(yr,{className:"w-4 h-4 text-amber-600 shrink-0"}):s.jsx(_r,{className:"w-4 h-4 text-primary shrink-0"}),s.jsxs("span",{className:`text-sm font-semibold whitespace-nowrap ${e?"text-amber-600":""}`,children:[n.credits??0,"/",n.creditAllocation??0]}),s.jsx(Ao,{value:i,className:`hidden xs:flex flex-1 h-1.5 min-w-8 max-w-16 ${e?"[&>div]:bg-amber-500":""}`}),s.jsx(be,{to:"/pricing#packs",className:`hidden xs:inline text-xs font-medium hover:underline shrink-0 ${e?"text-amber-600":"text-primary"}`,children:"Top Up"})]})});function Sx({onItemClick:r,docsHref:e="/docs",helpHref:t="/help"}){const[n,a]=u.useState(!1);return s.jsxs(Vd,{open:n,onOpenChange:a,children:[s.jsxs(zd,{className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors w-full",children:[s.jsx(ga,{className:"w-4 h-4"}),s.jsx("span",{className:"flex-1 text-left",children:"Resources"}),s.jsx(Rr,{className:`w-4 h-4 transition-transform duration-200 ${n?"rotate-180":""}`})]}),s.jsx(Hd,{className:"overflow-hidden data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up",children:s.jsxs("div",{className:"pl-7 space-y-0.5 pt-1",children:[s.jsxs(be,{to:e,onClick:r,className:"flex items-center gap-2.5 px-3 py-1.5 rounded-md text-sm text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",children:[s.jsx(ga,{className:"w-3.5 h-3.5"}),"Guides & Docs"]}),s.jsxs(be,{to:t,onClick:r,className:"flex items-center gap-2.5 px-3 py-1.5 rounded-md text-sm text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",children:[s.jsx(Ia,{className:"w-3.5 h-3.5"}),"Help Center"]}),s.jsxs("button",{onClick:()=>{window.dispatchEvent(new CustomEvent("open-chat-widget")),r?.()},className:"flex items-center gap-2.5 px-3 py-1.5 rounded-md text-sm text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors w-full",children:[s.jsx(br,{className:"w-3.5 h-3.5"}),"Live Chat"]})]})})]})}function qd({collapsed:r=!1}){const{isEligible:e,isLiveModeOverride:t,toggleMode:n,isLoading:a}=ir();if(!e||a)return null;const i=t;
584return r?s.jsxs(Ht,{delayDuration:0,children:[s.jsx(Ut,{asChild:!0,children:s.jsx("button",{onClick:n,className:` 585 relative flex items-center justify-center p-3 rounded-lg w-full 586 transition-colors duration-200 587 ${i?"bg-emerald-500/10 text-emerald-600 hover:bg-emerald-500/20":"bg-amber-500/10 text-amber-600 hover:bg-amber-500/20"} 588 `,"aria-label":i?"Switch to Test Mode":"Switch to Live Mode",children:i?s.jsx(_r,{className:"w-5 h-5"}):s.jsxs(s.Fragment,{children:[s.jsx(yr,{className:"w-5 h-5"}),s.jsx("span",{className:"absolute top-2 right-2 w-2 h-2 bg-amber-500 rounded-full animate-pulse"})]})})}),s.jsx($t,{side:"right",sideOffset:10,children:i?s.jsx("span",{className:"text-emerald-600",children:"ð Live Mode ⢠Click for Test"}):s.jsx("span",{className:"text-amber-600",children:"𧪠Test Mode ⢠Click for Live"})})]}):s.jsxs("button",{onClick:n,className:` 589 relative flex items-center gap-3 px-3 py-2 rounded-lg w-full text-sm font-medium 590 transition-colors duration-200 591 ${i?"bg-emerald-500/10 text-emerald-600 border border-emerald-500/30 hover:bg-emerald-500/20":"bg-amber-500/10 text-amber-600 border border-amber-500/30 hover:bg-amber-500/20"} 592 `,"aria-label":i?"Switch to Test Mode":"Switch to Live Mode",children:[i?s.jsx(_r,{className:"w-4 h-4"}):s.jsx(yr,{className:"w-4 h-4"}),s.jsx("span",{className:"flex-1 text-left",children:i?"Live Mode":"Test Mode"}),s.jsx("span",{className:` 593 text-[10px] px-1.5 py-0.5 rounded-full 594 ${i?"bg-emerald-500/20 text-emerald-700":"bg-amber-500/20 text-amber-700"} 595 `,children:i?"ð":"ð§ª"}),!i&&s.jsx("span",{className:"absolute top-1.5 right-1.5 w-2 h-2 bg-amber-500 rounded-full animate-pulse"})]})}const Io=co,Ex=uo,BN=lo,Cx=u.forwardRef(({className:r,...e},t)=>s.jsx(Nn,{className:Y("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",r),...e,ref:t}));Cx.displayName=Nn.displayName;const qN=mo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ha=u.forwardRef(({side:r="right",className:e,children:t,...n},a)=>s.jsxs(BN,{children:[s.jsx(Cx,{}),s.jsxs(Sn,{ref:a,className:Y(qN({side:r}),e),...n,children:[t,s.jsxs(Pa,{className:"absolute right-4 top-4 roun
595ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(lt,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ha.displayName=Sn.displayName;const Wd=({className:r,...e})=>s.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",r),...e});Wd.displayName="SheetHeader";const WN=({className:r,...e})=>s.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...e});WN.displayName="SheetFooter";const Ro=u.forwardRef(({className:r,...e},t)=>s.jsx(En,{ref:t,className:Y("text-lg font-semibold text-foreground",r),...e}));Ro.displayName=En.displayName;const Tx=u.forwardRef(({className:r,...e},t)=>s.jsx(Cn,{ref:t,className:Y("text-sm text-muted-foreground",r),...e}));Tx.displayName=Cn.displayName;const GN=[{id:"campaigns",label:"Campaigns",group:"Core",alwaysCore:!0},{id:"videos",label:"Videos",group:"Core",alwaysCore:!0},{id:"actors",label:"Browse Actors",group:"Actors"},{id:"following",label:"Following",group:"Actors"},{id:"scripts",label:"Scripts",group:"Library"},{id:"voices",label:"Voices",group:"Library"},{id:"feed",label:"Discover",group:"Labs"},{id:"context-reply",label:"Context Reply",group:"Labs"},{id:"ad-clone",label:"Ad Clone",group:"Labs"},{id:"showcase",label:"Showcase Studio",group:"Labs"}];function YN({open:r,onOpenChange:e,config:t,togglePin:n,toggleHidden:a,resetConfig:i}){const o=["Core","Actors","Library","Labs"];return s.jsx(Io,{open:r,onOpenChange:e,children:s.jsxs(Ha,{side:"left",className:"w-80 sm:max-w-80",children:[s.jsxs(Wd,{children:[s.jsx(Ro,{children:"Customize Sidebar"}),s.jsx(Tx,{children:"Toggle visibility and pin items to your Core section."})]}),s.jsx("div",{className:"mt-6 space-y-6 overflow-y-auto max-h-[calc(100vh-12rem)]",children:o.map(l=>{const d=GN.filter(c=>c.group===l);return d.length===0?null:s.jsxs("div",{children:[s.jsx("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:l}),s.jsx("div",{className:"space-y-1",children:d.map(c=>{const h=t.hidden.includes(c.id),m=t.pinned.includes(c.id)||c.alwaysCore;return s.jsxs("div",{className:"flex items-center justify-between py-2 px-2 rounded-md hover:bg-secondary/50",children:[s.jsx("span",{className:`text-sm ${h?"text-muted-foreground line-through":"text-foreground"}`,children:c.label}),s.jsxs("div",{className:"flex items-center gap-2",children:[!c.alwaysCore&&s.jsx(ie,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>n(c.id),title:m?"Unpin from Core":"Pin to Core",children:m?s.jsx(g1,{className:"h-3.5 w-3.5 text-primary"}):s.jsx(x1,{className:"h-3.5 w-3.5 text-muted-foreground"})}),!c.alwaysCore&&s.jsx(jd,{checked:!h,onCheckedChange:()=>a(c.id),className:"scale-75"})]})]},c.id)})})]},l)})}),s.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:s.jsxs(ie,{variant:"outline",size:"sm",onClick:i,className:"w-full",children:[s.jsx(v1,{className:"h-3.5 w-3.5 mr-2"}),"Reset to Default"]})})]})})}const Px="vidacious_sidebar_config",bi={pinned:[],hidden:[],coreOrder:["campaigns","videos"]};function ZN(){try{const r=localStorage.getItem(Px);if(!r)return bi;const e=JSON.parse(r);return{pinned:Array.isArray(e.pinned)?e.pinned:[],hidden:Array.isArray(e.hidden)?e.hidden:[],coreOrder:Array.isArray(e.coreOrder)?e.coreOrder:bi.coreOrder}}catch{return bi}}function JN(r){try{localStorage.setItem(Px,JSON.stringify(r))}catch{}}function XN(){const[r,e]=u.useState(ZN),t=u.useCallback(c=>{e(h=>{const m=c(h);return JN(m),m})},[]),n=u.useCallback(c=>{t(h=>{const m=h.pinned.includes(c),f=m?h.pinned.filter(v=>v!==c):[...h.pinned,c],p=m?h.coreOrder.filter(v=>v!==c):[...h.coreOrder,c];return{...h,pinned:f,coreOrder:p}})},[t]),a=u.useCallback(c=>{t(h=>{const f=h.hidden.includes(c)?h.hidden.filter(p=>p!==c):[...h.hidden,c];return{...h,hidden:f}})},[t]),i=u.useCallback(c=>{t(h=>({...h,coreOrder:c}))},[t]),o=u.useCallback(c=>r.pinned.includes(c),[r.pinned]),l=u.useCallback(c=>r.hidden.includes(c),[r.hidden]),d=u.useCallback(()=>{t(()=>bi)},[t]);return{config:r,togglePin:n,toggleHidden:a,reorderCore:i,isPinned:o,isHidden:l,resetConfig:d}}function Ax({onItemClick:r,collapsed:e=!1}){const t=ot(),n=Xt(),{user:a,signOut:i}=Ee(),{subscription:o,isLoading:l}=Ns(),{isCreator:d,isLoading:c}=So(a?.id),{isAdminOrAbove:h,isMod:m}=Ss(),{isEligible:f}=ir(),{config:p,togglePin:v,toggleHidden:x,isPinned:g,isHidden:b,resetConfig:j}=XN(),[k,y]=u.useState(!1),w=h||m||f,N=(D=>D==="/dashboard"?"dashboard":D.startsWith("/showcase")?"showcase":D.startsWith("/create/ad-clone")?"ad-clone":D.startsWith("/create/context-reply")?"context-reply":D.startsWith("/create/scene-generator")?"scene-generator":D==="/create"||D.startsWith("/create")?"create":D==="/feed"||D.startsWith("/feed")?"feed":D==="/following"||D.startsWith("/following")?"following":D.startsWith("/campaigns")?"campaigns":D.startsWith("/actors")?"actors":
595D.startsWith("/scripts")?"scripts":D.startsWith("/voices")?"voices":D.startsWith("/videos")?"videos":D.startsWith("/settings")?"settings":"dashboard")(t.pathname),_=[{id:"campaigns",icon:ji,label:"Campaigns",href:"/campaigns",dataTour:"campaigns-nav"},{id:"videos",icon:t1,label:"Videos",href:"/videos",dataTour:"videos-nav"},{id:"actors",icon:ur,label:"Browse",href:"/actors",dataTour:"actors-nav"},{id:"following",icon:$f,label:"Following",href:"/following"},{id:"feed",icon:Kb,label:"Discover",href:"/feed",badge:"Alpha"},{id:"scripts",icon:ji,label:"Scripts",href:"/scripts",dataTour:"scripts-nav"},{id:"voices",icon:Kc,label:"Voices",href:"/voices"},{id:"context-reply",icon:If,label:"Context Reply",href:"/create/context-reply",badge:"Alpha"},{id:"ad-clone",icon:d1,label:"Ad Clone",href:"/create/ad-clone",badge:"Alpha",hidden:!w},{id:"showcase",icon:_r,label:"Showcase Studio",href:"/showcase",badge:"New",hidden:!w},{id:"scene-generator",icon:n1,label:"Scene Generator",href:"/create/scene-generator",badge:"Alpha",hidden:!w}],C=D=>_.find(ee=>ee.id===D),O=["campaigns","videos"],R=[...O,...p.pinned.filter(D=>!O.includes(D))],L=(p.coreOrder.length>0?[...new Set([...p.coreOrder,...R])].filter(D=>R.includes(D)):R).map(C).filter(D=>!!D&&!D.hidden&&!b(D.id)),A=[{id:"actors-group",icon:ur,label:"Actors",children:[_.find(D=>D.id==="actors"),_.find(D=>D.id==="following")]},{id:"library",icon:ga,label:"Library",children:[_.find(D=>D.id==="scripts"),_.find(D=>D.id==="voices")]},{id:"labs",icon:yr,label:"Labs",defaultCollapsed:!0,children:[_.find(D=>D.id==="feed"),_.find(D=>D.id==="context-reply"),_.find(D=>D.id==="ad-clone"),_.find(D=>D.id==="showcase"),_.find(D=>D.id==="scene-generator")]}],V=D=>D.children.filter(ee=>!ee.hidden&&!g(ee.id)&&!b(ee.id)),G=A.find(D=>V(D).some(ee=>ee.id===N))?.id??null,[se,re]=u.useState(()=>{const D={};for(const ee of A)ee.defaultCollapsed?D[ee.id]=ee.id===G:D[ee.id]=!0;return D}),Z=D=>{re(ee=>({...ee,[D]:!ee[D]}))},P=async()=>{await i(),n("/",{replace:!0})},E=(D,ee)=>{_t("nav_click",{item:D.id,group:ee||"core",pinned:g(D.id)}),r?.()},U=(D,ee)=>{if(D.hidden)return null;const T=`flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${N===D.id?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`;return s.jsxs(be,{to:D.href,onClick:()=>E(D,ee),className:T,"data-tour":D.dataTour,children:[s.jsx(D.icon,{className:"w-5 h-5"}),D.label,D.badge&&s.jsx(rt,{variant:"outline",className:"ml-auto text-[10px] px-1.5 py-0 h-5 bg-primary/10 text-primary border-primary/30",children:D.badge})]},D.id)},J=D=>{if(D.hidden)return null;const ee=`flex items-center justify-center p-3 rounded-lg transition-colors ${N===D.id?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`;return s.jsxs(Ht,{delayDuration:0,children:[s.jsx(Ut,{asChild:!0,children:s.jsx(be,{to:D.href,onClick:()=>E(D),className:ee,"data-tour":D.dataTour,children:s.jsxs("div",{className:"relative",children:[s.jsx(D.icon,{className:"w-5 h-5"}),D.badge&&s.jsx("span",{className:"absolute -top-1 -right-1 w-2 h-2 rounded-full bg-primary animate-pulse"})]})})}),s.jsxs($t,{side:"right",sideOffset:10,children:[D.label,D.badge&&s.jsxs("span",{className:"text-primary ml-1",children:["(",D.badge,")"]})]})]},D.id)},te=D=>{const ee=V(D);if(ee.length===0)return null;const T=se[D.id]??!1,z=ee.some(q=>q.id===N);return s.jsxs(Vd,{open:T,onOpenChange:()=>Z(D.id),children:[s.jsxs(zd,{"data-tour":`${D.id}-nav`,className:`flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors w-full ${z?"text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`,children:[s.jsx(D.icon,{className:"w-5 h-5"}),s.jsx("span",{className:"flex-1 text-left",children:D.label}),s.jsx(Rr,{className:`w-4 h-4 transition-transform duration-200 ${T?"rotate-180":""}`})]}),s.jsx(Hd,{className:"overflow-hidden data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up",children:s.jsx("div",{className:"pl-4 space-y-0.5 pt-0.5",children:ee.map(q=>U(q,D.id))})})]},D.id)};return e?s.jsxs("div",{className:"flex flex-col h-full items-center overflow-hidden group",children:[s.jsxs(Ht,{delayDuration:0,
595children:[s.jsx(Ut,{asChild:!0,children:s.jsx(be,{to:"/create",onClick:r,className:"flex items-center justify-center p-3 rounded-xl bg-primary text-primary-foreground hover:opacity-90 transition-opacity w-full mb-1","data-tour":"new-video-button",children:s.jsx(mn,{className:"w-5 h-5"})})}),s.jsx($t,{side:"right",sideOffset:10,children:"Create Video"})]}),s.jsxs("nav",{className:"flex-1 space-y-1 w-full overflow-y-auto min-h-0",children:[J({id:"dashboard",icon:xa,label:"Dashboard",href:"/dashboard"}),s.jsx("div",{className:"border-t border-border my-1"}),L.map(D=>J(D)),s.jsx("div",{className:"border-t border-border my-1"}),A.map(D=>{const ee=V(D);if(ee.length===0)return null;const T=ee.some(q=>q.id===N),z=ee[0];return s.jsxs(Ht,{delayDuration:0,children:[s.jsx(Ut,{asChild:!0,children:s.jsx(be,{to:z.href,onClick:r,className:`flex items-center justify-center p-3 rounded-lg transition-colors ${T?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`,children:s.jsx(D.icon,{className:"w-5 h-5"})})}),s.jsx($t,{side:"right",sideOffset:10,children:D.label})]},D.id)}),s.jsx("div",{className:"border-t border-border my-1"}),J({id:"settings",icon:ya,label:"Settings",href:"/settings"}),J({id:"console",icon:$s,label:"Developer Console",href:"/console/overview"})]}),s.jsxs("div",{className:"mt-auto pt-3 border-t border-border w-full space-y-1",children:[s.jsxs(Ht,{delayDuration:0,children:[s.jsx(Ut,{asChild:!0,children:s.jsx(be,{to:"/pricing",className:"flex items-center justify-center p-3 rounded-lg text-muted-foreground hover:bg-secondary hover:text-foreground",children:s.jsx(_r,{className:"w-5 h-5 text-primary"})})}),s.jsx($t,{side:"right",sideOffset:10,children:l?s.jsx(s.Fragment,{children:"Loading creditsâ¦"}):s.jsxs(s.Fragment,{children:[o.credits??0," credits ⢠",o.plan||"Free"," Plan",a?.email&&s.jsx("div",{className:"text-muted-foreground mt-1",children:a.email})]})})]}),s.jsxs(Ht,{delayDuration:0,children:[s.jsx(Ut,{asChild:!0,children:s.jsx(ie,{variant:"ghost",onClick:P,className:"w-full justify-center p-3 text-muted-foreground hover:text-foreground",children:s.jsx(va,{className:"w-5 h-5"})})}),s.jsx($t,{side:"right",sideOffset:10,children:"Sign Out"})]})]})]}):s.jsxs("div",{className:"flex flex-col h-full overflow-hidden group",children:[s.jsxs("nav",{className:"flex-1 space-y-0.5 overflow-y-auto min-h-0 scrollbar-subtle",children:[s.jsxs(be,{to:"/create",onClick:r,className:"flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl bg-primary text-primary-foreground font-semibold text-sm hover:opacity-90 transition-opacity mb-2","data-tour":"new-video-button",children:[s.jsx(mn,{className:"w-5 h-5"}),"Create Video"]}),U({id:"dashboard",icon:xa,label:"Dashboard",href:"/dashboard"}),L.length>0&&s.jsx("div",{className:"space-y-0.5",children:L.map(D=>U(D,"core"))}),A.map(te),s.jsxs("div",{className:"pt-2 mt-2 border-t border-border space-y-0.5",children:[U({id:"settings",icon:ya,label:"Settings",href:"/settings"}),U({id:"console",icon:$s,label:"Dev Console",href:"/console/overview"}),!c&&!d&&s.jsxs(be,{to:"/become-creator",onClick:r,className:`flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${t.pathname==="/become-creator"?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`,children:[s.jsx(Ra,{className:"w-5 h-5"}),s.jsx("span",{children:"Earn as Creator"})]}),s.jsxs(be,{to:"/refer",onClick:r,className:`flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${t.pathname==="/refer"||t.pathname.startsWith("/partners")?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`,children:[s.jsx(fo,{className:"w-5 h-5"}),s.jsx("span",{children:"Refer & Earn"})]}),s.jsx(Md,{collapsed:e,onItemClick:r,typeFilter:["transactional","billing","system","marketing"]}),s.jsx(Sx,{onItemClick:r}),s.jsxs("button",{onClick:()=>y(!0),className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors text-muted-foreground hover:bg-secondary hover:text-foreground w-full",children:[s.jsx(w1,{className:"w-5 h-5"}),s.jsx("span",{children:"Customize"})]}),s.jsx(qd,{collapsed:e})]})]}),s.jsxs("div",{className:"mt-auto pt-3 border-t border-border space-y-2",children:[s.jsx("div",{className:"px-3 text-xs text-muted-foreground truncate",children:a?.email}),s.jsx(Nx,{}),s.jsxs(ie,{variant:"ghost",onClick:P,className:"w-full justify-start text-muted-foreground hover:text-foreground h-9",children:[s.jsx(va,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]}),s.jsx(YN,{open:k,onOpenChange:y,config:p,togglePin:v,toggleHidden:x,resetConfig:j})]})}function KN(){const{user:r}=Ee(),[e,t]=u.useState({hasCompletedAvatarSetup:!1,hasVerifiedIdentity:!1,hasFailed:!1,avatarStatus:null,verificationStatus:null,isLoading:!0,creatorId:null});return u.useEffect(()=>{if(!r){t(a=>({...a,isLoading:!1}));return}(async()=>{try{const{data:a,error:i}=await W.from("creator_profiles").select("id, heygen_avatar_status, heygen_verification_status, primary_avatar_id, avatar_video_url, consent_video_url, is_verified").eq("user_id",r.id).maybeSingle();if(i){console.error("[useCreatorAvatarStatus] Error fetching profile:",i),t(m=>({...m,isLoading:!1}));return}if(!a){t(m=>({...m,isLoading:!1}));return}const o=a.heygen_avatar_status,l=a.heygen_verification_status,d=o==="failed",c=o==="completed"||!!a.primary_avatar_id||!d&&!!a.avatar_video_url&&!!a.consent_video_url,h=l==="verified"||o==="completed"||!!a.is_verified;t({hasCompletedAvatarSetup:c,hasVerifiedIdentity:h,hasFailed:d,avatarStatus:o,verificationStatus:l,isLoading:!1,creatorId:a.id})}catch(a){console.error("[useCreatorAvatarStatus] Exception:",a),t(i=>({...i,isLoading:!1}))}})()},[r]),e}function QN({onItemClick:r,helpHref:e="/help"}){const[t,n]=u.useState(!1);return s.jsxs(Vd,{open:t,onOpenChange:n,children:[s.jsxs(zd,{className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors w-full",children:[s.jsx(u1,{className:"w-4 h-4"}),s.jsx("span",{className:"flex-1 text-left",children:"Support"}),s.jsx(Rr,{className:`w-4 h-4 transition-transform duration-200 ${t?"rotate-180":""}`})]}),s.jsx(Hd,{className:"overflow-hidden data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up",children:s.jsxs("div",{className:"pl-7 space-y-0.5 pt-1",children:[s.jsxs(be,{to:e,onClick:r,className:"flex items-center gap-2.5 px-3 py-1.5 rounded-md text-sm text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors",children:[s.jsx(Ia,{className:"w-3.5 h-3.5"}),"Help Center"]}),s.jsxs("button",{onClick:()=>{window.dispatchEvent(new CustomEvent("open-chat-widget")),r?.()},className:"flex items-center gap-2.5 px-3 py-1.5 rounded-md text-sm text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors w-full",children:[s.jsx(br,{className:"w-3.5 h-3.5"}
595),"Priority Support"]})]})})]})}const eS=2166136261,tS=16777619;function Ix(r){let e=eS;for(let t=0;t<r.length;t++)e^=r.charCodeAt(t),e=Math.imul(e,tS)>>>0;return e}const um=1e4;function rS(r,e){const t=Ix(`${r}:${e.key}`)%um;let n=0;for(const a of e.variants)if(n+=a.weight*(um/100),t<n)return a.id;return"control"}function sS(r,e){return e<=0?!1:e>=100?!0:Ix(`${r}:__holdout__`)%100<e}function nS(r,e){const t=new Map;for(const a of e)if(a.exclusiveGroup){const i=t.get(a.exclusiveGroup)||[];i.push(a),t.set(a.exclusiveGroup,i)}const n={...r};for(const[,a]of t){if(a.length<=1)continue;const i=[...a].sort((o,l)=>o.priority-l.priority);for(let o=1;o<i.length;o++)n[i[o].key]="control"}return n}const aS=[/Googlebot/i,/bingbot/i,/Baiduspider/i,/YandexBot/i,/DuckDuckBot/i,/Slurp/i,/facebookexternalhit/i,/LinkedInBot/i,/Twitterbot/i,/Applebot/i,/SemrushBot/i,/AhrefsBot/i,/MJ12bot/i,/DotBot/i,/PetalBot/i,/Bytespider/i,/GPTBot/i,/ClaudeBot/i,/Amazonbot/i,/ia_archiver/i];function iS(r){if(typeof navigator<"u"&&navigator.webdriver)return!0;const e=typeof navigator<"u"?navigator.userAgent:"";return e?aS.some(t=>t.test(e)):!1}const hm="vid_did",Rx="vid_exp",oS=30*24*60*60;function Mx(r){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp(`(?:^|;\\s*)${r}=([^;]*)`));return e?decodeURIComponent(e[1]):null}function Ox(r,e,t=oS){if(typeof document>"u")return;const a=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${r}=${encodeURIComponent(e)}; max-age=${t}; path=/; SameSite=Lax${a}`}function lS(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function cS(){let r=Mx(hm);return r||(r=lS(),Ox(hm,r)),r}function dS(){const r=Mx(Rx);if(!r)return{};try{return JSON.parse(atob(r))}catch{return{}}}function uS(r){try{const e=btoa(JSON.stringify(r));Ox(Rx,e)}catch{}}function hS(r){const e=iS(),t=e?"bot":cS(),n=e?{}:dS(),a={};for(const o of r){if(e){a[o.key]="control";continue}if(n[o.key]&&o.variants.some(d=>d.id===n[o.key])){a[o.key]=n[o.key];continue}if(sS(t,o.holdoutPercent)){a[o.key]="control";continue}a[o.key]=rS(t,o)}const i=nS(a,r);return e||uS(i),{distinct_id:t,experiments:i,assigned_at:new Date().toISOString(),is_bot:e}}const Ua=[{key:"landing_hero_v2",description:"Test new hero section copy and CTA layout",variants:[{id:"control",weight:50,label:"Original Hero",description:"Current hero section with standard copy and layout"},{id:"variant_a",weight:25,label:"Bold CTA",description:'Emphasizes "AI Video Ads" with accent badge and bolder call-to-action'},{id:"variant_b",weight:25,label:"Social Proof",description:'Leads with "Trusted by 2,000+ brands" and video testimonials above fold'}],active:!0,startDate:"2026-02-15T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:"landing",priority:1,holdoutPercent:0},{key:"pricing_discount_framing",description:"Discount messaging: 30% vs 50% vs urgency framing on pricing surfaces",variants:[{id:"control",weight:34,label:"Standard Pricing",description:"Current pricing page with no discount framing"},{id:"variant_a",weight:33,label:"Urgency Frame",description:'"Limited Time" countdown-style discount messaging'},{id:"variant_b",weight:33,label:"Big Discount",description:'"50% OFF" large discount emphasis with two-column layout'}],active:!0,startDate:"2026-02-15T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:"pricing",priority:1,holdoutPercent:0,previewPath:"/#pricing"},{key:"free_tier_credits_gate",description:"Free video allowance copy and upgrade prompt timing in create flow",variants:[{id:"control",weight:50,label:"Standard Prompt",description:"Current free video allowance copy"},{id:"variant_a",weight:50,label:"Early Upgrade",description:"Earlier upgrade prompt with adjusted free-tier messaging"}],active:!0,startDate:"2026-02-15T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:null,priority:2,holdoutPercent:0,previewPath:"/create"},{key:"onboarding_tour_style",description:"Tour style: full walkthrough vs tooltip-only vs off",variants:[{id:"control",weight:34,label:"No Tour",description:"No onboarding tour shown"},{id:"variant_a",weight:33,label:"Full Walkthrough",description:"Step-by-step guided tour of all features"},{id:"variant_b",weight:33,label:"Tooltip Only",description:"Contextual tooltips without full walkthrough"}],active:!0,startDate:"2026-02-15T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:"onboarding",priority:1,holdoutPercent:0,previewPath:"/dashboard"},{key:"studio_create_layout",description:"Merged actor+script layout vs tabbed steps in /create",variants:[{id:"control",weight:50,label:"Tabbed Steps",description:"Current multi-tab create flow"},{id:"variant_a",weight:50,label:"Merged Layout",description:"Combined actor + script panel in single view"}],active:!0,startDate:"2026-02-15T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:"create",priority:1,holdoutPercent:0,previewPath:"/create"},{key:"post_gen_share_cta",description:"Share button prominence and caption attachment flow after video generation",variants:[{id:"control",weight:50,label:"Subtle Share",description:"Current share button placement"},{id:"variant_a",weight:50,label:"Prominent Share",description:"Larger share CTA with caption attachment flow"}],active:!0,startDate:"2026-02-15T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:"studio",priority:1,holdoutPercent:0,previewPath:"/create"},{key:"reel_page_cta_placement",description:"CTA position on actor/reel detail: near video vs below fold",variants:[{id:"control",weight:50,label:"Below Fold",de
595scription:"CTA positioned below the video content"},{id:"variant_a",weight:50,label:"Near Video",description:"CTA positioned adjacent to the video player"}],active:!0,startDate:"2026-02-15T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:"marketplace",priority:1,holdoutPercent:0,previewPath:"/actors"},{key:"creator_portal_nav",description:"Creator sidebar navigation density and share affordance placement",variants:[{id:"control",weight:50,label:"Standard Nav",description:"Current sidebar navigation density"},{id:"variant_a",weight:50,label:"Compact Nav",description:"Denser sidebar with inline share affordance"}],active:!0,startDate:"2026-02-15T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:"creator",priority:1,holdoutPercent:0,previewPath:"/creator/dashboard"},{key:"content_cta_copy",description:"CTA copy variant on blog posts: try_template vs try_free vs remove_watermark",variants:[{id:"control",weight:34,label:"Try Template",description:"CTA links to Studio"},{id:"variant_a",weight:33,label:"Try Free",description:"CTA links to signup"},{id:"variant_b",weight:33,label:"Remove Watermark",description:"CTA links to pricing"}],active:!0,startDate:"2026-02-17T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:"content",priority:1,holdoutPercent:0,previewPath:"/resources/blog/ugc-video-ads"},{key:"content_cta_placement",description:"CTA placement on blog posts: mid_only vs top_only vs top_and_mid",variants:[{id:"control",weight:34,label:"Mid Only",description:"CTA after 2nd H2 only"},{id:"variant_a",weight:33,label:"Top Only",description:"CTA after KeyTakeaways only"},{id:"variant_b",weight:33,label:"Top and Mid",description:"Both positions"}],active:!0,startDate:"2026-02-17T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:"content",priority:2,holdoutPercent:0,previewPath:"/resources/blog/ugc-video-ads"},{key:"content_platform_cta",description:"Platform-specific CTA framing on platform blog posts",variants:[{id:"control",weight:34,label:"Generic",description:"Create your first AI video ad"},{id:"variant_a",weight:33,label:"TikTok",description:"Create a TikTok ad in 60 seconds"},{id:"variant_b",weight:33,label:"Reels",description:"Make a Reels ad now"}],active:!0,startDate:"2026-02-17T00:00:00Z",endDate:"2026-03-17T23:59:59Z",exclusiveGroup:null,priority:3,holdoutPercent:0,previewPath:"/resources/blog/ugc-video-ads"},{key:"product_video_storyboard_style",description:"Product ImageâVideo (Experimental): test storyboard UI â UGC-first vs cinematic-first vs control (3-script flow)",variants:[{id:"control",weight:34,label:"Script Flow",description:"Lightweight 3-script flow (no storyboard UI) â validates demand before full build"},{id:"ugc_first",weight:33,label:"UGC First",description:"Storyboard defaults to UGC/creator-style scenes with actor talking-head"},{id:"cinematic_first",weight:33,label:"Cinematic First",description:"Storyboard defaults to cinematic product shots (Stage 2 path)"}],active:!1,startDate:null,endDate:null,exclusiveGroup:"product_video",priority:1,holdoutPercent:0,previewPath:"/create/product-video"}];function mS(r=new Date){return Ua.filter(e=>!(!e.active||e.startDate&&new Date(e.startDate)>r||e.endDate&&new Date(e.endDate)<r))}function DA(r){return Ua.find(e=>e.key===r)??null}function LA(r,e){return Ua.find(a=>a.key===r)?.variants.find(a=>a.id===e)?.label||e.replace(/_/g," ")}function $A(r,e){return Ua.find(a=>a.key===r)?.variants.find(a=>a.id===e)?.description||null}const Dx=u.createContext(null);function pS({children:r}){const e=u.useMemo(()=>{let t;window.__VID_EXP__?t=window.__VID_EXP__:(t=hS(mS()),window.__VID_EXP__=t);const n=new URLSearchParams(window.location.search);if(n.get("exp_kill")==="1")for(const i of Object.keys(t.experiments))t.experiments[i]="control";for(const[i,o]of n.entries())if(i.startsWith("exp_force_")){const l=i.slice(10),d=Ua.some(c=>c.key===l);(t.experiments[l]!==void 0||d)&&(t.experiments[l]=o)}const a=Object.freeze({...t.experiments});return Object.freeze({getVariant:i=>a[i]||"control",isEnabled:i=>(a[i]||"control")!=="control",getAllAssignments:()=>a,distinctId:t.distinct_id,isBot:t.is_bot})},[]);return s.jsx(Dx.Provider,{value:e,children:r})}function fS(){const r=u.useContext(Dx);return r||{getVariant:()=>"control",isEnabled:()=>!1,getAllAssignments:()=>({}),distinctId:"",isBot:!1}}function Lx(r){const{getVariant:e}=fS(),t=e(r);return{variant:t,isControl:t==="control"}}const mm=[{id:"home",icon:xa,label:"Home",href:"/creator-dashboard",requiresOnboarding:!1,
595comingSoon:!1,dataTour:"creator-dashboard-nav"},{id:"content",icon:s1,label:"Content",href:"/creators/content",requiresOnboarding:!0,comingSoon:!1,dataTour:"creator-content-nav"},{id:"my-clone",icon:Bt,label:"My Clone",href:"/creators/my-clone",requiresOnboarding:!0,comingSoon:!1,dataTour:"creator-clone-nav"},{id:"earnings",icon:Ra,label:"Earnings",href:"/creators/earnings",requiresOnboarding:!0,comingSoon:!1,dataTour:"creator-earnings-nav"},{id:"settings",icon:ya,label:"Settings",href:"/creators/settings",requiresOnboarding:!0,comingSoon:!1,dataTour:"creator-settings-nav"},{id:"academy",icon:i1,label:"Academy",href:"/creators/academy",requiresOnboarding:!1,comingSoon:!1,dataTour:"creator-academy-nav"}],gS={id:"identity",icon:b1,label:"Identity",href:"/creators/avatar-setup",requiresOnboarding:!0,comingSoon:!1,dataTour:"creator-identity-nav"};function $x({onItemClick:r,collapsed:e=!1}){const t=ot(),n=Xt(),{user:a,signOut:i}=Ee();Ss();const{creatorProfile:o,availableBalance:l,isVerified:d,isLoading:c,refetch:h}=So(a?.id),{hasVerifiedIdentity:m,isLoading:f}=KN(),{isTestMode:p}=ir();Lx("creator_portal_nav"),u.useEffect(()=>{a?.id&&h()},[t.pathname,a?.id]);const v=c||!!o?.display_name&&!!o?.bio,x=u.useMemo(()=>{if(f||m)return mm;const w=[...mm];return w.splice(1,0,gS),w},[m,f]),g=p?o?.test_available_balance??0:l,j=(w=>w==="/creator-dashboard"?"home":w.includes("/creators/content")||w.includes("/creators/submissions")?"content":w.includes("/creators/earnings")||w.includes("/creators/monetization")||w.includes("/creators/payouts")?"earnings":w.includes("/creators/settings")||w.includes("/creators/identity")?"settings":w.includes("/creators/avatar-setup")?"identity":w.includes("/creators/my-clone")?"my-clone":w.includes("/creators/academy")?"academy":"home")(t.pathname),k=async()=>{await i(),n("/",{replace:!0})},y=(w,S)=>{if(w.requiresOnboarding&&!v){S.preventDefault();return}r?.()};return e?s.jsxs("div",{className:"flex flex-col h-full items-center overflow-hidden group",children:[s.jsx("nav",{className:"flex-1 space-y-1 w-full overflow-y-auto min-h-0",children:x.map(w=>{const S=w.requiresOnboarding&&!v,N=s.jsxs("div",{className:"relative",children:[s.jsx(w.icon,{className:"w-5 h-5"}),w.comingSoon&&s.jsx("span",{className:"absolute -top-1 -right-1 w-2 h-2 rounded-full bg-amber-500 animate-pulse"})]}),_=`flex items-center justify-center p-3 rounded-lg transition-colors ${j===w.id?"bg-primary/10 text-primary":S?"text-muted-foreground/40 cursor-not-allowed":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`;return s.jsxs(Ht,{delayDuration:0,children:[s.jsx(Ut,{asChild:!0,children:S?s.jsx("div",{className:_,title:"Complete onboarding to unlock",children:N}):s.jsx(be,{to:w.href,onClick:C=>y(w,C),className:_,"data-tour":w.dataTour,children:N})}),s.jsxs($t,{side:"right",sideOffset:10,children:[w.label,S&&s.jsx("span",{className:"text-muted-foreground ml-1",children:"(locked)"}),w.comingSoon&&s.jsx("span",{className:"text-amber-500 ml-1",children:"(Soon)"})]})]},w.id)})}),s.jsxs("div",{className:"mt-auto pt-3 border-t border-border w-full space-y-1",children:[s.jsxs(Ht,{delayDuration:0,children:[s.jsx(Ut,{asChild:!0,children:s.jsx(be,{to:"/creators/earnings?tab=payouts",className:"flex items-center justify-center p-3 rounded-lg text-muted-foreground hover:bg-secondary hover:text-foreground",children:p?s.jsx(yr,{className:"w-5 h-5 text-amber-500"}):s.jsx(Ra,{className:"w-5 h-5 text-primary"})})}),s.jsxs($t,{side:"right",sideOffset:10,children:[p&&s.jsx("span",{className:"text-amber-500",children:"[Test] "}),"$",g.toFixed(2)," Available",d&&s.jsx("span",{className:"text-primary ml-1",children:"â"}),a?.email&&s.jsx("div",{className:"text-muted-foreground mt-1",children:a.email})]})]}),s.jsxs(Ht,{delayDuration:0,children:[s.jsx(Ut,{asChild:!0,children:s.jsx(ie,{variant:"ghost",onClick:k,className:"w-full justify-center p-3 text-muted-foreground hover:text-foreground",children:s.jsx(va,{className:"w-5 h-5"})})}),s.jsx($t,{side:"right",sideOffset:10,children:"Sign Out"})]})]})]}):s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.jsxs("nav",{className:"flex-1 space-y-0.5 overflow-y-auto min-h-0 scrollbar-subtle",children:[x.map(w=>w.requiresOnboarding&&!v?s.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium text-muted-foreground
595/40 cursor-not-allowed",title:"Complete onboarding to unlock",children:[s.jsx(w.icon,{className:"w-5 h-5"}),w.label]},w.id):s.jsxs(be,{to:w.href,onClick:N=>y(w,N),"data-tour":w.dataTour,className:`flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${j===w.id?"bg-primary/10 text-primary":w.comingSoon?"text-muted-foreground/70 hover:bg-secondary/50":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`,children:[s.jsx(w.icon,{className:"w-5 h-5"}),s.jsx("span",{className:"flex-1",children:w.label}),w.id==="identity"&&!m&&s.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[s.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75"}),s.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-amber-500"})]}),w.comingSoon&&s.jsx(rt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 bg-amber-500/10 text-amber-600 dark:text-amber-400",children:"Soon"})]},w.id)),s.jsxs("div",{className:"pt-2 mt-2 border-t border-border space-y-0.5",children:[s.jsx(Md,{collapsed:e,onItemClick:r,typeFilter:["creator","system"]}),s.jsx(QN,{onItemClick:r,helpHref:"/help#creators"}),s.jsx(qd,{collapsed:e})]})]}),s.jsxs("div",{className:"mt-auto pt-3 border-t border-border space-y-2",children:[d&&s.jsx("div",{className:"px-3 py-2 bg-primary/10 rounded-lg",children:s.jsxs("div",{className:"flex items-center gap-2 text-primary text-sm",children:[s.jsx(Df,{className:"w-4 h-4"}),s.jsx("span",{className:"font-medium",children:"Verified Creator â"})]})}),s.jsx("div",{className:"px-3 text-xs text-muted-foreground truncate",children:a?.email}),s.jsxs("div",{className:`px-3 py-2.5 rounded-lg ${p?"bg-amber-500/10 border border-amber-500/20":"bg-secondary/50"}`,children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[p&&s.jsx(yr,{className:"w-3 h-3 text-amber-500"}),p?"Test Balance":"Available Balance"]}),s.jsx(Lf,{className:`w-3.5 h-3.5 ${p?"text-amber-500":"text-primary"}`})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:`text-lg font-bold ${p?"text-amber-500":"text-primary"}`,children:["$",g.toFixed(2)]}),s.jsx(be,{to:"/creators/earnings?tab=payouts",className:`text-xs font-medium hover:underline ${p?"text-amber-500":"text-primary"}`,children:"Request Payout"})]})]}),s.jsxs(ie,{variant:"ghost",onClick:k,className:"w-full justify-start text-muted-foreground hover:text-foreground h-9",children:[s.jsx(va,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]})]})}function xS(){const{user:r}=Ee(),[e,t]=u.useState(!1),[n,a]=u.useState(!0);return u.useEffect(()=>{(async()=>{if(!r){t(!1),a(!1);return}try{const{data:o,error:l}=await W.from("user_roles").select("role").eq("user_id",r.id).eq("role","superadmin").maybeSingle();l?(console.error("Error checking superadmin status:",l),t(!1)):t(!!o)}catch(o){console.error("Error checking superadmin status:",o),t(!1)}finally{a(!1)}})()},[r]),{isSuperAdmin:e,isLoading:n}}function vS(){const[r,e]=u.useState(0),[t,n]=u.useState(!0),a=u.useCallback(async()=>{try{const{count:i,error:o}=await W.from("creator_submissions").select("*",{count:"exact",head:!0}).eq("status","pending");if(o)throw o;e(i||0)}catch(i){console.error("Error fetching pending submissions count:",i)}finally{n(!1)}},[]);return u.useEffect(()=>{a();const i=W.channel("pending-submissions-count").on("postgres_changes",{event:"*",schema:"public",table:"creator_submissions"},()=>{a()}).subscribe();return()=>{W.removeChannel(i)}},[a]),{pendingCount:r,isLoading:t,refetch:a}}function yS(){const{isAdminOrAbove:r}=Ss(),[e,t]=u.useState({total:0,open:0,pending:0,needsHuman:0}),[n,a]=u.useState(!0),i=u.useRef(0),o=u.useRef(!1),l=u.useCallback(async()=>{if(!r){a(!1);return}try{const{data:d,error:c}=await W.from("support_conversations").select("status").in("status",["open","pending"]);if(c)throw c;const h=d?.filter(p=>p.status==="open").length||0,m=d?.filter(p=>p.status==="pending").length||0,f=h+m;if(o.current&&m>i.current){const p=m-i.current;ne.warning(`ð¨ ${p} new support ${p===1?"conversation needs":"conversations need"} human attention!`,{duration:1e4,action:{label:"View",onClick:()=>{window.location.href="/admin?group=support&tab=support"}}}),Gi(.5)}
595i.current=m,o.current=!0,t({total:f,open:h,pending:m,needsHuman:m})}catch(d){console.error("Error fetching support stats:",d)}finally{a(!1)}},[r]);return u.useEffect(()=>{l()},[l]),u.useEffect(()=>{if(!r)return;const d=W.channel("support_notifications").on("postgres_changes",{event:"*",schema:"public",table:"support_conversations"},()=>{l()}).subscribe();return()=>{W.removeChannel(d)}},[r,l]),{stats:e,isLoading:n,refetch:l}}const bS=[{id:"users",icon:ur,label:"Users & Access",href:"/admin?group=users",defaultTab:"users",modAccessible:!1},{id:"creators",icon:$f,label:"Creators",href:"/admin?group=creators",defaultTab:"submissions",badgeType:"submissions",modAccessible:!1},{id:"content",icon:Dt,label:"Content",href:"/admin?group=content",defaultTab:"homepage",modAccessible:!1},{id:"analytics",icon:po,label:"Analytics & Billing",href:"/admin?group=analytics",defaultTab:"activity",modAccessible:!1},{id:"videos",icon:Dt,label:"Video Observatory",href:"/admin?group=videos",defaultTab:"video-observatory",modAccessible:!1},{id:"support",icon:ki,label:"Support",href:"/admin?group=support",defaultTab:"support",badgeType:"support",modAccessible:!0},{id:"email",icon:l1,label:"Email Hub",href:"/admin?group=email",defaultTab:"email-hub",modAccessible:!1},{id:"startups",icon:Ni,label:"Startups",href:"/admin?group=startups",defaultTab:"startup-applications",modAccessible:!1},{id:"ops",icon:_1,label:"Ops Pager",href:"/admin?group=ops",defaultTab:"ops-dashboard",modAccessible:!1},{id:"system",icon:on,label:"System",href:"/admin?group=system",superAdminOnly:!0,defaultTab:"sync",modAccessible:!1}];function Ki({onItemClick:r,collapsed:e=!1,modOnly:t=!1}){const[n]=Tn(),a=Xt(),{user:i,signOut:o}=Ee(),{subscription:l}=Ns(),{isSuperAdmin:d}=xS(),{isMod:c,isAdminOrAbove:h}=Ss(),{pendingCount:m}=vS(),{stats:f}=yS(),{isTestMode:p}=ir(),v=n.get("group")||"users",x=l.credits&&l.creditAllocation?Math.min(l.credits/l.creditAllocation*100,100):0,g=async()=>{await o(),a("/",{replace:!0})},b=bS.filter(j=>j.superAdminOnly&&!d?!1:t?j.modAccessible:!!(d||h||c&&j.modAccessible));return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.jsxs("nav",{className:"flex-1 space-y-0.5 overflow-y-auto min-h-0 scrollbar-subtle",children:[b.map(j=>s.jsxs(be,{to:j.href,onClick:r,title:e?j.label:void 0,className:`flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${v===j.id?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`,children:[s.jsx(j.icon,{className:"w-4 h-4"}),!e&&s.jsx("span",{className:"flex-1",children:j.label}),j.badgeType==="submissions"&&m>0&&s.jsx(rt,{variant:"secondary",className:"bg-accent/20 text-accent-foreground hover:bg-accent/30 px-1.5 py-0.5 text-xs font-semibold",children:m}),j.badgeType==="support"&&f.needsHuman>0&&s.jsx(rt,{variant:"destructive",className:"px-1.5 py-0.5 text-xs font-semibold animate-pulse",children:f.needsHuman}),j.badgeType==="support"&&f.needsHuman===0&&f.open>0&&s.jsx(rt,{variant:"secondary",className:"bg-primary/20 text-primary hover:bg-primary/30 px-1.5 py-0.5 text-xs font-semibold",children:f.open})]},j.id)),s.jsxs("div",{className:"pt-2 mt-2 border-t border-border space-y-0.5",children:[s.jsx(Md,{collapsed:e,onItemClick:r,typeFilter:["system","support"]}),s.jsx(Sx,{onItemClick:r}),s.jsx(qd,{collapsed:e})]})]}),s.jsxs("div",{className:"mt-auto pt-3 border-t border-border space-y-2",children:[s.jsx("div",{className:"px-3 text-xs text-muted-foreground truncate",children:i?.email}),s.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg ${p?"bg-amber-500/10 border border-amber-500/30":"bg-secondary/50"}`,children:[p?s.jsx(yr,{className:"w-4 h-4 text-amber-600 shrink-0"}):s.jsx(_r,{className:"w-4 h-4 text-primary shrink-0"}),s.jsxs("span",{className:`text-sm font-semibold whitespace-nowrap ${p?"text-amber-600":""}`,children:[l.credits??0,"/",l.creditAllocation??0]}),s.jsx(Ao,{value:x,className:`flex-1 h-1.5 min-w-8 max-w-16 ${p?"[&>div]:bg-amber-500":""}`}),p&&s.jsx("span",{className:"text-[10px] text-amber-600/80",children:"Test"})]}),s.jsxs(ie,{variant:"ghost",onClick:g,className:"w-full justify-start text-muted-foreground hover:text-foreground h-9",children:[s.jsx(va,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]})]})}const _S=["/create","/dashboard-test"];function wS(){const{user:r}=Ee(),e=ot(),{currentWorkspace:t}=Eo(),n=u.useRef(null),[a,i]=u.useState(!1),o=["/dashboard","/videos","/settings","/scripts","/voices","/campaigns","/checkout","/admin","/creators","/create","/feed","/following","/moderator-dashboard","/creator-dashboard","/showcase"],d=["/creators/become","/become-creator","/creators/sign-mock"].some(x=>e.pathname===x),c=e.pathname==="/actors",h=o.some(x=>e.pathname.startsWith(x))||c,m=_S.some(x=>e.pathname.startsWith(x)),f=m&&!a;u.useEffect(()=>{const x=document.documentElement;return x.style.setProperty("--app-sidebar-width",f?"4rem":"16rem"),()=>{x.style.removeProperty("--app-sidebar-width")}},[f]);const p=()=>
595{m&&!a&&i(!0)};if(u.useEffect(()=>{if(!m||!a)return;const x=g=>{n.current&&!n.current.contains(g.target)&&i(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[m,a]),u.useEffect(()=>{i(!1)},[e.pathname]),!r||d||!h)return null;const v=()=>{switch(t){case"creator":return s.jsx($x,{collapsed:f});case"admin":return s.jsx(Ki,{collapsed:f});case"moderator":return s.jsx(Ki,{collapsed:f,modOnly:!0});default:return s.jsx(Ax,{collapsed:f})}};return s.jsx(s.Fragment,{children:s.jsx("aside",{ref:n,onClick:p,className:`hidden lg:flex border-r border-border bg-sidebar flex-col fixed left-0 bottom-0 z-40 transition-all duration-200 cursor-pointer ${f?"w-16 p-2":"w-64 p-4"}`,style:{top:"calc(var(--campaign-banner-height, 0px) + var(--header-height))"},children:v()})})}const Gd=jy,Yd=ky,FA=Ny,jS=u.forwardRef(({className:r,inset:e,children:t,...n},a)=>s.jsxs(Sp,{ref:a,className:Y("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",r),...n,children:[t,s.jsx(Jr,{className:"ml-auto h-4 w-4"})]}));jS.displayName=Sp.displayName;const kS=u.forwardRef(({className:r,...e},t)=>s.jsx(Ep,{ref:t,className:Y("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",r),...e}));kS.displayName=Ep.displayName;const Mo=u.forwardRef(({className:r,sideOffset:e=4,...t},n)=>s.jsx(wy,{children:s.jsx(Cp,{ref:n,sideOffset:e,className:Y("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",r),...t})}));Mo.displayName=Cp.displayName;const un=u.forwardRef(({className:r,inset:e,...t},n)=>s.jsx(Tp,{ref:n,className:Y("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",r),...t}));un.displayName=Tp.displayName;const NS=u.forwardRef(({className:r,children:e,checked:t,...n},a)=>s.jsxs(Pp,{ref:a,className:Y("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",r),checked:t,...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Ap,{children:s.jsx(Ue,{className:"h-4 w-4"})})}),e]}));NS.displayName=Pp.displayName;const SS=u.forwardRef(({className:r,children:e,...t},n)=>s.jsxs(Ip,{ref:n,className:Y("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",r),...t,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Ap,{children:s.jsx(Xb,{className:"h-2 w-2 fill-current"})})}),e]}));SS.displayName=Ip.displayName;const Fx=u.forwardRef(({className:r,inset:e,...t},n)=>s.jsx(Rp,{ref:n,className:Y("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",r),...t}));Fx.displayName=Rp.displayName;const Vx=u.forwardRef(({className:r,...e},t)=>s.jsx(Mp,{ref:t,className:Y("-mx-1 my-1 h-px bg-muted",r),...e}));Vx.displayName=Mp.displayName;const pm={studio:{label:"Studio",icon:p1,color:"text-primary"},creator:{label:"Creator",icon:ur,color:"text-emerald-500"},moderator:{label:"Moderator",icon:Cf,color:"text-cyan-500"},admin:{label:"Admin",icon:Pn,color:"text-amber-500"}};function ES({variant:r="default"}
595){const{currentWorkspace:e,availableWorkspaces:t,switchWorkspace:n,isLoading:a}=Eo(),i=pm[e],o=i.icon;return a?s.jsxs(ie,{variant:"ghost",disabled:!0,className:`gap-2 font-medium ${r==="compact"?"h-9 px-3 text-sm":"h-10 px-4 text-base"}`,children:[s.jsx(o,{className:`h-4 w-4 ${i.color}`}),s.jsx("span",{className:"hidden sm:inline",children:i.label}),s.jsx(Mt,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"})]}):t.length<=1?s.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-1 rounded-md bg-secondary/50 ${r==="compact"?"h-8 text-xs sm:text-sm":"h-9 text-sm"}`,children:[s.jsx(o,{className:`h-4 w-4 ${i.color}`}),s.jsx("span",{className:"font-medium",children:i.label})]}):s.jsxs(Gd,{children:[s.jsx(Yd,{asChild:!0,children:s.jsxs(ie,{variant:"ghost",className:`justify-between gap-2 3xl:gap-3 4xl:gap-4 font-medium ${r==="compact"?"h-9 px-3 text-sm 3xl:h-11 3xl:px-4 3xl:text-base 4xl:h-13 4xl:px-5 4xl:text-lg":"h-10 px-4 text-base 3xl:h-12 3xl:px-5 3xl:text-lg 4xl:h-14 4xl:px-6 4xl:text-xl"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 3xl:gap-2.5 4xl:gap-3",children:[s.jsx(o,{className:`${r==="compact"?"h-4 w-4 3xl:h-5 3xl:w-5 4xl:h-6 4xl:w-6":"h-5 w-5 3xl:h-6 3xl:w-6 4xl:h-7 4xl:w-7"} ${i.color}`}),s.jsx("span",{className:"hidden sm:inline",children:i.label})]}),s.jsx(Rr,{className:`${r==="compact"?"h-4 w-4 3xl:h-5 3xl:w-5 4xl:h-6 4xl:w-6":"h-5 w-5 3xl:h-6 3xl:w-6 4xl:h-7 4xl:w-7"} text-muted-foreground`})]})}),s.jsxs(Mo,{align:"end",className:"w-[200px] 3xl:w-[240px] 4xl:w-[280px]",children:[s.jsx(Fx,{className:"text-sm 3xl:text-base 4xl:text-lg font-semibold",children:"Switch Dashboard"}),s.jsx(Vx,{}),t.map(l=>{const d=pm[l],c=d.icon;return s.jsxs(un,{onClick:()=>n(l),className:"flex items-center justify-between cursor-pointer py-2.5 3xl:py-3 4xl:py-4",children:[s.jsxs("div",{className:"flex items-center gap-2.5 3xl:gap-3 4xl:gap-4",children:[s.jsx(c,{className:`h-5 w-5 3xl:h-6 3xl:w-6 4xl:h-7 4xl:w-7 ${d.color}`}),s.jsx("span",{className:"text-sm 3xl:text-base 4xl:text-lg font-medium",children:d.label})]}),l===e&&s.jsx(Ue,{className:"h-5 w-5 3xl:h-6 3xl:w-6 4xl:h-7 4xl:w-7 text-primary"})]},l)})]})]})}function CS(){const{user:r}=Ee(),[e,t]=u.useState([]),[n,a]=u.useState(!0);return u.useEffect(()=>{if(!r){t([]),a(!1);return}const i=async()=>{const{data:d,error:c}=await W.from("jobs").select(` 596 id, 597 status, 598 progress, 599 created_at, 600 actors (name) 601 `).eq("user_id",r.id).in("status",["queued","generating","processing","pending","captioning"]).order("created_at",{ascending:!1});!c&&d&&t(d.map(h=>({id:h.id,status:h.status,progress:h.progress,created_at:h.created_at,actor_name:h.actors?.name}))),a(!1)};i();const o=setInterval(i,3e4),l=W.channel("pending-jobs-badge").on("postgres_changes",{event:"*",schema:"public",table:"jobs",filter:`user_id=eq.${r.id}`},d=>{const c=d.new,h=d.old;d.eventType==="INSERT"?["queued","generating","processing","pending","captioning"].includes(c.status)&&t(m=>[{id:c.id,status:c.status,progress:c.progress,created_at:c.created_at},...m]):d.eventType==="UPDATE"?c.status==="completed"||c.status==="ready"?t(m=>m.filter(f=>f.id!==c.id)):c.status==="failed"?t(m=>m.filter(f=>f.id!==c.id)):t(m=>m.map(f=>f.id===c.id?{...f,status:c.status,progress:c.progress}:f)):d.eventType==="DELETE"&&t(m=>m.filter(f=>f.id!==h.id))}).subscribe();return()=>{clearInterval(o),W.removeChannel(l)}},[r]),{pendingJobs:e,loading:n,count:e.length}}function kc(){const{pendingJobs:r,count:e,loading:t}=CS(),[n,a]=u.useState(!1);return t||e===0?null:s.jsxs(vc,{open:n,onOpenChange:a,children:[s.jsx(yc,{asChild:!0,children:s.jsxs(ie,{variant:"ghost",size:"sm",className:"relative gap-2 px-2 sm:px-3",children:[s.jsx(ae.div,{animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"},children:s.jsx(Mt,{className:"h-4 w-4 text-primary"})}),s.jsx("span",{className:"hidden sm:inline text-sm text-foreground",children:"Generating"}),s.jsx(ae.span,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},className:"absolute -top-1 -right-1 sm:static sm:top-auto sm:right-auto flex h-5 w-5 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-primary-foreground",children:e},e),s.jsx(Rr,{className:"hidden sm:block h-3 w-3 text-muted-foreground"})]})}),s.jsxs(Bi,{className:"w-80 p-0",align:"end",sideOffset:8,children:[s.jsxs("div",{className:"p-3 border-b border-border",children:[s.jsx("h4",{className:"font-medium text-sm",children:"Active Generations"}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[e," video",e!==1?"s":""," in progress"]})]}),s.jsx("div",{className:"max-h-64 overflow-y-auto",children:s.jsx(pt,{mode:"popLayout",children:r.map(i=>s.jsx(TS,{job:i},i.id))})}),s.jsx("div",{className:"p-2 border-t border-border",children:s.jsx(be,{to:"/videos",onClick:()=>a(!1),children:s.jsx(ie,{variant:"ghost",size:"sm",className:"w-full text-xs",children:"View All Videos"})})})]})]})}function TS({job:r}){const e={queued:"Queued",pending:"Pending",generating:"Generating",processing:"Processing"};return s.jsx(ae.div,{layout:!0,initial:{opacity:0,y:-10}
601,animate:{opacity:1,y:0},exit:{opacity:0,x:20},className:"p-3 border-b border-border/50 last:border-0 hover:bg-muted/50 transition-colors",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-8 w-8 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Dt,{className:"h-4 w-4 text-primary"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:r.actor_name||"Video"}),s.jsx("span",{className:Y("text-[10px] px-1.5 py-0.5 rounded-full font-medium flex-shrink-0",r.status==="generating"||r.status==="processing"?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:e[r.status]||r.status})]}),s.jsx("div",{className:"mt-1.5",children:s.jsx(Ao,{value:r.progress,className:"h-1"})}),s.jsxs("p",{className:"text-[10px] text-muted-foreground mt-1",children:[r.progress,"% complete"]})]})]})})}function Nc(){const{theme:r,setTheme:e,resolvedTheme:t}=ad(),[n,a]=u.useState(!1);if(u.useEffect(()=>{a(!0)},[]),!n)return s.jsx(ie,{variant:"ghost",size:"icon",className:"h-9 w-9",children:s.jsx(mi,{className:"h-4 w-4"})});const i=t==="dark"?s.jsx(Vl,{className:"h-4 w-4"}):s.jsx(mi,{className:"h-4 w-4"});return s.jsxs(Gd,{children:[s.jsx(Yd,{asChild:!0,children:s.jsxs(ie,{variant:"ghost",size:"icon",className:"h-9 w-9",children:[i,s.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),s.jsxs(Mo,{align:"end",children:[s.jsxs(un,{onClick:()=>e("light"),className:r==="light"?"bg-accent":"",children:[s.jsx(mi,{className:"mr-2 h-4 w-4"}),"Light"]}),s.jsxs(un,{onClick:()=>e("dark"),className:r==="dark"?"bg-accent":"",children:[s.jsx(Vl,{className:"mr-2 h-4 w-4"}),"Dark"]}),s.jsxs(un,{onClick:()=>e("system"),className:r==="system"?"bg-accent":"",children:[s.jsx(Mf,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}function VA(){const{theme:r,setTheme:e}=ad(),[t,n]=u.useState(!1);if(u.useEffect(()=>{n(!0)},[]),!t)return s.jsx("div",{className:"flex items-center gap-1 p-1 bg-secondary rounded-lg",children:s.jsx("div",{className:"px-3 py-1.5 rounded-md text-sm",children:"Loading..."})});const a=[{value:"light",label:"Light",icon:mi},{value:"dark",label:"Dark",icon:Vl},{value:"system",label:"System",icon:Mf}];return s.jsx("div",{className:"flex items-center gap-1 p-1 bg-secondary rounded-lg",children:a.map(({value:i,label:o,icon:l})=>s.jsxs("button",{onClick:()=>e(i),className:`flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${r===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[s.jsx(l,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:o})]},i))})}const Zd="edu",PS="mobileEducationOptOut",zx="mobileEduSessionDismissCount",Hx="mobileEduSessionTooltipCount",fm=2,gm=5,AS=3;function Ux(r,e){return`${Zd}_${r}_${e}_dismissed`}function xm(r,e){try{return localStorage.getItem(Ux(r,e))==="true"}catch{return!1}}function IS(r,e){try{localStorage.setItem(Ux(r,e),"true")}catch{}}function RS(r){try{sessionStorage.setItem(`${Zd}_session_${r}`,"true")}catch{}}function vm(r){try{return sessionStorage.getItem(`${Zd}_session_${r}`)==="true"}catch{return!1}}function MS(){try{return localStorage.getItem(PS)==="true"}catch{return!1}}function Sc(){try{return parseInt(sessionStorage.getItem(Hx)||"0",10)}catch{return 0}}function ym(){try{const r=Sc()+1;sessionStorage.setItem(Hx,String(r))}catch{}}function Bx(){try{return parseInt(sessionStorage.getItem(zx)||"0",10)}catch{return 0}}function OS(){try{const r=Bx()+1;sessionStorage.setItem(zx,String(r))}catch{}}function bm(){return Bx()>=AS}const _m=[{id:"credit_explainer",target:'[data-edu="credit-meter"]',trigger:"on_first_visit",page:"/dashboard",title:"How Credits Work",body:"1 video = 10 credits. Add motion (+5) or captions (+1). Your balance is shown here.",learnMoreLabel:"Credit details",learnMoreUrl:"/pricing#credits",position:"bottom",priority:2,frequencyGroup:"dashboard",dismissBehavior:"permanent"},{id:"verify_incentive",target:'[data-edu="verify-banner"]',trigger:"on_state",triggerCondition:"unverified",page:"/dashboard",title:"Verify for Free Videos",body:"Confirm your email to unlock 30 credits (3 videos) in your first month. Check inbox â expires in 24h.",learnMoreLabel:"Why verify?",position:"bottom",priority:1,frequencyGroup:"dashboard",dismissBehavior:"permanent"},{id:"script_limit",target:'[data-edu="script-textarea"]',trigger:"on_first_visit",page:"/create",title:"120 Seconds Max",body:"Scripts can be up to ~180 words (120s of video). Need longer? Split into multiple videos.",learnMoreLabel:"Script tips",position:"top",priority:1,frequencyGroup:"create",dismissBehavior:"permanent"},{id:"hooks_explain",target:'[data-edu="hooks-button"]',trigger:"on_action",triggerCondition:"script_has_text",page:"/create",title:"Try AI Hooks",body:"Hooks are attention-grabbing openers. AI generates 3 variants â pick the one that stops the scroll.",learnMoreLabel:"What are hooks?",position:"bottom",priority:3,frequencyGroup:"create",dismissBehavior:"permanent"},{id:"enhance_explain",target:'[data-edu="enhance-button"]',trigger:"on_action",triggerCondition:"script_has_text",page:"/create",title:"Enhance Your Script",body:"AI rewrites your script to be more persuasive, concise, or emotional. Your original is saved in Undo.",learnMoreLabel:"Enhance tips",position:"bottom",priority:4,frequencyGroup:"create",dismissBehavior:"permanent"},{id:"actor_tip",target:'[data-edu="actor-grid"]',trigger:"on_first_visit",page:"/create",title:"Cho
601ose Your Presenter",body:"Pick an actor matching your audience. Pro tip: test 2â3 actors with the same script for A/B testing.",learnMoreLabel:"Actor guide",position:"bottom",priority:2,frequencyGroup:"create",dismissBehavior:"permanent"},{id:"voice_sliders",target:'[data-edu="voice-settings"]',trigger:"on_first_visit",page:"/create",title:"Tune the Voice",body:"Consistency = how steady it sounds. Naturalness = how human it feels. Expression = emotional range.",learnMoreLabel:"Voice settings",position:"bottom",priority:3,frequencyGroup:"create",dismissBehavior:"permanent"},{id:"generation_wait",target:'[data-edu="generation-progress"]',trigger:"on_state",triggerCondition:"job_processing",page:"/videos",title:"Video Generating...",body:"Usually ready in 1â3 minutes. While you wait, browse actors for your next video!",position:"bottom",priority:1,dismissBehavior:"auto"},{id:"video_ready_next",target:'[data-edu="video-ready"]',trigger:"on_state",triggerCondition:"first_job_ready",page:"/videos",title:"Video Ready!",body:"Download it, share to earn credits, or create a variation with a different actor.",learnMoreLabel:"Sharing guide",position:"bottom",priority:1,frequencyGroup:"videos",dismissBehavior:"permanent"},{id:"preview_vs_export",target:'[data-edu="video-preview"]',trigger:"on_state",triggerCondition:"free_user_video_ready",page:"/videos",title:"Preview vs Full Video",body:"Free users can preview videos with a watermark. Remove watermark from $12.",learnMoreLabel:"Plans & pricing",learnMoreUrl:"/pricing",position:"bottom",priority:2,frequencyGroup:"videos",dismissBehavior:"permanent"}],wm=[{question:"How do credits work?",answer:"1 video = 10 credits. Motion adds +5, captions +1. Buy packs from $12 or subscribe for monthly credits.",pages:["/dashboard","/create","/pricing","/videos"],learnMoreUrl:"/pricing#credits"},{question:"What are preview videos?",answer:"Free users get watermarked previews. Subscribe or buy credits to export full-quality, watermark-free videos.",pages:["/dashboard","/videos"],learnMoreUrl:"/pricing"},{question:"How long can my video be?",answer:"Each video can be up to 120 seconds (~180 words). For longer content, split into multiple videos.",pages:["/create"]},{question:"What are AI Hooks?",answer:"Hooks are attention-grabbing opening lines. AI generates 3 options â pick the one that stops the scroll.",pages:["/create"]},{question:"How do I earn free credits?",answer:"Verify your email for 30 credits in your first month, then 10 credits/month ongoing. Share your video link â when someone signs up, you both earn credits.",pages:["/dashboard","/videos"]},{question:"How long does generation take?",answer:"Videos typically render in 1â3 minutes. You'll get a notification when it's ready.",pages:["/create","/videos"]},{question:"Can I use videos commercially?",answer:"Yes! All generated videos include commercial usage rights. Perfect for ads, social media, and marketing.",pages:["/dashboard","/create","/pricing"]},{question:"How do I pick the right actor?",answer:"Match your actor to your audience. Use filters for gender, age, and style. Test 2â3 actors for A/B testing.",pages:["/create","/actors"]}],DS=[{id:"create_first_video",name:"Create Your First Video",triggerCondition:"totalVideos === 0",steps:[{id:"write_script",target:'[data-edu="script-textarea"]',title:"Write Your Script",body:"Type your ad copy or tap ⨠to let AI write it. 120s max (~180 words).",position:"top"},{id:"set_tone",target:'[data-edu="tone-selector"]',title:"Set the Tone",body:"Pick a style that matches your brand. This guides the AI voice.",position:"bottom"},{id:"choose_actor",target:'[data-edu="actor-grid"]',title:"Pick Your Presenter",body:"Tap any actor to select them. Tap the heart to save favorites.",position:"bottom"},{id:"generate",target:'[data-edu="generate-button"]',title:"Generate Your Video",body:"All set! Tap Generate to create your video (~2 min). Costs 10 credits.",position:"top"}]},{id:"understand_credits",name:"Understand Credits",triggerCondition:"credits === 0",steps:[{id:"balance",target:'[data-edu="credit-meter"]',title:"Your Credit Balance",body:"Credits are your video currency. 1 video = 10 credits.",position:"bottom"},{id:"addons",target:'[data-edu="credit-addons"]',title:"Add-on Costs",body:"Motion adds natural movement (+5 credits). Captions add subtitles (+1 credit).",position:"bottom"},{id:"buy",target:'[data-edu="buy-credits"]',title:"Get More Credits",body:"Buy credit packs from $12, or subscribe for monthly credits at better rates.",position:"top"}]},{id:"share_amplify",name:"Share & Amplify",triggerCondition:"firstVideoReady",steps:[{id:"download",target:'[data-edu="download-button"]',title:"Download Your Video",body:"Save your video to share anywhere. MP4 format, ready for social.",position:"top"},{id:"share",target:'[data-edu="share-button"]',title:"Share to Earn Credits",body:"Share your link. When someone signs up through it, you both earn credits.",position:"top"},{id:"variations",target:'[data-edu="create-more"]',title:"Try Variations",body:"Same script, different actor = A/B testing. Find what converts best.",position:"top"}]}];var kr="Accordion",LS=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Jd,$S,FS]=fp(kr),[Oo]=js(kr,[FS,gx]),Xd=gx(),qx=$.forwardRef((r,e)=>{const{type:t,...n}=r,a=n,i=n;return s.jsx(Jd.Provider,{scope:r.__scopeAccordion,children:t==="multiple"?s.jsx(US,{...i,ref:e}):s.jsx(HS,{...a,ref:e})})});qx.displayName=kr;var[Wx,VS]=Oo(kr),[Gx,zS]=Oo(kr,{collapsible:!1}),HS=$.forwardRef((r,e)=>{const{value:t,defaultValue:n,onValueChange:a=()=>{},collapsible:i=!1,...o}=r,[l,d]=kn({prop:t,defaultProp:n??"",onChange:a,caller:kr});return s.jsx(Wx,{scope:r.__scopeAccordion,value:$.useMemo(()=>l?[l]:[],[l]),onItemOpen:d,onItemClose:$.useCallback(()=>i&&d(""),[i,d]),children:s.jsx(Gx,{scope:r.__scopeAccordion,collapsible:i,children:s.jsx(Yx,{...o,ref:e})})})}),US=$.forwardRef((r,e)=>{const{value:t,defaultValue:n,onValueChange:a=()=>{},...i}=r,[o,l]=kn({prop:t,defaultProp:n??[],onChange:a,caller:kr}),d=$.useCallback(h=>l((m=[])=>[...m,h]),[l]),c=$.useCallback(h=>l((m=[])=>m.filter(f=>f!==h)),[l]);return s.jsx(Wx,{scope:r.__scopeAccordion,value:o,onItemOpen:d,onItemClose:c,children:s.jsx(Gx,{scope:r.__scopeAccordion,collapsible:!0,children:s.jsx(Yx,{...i,ref:e})})})}),[BS,Do]=Oo(kr),Yx=$.forwardRef((r,e)=>{const{__scopeAccordion:t,disabled:n,dir:a,orientation:i="vertical",...o}=r,l=$.useRef(null),d=Ft(l,e),c=$S(t),m=_p(a)==="ltr",f=mt(r.onKeyDown,p=>{if(!LS.includes(p.key))return;const v=p.target,x=c().filter(_=>!_.ref.current?.disabled),g=x.findIndex(_=>_.ref.current===v),b=x.length;if(g===-1)return;p.preventDefault();let j=g;
601const k=0,y=b-1,w=()=>{j=g+1,j>y&&(j=k)},S=()=>{j=g-1,j<k&&(j=y)};switch(p.key){case"Home":j=k;break;case"End":j=y;break;case"ArrowRight":i==="horizontal"&&(m?w():S());break;case"ArrowDown":i==="vertical"&&w();break;case"ArrowLeft":i==="horizontal"&&(m?S():w());break;case"ArrowUp":i==="vertical"&&S();break}const N=j%b;x[N].ref.current?.focus()});return s.jsx(BS,{scope:t,disabled:n,direction:a,orientation:i,children:s.jsx(Jd.Slot,{scope:t,children:s.jsx(ft.div,{...o,"data-orientation":i,ref:d,onKeyDown:n?void 0:f})})})}),Qi="AccordionItem",[qS,Kd]=Oo(Qi),Zx=$.forwardRef((r,e)=>{const{__scopeAccordion:t,value:n,...a}=r,i=Do(Qi,t),o=VS(Qi,t),l=Xd(t),d=Np(),c=n&&o.value.includes(n)||!1,h=i.disabled||r.disabled;return s.jsx(qS,{scope:t,open:c,disabled:h,triggerId:d,children:s.jsx(yx,{"data-orientation":i.orientation,"data-state":tv(c),...l,...a,ref:e,disabled:h,open:c,onOpenChange:m=>{m?o.onItemOpen(n):o.onItemClose(n)}})})});Zx.displayName=Qi;var Jx="AccordionHeader",Xx=$.forwardRef((r,e)=>{const{__scopeAccordion:t,...n}=r,a=Do(kr,t),i=Kd(Jx,t);return s.jsx(ft.h3,{"data-orientation":a.orientation,"data-state":tv(i.open),"data-disabled":i.disabled?"":void 0,...n,ref:e})});Xx.displayName=Jx;var Ec="AccordionTrigger",Kx=$.forwardRef((r,e)=>{const{__scopeAccordion:t,...n}=r,a=Do(kr,t),i=Kd(Ec,t),o=zS(Ec,t),l=Xd(t);return s.jsx(Jd.ItemSlot,{scope:t,children:s.jsx(ON,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...n,ref:e})})});Kx.displayName=Ec;var Qx="AccordionContent",ev=$.forwardRef((r,e)=>{const{__scopeAccordion:t,...n}=r,a=Do(kr,t),i=Kd(Qx,t),o=Xd(t);return s.jsx(DN,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...o,...n,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...r.style}})});ev.displayName=Qx;function tv(r){return r?"open":"closed"}var WS=qx,GS=Zx,YS=Xx,rv=Kx,sv=ev;const nv=WS,Qd=u.forwardRef(({className:r,...e},t)=>s.jsx(GS,{ref:t,className:Y("border-b",r),...e}));Qd.displayName="AccordionItem";const eu=u.forwardRef(({className:r,children:e,...t},n)=>s.jsx(YS,{className:"flex",children:s.jsxs(rv,{ref:n,className:Y("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",r),...t,children:[e,s.jsx(Rr,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));eu.displayName=rv.displayName;const tu=u.forwardRef(({className:r,children:e,...t},n)=>s.jsx(sv,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...t,children:s.jsx("div",{className:Y("pb-4 pt-0",r),children:e})}));tu.displayName=sv.displayName;function ZS(){const r=Es(),e=ot(),[t,n]=u.useState(!1),a=u.useMemo(()=>{const o=e.pathname;return wm.filter(l=>l.pages.some(d=>o.startsWith(d)))},[e.pathname]),i=a.length>0?a:wm.slice(0,4);return r?s.jsxs(Io,{open:t,onOpenChange:n,children:[s.jsx(Ex,{asChild:!0,children:s.jsx(ie,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full border-border/50 bg-background/80 backdrop-blur-sm","aria-label":"Help",children:s.jsx(Ia,{className:"w-4 h-4 text-muted-foreground"})})}),s.jsxs(Ha,{side:"bottom",className:"rounded-t-2xl max-h-[80vh] overflow-y-auto pb-safe",children:[s.jsx(Wd,{className:"pb-3",children:s.jsx(Ro,{className:"text-base font-semibold",children:"Help & Tips"})}),s.jsxs("div",{className:"space-y-5",children:[s.jsxs("section",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Quick Answers"}),s.jsx(nv,{type:"single",collapsible:!0,className:"w-full",children:i.map((o,l)=>s.jsxs(Qd,{value:`faq-${l}`,className:"border-b border-border/50",children:[s.jsx(eu,{className:"text-sm py-2.5 hover:no-underline",children:o.question}),s.jsxs(tu,{className:"text-xs text-muted-foreground pb-2.5",children:[o.answer,o.learnMoreUrl&&s.jsxs(be,{to:o.learnMoreUrl,className:"text-primary ml-1 inline-flex items-center gap-0.5",onClick:()=>n(!1),children:["Learn more",s.jsx(Jr,{className:"w-3 h-3"})]})]})]},l))})]}),s.jsxs("section",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Guides"}),s.jsx("div",{className:"space-y-1.5",children:DS.map(o=>s.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm text-foreground hover:bg-muted/50 transition-colors text-left",onClick:()=>{n(!1)},children:[s.jsx(ga,{className:"w-4 h-4 text-primary shrink-0"}),s.jsx("span",{className:"flex-1",children:o.name}),s.jsx(Jr,{className:"w-4 h-4 text-muted-foreground"})]},o.id))})]}),s.jsxs("section",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Resources"}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("a",{href:"https://docs.vidacious.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm text-foreground hover:bg-muted/50 transition-colors",children:[s.jsx(Fs,{className:"w-4 h-4 text-muted-foreground shrink-0"}),s.jsx("span",{className:"flex-1",children:"Documentation"})]}),s.jsxs("a",{href:"https://docs.vidacious.com/api",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm text-foreground hover:bg-muted/50 transition-colors",children:[s.jsx(Fs,{className:"w-4 h-4 text-muted-foreground shrink-0"}),s.jsx("span",{className:"flex-1",children:"API & Developer Docs"})]})]})]}),s.jsx("section",{className:"border-t border-border/50 pt-4",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm text-foreground hover:bg-muted/50 transition-colors text-left",onClick:()=>{n(!1);const o=document.querySelector('[data-tour="chat-trigger"]');o?o.click():window.location.href="/dashboard?openSupport=true"},children:[s.jsx(br,{className:"w-4 h-4 text-primary shrink-0"}),s.jsx("span",{className:"flex-1",children:"Contact Support"})]}),s.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm text-foreground hover:bg-muted/50 transition-colors text-left",onClick:()=>{n(!1);const o=document.querySelector('[data-tour="chat-trigger"]');o?o.click():window.location.href="/dashboard?openSupport=true"},children:[s.jsx(_f,{className:"w-4 h-4 text-muted-foreground shrink-0"}),s.jsx("span",{className:"flex-1",children:"Report a Problem"})]})]})})]})]})]}):null}const JS=[];function XS(){const{user:r,profile:e}=Ee(),t=ot(),{currentWorkspace:n}=Eo(),[a,i]=u.useState(!1),o=Es(),l=e?.signup_context==="developer";if(!r||JS.some(p=>t.pathname.startsWith(p)))return null;const d=["/dashboard","/videos","/settings","/scripts","/voices","/campaigns","/checkout","/admin","/creators","/create","/feed","/following","/actors","/moderator-dashboard","/creator-dashboard","/showcase"];if(["/become-creator","/creators/sign-mock"].some(p=>t.pathname===p)||t.pathname.startsWith("/actors/")&&t.pathname!=="/actors/"||!d.some(p=>t.pathname.startsWith(p)))return null;const f=p=>{switch(n){case"creator":return s.jsx($x,{onItemClick:p});case"admin":return s.jsx(Ki,{onItemClick:p});case"moderator":return s.jsx(Ki,{onItemClick:p,modOnly:!0});default:return s.jsx(Ax,{onItemClick:p})}};return s.jsx("header",{className:"global-header fixed left-0 right-0 z-50 bg-background border-b border-border h-[var(--header-height)]",style:{to
601p:"var(--campaign-banner-height, 0px)",transform:"translateZ(0)",WebkitTransform:"translateZ(0)"},children:s.jsxs("div",{className:"flex items-center justify-between h-full px-4 md:px-6 3xl:px-8 4xl:px-10",children:[s.jsxs("div",{className:"flex items-center gap-3 md:gap-4 3xl:gap-5 4xl:gap-6",children:[s.jsx("div",{className:"lg:hidden",children:s.jsxs(Io,{open:a,onOpenChange:p=>{!p&&document.body.hasAttribute("data-tour-nav-active")||i(p)},children:[s.jsx(Ex,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"icon",className:"h-9 w-9 md:h-10 md:w-10","data-tour":"mobile-menu-trigger",children:s.jsx(Xc,{className:"h-5 w-5 md:h-6 md:w-6"})})}),s.jsx(Ha,{side:"left",className:"w-64 p-4 bg-sidebar border-border",style:{paddingTop:"calc(var(--campaign-banner-height, 0px) + var(--header-height) + 0.5rem)"},children:f(()=>i(!1))})]})}),s.jsxs(be,{to:"/",className:"flex items-center gap-2 md:gap-2.5 3xl:gap-3 4xl:gap-4",children:[s.jsx("div",{className:"w-10 h-10 md:w-11 md:h-11 3xl:w-12 3xl:h-12 4xl:w-14 4xl:h-14 rounded-xl bg-gradient-to-r from-primary to-accent flex items-center justify-center",children:s.jsx(Dt,{className:"w-5 h-5 md:w-6 md:h-6 3xl:w-7 3xl:h-7 4xl:w-8 4xl:h-8 text-primary-foreground"})}),s.jsx("span",{className:"text-lg md:text-xl 3xl:text-2xl 4xl:text-3xl font-bold font-display hidden sm:inline",children:"Vidacious"})]})]}),s.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 md:gap-3",children:[l&&s.jsxs(Ht,{children:[s.jsx(Ut,{asChild:!0,children:s.jsx(be,{to:"/console/overview",children:s.jsx(ie,{variant:"ghost",size:"icon",className:"h-9 w-9",children:s.jsx($s,{className:"h-4 w-4"})})})}),s.jsx($t,{children:"Developer Console"})]}),o&&n==="creator"&&s.jsx(Nx,{}),s.jsx("div",{className:"hidden sm:block",children:o&&s.jsx(ZS,{})}),s.jsx("div",{className:"hidden sm:block",children:s.jsx(Nc,{})}),s.jsx(kc,{}),s.jsx("div",{"data-tour":"role-switcher",children:s.jsx(ES,{variant:"compact"})})]})]})})}const jm=()=>{let r=sessionStorage.getItem("analytics_session_id");return r||(r=`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`,sessionStorage.setItem("analytics_session_id",r)),r},km=()=>{const r=window.innerWidth;return r<768?"mobile":r<1024?"tablet":"desktop"},KS=()=>{const r=navigator.userAgent.toLowerCase();return r.includes("android")?"android":r.includes("iphone")||r.includes("ipad")?"ios":r.includes("mac")?"macos":r.includes("win")?"windows":"other"},QS=()=>{try{const r=localStorage.getItem("attribution");if(r){const e=JSON.parse(r);return{source:e.utm_source||e.source,medium:e.utm_medium||e.medium,campaign:e.utm_campaign||e.campaign,utm_source:e.utm_source,utm_medium:e.utm_medium,utm_campaign:e.utm_campaign}}}catch{}return{}},e4=()=>{try{const r=localStorage.getItem("referral");if(r)return JSON.parse(r).code||null}catch{}return null},Nm=r=>{typeof window<"u"&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push(r),console.log("[Analytics] GTM event pushed:",r.event,r.eventModel))},t4=r=>r.startsWith("landing_")||r.startsWith("cta_")||r.startsWith("pricing_")||r.startsWith("plan_")||r==="signup_start"?"acquisition":r.startsWith("signup_")||r.startsWith("verification_")?"signup":r.startsWith("onboarding_")||r.startsWith("project_")||r.startsWith("template_")||r.startsWith("render_")||r.startsWith("export_")?"activation":r.startsWith("upgrade_")||r.startsWith("checkout_")||r.startsWith("cancel_")||r==="payment_succeeded"||r==="promo_code_applied"?"monetization":r.startsWith("affiliate_")||r.startsWith("referral_")||r.startsWith("asset_")||r.startsWith("payout_")?"affiliate":r.startsWith("docs_")||r.startsWith("api_")||r.startsWith("playground_")||r==="rate_limit_hit"?"developer":r.startsWith("campaign_")?"acquisition":"engagement";function Ba(){const{user:r}=Ee(),e=u.useRef(jm()),t=u.useRef(new Set);u.useEffect(()=>{e.current=jm(),t.current=new Set},[r?.id]);const n=u.useCallback(async(y,w={},S={})=>{const{dedupe:N=!1,dedupeKey:_,skipDatabase:C=!1,skipGTM:O=!1,skipClarity:R=!1}=S;if(N){const V=_||`${e.current}_${y}`;if(t.current.has(V)){console.log("[Analytics] Event deduplicated:",y);return}t.current.add(V)}const M=QS(),L=e4(),A={...w,device_type:w.device_type||km(),page_path:w.page_path||window.location.pathname,referrer:w.referrer||document.referrer,utm_source:w.utm_source||M.utm_source,utm_medium:w.utm_medium||M.utm_medium,utm_campaign:w.utm_campaign||M.utm_campaign,has_referral_code:w.has_referral_code??!!L,is_authenticated:w.is_authenticated??!!r};if(!O&&Jt()&&Nm({event:y,eventModel:A}),R||Q_(y),_t(y,A),!C&&r?.id)try{const V=typeof y=="string"?t4(y):"engagement",{error:G}=await W.from("analytics_events").insert({user_id:r.id,session_id:e.current,event_name:y,event_category:V,event_data:A,device_type:A.device_type||km(),platform:KS(),source:M.source||null,medium:M.medium||null,campaign:M.campaign||null});G&&console.error("[Analytics] Database insert error:",G)}catch(V){console.error("[Analytics] Database exception:",V)}else!C&&!r?.id&&console.log("[Analytics] Anonymous event (not stored):",y,A)},[r?.id]),a=u.useCallback((y,w={})=>{h0(window.location.pathname),n("landing_page_view",{...w,page_path:window.location.pathname},{dedupe:!0,dedupeKey:`pageview_${y}_${e.current}`})},[n]),i=u.useCallback((y,w,S)=>{n("cta_click",{button_text:y,button_location:w,destination_url:S})},[n]),o=u.useCallback((y,w,S)=>{n("plan_compare_interaction",{plan_key:y,billing_cycle:w,price_displayed:S})},[n]),l=u.useCallback(y=>{n("render_start",y)},[n]),d=u.useCallback(y=>{n("render_success",y)},[n]),c=u.useCallback(y=>{n("render_fail",y)},[n]),h=u.useCallback(y=>{n("checkout_start",y)},[n]),m=u.useCallback(y=>{n("checkout_success",y)},[n]),f=u.useCallback(y=>{n("payment_succeeded",{...y,order_value:y.value}),Jt()&&Nm({event:"purchase",ecommerce:{transaction_id:y.checkout_session_id,value:y.value,currency:y.currency}})},[n]),p=u.useCallback(y=>{n("promo_code_applied",y)},[n]),v=u.useCallback(y=>{n("campaign_banner_impression",y,{dedupe:!0,dedupeKey:`banner_imp_${y.campaign_id}_${e.current}`})},[n]),x=u.useCallback(y=>{n("campaign_banner_click",y)},[n]),g=u.useCallback(y=>{n("docs_view",{section:y},{dedupe:!0,dedupeKey:`docs_${y}_${e.current}`})},[n]),b=u.useCallback((y,w)=>{n(y?"api_call_success":"api_call_fail",w)},[n]),j=u.useCallback((y,w={})=>{n(y,w)},[n]),k=u.useCallback(y=>
601{Object.entries(y).forEach(([w,S])=>{eg(w,S)})},[]);return{track:n,trackPageView:a,trackCTAClick:i,trackPricingInteraction:o,trackRenderStart:l,trackRenderSuccess:d,trackRenderFail:c,trackCheckoutStart:h,trackCheckoutSuccess:m,trackPaymentSucceeded:f,trackPromoCodeApplied:p,trackCampaignBannerImpression:v,trackCampaignBannerClick:x,trackDocsView:g,trackAPICall:b,trackAffiliateAction:j,setUserProperties:k}}const eo="campaignBannerDismissedSession",r4="--campaign-banner-height",av=["/verify-email","/auth","/admin"];function iv(){const{campaign:r,shouldShowBanner:e,timeRemaining:t,isLoading:n}=Fa(),{isBannerVisible:a,isTestMode:i,isEligible:o}=ir(),{user:l,isLoading:d}=Ee(),c=ot(),{trackCampaignBannerImpression:h,trackCampaignBannerClick:m}=Ba(),f=u.useRef(!1),p=u.useRef(null),[v,x]=u.useState(()=>sessionStorage.getItem(eo)==="true"),g=av.some(S=>c.pathname.startsWith(S)),b=!n&&!d&&e&&!a&&!v&&!g&&!!l;u.useEffect(()=>{b&&r&&!f.current&&(h({campaign_id:r.id,campaign_code:r.code,banner_title:r.banner_title,discount_percent:r.discount_percent,is_test_mode:r.is_test_mode}),W.functions.invoke("track-campaign-event",{body:{campaignId:r.id,eventType:"impression",isTestMode:r.is_test_mode??!1}}).catch(()=>{}),f.current=!0)},[b,r?.id,h]),u.useEffect(()=>{r?.id&&(f.current=!1)},[r?.id]);const j=()=>{r&&(m({campaign_id:r.id,campaign_code:r.code,banner_title:r.banner_title,destination_url:r.banner_cta_url,discount_percent:r.discount_percent,is_test_mode:r.is_test_mode}),W.functions.invoke("track-campaign-event",{body:{campaignId:r.id,eventType:"click",isTestMode:r.is_test_mode??!1}}).catch(()=>{}))},k=()=>{sessionStorage.setItem(eo,"true"),x(!0)},y=S=>{document.documentElement.style.setProperty(r4,`${S}px`)};if(u.useLayoutEffect(()=>{if(!b){y(0);return}const S=p.current;if(!S)return;const N=()=>{requestAnimationFrame(()=>{const C=p.current?.offsetHeight??0;y(C)})};N();const _=new ResizeObserver(()=>N());return _.observe(S),window.addEventListener("resize",N),()=>{_.disconnect(),window.removeEventListener("resize",N)}},[b]),u.useEffect(()=>{b||y(0)},[b]),!b||!r)return null;const w=(S,N)=>`${S}${N}`;return s.jsx(pt,{children:s.jsxs(ae.div,{ref:p,"data-testid":"campaign-banner",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"fixed top-0 left-0 right-0 z-[60] bg-gradient-to-r from-primary via-accent to-primary",children:[s.jsxs("div",{className:"container px-4 py-2.5 flex items-center justify-between",children:[s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap justify-center text-banner-foreground",children:[r.is_test_mode&&o&&s.jsxs(rt,{variant:"outline",className:"bg-amber-500/20 text-amber-100 border-amber-400/50 gap-1 text-[10px]",children:[s.jsx(yr,{className:"w-3 h-3"}),"TEST"]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx("span",{"data-testid":"banner-title",className:"font-bold text-base",children:r.banner_title}),r.banner_subtitle&&s.jsxs("span",{"data-testid":"banner-subtitle",className:"hidden sm:inline opacity-90",children:["â ",r.banner_subtitle]})]}),t&&r.show_countdown&&s.jsxs("div",{"data-testid":"banner-countdown",className:"hidden sm:flex items-center gap-1.5 text-xs bg-background/20 rounded-full px-3 py-1",children:[s.jsx(Ls,{className:"w-3 h-3"}),s.jsxs("span",{className:"font-mono",children:[t.days>0&&w(t.days,"d "),w(t.hours,"h "),w(t.minutes,"m "),w(t.seconds,"s")]})]}),s.jsx(ie,{size:"sm",variant:"secondary",className:"h-7 px-3 text-xs font-semibold bg-background text-foreground hover:bg-background/90",asChild:!0,"data-testid":"banner-cta",children:s.jsxs(be,{to:r.banner_cta_url,onClick:j,children:[r.banner_cta_text,s.jsx(nr,{className:"w-3 h-3 ml-1"})]})})]}),s.jsx("div",{className:"flex-1 flex justify-end",children:s.jsx(ie,{variant:"ghost",size:"sm",onClick:k,className:"h-6 w-6 p-0 text-banner-foreground
601/80 hover:text-banner-foreground hover:bg-white/10","aria-label":"Dismiss banner",children:s.jsx(lt,{className:"w-4 h-4"})})})]}),t&&r.show_countdown&&s.jsxs("div",{className:"sm:hidden flex items-center justify-center gap-1.5 text-xs text-banner-foreground bg-white/10 py-1",children:[s.jsx(Ls,{className:"w-3 h-3"}),s.jsxs("span",{className:"font-mono",children:["Ends in: ",t.days>0&&`${t.days}d `,t.hours,"h ",t.minutes,"m ",t.seconds,"s"]})]})]})})}function s4(){const{shouldShowBanner:r,isLoading:e}=Fa(),{isBannerVisible:t}=ir(),{user:n,isLoading:a}=Ee(),i=ot(),[o,l]=u.useState(()=>sessionStorage.getItem(eo)==="true");u.useEffect(()=>{const h=setInterval(()=>{l(sessionStorage.getItem(eo)==="true")},100);return()=>clearInterval(h)},[]);const d=av.some(c=>i.pathname.startsWith(c));return!e&&!a&&r&&!t&&!o&&!d&&!!n}function n4(r){const{user:e}=Ee(),[t,n]=u.useState(0),[a,i]=u.useState(!0),[o,l]=u.useState(null),d=u.useRef(null),c=u.useRef(r?.onNewMessage);u.useEffect(()=>{c.current=r?.onNewMessage},[r?.onNewMessage]);const h=u.useCallback(async()=>{if(!e){i(!1),n(0);return}try{const{data:f,error:p}=await W.from("support_conversations").select("id").eq("user_id",e.id).in("status",["open","pending"]).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(p)throw p;if(!f){n(0),l(null),i(!1);return}l(f.id);const{count:v,error:x}=await W.from("support_messages").select("*",{count:"exact",head:!0}).eq("conversation_id",f.id).in("sender_type",["ai","agent"]).eq("is_read",!1);if(x)throw x;n(v||0)}catch(f){console.error("Error fetching unread count:",f),n(0)}finally{i(!1)}},[e]),m=u.useCallback(async()=>{if(!(!o||!e))try{const{error:f}=await W.from("support_messages").update({is_read:!0}).eq("conversation_id",o).in("sender_type",["ai","agent"]).eq("is_read",!1);if(f)throw f;n(0)}catch(f){console.error("Error marking messages as read:",f)}},[o,e]);return u.useEffect(()=>{if(o)return d.current=W.channel(`unread_messages:${o}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"support_messages",filter:`conversation_id=eq.${o}`},f=>{const p=f.new;(p.sender_type==="ai"||p.sender_type==="agent")&&!p.is_read&&(n(v=>v+1),c.current?.())}).on("postgres_changes",{event:"UPDATE",schema:"public",table:"support_messages",filter:`conversation_id=eq.${o}`},f=>{const p=f.new,v=f.old;(p.sender_type==="ai"||p.sender_type==="agent")&&!v.is_read&&p.is_read&&n(x=>Math.max(0,x-1))}).subscribe(),()=>{d.current&&W.removeChannel(d.current)}},[o]),u.useEffect(()=>{if(!e)return;const f=W.channel(`user_conversations:${e.id}`).on("postgres_changes",{event:"*",schema:"public",table:"support_conversations",filter:`user_id=eq.${e.id}`},()=>{h()}).subscribe();return()=>{W.removeChannel(f)}},[e,h]),u.useEffect(()=>{h()},[h]),{unreadCount:t,markAsRead:m,isLoading:a}}const a4=r=>{if(!r)return[];if(Array.isArray(r))return r;if(typeof r=="object"){const e=r;if(typeof e.url=="string")return[e];const n=Object.values(e).filter(a=>typeof a=="object"&&a!==null&&typeof a.url=="string");return n.length>0?n:[]}return[]},Sm=r=>({id:r.id,conversation_id:r.conversation_id,sender_type:r.sender_type,sender_id:r.sender_id,content:r.content,attachments:a4(r.attachments),is_read:r.is_read??!1,metadata:r.metadata||{},created_at:r.created_at}),ls="pending";function i4(){const{user:r}=Ee(),[e,t]=u.useState(null),[n,a]=u.useState([]),[i,o]=u.useState([]),[l,d]=u.useState(!0),[c,h]=u.useState(!1),[m,f]=u.useState(null),[p,v]=u.useState(!1),x=u.useRef(null),g=u.useCallback(async()=>{if(!r){d(!1);return}try{const{data:_,error:C}=await W.from("support_conversations").select("*").eq("user_id",r.id).in("status",["open","pending"]).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(C)throw C;if(_){const O={..._,status:_.status,metadata:_.metadata||{}};t(O),await j(_.id)}}catch(_){console.error("Error fetching conversation:",_),f("Failed to load conversation")}finally{d(!1)}},[r]),b=u.useCallback(async()=>{if(r)try{const{data:_,error:C}=await W.from("support_conversations").select("id, subject, status, created_at, resolved_at").eq("user_id",r.id).in("status",["resolved","closed"]).order("created_at",{ascending:!1}).limit(10);if(C)throw C;const O=(_||[]).map(R=>({...R,status:R.status}));o(O)}catch(_){console.error("Error fetching past conversations:",_)}},[r]),j=async _=>{if(_===ls)return;const{data:C,error:O}=await W.from("support_messages").select("*").eq("conversation_id",_).order("created_at",{ascending:!0});if(O){console.error("Error fetching messages:",O);return}if(C){const R=C.map(Sm);a(R)}},k=u.useCallback(async _=>{if(r){d(!0);try{const{data:C,error:O}=await W.from("support_conversations").select("*").eq("id",_).eq("user_id",r.id).single();if(O)throw O;const R={...C,status:C.status,metadata:C.metadata||{}};t(R),await j(C.id)}catch(C){console.error("Error loading conversation:",C),f("Failed to load conversation")}finally{d(!1)}}},[r]);return u.useEffect(()=>{if(!(!e?.id||e.id===ls))return x.current=W.channel(`support_messages:${e.id}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"support_messages",filter:`conversation_id=eq.${e.id}`},_=>{const C=_.new,O=Sm({...C,attachments:C.attachments,metadata:C.metadata});a(R=>R.some(M=>M.id===O.id)?R:[...R,O]),O.sender_type==="ai"&&v(!1)}).subscribe(),()=>{x.current&&W.removeChannel(x.current)}},[e?.id]),u.useEffect(()=>{g(),b()},[g,b]),{conversation:e,messages:n,pastConversations:i,isLoading:l,isSending:c,error:m,sendMessage:async(_,C)=>{if(!r){f("You must be logged in to send a message");return}if(!(!_.trim()&&(!C||C.length===0))){h(!0),f(null);try{let O=e?.id,R=!1;if(e&&(e.status==="resolved"||e.status==="closed")&&e.id!==ls){const re=e.metadata||{},{error:Z}=await W.from("support_conversations").update({status:"open",resolved_at:null,metadata:{...re,reopened:!0,reopened_at:new Date().toISOString(),nudge_stage:null,nudge_1_sent_at:null,nudge_2_sent_at:null}}).eq("id",e.id);Z?console.error("Error reopening conversation:",Z):(t({...e,status:"open",resolved_at:null,metadata:{...re,reopened:!0,reopened_at:new Date().toISOString(),nudge_stage:null}}),O=e.id)}if(!O||O===ls){R=!0;const{data:re,error:Z}=await W.from("support_conversations").insert({user_id:r.id,subject:e?.subject||"New Support Request",status:"open",tags:["user"]}).select().single();if(Z)throw Z;const P={...re,status:re.status,metadata:re.metadata||{}};t(P),O=re.id,(async()=>{try{const{data:E}=await W.from("profiles").select("email, display_name, plan").eq("user_id",r.id).single();await W.functions.invoke("slack-notify",{body:{channel:"support_chat",event_type:"new_chat",data:{user_id:r.id,user_email:E?.email,display_name:E?.display_name,subject:e?.subject||"New Support Request",plan:E?.plan||"free",first_message:_,is_creator:!1}}})}catch(E){console.error("Slack notification error:",E)}})()}const M=C&&C.length>0,L=_.trim()||(M?`Sent ${C.length} file(s)`:""),A=C?.map(re=>({name:re.name,url:re.url,type:re.type,size:re.size}))||[],{data:V,error:G}=await W.from("support_messages").insert({conversation_id:O,sender_type:"user",sender_id:r.id,content:L,attachments:A}).select("id").single();if(G)throw G;if(_.trim().length>=3&&V?.id&&(async()=>{try{const{data:re}=await W.functions.invoke("support-translate",{body:{action:"detect_and_translate",text:_.trim(),target_language:"en",conversation_id:O,message_id:V.id}});re&&(re.detected_language||re.language_code)&&(R&&await W.from("support_conversations").update({metadata:{user_language:re.detected_language||re.language_code,user_language_name:re.detected_language_name||re.language_name}}).eq("id",O),console.log("Detected user language:",re.detected_language||re.language_code))}catch(re){console.error("Language detection error:",re)}})(),!R&&O&&e?.metadata?.nudge_stage){const re=e.metadata||{};await W.from("support_conversations").update({metadata:{...re,nudge_stage:null,nudge_1_sent_at:null,nudge_2_sent_at:null}}).eq("id",O),t(Z=>Z?{...Z,metadata:{...Z.metadata,nudge_stage:null,nudge_1_sent_at:void 0,nudge_2_sent_at:void 0}}:null)}v(!0);const se=_.trim()||(M?"User sent a file attachment":"");
601if(se){const{error:re}=await W.functions.invoke("support-ai-respond",{body:{conversation_id:O,message:se,has_attachments:M}});re&&(console.error("AI response error:",re),v(!1))}else v(!1)}catch(O){console.error("Error sending message:",O),f("Failed to send message"),v(!1)}finally{h(!1)}}},startConversation:async _=>{if(!r){f("You must be logged in to start a conversation");return}const C={id:ls,user_id:r.id,visitor_id:null,subject:_||"New Support Request",status:"open",priority:1,assigned_agent_id:null,metadata:{},tags:["user"],last_message_at:null,resolved_at:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString()};t(C),a([]),d(!1)},startNewTopic:async()=>{if(!r){f("You must be logged in to start a new topic");return}d(!0);try{e&&e.id!==ls&&(await W.from("support_conversations").update({status:"resolved",resolved_at:new Date().toISOString()}).eq("id",e.id),o(C=>[{id:e.id,subject:e.subject,status:"resolved",created_at:e.created_at,resolved_at:new Date().toISOString()},...C.slice(0,9)]));const _={id:ls,user_id:r.id,visitor_id:null,subject:"New Support Request",status:"open",priority:1,assigned_agent_id:null,metadata:{},tags:["user"],last_message_at:null,resolved_at:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString()};t(_),a([])}catch(_){console.error("Error starting new topic:",_),f("Failed to start new topic")}finally{d(!1)}},loadConversation:k,closeConversation:async()=>{if(e){if(e.id===ls){t(null),a([]);return}try{const{error:_}=await W.from("support_conversations").update({status:"closed",resolved_at:new Date().toISOString()}).eq("id",e.id);if(_)throw _;t(null),a([]),b()}catch(_){console.error("Error closing conversation:",_),f("Failed to close conversation")}}},isTyping:p}}const zA={creator:{label:"Creator",className:"bg-purple-500/10 text-purple-600 border-purple-500/20",icon:"star"},user:{label:"User",className:"bg-slate-500/10 text-slate-500 border-slate-500/20",icon:"user"}},o4={en:"English",es:"Spanish",ar:"Arabic",fr:"French",de:"German",pt:"Portuguese",zh:"Chinese",ja:"Japanese",ko:"Korean",hi:"Hindi",ru:"Russian",it:"Italian",nl:"Dutch",tr:"Turkish",pl:"Polish",vi:"Vietnamese",th:"Thai",id:"Indonesian"},l4=({url:r,name:e,size:t,duration:n,isUserMessage:a})=>{const[i,o]=u.useState(!1),[l,d]=u.useState(0),[c,h]=u.useState(n??0),[m,f]=u.useState(!0),[p,v]=u.useState(null),x=u.useRef(null),g=u.useRef(null),b=_=>{if(!isFinite(_)||isNaN(_))return"0:00";const C=Math.floor(_/60),O=Math.floor(_%60);return`${C}:${O.toString().padStart(2,"0")}`},j=_=>_?_<1024?`${_} B`:_<1024*1024?`${(_/1024).toFixed(1)} KB`:`${(_/(1024*1024)).toFixed(1)} MB`:"",k=u.useCallback(()=>{x.current&&(d(x.current.currentTime),i&&(g.current=requestAnimationFrame(k)))},[i]);u.useEffect(()=>{const _=new Audio(r);x.current=_;const C=()=>{isFinite(_.duration)&&!isNaN(_.duration)?(h(_.duration),f(!1)):_.currentTime=Number.MAX_SAFE_INTEGER},O=()=>{isFinite(_.duration)&&!isNaN(_.duration)&&_.duration>0&&(h(_.duration),_.currentTime>_.duration-.5&&(_.currentTime=0),f(!1))},R=()=>{f(!1)},M=()=>{o(!1),d(0),g.current&&cancelAnimationFrame(g.current)},L=()=>{v("Failed to load audio"),f(!1)};return _.addEventListener("loadedmetadata",C),_.addEventListener("durationchange",O),_.addEventListener("canplaythrough",R),_.addEventListener("ended",M),_.addEventListener("error",L),()=>{_.removeEventListener("loadedmetadata",C),_.removeEventListener("durationchange",O),_.removeEventListener("canplaythrough",R),_.removeEventListener("ended",M),_.removeEventListener("error",L),_.pause(),_.src="",g.current&&cancelAnimationFrame(g.current)}},[r]),u.useEffect(()=>(i?g.current=requestAnimationFrame(k):g.current&&cancelAnimationFrame(g.current),()=>{g.current&&cancelAnimationFrame(g.current)}),[i,k]);const y=u.useCallback(()=>{x.current&&(i?(x.current.pause(),o(!1)):(x.current.play().catch(_=>{console.error("Audio play error:",_),v("Failed to play audio")}),o(!0)))},[i]),w=u.useCallback(_=>{if(!x.current||!c)return;const C=_.currentTarget.getBoundingClientRect(),M=(_.clientX-C.left)/C.width*c;x.current.currentTime=M,d(M)},[c]),S=u.useMemo(()=>Array.from({length:20},()=>`${Math.random()*60+40}%`),[]);if(p)return s.jsxs("div",{className:Y("flex items-center gap-2 px-3 py-2 rounded-lg border text-xs",a?"bg-primary-foreground
601/10 border-primary-foreground/20":"bg-muted"),children:[s.jsx(T1,{className:"h-4 w-4 opacity-50"}),s.jsx("span",{className:"text-muted-foreground",children:p})]});const N=c>0?l/c*100:0;return s.jsxs("div",{className:Y("flex items-center gap-2 px-3 py-2 rounded-lg border min-w-[200px]",a?"bg-primary-foreground/10 border-primary-foreground/20":"bg-background"),children:[s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 flex-shrink-0",onClick:y,disabled:m,children:i?s.jsx(Of,{className:"h-4 w-4"}):s.jsx(Qc,{className:"h-4 w-4"})}),s.jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[s.jsxs("div",{className:"h-2 bg-muted rounded-full cursor-pointer relative overflow-hidden",onClick:w,children:[s.jsx("div",{className:Y("h-full rounded-full transition-all duration-100",a?"bg-primary-foreground/60":"bg-primary"),style:{width:`${N}%`}}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-around opacity-30 pointer-events-none",children:S.map((_,C)=>s.jsx("div",{className:Y("w-0.5 rounded-full",a?"bg-primary-foreground":"bg-foreground"),style:{height:_}},C))})]}),s.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[s.jsx("span",{children:b(l)}),s.jsx("span",{children:b(c)})]})]}),t&&s.jsx("span",{className:"text-[10px] text-muted-foreground flex-shrink-0",children:j(t)})]})},c4=({attachments:r,isUserMessage:e})=>
601{if(!r||r.length===0)return null;const t=i=>i?i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`:"",n=i=>i.startsWith("image/"),a=i=>i.startsWith("audio/");return s.jsx("div",{className:"flex flex-col gap-2 mt-2",children:r.map((i,o)=>s.jsx("div",{children:n(i.type)?s.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"block max-w-[200px] rounded-lg overflow-hidden border hover:opacity-90 transition-opacity",children:s.jsx("img",{src:i.url,alt:i.name,className:"w-full h-auto max-h-[150px] object-cover",loading:"lazy"})}):a(i.type)?s.jsx(l4,{url:i.url,name:i.name,size:i.size,duration:i.duration,isUserMessage:e}):s.jsxs("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:Y("flex items-center gap-2 px-3 py-2 rounded-lg border text-xs hover:bg-muted/50 transition-colors",e?"bg-primary-foreground/10 border-primary-foreground/20":"bg-background"),children:[s.jsx(ji,{className:"h-4 w-4 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"truncate font-medium",children:i.name}),i.size&&s.jsx("p",{className:Y("text-[10px]",e?"text-primary-foreground/70":"text-muted-foreground"),children:t(i.size)})]}),s.jsx(Fs,{className:"h-3 w-3 flex-shrink-0 opacity-60"})]})},o))})},wl=/(https?:\/\/[^\s<>"{}|\\^`[\]]+|www\.[^\s<>"{}|\\^`[\]]+|[a-zA-Z0-9][-a-zA-Z0-9]*\.(com|org|net|io|co|app|dev|ai|xyz|me|info|biz|edu|gov|uk|de|fr|jp|cn|au|ca|in|br|ru|nl|se|no|fi|es|it|pl|ch|at|be|dk|ie|pt|cz|hu|sk|ro|bg|hr|si|lt|lv|ee|gr|tr|ua|il|ae|sa|sg|hk|tw|kr|nz|mx|ar|cl|co\.uk|com\.au|co\.nz|com\.br|co\.in)[^\s<>"{}|\\^`[\]]*)/gi,d4=(r,e={})=>{if(!r)return r;const t=r.replace(/vidacious\.lovable\.app/gi,"vidacious.ai");return e.disableLinks?t:t.split(wl).map((a,i)=>{if(wl.test(a)){wl.lastIndex=0;const o=a.match(/[.,:;!?]+$/),l=o?o[0]:"",d=l?a.slice(0,-l.length):a,h=d.startsWith("http://")||d.startsWith("https://")?d:`https://${d}`;return s.jsxs(u.Fragment,{children:[s.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"underline hover:opacity-80 transition-opacity break-all text-inherit",onClick:m=>m.stopPropagation(),children:d}),l]},i)}return s.jsx(u.Fragment,{children:a},i)})},u4=r=>{if(!r||r.length<10)return!1;if(/[\u0600-\u06FF\u0900-\u097F\u4E00-\u9FFF\u3040-\u30FF\u0400-\u04FF\u0370-\u03FF\u0590-\u05FF\u0E00-\u0E7F\uAC00-\uD7AF]/.test(r))return!0;const t=/[äöüÃà âçéèêëïîôùûÿæÅñ]/i;return(r.match(t)||[]).length>r.length*.05},h4=({message:r,content:e,isUser:t,styles:n,attachments:a,isLastInGroup:i,msgIndex:o,isAdminView:l})=>{const[d,c]=u.useState(!l),[h,m]=u.useState(!1),[f,p]=u.useState(null),[v,x]=u.useState(!1),g=r.metadata,b=g?.detected_language,j=g?.detected_language_name,k=g?.translated_content,y=g?.original_content,w=g?.translated_to,S=g?.translated_to_name,N=b&&b!=="en"||u4(e),_=l&&t&&N,C=r.sender_type==="ai"||r.sender_type==="agent",R=!l&&C&&(!!y&&w&&w!=="en");let M=e;_?d?M=e:M=f||k||e:R&&(M=d&&y||e);const L=!!(f||k),A=u.useCallback(async()=>{if(f||k){c(!1);return}m(!0),x(!1);try{const{data:se,error:re}=await W.functions.invoke("support-translate",{body:{action:"translate",text:e,target_language:"en"}});!re&&se?.text?(p(se.text),c(!1)):x(!0)}catch(se){console.error("Translation error:",se),x(!0)}finally{m(!1)}},[e,f,k]),V=u.useRef(!1);u.useEffect(()=>{_&&!d&&!L&&!h&&!V.current&&(V.current=!0,A())},[_,d,L,h,A]);const G=()=>{c(!d)};return s.jsxs("div",{className:Y("flex flex-col",t?"items-end":"items-start"),children:[l&&t&&N&&s.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[s.jsx(a1,{className:"h-3 w-3 text-muted-foreground/60"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:j||b&&o4[b]||b||"Non-English"})]}),s.jsxs("div",{className:Y("px-4 py-2.5 text-sm leading-relaxed shadow-sm",n.bubble,!i&&(t?"rounded-br-xl":"rounded-bl-xl"),o>0&&(t?"rounded-tr-xl":"rounded-tl-xl")),children:[s.jsx("p",{className:"whitespace-pre-wrap break-words overflow-hidden",children:d4(M,{disableLinks:l&&t})}),a.length>0&&s.jsx("div",{className:"mt-2",children:s.jsx(c4,{attachments:a,isUserMessage:t})}),_&&s.jsx("div",{className:"mt-2 pt-1.5 border-t border-primary-foreground
601/20",children:h?s.jsxs("span",{className:"text-[11px] text-primary-foreground/80 flex items-center gap-1",children:[s.jsx(Mt,{className:"h-3 w-3 animate-spin"}),s.jsx("span",{children:"Translating..."})]}):v&&!L?s.jsx("button",{onClick:A,className:"text-[11px] text-primary-foreground/80 hover:text-primary-foreground flex items-center gap-1 transition-colors",children:s.jsx("span",{className:"text-destructive",children:"Translation failed â Retry"})}):L?s.jsxs("button",{onClick:G,className:"text-[11px] text-primary-foreground/80 hover:text-primary-foreground flex items-center gap-1 transition-colors",children:[s.jsx(Tu,{className:"h-3 w-3"}),s.jsx("span",{children:d?"Show Translation":"View Original"})]}):null}),R&&s.jsx("div",{className:"mt-2 pt-1.5 border-t border-muted-foreground/20",children:s.jsxs("button",{onClick:G,className:"text-[11px] text-muted-foreground/80 hover:text-foreground flex items-center gap-1 transition-colors",children:[s.jsx(Tu,{className:"h-3 w-3"}),s.jsx("span",{children:d?`View in ${S||"your language"}`:"View Original (English)"})]})})]})]})},m4=({messages:r,isAdminView:e=!1})=>{const t=d=>{switch(d){case"user":return s.jsx(go,{className:"h-4 w-4"});case"ai":return s.jsx(Jc,{className:"h-4 w-4"});case"agent":return s.jsx(ki,{className:"h-4 w-4"})}},n=d=>{switch(d){case"user":return"You";case"ai":return"AI Assistant";case"agent":return"Support Agent"}},a=d=>{switch(d){case"user":return{container:"justify-end",bubble:"bg-primary text-primary-foreground rounded-2xl rounded-br-md",icon:"bg-primary text-primary-foreground",wrapper:"items-end"};case"ai":return{container:"justify-start",bubble:"bg-muted text-foreground rounded-2xl rounded-bl-md",icon:"bg-blue-500/10 text-blue-600 dark:text-blue-400",wrapper:"items-start"};case"agent":return{container:"justify-start",bubble:"bg-muted text-foreground rounded-2xl rounded-bl-md border border-green-500/20",icon:"bg-green-500/10 text-green-600 dark:text-green-400",wrapper:"items-start"}}},i=d=>{const c=new Date(d);return jN(c)?bl(c,"h:mm a"):NN(c)?`Yesterday ${bl(c,"h:mm a")}`:bl(c,"MMM d, h:mm a")},o=d=>!d||!Array.isArray(d)?[]:d.filter(c=>typeof c=="object"&&c!==null).map(c=>({name:String(c.name||"File"),url:String(c.url||""),type:String(c.type||"application/octet-stream"),size:typeof c.size=="number"?c.size:void 0})).filter(c=>c.url),l=r.reduce((d,c,h)=>{const m=r[h-1],f=m&&m.sender_type===c.sender_type,p=m&&new Date(c.created_at).getTime()-new Date(m.created_at).getTime()<6e4;return f&&p?d[d.length-1].push(c):d.push([c]),d},[]);return s.jsx("div",{className:"flex flex-col gap-4",children:l.map((d,c)=>{const h=d[0];if(!h)return null;const m=a(h.sender_type),f=h.sender_type==="user";return s.jsxs(ae.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.2,delay:Math.min(c*.05,.3)},className:Y("flex gap-2.5",m.container),children:[!f&&s.jsx("div",{className:Y("h-8 w-8 rounded-full flex items-center justify-center flex-shrink-0 shadow-sm",m.icon),children:t(h.sender_type)}),s.jsxs("div",{className:Y("flex flex-col gap-1 max-w-[80%]",m.wrapper),children:[!f&&s.jsx("span",{className:"text-[11px] font-medium text-muted-foreground px-1 mb-0.5",children:n(h.sender_type)}),d.map((p,v)=>{const x=o(p.attachments),g=v===d.length-1;return s.jsx(h4,{message:p,content:p.content,isUser:f,styles:m,attachments:x,isLastInGroup:g,msgIndex:v,isAdminView:e},p.id)}),s.jsx("span",{className:Y("text-[10px] text-muted-foreground/70 px-1 mt-0.5",f?"text-right":"text-left"),children:i(d[d.length-1].created_at)})]}),f&&s.jsx("div",{className:Y("h-8 w-8 rounded-full flex items-center justify-center flex-shrink-0 shadow-sm",m.icon),children:t(h.sender_type)})]},`group-${c}`)})})},p4=({isVisible:r=!0})=>s.jsx(pt,{children:r&&s.jsxs(ae.div,{initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-5,scale:.95},transition:{duration:.3,ease:[.4,0,.2,1]},className:"flex gap-2.5 items-start mt-4",children:[s.jsx(ae.div,{initial:{scale:.8,opacity:0}
601,animate:{scale:1,opacity:1},transition:{delay:.1,duration:.2},className:"h-8 w-8 rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400 flex items-center justify-center flex-shrink-0 shadow-sm",children:s.jsx(Jc,{className:"h-4 w-4"})}),s.jsxs("div",{className:"flex flex-col items-start",children:[s.jsx("span",{className:"text-[11px] font-medium text-muted-foreground px-1 mb-1",children:"AI Assistant"}),s.jsx(ae.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.15,duration:.25},className:"bg-muted rounded-2xl rounded-bl-md px-4 py-3 shadow-sm",children:s.jsx("div",{className:"flex gap-1.5 items-center h-4",children:[0,1,2].map(e=>s.jsx(ae.span,{className:"w-2 h-2 bg-muted-foreground/50 rounded-full",animate:{y:[0,-6,0],opacity:[.5,1,.5],scale:[1,1.15,1]},transition:{duration:.7,ease:"easeInOut",repeat:1/0,delay:e*.12}},e))})}),s.jsx("span",{className:"text-[10px] text-muted-foreground/70 px-1 mt-1",children:"Typing..."})]})]})}),f4={maxWidth:1920,maxHeight:1080,quality:.8,maxSizeKB:500};function g4(r,e,t){let{width:n,height:a}=r;const i=e/n,o=t/a,l=Math.min(i,o,1);n=Math.round(n*l),a=Math.round(a*l);const d=document.createElement("canvas");d.width=n,d.height=a;const c=d.getContext("2d");if(!c)throw new Error("Could not get canvas 2d context");return c.imageSmoothingEnabled=!0,c.imageSmoothingQuality="high",c.drawImage(r,0,0,n,a),d}function Em(r,e,t){return new Promise((n,a)=>{r.toBlob(i=>{i?n(i):a(new Error("Failed to convert canvas to blob"))},e,t)})}function x4(r){return new Promise((e,t)=>{const n=new Image,a=URL.createObjectURL(r);n.onload=()=>{URL.revokeObjectURL(a),e(n)},n.onerror=()=>{URL.revokeObjectURL(a),t(new Error("Failed to load image"))},n.src=a})}function v4(){const r=u.useCallback(async(t,n={})=>{const a={...f4,...n},i=t.size;if(!t.type.startsWith("image/"))return{file:t,originalSize:i,compressedSize:i,wasCompressed:!1};const o=(a.maxSizeKB??500)*1024;if(i<=o)return{file:t,originalSize:i,compressedSize:i,wasCompressed:!1};if(t.type==="image/gif")return{file:t,originalSize:i,compressedSize:i,wasCompressed:!1};try{const l=await x4(t),d=g4(l,a.maxWidth??1920,a.maxHeight??1080),c=t.type==="image/png"?"image/png":"image/jpeg";let h=a.quality??.8,m=await Em(d,c,h),f=0;for(;m.size>o&&h>.3&&f<5;)h-=.1,m=await Em(d,c,h),f++;if(m.size>=i)return{file:t,originalSize:i,compressedSize:i,wasCompressed:!1};const p=new File([m],t.name,{type:c,lastModified:Date.now()});return console.debug(`Image compressed: ${(i/1024).toFixed(1)}KB â ${(m.size/1024).toFixed(1)}KB (${Math.round((1-m.size/i)*100)}% reduction, quality: ${h.toFixed(1)})`),{file:p,originalSize:i,compressedSize:m.size,wasCompressed:!0}}catch(l){return console.warn("Image compression failed, using original:",l),{file:t,originalSize:i,compressedSize:i,wasCompressed:!1}}},[]),e=u.useCallback(async(t,n={})=>Promise.all(t.map(a=>r(a,n))),[r]);return{compressImage:r,compressImages:e}}const Cm="audio/webm;codecs=opus",Tm="audio/webm";function y4(r={}){const{maxDuration:e=120,onRecordingComplete:t}=r,[n,a]=u.useState({isRecording:!1,isPaused:!1,duration:0,audioBlob:null,audioUrl:null,error:null,isSupported:typeof MediaRecorder<"u"}),i=u.useRef(null),o=u.useRef(null),l=u.useRef([]),d=u.useRef(null),c=u.useRef(0),h=u.useRef(0),m=u.useCallback(()=>{d.current&&(clearInterval(d.current),d.current=null),o.current&&(o.current.getTracks().forEach(k=>k.stop()),o.current=null),i.current&&(i.current=null),l.current=[],c.current=0,h.current=0},[]);u.useEffect(()=>()=>{m(),n.audioUrl&&URL.revokeObjectURL(n.audioUrl)},[m,n.audioUrl]);const f=u.useCallback(async()=>{try{n.audioUrl&&URL.revokeObjectURL(n.audioUrl),m();const k=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,sampleRate:48e3}});o.current=k;const y=MediaRecorder.isTypeSupported(Cm)?Cm:MediaRecorder.isTypeSupported(Tm)?Tm:"";if(!y)throw new Error("No supported audio MIME type found");const w=new MediaRecorder(k,{mimeType:y,audioBitsPerSecond:128e3});i.current=w,l.current=[],c.current=Date.now(),h.current=0,w.ondataavailable=S=>{S.data.size>0&&l.current.push(S.data)},w.onstop=()=>{const S=new Blob(l.current,{type:y}),N=URL.createObjectURL(S),_=Math.round((h.current+(Date.now()-c.current))/1e3);a(C=>({...C,isRecording:!1,isPaused:!1,audioBlob:S,audioUrl:N,duration:_})),t?.(S,_),m()},w.onerror=S=>{console.error("MediaRecorder error:",S),a(N=>({...N,error:"Recording error occurred",isRecording:!1,isPaused:!1})),m()},w.start(1e3),d.current=setInterval(()=>{const S=Math.round((h.current+(Date.now()-c.current))/1e3);a(N=>({...N,duration:S}
601)),S>=e&&p()},100),a(S=>({...S,isRecording:!0,isPaused:!1,duration:0,audioBlob:null,audioUrl:null,error:null})),console.debug("[VoiceRecorder] Recording started")}catch(k){console.error("[VoiceRecorder] Start error:",k);let y="Failed to start recording";k instanceof Error&&(k.name==="NotAllowedError"?y="Microphone access denied. Please allow microphone access.":k.name==="NotFoundError"?y="No microphone found. Please connect a microphone.":k.name==="NotSupportedError"?y="Audio recording not supported in this browser.":y=k.message),a(w=>({...w,error:y,isRecording:!1,isPaused:!1}))}},[m,e,t,n.audioUrl]),p=u.useCallback(()=>{i.current&&n.isRecording&&(console.debug("[VoiceRecorder] Stopping recording"),d.current&&(clearInterval(d.current),d.current=null),i.current.state!=="inactive"&&i.current.stop())},[n.isRecording]),v=u.useCallback(()=>{i.current&&n.isRecording&&!n.isPaused&&(i.current.pause(),h.current+=Date.now()-c.current,d.current&&(clearInterval(d.current),d.current=null),a(k=>({...k,isPaused:!0})),console.debug("[VoiceRecorder] Recording paused"))},[n.isRecording,n.isPaused]),x=u.useCallback(()=>{i.current&&n.isRecording&&n.isPaused&&(i.current.resume(),c.current=Date.now(),d.current=setInterval(()=>{const k=Math.round((h.current+(Date.now()-c.current))/1e3);a(y=>({...y,duration:k})),k>=e&&p()},100),a(k=>({...k,isPaused:!1})),console.debug("[VoiceRecorder] Recording resumed"))},[n.isRecording,n.isPaused,e,p]),g=u.useCallback(()=>{console.debug("[VoiceRecorder] Cancelling recording"),m(),n.audioUrl&&URL.revokeObjectURL(n.audioUrl),a(k=>({...k,isRecording:!1,isPaused:!1,duration:0,audioBlob:null,audioUrl:null,error:null}))},[m,n.audioUrl]),b=u.useCallback(()=>{n.audioUrl&&URL.revokeObjectURL(n.audioUrl),a(k=>({...k,audioBlob:null,audioUrl:null,duration:0}))},[n.audioUrl]),j=u.useCallback(()=>{a(k=>({...k,error:null}))},[]);return{...n,startRecording:f,stopRecording:p,pauseRecording:v,resumeRecording:x,cancelRecording:g,clearRecording:b,clearError:j,maxDuration:e}}const b4=({userId:r,onVoiceMessageReady:e,disabled:t})=>{const[n,a]=u.useState(!1),{isRecording:i,isPaused:o,duration:l,audioBlob:d,audioUrl:c,error:h,isSupported:m,startRecording:f,stopRecording:p,pauseRecording:v,resumeRecording:x,cancelRecording:g,clearRecording:b,clearError:j,maxDuration:k}=y4({maxDuration:120}),y=S=>{const N=Math.floor(S/60),_=S%60;return`${N}:${_.toString().padStart(2,"0")}`},w=u.useCallback(async()=>{if(!(!d||!c)){a(!0);try{const S=`${r}/voice-${Date.now()}-${Math.random().toString(36).slice(2,11)}.webm`,{data:N,error:_}=await W.storage.from("support-attachments").upload(S,d,{contentType:"audio/webm",cacheControl:"3600"});if(_)throw _;const{data:C}=W.storage.from("support-attachments").getPublicUrl(N.path),O={name:`Voice message (${y(l)})`,url:C.publicUrl,type:"audio/webm",size:d.size,duration:l};e(O),b(),ne.success("Voice message ready to send")}catch(S){console.error("Voice upload error:",S),ne.error("Failed to prepare voice message")}finally{a(!1)}}},[d,c,r,l,e,b]);return $.useEffect(()=>{h&&(ne.error(h),j())},[h,j]),m?i?s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-destructive/10 rounded-lg border border-destructive/20",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[s.jsx("div",{className:Y("w-3 h-3 rounded-full bg-destructive",!o&&"animate-pulse")}),s.jsx("span",{className:"text-sm font-medium text-destructive",children:y(l)}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",y(k)]})]}),s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:o?x:v,title:o?"Resume":"Pause",children:o?s.jsx(Qc,{className:"h-4 w-4"}):s.jsx(Of,{className:"h-4 w-4"})}),s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:p,title:"Stop recording",children:s.jsx(j1,{className:"h-4 w-4"})}),s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:g,title:"Cancel",children:s.jsx(lt,{className:"h-4 w-4"})})]}):d&&c?s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-muted/50 rounded-lg",children:[s.jsx("audio",{src:c,controls:!0,className:"h-8 flex-1",style:{maxWidth:"200px"}}),s.jsx("span",{className:"text-xs text-muted-foreground",children:y(l)}),s.jsx(ie,{type:"button",variant:"default",size:"icon",className:"h-8 w-8",onClick:w,disabled:n,title:"Send voice message",children:n?s.jsx(Mt,{className:"h-4 w-4 animate-spin"}):s.jsx(ed,{className:"h-4 w-4"})}),s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:b,disabled:n,title:"Discard",children:s.jsx(lt,{className:"h-4 w-4"})})]}):s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:f,disabled:t,title:"Record voice message",children:s.jsx(Kc,{className:"h-4 w-4"})}):null}
601,_4=5*1024*1024,Pm=["image/jpeg","image/png","image/gif","image/webp","application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","audio/webm","audio/mp3","audio/mpeg","audio/wav","audio/ogg"],w4=({onFilesUploaded:r,pendingFiles:e,onRemoveFile:t,disabled:n,userId:a})=>{const[i,o]=u.useState(!1),[l,d]=u.useState(!1),c=u.useRef(null),h=u.useRef(null),{compressImages:m}=v4(),f=u.useCallback(S=>S.filter(N=>N.size>_4?(ne.error(`${N.name} is too large. Max size is 5MB.`),!1):Pm.includes(N.type)?!0:(ne.error(`${N.name} has an unsupported file type.`),!1)),[]),p=u.useCallback(async S=>{const N=f(S);if(N.length===0)return;o(!0);const _=[];try{const C=await m(N,{maxWidth:1920,maxHeight:1080,quality:.8,maxSizeKB:500});for(const O of C){const R=O.file,M=R.name.split(".").pop(),L=`${a}/${Date.now()}-${Math.random().toString(36).slice(2,11)}.${M}`,{data:A,error:V}=await W.storage.from("support-attachments").upload(L,R);if(V){console.error("Upload error:",V),ne.error(`Failed to upload ${R.name}`);continue}const{data:G}=W.storage.from("support-attachments").getPublicUrl(A.path);_.push({name:R.name,url:G.publicUrl,type:R.type,size:R.size})}_.length>0&&(r(_),ne.success(`${_.length} file(s) ready to send`))}catch(C){console.error("Upload error:",C),ne.error("Failed to upload files")}finally{o(!1),c.current&&(c.current.value="")}},[a,f,m,r]),v=u.useCallback(async S=>{const N=Array.from(S.target.files||[]);N.length>0&&await p(N)},[p]),x=u.useCallback(S=>{S.preventDefault(),S.stopPropagation(),!n&&!i&&d(!0)},[n,i]),g=u.useCallback(S=>{S.preventDefault(),S.stopPropagation();const N=S.relatedTarget;h.current?.contains(N)||d(!1)},[]),b=u.useCallback(S=>{S.preventDefault(),S.stopPropagation()},[]),j=u.useCallback(async S=>{if(S.preventDefault(),S.stopPropagation(),d(!1),n||i)return;const N=Array.from(S.dataTransfer.files);N.length>0&&await p(N)},[n,i,p]),k=u.useCallback(async S=>{if(n||i)return;const N=S.clipboardData;if(!N)return;const _=[];for(const C of Array.from(N.items))if(C.kind==="file"){const O=C.getAsFile();if(O)if(O.type.startsWith("image/")&&O.name==="image.png"){const R=O.type.split("/")[1]||"png",M=new File([O],`pasted-image-${Date.now()}.${R}`,{type:O.type,lastModified:Date.now()});_.push(M)}else _.push(O)}_.length>0&&(S.preventDefault(),await p(_))},[n,i,p]);u.useEffect(()=>(document.addEventListener("paste",k),()=>{document.removeEventListener("paste",k)}),[k]);const y=S=>S.startsWith("image/")?s.jsx(o1,{className:"h-3.5 w-3.5"}):S.startsWith("audio/")?s.jsx(Kc,{className:"h-3.5 w-3.5"}):s.jsx(ji,{className:"h-3.5 w-3.5"}),w=S=>S<1024?`${S} B`:S<1024*1024?`${(S/1024).toFixed(1)} KB`:`${(S/(1024*1024)).toFixed(1)} MB`;return s.jsxs("div",{ref:h,className:"flex flex-col gap-2",onDragEnter:x,onDragLeave:g,onDragOver:b,onDrop:j,children:[s.jsx(pt,{children:l&&s.jsx(ae.div,{initial:{opacity:0}
601,animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-50 flex items-center justify-center bg-primary/10 backdrop-blur-sm border-2 border-dashed border-primary rounded-2xl pointer-events-none",children:s.jsxs("div",{className:"flex flex-col items-center gap-2 text-primary",children:[s.jsx(ae.div,{animate:{y:[0,-8,0]},transition:{duration:1,repeat:1/0},children:s.jsx(C1,{className:"h-10 w-10"})}),s.jsx("span",{className:"text-sm font-medium",children:"Drop files here"})]})})}),s.jsx(pt,{children:e.length>0&&s.jsx(ae.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"flex flex-wrap gap-2 p-2.5 bg-muted/50 rounded-xl border border-border/50",children:e.map((S,N)=>s.jsxs(ae.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},className:"flex items-center gap-2 px-2.5 py-1.5 bg-background rounded-lg border text-xs group",children:[s.jsx("span",{className:"text-primary",children:y(S.type)}),s.jsx("span",{className:"max-w-[100px] truncate font-medium",children:S.name}),s.jsxs("span",{className:"text-muted-foreground",children:["(",w(S.size),")"]}),s.jsx("button",{onClick:()=>t(N),className:"p-0.5 hover:bg-destructive/10 hover:text-destructive rounded transition-colors",type:"button",children:s.jsx(lt,{className:"h-3.5 w-3.5"})})]},N))})}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("input",{ref:c,type:"file",multiple:!0,accept:Pm.join(","),onChange:v,className:"hidden",disabled:n||i}),s.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:Y("h-9 w-9 rounded-lg transition-colors hover:bg-muted",l&&"bg-primary/20"),onClick:()=>c.current?.click(),disabled:n||i,title:"Attach files (or drag & drop, Ctrl+V)",children:i?s.jsx(Mt,{className:"h-4 w-4 animate-spin"}):s.jsx(f1,{className:"h-4 w-4 text-muted-foreground"})}),s.jsx(b4,{userId:a,onVoiceMessageReady:S=>r([S]),disabled:n||i}),e.length===0&&!i&&s.jsx("span",{className:"text-xs text-muted-foreground/60 hidden sm:inline",children:"Attach, record, or paste"})]})]})},j4=({currentView:r,onViewChange:e,unreadCount:t=0})=>{const n=[{id:"home",label:"Home",icon:Ma},{id:"messages",label:"Messages",icon:br,badge:t},{id:"help",label:"Help",icon:Ia}],a=i=>i==="home"&&r==="conversation"?!1:r===i;return s.jsx("nav",{className:"flex items-center justify-around border-t border-border/50 bg-muted/30 backdrop-blur-sm px-2 py-1.5 flex-shrink-0",role:"navigation","aria-label":"Support chat navigation",children:n.map(i=>{const o=a(i.id);return s.jsxs("button",{onClick:()=>e(i.id),className:Y("flex items-center gap-1.5 px-3 py-1.5 rounded-full transition-all relative","hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/20",o&&"bg-primary/10 text-primary"),"aria-current":o?"page":void 0,children:[s.jsx(i.icon,{className:Y("h-4 w-4 transition-colors shrink-0",o?"text-primary":"text-muted-foreground")}),s.jsx("span",{className:Y("text-xs font-medium transition-colors whitespace-nowrap",o?"text-primary":"text-muted-foreground"),children:i.label}),i.badge!==void 0&&i.badge>0&&s.jsx(ae.span,{initial:{scale:0},animate:{scale:1},className:"h-4 min-w-4 px-1 rounded-full bg-primary text-primary-foreground text-[10px] font-medium flex items-center justify-center shrink-0",children:i.badge>9?"9+":i.badge})]},i.id)})})},k4=({recentConversation:r,recentMessage:e,onStartConversation:t,onViewConversation:n,onSearchHelp:a})=>s.jsxs(ae.div,{initial:{opacity:0}
601,animate:{opacity:1},exit:{opacity:0},className:"flex-1 flex flex-col overflow-y-auto",children:[s.jsxs("div",{className:"relative px-6 pt-6 pb-8 bg-gradient-to-br from-primary/10 via-primary/5 to-transparent overflow-hidden",children:[s.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-bl from-primary/10 to-transparent rounded-full blur-2xl"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-accent/10 to-transparent rounded-full blur-xl"}),s.jsxs("div",{className:"relative",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx(ae.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:200,damping:15},children:s.jsx("img",{src:"/brand/icon-only.svg",alt:"Vidacious",className:"h-10 w-10 rounded-xl shadow-md"})}),s.jsx("div",{className:"flex -space-x-2",children:["bg-gradient-to-br from-primary to-primary/70","bg-gradient-to-br from-accent to-accent/70","bg-gradient-to-br from-violet-500 to-violet-500/70"].map((i,o)=>s.jsx(ae.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},transition:{delay:.1+o*.1},className:Y("h-9 w-9 rounded-full border-2 border-background flex items-center justify-center text-white text-xs font-semibold shadow-sm",i),children:["V","A","I"][o]},o))})]}),s.jsxs(ae.div,{initial:{y:10,opacity:0},animate:{y:0,opacity:1},transition:{delay:.2},children:[s.jsxs("h2",{className:"text-xl font-semibold mb-1 flex items-center gap-2",children:["Happy Creating!",s.jsx(ae.span,{animate:{rotate:[0,14,-8,14,-4,10,0]},transition:{delay:.5,duration:.8},children:"ð"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Hello! How can I help you today?"})]})]})]}),s.jsxs("div",{className:"flex-1 px-4 py-4 space-y-3",children:[r&&s.jsxs(ae.button,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.15},onClick:()=>n(r.id),className:"w-full text-left p-4 rounded-xl bg-muted/50 hover:bg-muted border border-transparent hover:border-border/50 transition-all group",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent message"}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:Ea(new Date(r.created_at),{addSuffix:!1})})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"h-8 w-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx(br,{className:"h-4 w-4 text-primary"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:r.subject||"Support Conversation"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:e?.content||"Tap to view conversation"})]}),s.jsx(Jr,{className:"h-4 w-4 text-muted-foreground group-hover:text-foreground transition-colors flex-shrink-0"})]})]}),s.jsx(ae.button,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.25},onClick:t,className:"w-full text-left p-4 rounded-xl bg-primary/5 hover:bg-primary/10 border border-primary/20 hover:border-primary/30 transition-all group",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"h-12 w-12 rounded-xl bg-primary/10 flex items-center justify-center flex-shrink-0 group-hover:bg-primary/20 transition-colors",children:s.jsx(ed,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("p",{className:"text-sm font-semibold flex items-center gap-2",children:["Send us a message",s.jsx(Jr,{className:"h-4 w-4 text-muted-foreground group-hover:translate-x-0.5 transition-transform"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[s.jsx(Ls,{className:"h-3 w-3 text-muted-foreground"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"We typically reply in under 2 minutes"})]})]})]})}),s.jsx(ae.button,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.35},onClick:a,className:"w-full text-left p-4 rounded-xl bg-muted/30 hover:bg-muted/50 border border-border/50 hover:border-border transition-all group",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"h-12 w-12 rounded-xl bg-muted flex items-center justify-center flex-shrink-0",children:s.jsx(zl,{className:"h-5 w-5 text-muted-foreground"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"text-sm font-medium",children:"Search for help"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Browse our help center articles"})]}),s.jsx(Jr,{className:"h-4 w-4 text-muted-foreground group-hover:translate-x-0.5 transition-transform"})]})}),s.jsx(ae.div,{initial:{y:20,opacity:0}
601,animate:{y:0,opacity:1},transition:{delay:.45},className:"flex items-center justify-center gap-2 pt-2",children:s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-muted/50",children:[s.jsx(Bt,{className:"h-3 w-3 text-primary"}),s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:"Powered by Vidacious AI"})]})})]})]}),N4=r=>{switch(r){case"resolved":return s.jsx(wi,{className:"h-3 w-3 text-accent-foreground"});case"closed":return s.jsx(wi,{className:"h-3 w-3 text-muted-foreground"});case"pending":return s.jsx(Ls,{className:"h-3 w-3 text-primary"});default:return s.jsx(br,{className:"h-3 w-3 text-primary"})}},S4=r=>{switch(r){case"resolved":return"bg-accent/10 text-accent-foreground border-accent/20";case"closed":return"bg-muted text-muted-foreground";case"pending":return"bg-secondary/10 text-secondary-foreground border-secondary/20";default:return"bg-primary/10 text-primary border-primary/20"}},E4=({currentConversation:r,pastConversations:e,onViewConversation:t,onStartNewConversation:n})=>{const a=[...r&&(r.status==="open"||r.status==="pending")?[{id:r.id,subject:r.subject,status:r.status,created_at:r.created_at,resolved_at:r.resolved_at,isCurrent:!0}]:[],...e.map(i=>({...i,isCurrent:!1}))];return s.jsxs(ae.div,{initial:{opacity:0}
601,animate:{opacity:1},exit:{opacity:0},className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-4 border-b flex items-center justify-between flex-shrink-0",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-base font-semibold",children:"Messages"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.length," conversation",a.length!==1?"s":""]})]}),s.jsxs(ie,{size:"sm",onClick:n,className:"h-8 gap-1.5",children:[s.jsx(mn,{className:"h-3.5 w-3.5"}),"New"]})]}),s.jsx(vn,{className:"flex-1",children:s.jsx("div",{className:"p-2 space-y-1",children:a.length===0?s.jsxs(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[s.jsx("div",{className:"h-16 w-16 rounded-2xl bg-muted/50 flex items-center justify-center mb-4",children:s.jsx(br,{className:"h-8 w-8 text-muted-foreground/50"})}),s.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:"No conversations yet"}),s.jsx("p",{className:"text-xs text-muted-foreground/70 mb-4",children:"Start a conversation to get help"}),s.jsxs(ie,{size:"sm",onClick:n,children:[s.jsx(mn,{className:"h-3.5 w-3.5 mr-1.5"}),"Start conversation"]})]}):a.map((i,o)=>s.jsx(ae.button,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:o*.05},onClick:()=>t(i.id),className:Y("w-full text-left p-3 rounded-xl transition-all","hover:bg-muted border border-transparent hover:border-border/50",i.isCurrent&&"bg-primary/5 border-primary/20"),children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:Y("h-10 w-10 rounded-full flex items-center justify-center flex-shrink-0",i.isCurrent?"bg-primary/10":"bg-muted"),children:s.jsx(br,{className:Y("h-4 w-4",i.isCurrent?"text-primary":"text-muted-foreground")})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.subject||"Support Request"}),s.jsx("span",{className:"text-[10px] text-muted-foreground flex-shrink-0",children:Ea(new Date(i.created_at),{addSuffix:!1})})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(rt,{variant:"outline",className:Y("text-[9px] px-1.5 py-0 h-4 gap-1",S4(i.status)),children:[N4(i.status),i.status]}),i.isCurrent&&s.jsx("span",{className:"text-[10px] text-primary font-medium",children:"Active"}),i.status==="resolved"&&s.jsx("span",{className:"text-[10px] text-muted-foreground italic",children:"Reply to reopen"})]})]})]})},i.id))})})]})},Gr=u.forwardRef(({className:r,type:e,...t},n)=>s.jsx("input",{type:e,className:Y("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:n,...t}));Gr.displayName="Input";const C4=[{id:"getting-started",icon:Ni,title:"Getting Started",description:"Learn the basics of creating AI videos",category:"Basics"},{id:"scripts",icon:Dt,title:"Scripts & Content",description:"Writing and enhancing your video scripts",category:"Features"},{id:"billing",icon:qs,title:"Billing & Credits",description:"Understanding pricing, credits, and subscriptions",category:"Account"},{id:"creators",icon:ur,title:"Creator Program",description:"Become a creator and earn royalties",category:"Creators"}],T4=({onOpenHelpCenter:r})=>{const[e,t]=u.useState(""),n=Xt(),a=C4.filter(o=>o.title.toLowerCase().includes(e.toLowerCase())||o.description.toLowerCase().includes(e.toLowerCase())||o.category.toLowerCase().includes(e.toLowerCase())),i=o=>{n(`/help#${o}`)};return s.jsxs(ae.div,{initial:{opacity:0}
601,animate:{opacity:1},exit:{opacity:0},className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-4 border-b flex-shrink-0",children:[s.jsx("h3",{className:"text-base font-semibold mb-3",children:"Help Center"}),s.jsxs("div",{className:"relative",children:[s.jsx(zl,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Gr,{placeholder:"Search for help...",value:e,onChange:o=>t(o.target.value),className:"pl-9 h-10 bg-muted/50 border-muted-foreground/20 focus:bg-background"})]})]}),s.jsx(vn,{className:"flex-1",children:s.jsx("div",{className:"p-4 space-y-2",children:a.length===0?s.jsxs(ae.div,{initial:{opacity:0},animate:{opacity:1},className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("div",{className:"h-12 w-12 rounded-xl bg-muted flex items-center justify-center mb-3",children:s.jsx(zl,{className:"h-5 w-5 text-muted-foreground"})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"No articles found"}),s.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Try a different search term"})]}):a.map((o,l)=>s.jsx(ae.button,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:l*.05},onClick:()=>i(o.id),className:Y("w-full text-left p-3 rounded-xl transition-all group","bg-muted/30 hover:bg-muted border border-transparent hover:border-border/50"),children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0 group-hover:bg-primary/20 transition-colors",children:s.jsx(o.icon,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 mb-0.5",children:[s.jsx("p",{className:"text-sm font-medium",children:o.title}),s.jsx(nr,{className:"h-3.5 w-3.5 text-muted-foreground opacity-0 group-hover:opacity-100 group-hover:translate-x-0.5 transition-all flex-shrink-0"})]}),s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:o.description})]})]})},o.id))})}),s.jsx("div",{className:"p-4 border-t flex-shrink-0",children:s.jsxs(ie,{variant:"outline",onClick:r,className:"w-full h-10 gap-2",children:[s.jsx(ga,{className:"h-4 w-4"}),"View Full Help Center",s.jsx(Fs,{className:"h-3 w-3 ml-auto"})]})})]})},P4=({onClose:r,initialConversationId:e,onConversationLoaded:t})=>{const{user:n}=Ee();Ss();const{conversation:a,messages:i,pastConversations:o,isLoading:l,isSending:d,error:c,sendMessage:h,startConversation:m,startNewTopic:f,loadConversation:p,isTyping:v}=i4(),[x,g]=u.useState("home"),[b,j]=u.useState(""),[k,y]=u.useState([]),[w,S]=u.useState(!1),N=u.useRef(null),_=u.useRef(null),C=u.useRef(null),O=u.useMemo(()=>a&&(a.status==="open"||a.status==="pending")?{id:a.id,subject:a.subject||"New Support Request",status:a.status,created_at:a.created_at,resolved_at:a.resolved_at,isActive:!0}:null,[a]),R=u.useMemo(()=>O||(o.length>0?o[0]:null),[O,o]),M=u.useMemo(()=>i.length>0?i[i.length-1]:null,[i]),L=u.useCallback(()=>{const q=C.current;q&&(q.style.height="auto",q.style.height=Math.min(q.scrollHeight,120)+"px")},[]),A=u.useCallback((q="smooth")=>{if(N.current&&N.current.scrollIntoView({behavior:q,block:"end"}),_.current){const ce=_.current.querySelector("[data-radix-scroll-area-viewport]");ce&&(ce.scrollTop=ce.scrollHeight)}},[]),V=u.useCallback(()=>{if(_.current){const q=_.current.querySelector("[data-radix-scroll-area-viewport]");if(q){const{scrollTop:ce,scrollHeight:pe,clientHeight:ke}=q,de=pe-ce-ke<100;S(!de&&i.length>3)}}},[i.length]);u.useEffect(()=>{const q=_.current?.querySelector("[data-radix-scroll-area-viewport]");if(q)return q.addEventListener("scroll",V),()=>q.removeEventListener("scroll",V)},[V,a]),u.useEffect(()=>{if(x==="conversation"){const q=requestAnimationFrame(()=>{A("smooth")});return()=>cancelAnimationFrame(q)}},[i,v,A,x]),u.useEffect(()=>{a&&i.length>0&&x==="conversation"&&A("instant")},[a,A,x,i.length]);const G=u.useRef(!1),se=u.useRef(null);u.useEffect(()=>{e&&!l&&!G.current&&se.current!==e&&(G.current=!0,se.current=e,console.log("[ChatWindow] Loading initial conversation:",e),p(e).then(()=>{g("conversation"),t?.()})),e||(G.current=!1)},[e,l,p,t]);const re=async()=>
601{if(!b.trim()&&k.length===0||d)return;const q=b,ce=k.map(pe=>({name:pe.name,url:pe.url,type:pe.type,size:pe.size}));j(""),y([]),C.current&&(C.current.style.height="auto"),await h(q,ce.length>0?ce:void 0)},Z=q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),re())},P=async()=>{await m(),g("conversation")},E=async()=>{await f(),g("conversation")},U=async q=>{await p(q),g("conversation")},J=q=>{y(ce=>[...ce,...q])},te=q=>{y(ce=>ce.filter((pe,ke)=>ke!==q))},D=q=>{if(q==="home"||q==="messages"||q==="help"){g(q);return}q==="conversation"&&!a?P():g(q)},ee=Xt(),T=()=>{ee("/help")},z=a&&(a.status==="resolved"||a.status==="closed");return l?s.jsx(ae.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{duration:.2,ease:"easeOut"},className:"w-[380px] sm:w-[420px] h-[600px] rounded-2xl shadow-2xl border border-border/50 bg-background overflow-hidden flex flex-col",children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx(ki,{className:"h-6 w-6 text-primary animate-pulse"})}),s.jsx("div",{className:"absolute -bottom-1 -right-1 h-4 w-4 rounded-full bg-accent border-2 border-background"})]}),s.jsxs("div",{className:"flex flex-col items-center gap-1",children:[s.jsx("span",{className:"text-sm font-medium",children:"Connecting..."}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Just a moment"})]})]})})}):s.jsxs(ae.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{duration:.25,ease:[.4,0,.2,1]},className:"w-[380px] sm:w-[420px] h-[600px] rounded-2xl shadow-2xl border border-border/40 bg-background flex flex-col overflow-hidden",children:[x==="conversation"&&s.jsx("div",{className:"px-5 py-4 border-b bg-gradient-to-r from-primary/5 to-transparent flex-shrink-0",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-11 w-11 rounded-full bg-primary/10 flex items-center justify-center ring-2 ring-primary/20",children:s.jsx(ki,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-base font-semibold",children:"Support"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent opacity-75"}),s.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-accent"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"We typically reply in minutes"})]})]})]}),s.jsx(ie,{variant:"ghost",size:"icon",onClick:r,className:"h-9 w-9 rounded-full hover:bg-muted",children:s.jsx(lt,{className:"h-4 w-4"})})]})}),s.jsx("div",{className:"flex-1 flex flex-col overflow-hidden relative",children:s.jsxs(pt,{mode:"wait",children:[x==="home"&&s.jsx(k4,{recentConversation:R,recentMessage:M,onStartConversation:P,onViewConversation:U,onSearchHelp:()=>g("help")},"home"),x==="messages"&&s.jsx(E4,{currentConversation:a,pastConversations:o,onViewConversation:U,onStartNewConversation:P},"messages"),x==="help"&&s.jsx(T4,{onOpenHelpCenter:T},"help"),x==="conversation"&&s.jsxs(ae.div,{initial:{opacity:0}
601,animate:{opacity:1},exit:{opacity:0},className:"flex-1 flex flex-col overflow-hidden",children:[z&&s.jsxs("div",{className:"px-4 py-2 bg-muted/50 border-b flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx(ui,{className:"h-3 w-3"}),s.jsx("span",{children:"Viewing past conversation"}),s.jsx(rt,{variant:"outline",className:"text-[9px] px-1.5 py-0 h-4",children:a.status})]}),s.jsxs(ie,{variant:"ghost",size:"sm",onClick:E,className:"h-6 px-2 text-xs gap-1",children:[s.jsx(mn,{className:"h-3 w-3"}),"New topic"]})]}),s.jsxs(vn,{className:"flex-1 px-4 py-3",ref:_,children:[i.length===0?s.jsxs(ae.div,{initial:{opacity:0},animate:{opacity:1},className:"flex flex-col items-center justify-center h-full text-center py-12",children:[s.jsx("div",{className:"h-14 w-14 rounded-2xl bg-muted/50 flex items-center justify-center mb-4",children:s.jsx(Jc,{className:"h-7 w-7 text-muted-foreground/50"})}),s.jsx("p",{className:"text-sm text-muted-foreground font-medium",children:"Hello! How can I help you today?"}),s.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Type your message below to get started"})]}):s.jsx(m4,{messages:i,isAdminView:!1}),!z&&s.jsx(p4,{isVisible:v}),s.jsx("div",{ref:N,className:"h-1","aria-hidden":"true"})]}),s.jsx(pt,{children:w&&s.jsx(ae.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>A("smooth"),className:"absolute bottom-24 left-1/2 -translate-x-1/2 h-8 w-8 rounded-full bg-background border shadow-lg flex items-center justify-center hover:bg-muted transition-colors z-10",children:s.jsx(Zc,{className:"h-4 w-4"})})}),s.jsx(pt,{children:c&&s.jsx(ae.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"px-4 py-2 bg-destructive/10 text-destructive text-xs border-t border-destructive/20",children:c})}),s.jsxs("div",{className:"p-4 border-t bg-muted/30 flex-shrink-0",children:[z&&s.jsx("p",{className:"text-xs text-muted-foreground mb-2 italic",children:"Reply to reopen this conversation"}),n&&s.jsx(w4,{userId:n.id,onFilesUploaded:J,pendingFiles:k,onRemoveFile:te,disabled:d}),s.jsxs("div",{className:"flex gap-2 items-end mt-2",children:[s.jsx("div",{className:"flex-1 relative",children:s.jsx("textarea",{ref:C,value:b,onChange:q=>{j(q.target.value),L()},onKeyDown:Z,placeholder:"Type a message...",disabled:d,rows:1,className:Y("w-full resize-none rounded-xl border border-input bg-background px-4 py-3 text-sm","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/20 focus-visible:border-primary/50","disabled:cursor-not-allowed disabled:opacity-50","min-h-[44px] max-h-[120px] transition-all")})}),s.jsx(ie,{onClick:re,disabled:!b.trim()&&k.length===0||d,size:"icon",className:Y("h-11 w-11 rounded-xl shrink-0 transition-all","bg-primary hover:bg-primary/90 shadow-md hover:shadow-lg",d&&"animate-pulse"),children:s.jsx(ed,{className:Y("h-4 w-4",d&&"opacity-50")})})]})]})]},"conversation")]})}),s.jsx(j4,{currentView:x,onViewChange:D,unreadCount:0})]})},A4=u.forwardRef(function({enableChatSound:e=!0,chatSoundVolume:t=.3},n){const{user:a}=Ee(),i=ot(),o=i.pathname==="/create",l=i.pathname==="/feed",d=i.pathname.startsWith("/admin/support"),c=i.pathname==="/moderator-dashboard",h=i.pathname.startsWith("/actors/")&&i.pathname!=="/actors",[m,f]=u.useState(!1),[p,v]=u.useState(null),x=u.useRef(!1),g=u.useRef(m),b=u.useRef(0),[j,k]=u.useState(()=>{try{return localStorage.getItem("chat-widget-minimized")==="true"}catch{return!1}}),[y,w]=u.useState(!1);u.useEffect(()=>{try{localStorage.setItem("chat-widget-minimized",String(j))}catch{}},[j]),u.useEffect(()=>{g.current=m},[m]);const S=()=>{e&&x.current&&!g.current&&Gi(t)},{unreadCount:N,markAsRead:_}=n4({onNewMessage:S});u.useEffect(()=>{if(N>b.current&&x.current&&!m){const Z=N-b.current;ne.info(`You have ${Z} new message${Z>1?"s":""} from support`,{duration:1/0,action:{label:"View",onClick:()=>{k(!1),f(!0)}}})}b.current=N},[N,m]);const C=u.useRef(m);u.useEffect(()=>{const Z=C.current;C.current=m,m&&!Z&&N>0&&_()},[m,N,_]),u.useEffect(()=>{const Z=()=>{k(!1),f(!0),x.current=!0,N>0&&_()},P=E=>{const{conversationId:U}=E.detail;console.log("[FloatingDock] Opening conversation:",U),k(!1),v(U),f(!0),x.current=!0};return window.addEventListener("open-chat-widget",Z),window.addEventListener("open-support-chat",Z),window.addEventListener("open-support-conversation",P),()=>{window.removeEventListener("open-chat-widget",Z),window.removeEventListener("open-support-chat",Z),window.removeEventListener("open-support-conversation",P)}},[N,_]),u.useEffect(()=>{const Z=()=>{w(window.scrollY>300)};return window.addEventListener("scroll",Z,{passive:!0}),Z(),()=>window.removeEventListener("scroll",Z)},[]);const O=()=>{x.current=!0;const Z=!m;f(Z),Z||v(null),Z&&N>0&&_()},R=()=>{v(null)},M=Z=>{Z.stopPropagation(),k(!0),f(!1)},L=()=>{G?(k(!1),f(!0),x.current=!0,N>0&&_()):k(!1)},A=()=>{window.scrollTo({top:0,behavior:"smooth"})},V=Z=>Z>9?"9+":Z.toString(),[G,se]=u.useState(()=>window.innerWidth<768);u.useEffect(()=>{const Z=()=>se(window.innerWidth<768);return window.addEventListener("resize",Z,{passive:!0}),()=>window.removeEventListener("resize",Z)},[]);const re=!!a&&!o&&!l&&!d&&!c&&!(h&&G);return!re&&!y?null:s.jsxs(s.Fragment,{children:[s.jsx(pt,{children:m&&a&&s.jsx(ae.div,{initial:{opacity:0,y:20,scale:.95}
601,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{duration:.2},className:"fixed bottom-20 sm:bottom-24 right-3 sm:right-6 z-[70] w-[calc(100vw-1.5rem)] sm:w-[380px] max-w-[400px]",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingRight:"env(safe-area-inset-right, 0px)"},children:s.jsx(P4,{onClose:()=>{f(!1),v(null)},initialConversationId:p,onConversationLoaded:R})})}),s.jsx(pt,{children:(j&&!m||G&&!m)&&re&&s.jsxs(ae.button,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},whileHover:{scale:1.1},whileTap:{scale:.95},onClick:L,className:`fixed right-3 sm:right-4 z-[70] rounded-full bg-primary/90 backdrop-blur-sm shadow-lg flex items-center justify-center hover:bg-primary transition-colors touch-manipulation ${G?"w-12 h-12 bottom-[4.5rem]":"w-10 h-10 bottom-4"}`,style:{paddingRight:"env(safe-area-inset-right, 0px)"},"aria-label":"Expand chat widget",children:[N>0?s.jsx("span",{className:"text-xs font-bold text-primary-foreground",children:V(N)}):s.jsx(br,{className:"w-5 h-5 text-primary-foreground"}),N>0&&s.jsx(ae.span,{className:"absolute -top-0.5 -right-0.5 w-3 h-3 bg-destructive rounded-full",animate:{scale:[1,1.2,1]},transition:{repeat:1/0,duration:1.5}})]})}),!j&&!G||G&&m?s.jsxs("div",{className:"fixed bottom-4 sm:bottom-6 right-3 sm:right-6 z-[70] flex flex-col-reverse items-center gap-2 sm:gap-3 pointer-events-none",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingRight:"env(safe-area-inset-right, 0px)"},children:[re&&s.jsxs("div",{className:"pointer-events-auto relative",children:[s.jsx(ae.button,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},onClick:M,className:"absolute -top-1 -left-1 w-4 h-4 sm:w-5 sm:h-5 rounded-full bg-muted border border-border flex items-center justify-center z-10 hover:bg-destructive hover:border-destructive hover:text-destructive-foreground transition-colors shadow-sm","aria-label":"Minimize chat widget",children:s.jsx(Rf,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3"})}),s.jsx(ae.button,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:O,className:`flex items-center justify-center w-12 h-12 sm:w-14 sm:h-14 rounded-full shadow-lg hover:shadow-xl transition-all focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 ${N>0&&!m?"bg-emerald-500 hover:bg-emerald-600 text-white":"bg-primary text-primary-foreground"}`,"aria-label":m?"Close support chat":`Open support chat${N>0?` - ${N} new message${N>1?"s":""}`:""}`,children:s.jsx(pt,{mode:"wait",children:m?s.jsx(ae.div,{initial:{rotate:-90,opacity:0},animate:{rotate:0,opacity:1},exit:{rotate:90,opacity:0},transition:{duration:.15},children:s.jsx(lt,{className:"w-5 h-5 sm:w-6 sm:h-6"})},"close"):s.jsx(ae.div,{initial:{rotate:90,opacity:0},animate:{rotate:0,opacity:1},exit:{rotate:-90,opacity:0},transition:{duration:.15},children:s.jsx(br,{className:"w-5 h-5 sm:w-6 sm:h-6"})},"chat")})}),s.jsx(pt,{children:N>0&&!m&&s.jsxs(s.Fragment,{children:[s.jsx(ae.span,{className:"absolute -top-1 -right-1 w-6 h-6 rounded-full bg-destructive/30",animate:{scale:[1,1.5,1],opacity:[.7,0,.7]},transition:{repeat:1/0,duration:1.5,ease:"easeInOut"}}),s.jsx(ae.span,{initial:{scale:0},animate:{scale:1},exit:{scale:0},className:"absolute -top-1.5 -right-1.5 flex items-center justify-center min-w-[22px] h-[22px] px-1.5 text-xs font-bold bg-destructive text-destructive-foreground rounded-full shadow-md border-2 border-background",children:V(N)})]})})]}),s.jsx(pt,{children:y&&s.jsx(ae.button,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:A,className:"pointer-events-auto flex items-center justify-center w-11 h-11 rounded-full bg-secondary text-secondary-foreground shadow-lg hover:shadow-xl transition-shadow focus:outline-none focus:ring-2 focus:ring-secondary focus:ring-offset-2","aria-label":"Scroll to top",children:s.jsx(Fl,{className:"w-5 h-5"})})})]}):null]})});function I4(){const r=ot(),e=u.useRef(!1);u.useEffect(()=>{if(e.current)return;
601const n=new URLSearchParams(r.search).get("supportConversationId");if(n){e.current=!0;const a=setTimeout(()=>{console.log("[SupportDeepLink] Opening conversation:",n),window.dispatchEvent(new CustomEvent("open-support-conversation",{detail:{conversationId:n}}));const i=r.pathname;window.history.replaceState({},"",i)},500);return()=>clearTimeout(a)}},[r.search,r.pathname])}const R4=u.forwardRef(function(e,t){return I4(),s.jsx(A4,{ref:t,...e})});function M4({tooltip:r,userId:e,onDismiss:t}){const n=Es(),[a,i]=u.useState(null),o=u.useRef(null);u.useEffect(()=>{const d=document.querySelector(r.target);if(!d)return;const c=()=>{const h=d.getBoundingClientRect();i({top:r.position==="bottom"?h.bottom+8:h.top-8,left:Math.max(12,h.left),width:Math.min(h.width,window.innerWidth-24)})};return c(),window.addEventListener("scroll",c,{passive:!0}),()=>window.removeEventListener("scroll",c)},[r.target,r.position]);const l=u.useCallback(d=>{r.dismissBehavior==="permanent"||d==="got_it"?IS(e,r.id):d==="tap_outside"&&RS(r.id),OS(),t(r.id,d)},[r,e,t]);return u.useEffect(()=>{const d=c=>{o.current&&!o.current.contains(c.target)&&l("tap_outside")};return document.addEventListener("touchend",d,{passive:!0}),()=>document.removeEventListener("touchend",d)},[l]),!n||!a?null:s.jsxs(pt,{children:[s.jsx("div",{className:"fixed inset-0 z-[59] pointer-events-none","aria-hidden":"true"}),s.jsx(ae.div,{ref:o,initial:{opacity:0,y:r.position==="bottom"?-6:6,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.97},transition:{duration:.2},className:"fixed z-[60] mx-3 pointer-events-none",style:{top:r.position==="bottom"?a.top:void 0,bottom:r.position==="top"?`calc(100vh - ${a.top}px)`:void 0,left:0,right:0},children:s.jsxs("div",{className:"relative bg-card border border-primary/20 rounded-xl shadow-lg shadow-primary/5 p-3.5 mx-auto max-w-[340px] pointer-events-auto",onClick:d=>d.stopPropagation(),children:[s.jsx("button",{onClick:()=>l("x"),className:"absolute top-2.5 right-2.5 text-muted-foreground hover:text-foreground transition-colors p-0.5","aria-label":"Dismiss tip",children:s.jsx(lt,{className:"w-3.5 h-3.5"})}),s.jsxs("div",{className:"flex gap-2.5",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:s.jsx(h1,{className:"w-4 h-4 text-primary"})}),s.jsxs("div",{className:"flex-1 min-w-0 pr-4",children:[s.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:r.title}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:r.body}),s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[r.learnMoreUrl&&r.learnMoreLabel&&s.jsx(ie,{size:"sm",variant:"link",className:"h-auto p-0 text-xs text-primary",asChild:!0,children:s.jsxs(be,{to:r.learnMoreUrl,children:[r.learnMoreLabel,s.jsx(nr,{className:"w-3 h-3 ml-0.5"})]})}),s.jsx(ie,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs text-muted-foreground ml-auto",onClick:()=>l("got_it"),children:"Got it"})]})]})]})]})})]})}function O4(){const r=Es(),{user:e}=Ee(),t=ot(),[n,a]=u.useState(null),i=u.useRef(0);u.useEffect(()=>{i.current=0,a(null)},[t.pathname]),u.useEffect(()=>{if(!r||!e?.id||MS()||bm()||i.current>=fm||Sc()>=gm)return;const l=t.pathname,d=_m.filter(h=>l===h.page||l.startsWith(h.page+"/")).filter(h=>h.trigger==="on_first_visit").filter(h=>!xm(e.id,h.id)).filter(h=>!vm(h.id)).sort((h,m)=>h.priority-m.priority);if(d.length===0)return;const c=setTimeout(()=>{const h=d.find(m=>document.querySelector(m.target));h&&(a(h),i.current+=1,ym())},1200);return()=>clearTimeout(c)},[r,e?.id,t.pathname]);const o=u.useCallback((l,d)=>{a(null),setTimeout(()=>{if(!e?.id||i.current>=fm||Sc()>=gm||bm())return;const c=t.pathname,h=_m.filter(m=>c===m.page||c.startsWith(m.page+"/")).filter(m=>m.trigger==="on_first_visit").filter(m=>m.id!==l).filter(m=>!xm(e.id,m.id)).filter(m=>!vm(m.id)).filter(m=>document.querySelector(m.target)).sort((m,f)=>m.priority-f.priority);h.length>0&&(a(h[0]),i.current+=1,ym())},600)},[e?.id,t.pathname]);return!r||!e?.id?null:s.jsx(s.Fragment,{children:n&&s.jsx(M4,{tooltip:n,userId:e.id,onDismiss:o})})}const D4=[{label:"Home",icon:Ma,path:"/dashboard"},{label:"Projects",icon:Sf,path:"/campaigns"}],L4=[{label:"Actors",icon:ur,path:"/actors"},{label:"Profile",icon:go,path:"/settings"}],$4=[{label:"Home",icon:Ma,path:"/creator-dashboard"},{label:"Content",icon:Sf,path:"/creators/content"}],F4=[{label:"Earnings",icon:Ra,path:"/creators/earnings"},{label:"Settings",icon:ya,path:"/creators/settings"}];function V4(){const r=Es(),e=ot(),t=Xt(),{currentWorkspace:n}=Eo();if(!r)return null;const a=n==="creator",i=a?$4:D4,o=a?F4:L4,l=c=>e.pathname===c,d=c=>s.jsxs("button",{onClick:()=>t(c.path),className:Y("flex flex-col items-center justify-center gap-0.5 flex-1 h-full transition-colors",l(c.path)?"text-primary":"text-muted-foreground"),children:[s.jsx(c.icon,{className:Y("w-5 h-5",l(c.path)&&"stroke-[2.5]")}),s.jsx("span",{className:"text-[10px] font-medium",children:c.label})]},c.path);return s.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-40 bg-background/80 backdrop-blur-lg border-t border-border/50 pb-[env(safe-area-inset-bottom)]",children:s.jsxs("div",{className:"flex items-center justify-around h-14",children:[i.map(d),s.jsxs("button",{onClick:()=>t(a?"/creators/submit":"/create"),className:"flex flex-col items-center justify-center gap-0.5 flex-1 h-full transition-colors",children:[s.jsx("div",{className:Y("w-10 h-10 rounded-full flex items-center justify-center -mt-4 shadow-lg","bg-primary text-primary-foreground"),children:s.jsx(Dt,{className:"w-5 h-5"})}),s.jsx("span",{className:"text-[10px] font-medium text-primary -mt-0.5",children:a?"Submit":"Create"})]}),o.map(d)]})})}function z4(){const{user:r,isLoading:e}=Ee(),t=Es(),n=ot();if(e||!r)return null;const i=["/refer","/partners","/affiliates","/pricing","/actors/","/voices/","/features/","/use-cases/","/learn/","/blog","/showcase-studio","/products/","/vs
601/"].some(h=>n.pathname===h||n.pathname.startsWith(h)),o=n.pathname.startsWith("/console");if(i||o)return null;const l=n.pathname==="/create",c=["/dashboard","/discover","/following","/campaigns","/actors","/scripts","/voices","/videos","/settings","/creator-dashboard","/creators/content","/creators/earnings","/creators/settings"].some(h=>n.pathname===h);return s.jsxs(s.Fragment,{children:[s.jsx(iv,{}),s.jsx(XS,{}),s.jsx(wS,{}),!l&&s.jsx(R4,{}),t&&s.jsx(O4,{}),c&&s.jsx(V4,{})]})}function H4(){return Dj(),null}function U4(){return Bj(),null}const ov=u.createContext(void 0),jl="vidacious_current_workspace";function B4({children:r}){const{user:e}=Ee(),[t,n]=u.useState([]),[a,i]=u.useState(null),[o,l]=u.useState(null),[d,c]=u.useState([]),[h,m]=u.useState([]),[f,p]=u.useState(!0),[v,x]=u.useState(!1),g=u.useCallback(async()=>{if(!e){n([]),i(null),l(null),p(!1);return}try{const{data:M,error:L}=await W.from("workspace_members").select(` 602 role, 603 workspaces (*) 604 `).eq("user_id",e.id);if(L){console.error("Error fetching workspaces:",L),p(!1);return}const A=M?.map(se=>se.workspaces).filter(Boolean);n(A||[]);const V=localStorage.getItem(jl);let G=A?.find(se=>se.id===V);if(!G&&A?.length>0&&(G=A[0]),G){i(G);const se=M?.find(re=>re.workspaces?.id===G?.id);l(se?.role||null),localStorage.setItem(jl,G.id)}}catch(M){console.error("Error in fetchWorkspaces:",M)}finally{p(!1)}},[e]),b=u.useCallback(async()=>{if(!a){c([]),m([]);return}x(!0);try{const{data:M,error:L}=await W.from("workspace_members").select("*").eq("workspace_id",a.id).order("role",{ascending:!0});if(L)console.error("Error fetching members:",L);else{const A=M?.map(se=>se.user_id)||[],{data:V}=await W.from("profiles").select("user_id, email, display_name, avatar_url").in("user_id",A),G=M?.map(se=>({...se,role:se.role,profile:V?.find(re=>re.user_id===se.user_id)}))||[];c(G)}if(o==="owner"||o==="admin"){const{data:A,error:V}=await W.from("workspace_invitations").select("*").eq("workspace_id",a.id).is("accepted_at",null).gt("expires_at",new Date().toISOString()).order("created_at",{ascending:!1});V?console.error("Error fetching invitations:",V):m((A||[]).map(G=>({...G,role:G.role})))}else m([])}finally{x(!1)}},[a,o]),j=u.useCallback(async M=>{const L=t.find(V=>V.id===M);if(!L)return;const{data:A}=await W.from("workspace_members").select("role").eq("workspace_id",M).eq("user_id",e?.id||"").single();i(L),l(A?.role||null),localStorage.setItem(jl,M)},[t,e]),k=u.useCallback(async M=>{if(!e)return null;try{const{data:L}=await W.rpc("generate_workspace_slug",{base_name:M}),{data:A,error:V}=await W.from("workspaces").insert({name:M,slug:L||`workspace-${Date.now()}`,owner_id:e.id,plan:"free",credits:0}).select().single();return V?(console.error("Error creating workspace:",V),null):(await W.from("workspace_members").insert({workspace_id:A.id,user_id:e.id,role:"owner"}),await g(),A)}catch(L){return console.error("Error in createWorkspace:",L),null}},[e,g]),y=u.useCallback(async M=>{if(!a)return!1;try{const{error:L}=await W.from("workspaces").update(M).eq("id",a.id);return L?(console.error("Error updating workspace:",L),!1):(i(A=>A?{...A,...M}:null),n(A=>A.map(V=>V.id===a.id?{...V,...M}:V)),!0)}catch(L){return console.error("Error in updateWorkspace:",L),!1}},[a]),w=u.useCallback(async(M,L)=>{if(!a)return{success:!1,error:"No workspace selected"};try{const{data:A,error:V}=await W.functions.invoke("workspace-invite",{body:{action:"invite",workspaceId:a.id,email:M,role:L}});return V?{success:!1,error:V.message}:A?.error?{success:!1,error:A.error}:(await b(),{success:!0})}catch(A){return{success:!1,error:A.message||"Failed to send invitation"}}},[a,b]),S=u.useCallback(async M=>{if(!a)return!1;try{const{data:L,error:A}=await W.functions.invoke("workspace-invite",{body:{action:"remove-member",workspaceId:a.id,memberId:M}});return A||L?.error?(console.error("Error removing member:",A||L?.error),!1):(await b(),!0)}catch(L){return console.error("Error in removeMember:",L),!1}},[a,b]),N=u.useCallback(async(M,L)=>{if(!a)return!1;try{const{data:A,error:V}=await W.functions.invoke("workspace-invite",{body:{action:"update-role",workspaceId:a.id,memberId:M,newRole:L}});return V||A?.error?(console.error("Error updating role:",V||A?.error),!1):(await b(),!0)}catch(A){return console.error("Error in updateMemberRole:",A),!1}},[a,b]),_=u.useCallback(async M=>{if(!a)return!1;try{const{data:L,error:A}=await W.functions.invoke("workspace-invite",{body:{action:"revoke",workspaceId:a.id,invitationId:M}});return A||L?.error?(console.error("Error revoking invitation:",A||L?.error),!1):(await b(),!0)}catch(L){return console.error("Error in revokeInvitation:",L),!1}},[a,b]),C=u.useCallback(async()=>
604{if(!a)return!1;try{const{data:M,error:L}=await W.functions.invoke("workspace-invite",{body:{action:"leave",workspaceId:a.id}});if(L||M?.error)return console.error("Error leaving workspace:",L||M?.error),!1;const A=t.filter(V=>V.id!==a.id);return A.length>0?await j(A[0].id):(i(null),l(null)),await g(),!0}catch(M){return console.error("Error in leaveWorkspace:",M),!1}},[a,t,j,g]),O=u.useCallback(async M=>{if(!a)return!1;try{const{data:L,error:A}=await W.functions.invoke("workspace-invite",{body:{action:"transfer-ownership",workspaceId:a.id,newOwnerId:M}});return A||L?.error?(console.error("Error transferring ownership:",A||L?.error),!1):(await g(),await b(),!0)}catch(L){return console.error("Error in transferOwnership:",L),!1}},[a,g,b]);u.useEffect(()=>{g()},[g]),u.useEffect(()=>{b()},[b]),u.useEffect(()=>{if(!a)return;const M=W.channel(`workspace-${a.id}`).on("postgres_changes",{event:"*",schema:"public",table:"workspace_members",filter:`workspace_id=eq.${a.id}`},()=>{b()}).on("postgres_changes",{event:"*",schema:"public",table:"workspace_invitations",filter:`workspace_id=eq.${a.id}`},()=>{b()}).subscribe();return()=>{W.removeChannel(M)}},[a,b]);const R={currentWorkspace:a,currentRole:o,workspaces:t,members:d,invitations:h,isLoading:f,isMembersLoading:v,switchWorkspace:j,createWorkspace:k,updateWorkspace:y,inviteMember:w,removeMember:S,updateMemberRole:N,revokeInvitation:_,leaveWorkspace:C,transferOwnership:O,refreshWorkspaces:g,refreshMembers:b};return s.jsx(ov.Provider,{value:R,children:r})}function HA(){const r=u.useContext(ov);if(r===void 0)throw new Error("useWorkspace must be used within a WorkspaceProvider");return r}function ht({className:r,...e}){return s.jsx("div",{className:Y("animate-pulse rounded-md bg-muted",r),...e})}function q4(){return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsxs("div",{className:"h-16 border-b border-border flex items-center px-4 gap-4",children:[s.jsx(ht,{className:"w-10 h-10 rounded-lg"}),s.jsx(ht,{className:"w-24 h-6"}),s.jsx("div",{className:"flex-1"}),s.jsx(ht,{className:"w-20 h-8 rounded-md"})]}),s.jsxs("div",{className:"container px-4 py-8 space-y-6",children:[s.jsx(ht,{className:"h-8 w-48"}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[s.jsx(ht,{className:"h-40 rounded-xl"}),s.jsx(ht,{className:"h-40 rounded-xl"}),s.jsx(ht,{className:"h-40 rounded-xl"})]}),s.jsx(ht,{className:"h-64 rounded-xl"})]})]})}function Hr(){return s.jsx("div",{className:"min-h-screen bg-background pt-14 lg:ml-64",children:s.jsxs("div",{className:"px-4 lg:px-6 py-6 space-y-4 animate-pulse",children:[s.jsx(ht,{className:"h-8 w-48"}),s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsx(ht,{className:"h-24 rounded-xl"}),s.jsx(ht,{className:"h-24 rounded-xl"}),s.jsx(ht,{className:"h-24 rounded-xl"}),s.jsx(ht,{className:"h-24 rounded-xl"})]}),s.jsx(ht,{className:"h-[300px] rounded-xl"})]})})}function W4(){return s.jsx("div",{className:"h-screen bg-background pt-14 md:pt-16 flex flex-col overflow-hidden",children:s.jsxs("div",{className:"flex-1 lg:ml-16 flex flex-col min-h-0 overflow-hidden",children:[s.jsx("div",{className:"h-[60%] min-h-0 overflow-hidden px-4 lg:px-6 py-4",children:s.jsxs("div",{className:"w-full border border-border rounded-xl p-4 h-full",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3 px-1",children:[s.jsx(ht,{className:"h-5 w-32"}),s.jsx(ht,{className:"h-8 w-28 rounded-md"})]}),s.jsx("div",{className:"flex gap-3 sm:gap-4 overflow-hidden",children:Array.from({length:6}).map((r,e)=>s.jsx("div",{className:"flex-shrink-0 w-[45%] sm:w-[30%] md:w-[23%] lg:w-[18%]",children:s.jsx(ht,{className:"aspect-[3/4] rounded-xl"})},e))})]})}),s.jsxs("div",{className:"h-[40%] min-h-0 border-t border-border/50 px-4 lg:px-6 py-4 flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ht,{className:"w-8 h-8 rounded-lg"}),s.jsx(ht,{className:"h-5 w-32"})]}),s.jsx(ht,{className:"flex-1 rounded-xl"}),s.jsx("div",{className:"flex justify-end",children:s.jsx(ht,{className:"h-9 w-28 rounded-md"})})]})]})})}function G4(r){if(typeof r=="string"){const t=r.replace(/^\//,""),n=Y4[t];if(n){const a=setTimeout(()=>{n().catch(()=>{})},100);return()=>clearTimeout(a)}return()=>{}}const e=setTimeout(()=>{r().catch(()=>{})},100);return()=>clearTimeout(e)}const Y4={dashboard:()=>F(()=>import("./Dashboard-CkOSf2Sh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])),create:()=>F(()=>import("./CreateVideoV2-CQvEvCgA.js"),__vite__mapDeps([17,1,2,14,18,10,11,5,12,19,20,7,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,15,41,42,43,44,45,46,47,48,4,49,50,51,52,53,16])),pricing:()=>F(()=>Promise.resolve().then(()=>W3),void 0),settings:()=>F(()=>import("./Settings-CRijON7k.js"),__vite__mapDeps([54,1,4,55,5,2,9,10,11,12,56,57,58,43,59,60,7,42,61,62,63,64,65,66,67,68,69,70,71,48,72,15,14,16])),exports:()=>F(()=>import("./Exports-CI0yugE1.js"),__vite__mapDeps([73,1,26,23,74,75,76,2,9,10,11,5,12,77,33,78,79,80,81,44,82,50,83,84,43,62,14,4,19,64,20,66,49,85,7,86,87,88,89,34,90,91,92,93,15,16])),actors:()=>F(()=>import("./Actors-CSt-Jxfn.js"),__vite__mapDeps([94,1,2,9,10,11,5,12,18,30,27,95,34,96,14,23,26,45,91,15,16])),voices:()=>F(()=>import("./Voices-C6kgIcG-.js"),__vite__mapDeps([97,1,39,98,37,5,27,34,96,2,91,15,14,16])),features:()=>F(()=>import("./Features-h8bObp05.js"),__vite__mapDeps([99,1,100,5,101,15,14,2,16,82,102,95])),"use-cases":()=>F(()=>import("./UseCases-DE-Qijbm.js"),__vite__mapDeps([103,1,2,5,102,15,14,16])),developers:()=>F(()=>import("./Developers-jBUifcaA.js"),__vite__mapDeps([104,1,2,5,105,106,107,15,14,16])),auth:()=>F(()=>Promise.resolve().then(()=>a3),void 0)},Cc=u.forwardRef(({preload:r=!0,onMouseEnter:e,onTouchStart:t,to:n,...a},i)=>{const o=u.useCallback(()=>{r&&typeof n=="string"&&G4(n)},[r,n]),l=u.useCallback(c=>{o(),e?.(c)},[o,e]),d=u.useCallback(c=>{o(),t?.(c)},[o,t]);return s.jsx(be,{ref:i,to:n,onMouseEnter:l,onTouchStart:d,...a}
604)});Cc.displayName="PreloadLink";const Am=[{name:"Vidacious Studio",description:"AI video generation for marketers",href:"/products/studio",icon:Dt},{name:"Creator Marketplace",description:"Monetize your likeness",href:"/creators/become",icon:ur},{name:"URL-to-Ad",description:"Turn any URL into a video ad",href:"/products/url-to-ad",icon:m1},{name:"Ad Clone",description:"Clone any video ad in seconds",href:"/products/ad-clone",icon:e1},{name:"Showcase Studio",description:"Product photo to video ad in minutes",href:"/showcase-studio",icon:Bt},{name:"Context Reply",description:"Turn any URL or text into a video reply",href:"/products/context-reply",icon:If},{name:"Developer API",description:"Build with our REST API",href:"/developers",icon:Nf}];function Z4(){const[r,e]=u.useState(!1),[t,n]=u.useState(!1),{user:a}=Ee(),i=ot();Xt();const{isBannerVisible:o}=ir(),l=hk(),d=s4(),{isCreator:c}=So(a?.id);u.useEffect(()=>{const p=()=>{e(window.scrollY>20)};return window.addEventListener("scroll",p,{passive:!0}),()=>window.removeEventListener("scroll",p)},[]);const h=(p,v)=>{const x=v.replace("#","");if(i.pathname!=="/")p.preventDefault(),window.location.href=`/${v}`;else{p.preventDefault();const g=document.getElementById(x);g?g.scrollIntoView({behavior:"smooth"}):window.location.hash=v}},m=[{label:"Features",href:"/features",isPage:!0},{label:"Use Cases",href:"/use-cases",isPage:!0},{label:"FAQ",href:"#faq"},{label:"Pricing",href:"/pricing",isPage:!0}],f=()=>o?"var(--test-banner-height, 40px)":d?"var(--campaign-banner-height, 0px)":l?"var(--promo-banner-height, 0px)":"0px";return s.jsxs(ae.nav,{initial:{y:-100},animate:{y:0},style:{top:f()},className:`fixed left-0 right-0 z-50 transition-all duration-300 bg-background/95 backdrop-blur-xl ${r?"border-b border-border":""}`,children:[s.jsx("div",{className:"container px-4 md:px-6 3xl:px-8 4xl:px-10",children:s.jsxs("div",{className:"flex items-center justify-between h-14 md:h-16 3xl:h-[4.5rem] 4xl:h-20",children:[s.jsxs(be,{to:"/",className:"flex items-center gap-2 md:gap-2.5 3xl:gap-3 4xl:gap-4",children:[s.jsx("div",{className:"w-10 h-10 md:w-11 md:h-11 3xl:w-12 3xl:h-12 4xl:w-14 4xl:h-14 rounded-xl bg-gradient-to-r from-primary to-accent flex items-center justify-center",children:s.jsx(Dt,{className:"w-5 h-5 md:w-6 md:h-6 3xl:w-7 3xl:h-7 4xl:w-8 4xl:h-8 text-primary-foreground"})}),s.jsx("span",{className:"text-lg md:text-xl 3xl:text-2xl 4xl:text-3xl font-bold font-display",children:"Vidacious"})]}),s.jsxs("div",{className:"hidden md:flex items-center gap-6 3xl:gap-8 4xl:gap-10",children:[s.jsxs(Gd,{children:[s.jsxs(Yd,{className:"flex items-center gap-1 3xl:gap-1.5 4xl:gap-2 text-sm 3xl:text-base 4xl:text-lg text-muted-foreground hover:text-foreground transition-colors",children:["Products",s.jsx(Rr,{className:"w-4 h-4 3xl:w-5 3xl:h-5 4xl:w-6 4xl:h-6"})]}),s.jsx(Mo,{align:"start",className:"w-64 3xl:w-72 4xl:w-80",children:Am.map(p=>s.jsx(un,{asChild:!0,children:s.jsxs(be,{to:p.href,className:"flex items-start gap-3 3xl:gap-4 4xl:gap-5 p-3 3xl:p-4 4xl:p-5 cursor-pointer",children:[s.jsx("div",{className:"w-8 h-8 3xl:w-10 3xl:h-10 4xl:w-12 4xl:h-12 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:s.jsx(p.icon,{className:"w-4 h-4 3xl:w-5 3xl:h-5 4xl:w-6 4xl:h-6 text-primary"})}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-sm 3xl:text-base 4xl:text-lg",children:p.name}),s.jsx("div",{className:"text-xs 3xl:text-sm 4xl:text-base text-muted-foreground",children:p.description})]})]})},p.name))})]}),m.map(p=>p.isPage?s.jsx(Cc,{to:p.href,className:"text-sm 3xl:text-base 4xl:text-lg text-muted-foreground hover:text-foreground transition-colors",children:p.label},p.label):s.jsx("a",{href:p.href,onClick:v=>h(v,p.href),className:"text-sm 3xl:text-base 4xl:text-lg text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:p.label},p.label)),s.jsx(Cc,{to:"/developers",className:"text-sm 3xl:text-base 4xl:text-lg text-muted-foreground hover:text-foreground transition-colors",children:"Developers"})]}),s.jsxs("div",{className:"hidden md:flex items-center gap-3 3xl:gap-4 4xl:gap-5",children:[s.jsx(Nc,{}),a&&s.jsx(kc,{}),a?s.jsx(ie,{variant:"hero",size:"sm",className:"3xl:h-10 3xl:px-5 3xl:text-base 4xl:h-12 4xl:px-6 4xl:text-lg",asChild:!0,children:s.jsx(be,{to:c?"/creator-dashboard":"/dashboard",children:"Dashboard"})}):s.jsxs(s.Fragment,{children:[s.jsx(ie,{variant:"ghost",size:"sm",className:"3xl:h-10 3xl:px-5 3xl:text-base 4xl:h-12 4xl:px-6 4xl:text-lg",asChild:!0,children:s.jsx(be,{to:"/auth",children:"Sign In"})}),s.jsx(ie,{variant:"hero",size:"sm",className:"3xl:h-10 3xl:px-5 3xl:text-base 4xl:h-12 4xl:px-6 4xl:text-lg",asChild:!0,children:s.jsxs(be,{to:"/auth?mode=signup",children:[s.jsx(Bt,{className:"w-4 h-4 3xl:w-5 3xl:h-5 4xl:w-6 4xl:h-6 mr-1 3xl:mr-1.5 4xl:mr-2"}),"Sign Up Free"]})})]})]}),s.jsx("button",{className:"md:hidden p-2",onClick:()=>n(!t),children:t?s.jsx(lt,{className:"w-6 h-6"}):s.jsx(Xc,{className:"w-6 h-6"})})]})}),t&&s.jsx(ae.div,{initial:{opacity:0,y:-10}
604,animate:{opacity:1,y:0},className:"md:hidden bg-background border-b border-border max-h-[calc(100dvh-3.5rem-var(--promo-banner-height,0px))] overflow-y-auto pb-[env(safe-area-inset-bottom)]",children:s.jsxs("div",{className:"container px-4 py-4 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Theme"}),s.jsx(Nc,{})]}),a&&s.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Active Jobs"}),s.jsx(kc,{})]}),s.jsxs("div",{className:"pb-3 border-b border-border",children:[s.jsx("span",{className:"text-sm font-medium mb-2 block",children:"Products"}),s.jsx("div",{className:"space-y-2",children:Am.map(p=>s.jsxs(be,{to:p.href,className:"flex items-center gap-3 p-2 rounded-lg hover:bg-secondary transition-colors",onClick:()=>n(!1),children:[s.jsx(p.icon,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"text-sm",children:p.name})]},p.name))})]}),m.map(p=>p.isPage?s.jsx(be,{to:p.href,className:"block py-2 text-muted-foreground hover:text-foreground transition-colors",onClick:()=>n(!1),children:p.label},p.label):s.jsx("a",{href:p.href,className:"block py-2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:v=>{n(!1),h(v,p.href)},children:p.label},p.label)),s.jsx(be,{to:"/developers",className:"block py-2 text-muted-foreground hover:text-foreground transition-colors",onClick:()=>n(!1),children:"Developers"}),s.jsx("div",{className:"flex flex-col gap-2 pt-4",children:a?s.jsxs(s.Fragment,{children:[s.jsx(ie,{variant:"hero",className:"w-full",asChild:!0,children:s.jsx(be,{to:c?"/creator-dashboard":"/dashboard",onClick:()=>n(!1),children:"Dashboard"})}),!c&&s.jsx(ie,{variant:"outline",className:"w-full",asChild:!0,children:s.jsxs(be,{to:"/creators/become",onClick:()=>n(!1),children:[s.jsx(ur,{className:"w-4 h-4 mr-1"}),"Become a Creator"]})})]}):s.jsxs(s.Fragment,{children:[s.jsx(ie,{variant:"ghost",className:"w-full",asChild:!0,children:s.jsx(be,{to:"/auth",onClick:()=>n(!1),children:"Sign In"})}),s.jsx(ie,{variant:"hero",className:"w-full",asChild:!0,children:s.jsxs(be,{to:"/auth?mode=signup",onClick:()=>n(!1),children:[s.jsx(Bt,{className:"w-4 h-4 mr-1"}),"Sign Up Free"]})})]})})]})})]})}var J4="authorization_response",X4="/~oauth/initiate",K4=["https://oauth.lovable.app"];function Q4(r){let e;const t=new Promise(i=>{e=i}),n=i=>{if(!r.some(d=>i.origin===d))return;const l=i.data;!l||typeof l!="object"||l.type===J4&&e(l.response)},a=()=>{window.removeEventListener("message",n)};return window.addEventListener("message",n),{cleanup:a,messagePromise:t}}function eE(r){const e=window.screenX!==0||window.screenY!==0||!r,t=e?window.outerWidth*.5:window.screen.width*.5,n=e?window.outerHeight*.5:window.screen.height*.5,a=e?window.screenX+(window.outerWidth-t)/2:(window.screen.width-t)/2,i=e?window.screenY+(window.outerHeight-n)/2:(window.screen.height-n)/2;return{width:t,height:n,left:a,top:i}}function tE(){return typeof crypto<"u"&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(r=>r.toString(16).padStart(2,"0")).join(""):Math.random().toString(36).substring(2)+Date.now().toString(36)}function rE(r={}){const e=r.oauthBrokerUrl??X4,t=r.supportedOAuthOrigins??K4;async function n(a,i={}){let o=!1;try{o=window.self!==window.top}catch{o=!0}const l=tE(),d=i.redirect_uri??window.location.origin,c=new URLSearchParams({provider:a,redirect_uri:d,state:l,...i.extraParams});if(!o)return window.location.href=`${e}?${c.toString()}`,{error:null,redirected:!0};c.set("response_mode","web_message");const h=`${e}?${c.toString()}`,{messagePromise:m,cleanup:f}=Q4(t),p=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);let v;if(p)v=window.open(h,"_blank");else{const{width:b,height:j,left:k,top:y}=eE(o);v=window.open(h,"oauth",`width=${b},height=${j},left=${k},top=${y}`)}if(!v)return f(),{error:new Error("Popup was blocked")};let x;const g=new Promise((b,j)=>{x=setInterval(()=>{v.closed&&(clearInterval(x),j(new Error("Sign in was cancelled")))},500)});try{const b=await Promise.race([m,g]);return b.error?b.error==="legacy_flow"?{error:new Error("This flow is not supported in Preview mode. Please open the app in a new tab to sign in.")}:{error:new Error(b.error_description??"Sign in failed")}
604:b.state!==l?{error:new Error("State is invalid")}:!b.access_token||!b.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:b.access_token,refresh_token:b.refresh_token},error:null}}catch(b){return{error:b instanceof Error?b:new Error(String(b))}}finally{clearInterval(x),f(),v?.close()}}return{signInWithOAuth:n}}function sE(r){return rE(r)}const nE=sE({}),lv={auth:{signInWithOAuth:async(r,e)=>{const t=await nE.signInWithOAuth(r,{...e});if(t.redirected||t.error)return t;try{await W.auth.setSession(t.tokens)}catch(n){return{error:n instanceof Error?n:new Error(String(n))}}return t}}},aE=[".lovable.app",".lovableproject.com",".lovableproject.app"];function cv(){const r=window.location.hostname;return!aE.some(e=>r.endsWith(e))&&r!=="localhost"}const kl="vidacious_google_prompt_dismissed",iE=7*24*60*60*1e3,oE=4e3,lE=200;function Im(){return s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 48 48","aria-hidden":"true",children:[s.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),s.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),s.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59a14.5 14.5 0 0 1 0-9.18l-7.98-6.19a24.0 24.0 0 0 0 0 21.56l7.98-6.19z"}),s.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"})]})}function cE(){const{user:r}=Ee(),e=Es(),[t,n]=u.useState(!1),[a,i]=u.useState(!1),[o,l]=u.useState(!1),d=u.useRef(!1),c=u.useRef(!1),h=u.useRef(null);u.useEffect(()=>{if(r)return;const p=localStorage.getItem(kl);if(p){if(Date.now()-Number(p)<iE){i(!0);return}localStorage.removeItem(kl)}const v=()=>{d.current&&c.current&&(n(!0),h.current&&(window.removeEventListener("scroll",h.current),h.current=null))},x=()=>{window.scrollY>=lE&&(d.current=!0,v())};window.addEventListener("scroll",x,{passive:!0}),h.current=x;const g=setTimeout(()=>{c.current=!0,v()},oE);return()=>{clearTimeout(g),window.removeEventListener("scroll",x),h.current=null}},[r]);const m=u.useCallback(()=>{i(!0),n(!1),localStorage.setItem(kl,String(Date.now()))},[]),f=u.useCallback(async()=>{l(!0);try{if(sessionStorage.setItem("google_auth_redirect",window.location.pathname+window.location.search),cv()){const{data:p,error:v}=await W.auth.signInWithOAuth({provider:"google",options:{redirectTo:window.location.origin,skipBrowserRedirect:!0}});if(v){l(!1);return}if(p?.url){window.location.href=p.url;return}}else await lv.auth.signInWithOAuth("google",{redirect_uri:window.location.origin})}catch{l(!1)}},[]);return r||a?null:s.jsx(pt,{children:t&&s.jsx(ae.div,{initial:{y:60,opacity:0},animate:{y:0,opacity:1},exit:{y:60,opacity:0},transition:{type:"spring",damping:22,stiffness:260},className:`fixed z-50 ${e?"bottom-20 left-4 right-4":"bottom-6 right-6 max-w-sm w-full"}`,children:s.jsxs("div",{className:"rounded-xl border border-border bg-card/95 backdrop-blur-md shadow-2xl p-4 relative",children:[s.jsx("button",{onClick:m,className:"absolute top-2 right-2 p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors","aria-label":"Dismiss sign-in prompt",children:s.jsx(lt,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex items-center gap-3 pr-6 mb-3",children:[s.jsx("div",{className:"flex-shrink-0 w-9 h-9 rounded-lg bg-secondary flex items-center justify-center",children:s.jsx(Im,{})}),s.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:"Sign in to Vidacious"})]}),s.jsxs(ie,{variant:"outline",size:"sm",className:"w-full gap-2",onClick:f,disabled:o,children:[s.jsx(Im,{}),o?"Redirectingâ¦":"Continue with Google"]})]})})})}function Rm(){return s.jsxs(s.Fragment,{children:[s.jsx(iv,{}),s.jsx(Z4,{}),s.jsx(Bp,{}),s.jsx(cE,{})]})}function dv(r){return!r||typeof window<"u"&&localStorage.getItem("studio_activated")==="true"?!1:r.signup_context==="developer"&&r.plan==="free"&&(r.total_videos_created??0)===0}function uv(){typeof window<"u"&&localStorage.setItem("studio_activated","true")}const hv=u.createContext({isSandbox:!1,toggleEnvironment:()=>{},environmentLabel:"Live"});function dE({children:r}){const[e,t]=u.useState(()=>{try{return localStorage.getItem("console_env_sandbox")==="true"}catch{return!1}}),n=u.useCallback(()=>{t(i=>{const o=!i;try{localStorage.setItem("console_env_sandbox",String(o))}catch{}return o}
604)},[]),a=e?"Test":"Live";return s.jsx(hv.Provider,{value:{isSandbox:e,toggleEnvironment:n,environmentLabel:a},children:r})}function mv(){return u.useContext(hv)}function pv({className:r}){const{isSandbox:e,toggleEnvironment:t}=mv();return s.jsxs("button",{onClick:t,className:Y("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] font-semibold transition-colors border cursor-pointer select-none",e?"bg-amber-500/15 text-amber-600 border-amber-500/30 dark:text-amber-400 dark:border-amber-500/25":"bg-emerald-500/15 text-emerald-600 border-emerald-500/30 dark:text-emerald-400 dark:border-emerald-500/25",r),"aria-label":`Switch to ${e?"live":"test"} mode`,children:[s.jsx("span",{className:Y("w-1.5 h-1.5 rounded-full",e?"bg-amber-500":"bg-emerald-500")}),e?"Test Mode":"Live"]})}const uE=[{label:"Overview",path:"/console/overview",icon:xa},{label:"Sandbox",path:"/console/sandbox",icon:yr},{label:"API Keys",path:"/console/api-keys",icon:Pf},{label:"Webhooks",path:"/console/webhooks",icon:Ff},{label:"Usage",path:"/console/usage",icon:po},{label:"Billing",path:"/console/billing",icon:qs},{label:"Limits",path:"/console/limits",icon:Ef}];function hE(){const r=ot(),{profile:e}=Ee(),t=dv(e);return s.jsxs("aside",{className:"w-64 border-r border-border bg-sidebar flex flex-col h-full",children:[s.jsxs("div",{className:"p-4 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx($s,{className:"w-5 h-5 text-primary"}),s.jsx("span",{className:"font-semibold font-display text-sm",children:"Developer Console"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[t?s.jsx("span",{}):s.jsxs(be,{to:"/dashboard",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(_i,{className:"w-3 h-3"}),"Switch to Studio"]}),s.jsx(pv,{})]})]}),s.jsx("nav",{className:"flex-1 p-2 space-y-1",children:uE.map(n=>{const a=r.pathname===n.path;return s.jsxs(be,{to:n.path,className:Y("flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",a?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[s.jsx(n.icon,{className:"w-4 h-4 shrink-0"}),n.label]},n.path)})}),t&&s.jsxs("div",{className:"p-3 mx-3 mb-3 rounded-lg border border-primary/20 bg-primary/5",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[s.jsx(Dt,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"text-xs font-semibold text-primary",children:"Try Studio"})]}),s.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed mb-2.5",children:"Create AI video ads with virtual actors â no camera needed."}),s.jsx(ie,{asChild:!0,variant:"default",size:"sm",className:"w-full h-7 text-xs",onClick:()=>uv(),children:s.jsxs(be,{to:"/dashboard?activate=studio",children:["Explore Studio ",s.jsx(nr,{className:"w-3 h-3 ml-1"})]})})]}),s.jsxs("div",{className:"p-4 border-t border-border space-y-2",children:[s.jsx(be,{to:"/developers",className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"API Docs"}),s.jsx(be,{to:"/developers/pricing",className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"API Pricing"})]})]})}function mE(){const{isSandbox:r}=mv();return r?s.jsxs("div",{className:"w-full bg-amber-500/10 border-b border-amber-500/20 px-4 py-1.5 flex items-center justify-center gap-2 text-amber-600 dark:text-amber-400",children:[s.jsx(yr,{className:"w-3.5 h-3.5"}),s.jsx("span",{className:"text-xs font-medium",children:"Viewing test data. Sandbox requests don't affect billing."})]}):null}const pE=[{label:"Overview",path:"/console/overview",icon:xa},{label:"Sandbox",path:"/console/sandbox",icon:yr},{label:"API Keys",path:"/console/api-keys",icon:Pf},{label:"Webhooks",path:"/console/webhooks",icon:Ff},{label:"Usage",path:"/console/usage",icon:po},{label:"Billing",path:"/console/billing",icon:qs},{label:"Limits",path:"/console/limits",icon:Ef}];function fE(){const{user:r,isLoading:e,profile:t}=Ee(),[n,a]=u.useState(!1),i=ot(),o=dv(t);return e?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:s.jsx(ht,{className:"w-48 h-6"})}):r?s.jsx(dE,{children:s.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[s.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 lg:hidden border-b border-border bg-background/95 backdrop-blur-sm",children:s.jsxs("div",{className:"flex items-center justify-between h-14 px-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx($s,{className:"w-5 h-5 text-primary"}),s.jsx("span",{className:"font-semibold font-display text-sm",children:"Developer Console"}),s.jsx(pv,{className:"ml-1"})]}),s.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>a(!0),children:s.jsx(Xc,{className:"w-5 h-5"})})]})}),s.jsx(Io,{open:n,onOpenChange:a,children:s.jsxs(Ha,{side:"left",className:"w-64 p-0",children:[s.jsx(Ro,{className:"sr-only",children:"Navigation"}),s.jsxs("div",{className:"p-4 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx($s,{className:"w-5 h-5 text-primary"}),s.jsx("span",{className:"font-semibold font-display text-sm",children:"Developer Console"})]}),!o&&s.jsxs(be,{to:"/dashboard",onClick:()=>a(!1),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(_i,{className:"w-3 h-3"}),"Switch to Studio"]})]}),s.jsx("nav",{className:"p-2 space-y-1",children:pE.map(l=>{const d=i.pathname===l.path;return s.jsxs(be,{to:l.path,onClick:()=>a(!1),className:Y("flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",d?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[s.jsx(l.icon,{className:"w-4 h-4 shrink-0"}),l.label]},l.path)})}),o&&s.jsxs("div",{className:"p-3 mx-3 mb-3 rounded-lg border border-primary/20 bg-primary/5",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[s.jsx(Dt,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"text-xs font-semibold text-primary",children:"Try Studio"})]}),s.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed mb-2.5",children:"Create AI video ads with virtual actors â no camera needed."}),s.jsx(ie,{asChild:!0,variant:"default",size:"sm",className:"w-full h-7 text-xs",onClick:()=>
604{uv(),a(!1)},children:s.jsxs(be,{to:"/dashboard?activate=studio",children:["Explore Studio ",s.jsx(nr,{className:"w-3 h-3 ml-1"})]})})]}),s.jsxs("div",{className:"p-4 border-t border-border space-y-2 mt-auto",children:[s.jsx(be,{to:"/developers",onClick:()=>a(!1),className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"API Docs"}),s.jsx(be,{to:"/developers/pricing",onClick:()=>a(!1),className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"API Pricing"})]})]})}),s.jsxs("div",{className:"flex flex-1",children:[s.jsx("div",{className:"hidden lg:block shrink-0",children:s.jsx("div",{className:"sticky top-0 h-screen",children:s.jsx(hE,{})})}),s.jsxs("div",{className:"flex-1 min-w-0 flex flex-col pt-14 lg:pt-0",children:[s.jsx(mE,{}),s.jsx("main",{className:"flex-1",children:s.jsx(Bp,{})})]})]})]})}):s.jsx(Se,{to:"/auth?redirect=/console/overview",replace:!0})}class gE extends u.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){const{onError:n,name:a,level:i="component"}=this.props;if(Ol(e)){const o="chunk-error-boundary-reload";if(!sessionStorage.getItem(o)){sessionStorage.setItem(o,"1"),window.location.reload();return}sessionStorage.removeItem(o)}console.error(`[ErrorBoundary${a?`:${a}`:""}][${i}]`,e,t.componentStack),n?.(e,t)}handleReset=()=>{this.setState({hasError:!1,error:null})};render(){const{hasError:e,error:t}=this.state,{children:n,fallback:a}=this.props;return e&&t?typeof a=="function"?a(t,this.handleReset):a||s.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[s.jsx("div",{className:"text-destructive mb-2",children:s.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),s.jsx("h3",{className:"text-lg font-semibold text-foreground mb-1",children:"Something went wrong"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"An unexpected error occurred"}),s.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",children:"Try Again"}),!1]}):n}}const es=u.forwardRef(({className:r,variant:e="default",...t},n)=>{const a={default:"bg-card border border-border shadow-card",glass:"bg-secondary/30 backdrop-blur-xl border border-border/50",gradient:"relative bg-card before:absolute before:inset-0 before:p-[1px] before:rounded-xl before:bg-gradient-to-r before:from-primary before:via-accent before:to-primary before:-z-10",elevated:"bg-card border border-border shadow-elevated hover:border-primary/30 transition-all duration-300"};return s.jsx("div",{ref:n,className:Y("rounded-xl text-card-foreground",a[e],r),...t})});es.displayName="Card";const to=u.forwardRef(({className:r,...e},t)=>s.jsx("div",{ref:t,className:Y("flex flex-col space-y-1.5 p-6",r),...e}));to.displayName="CardHeader";const ds=u.forwardRef(({className:r,...e},t)=>s.jsx("h3",{ref:t,className:Y("text-2xl font-semibold leading-none tracking-tight font-display",r),...e}));ds.displayName="CardTitle";const us=u.forwardRef(({className:r,...e},t)=>s.jsx("p",{ref:t,className:Y("text-sm text-muted-foreground",r),...e}));us.displayName="CardDescription";const Lo=u.forwardRef(({className:r,...e},t)=>s.jsx("div",{ref:t,className:Y("p-6 pt-0",r),...e}));Lo.displayName="CardContent";const xE=u.forwardRef(({className:r,...e},t)=>s.jsx("div",{ref:t,className:Y("flex items-center p-6 pt-0",r),...e}));xE.displayName="CardFooter";function vE({error:r,reset:e}){const t=()=>{e?e():window.location.reload()},n=()=>{window.location.href="/dashboard"};return s.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 bg-background",children:s.jsxs("div",{className:"max-w-md w-full text-center space-y-6",children:[s.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-destructive/10 flex items-center justify-center",children:s.jsx(td,{className:"w-8 h-8 text-destructive"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-muted-foreground",children:"We encountered an unexpected error. Please try refreshing the page."})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[s.jsxs(ie,{onClick:t,className:"gap-2",children:[s.jsx(on,{className:"w-4 h-4"}),"Refresh Page"]}),s.jsxs(ie,{variant:"outline",onClick:n,className:"gap-2",children:[s.jsx(Ma,{className:"w-4 h-4"}),"Go to Dashboard"]})]}),!1]})})}function yE(r,e,t){const n=window.__VID_EXP__,a=new URLSearchParams(window.location.search);_t(r,{...e,experiments:n?.experiments||{},vid_did:n?.distinct_id||null,utm_source:a.get("utm_source")||void 0,utm_medium:a.get("utm_medium")||void 0,utm_campaign:a.get("utm_campaign")||void 0,referrer:document.referrer||void 0,path:window.location.pathname},t)}function bE(r,e,t){yE("experiment_exposure",{experiment_key:r,variant:e,surface:window.location.pathname})}function _E(){const r=ot(),{user:e}=Ee(),t=u.useRef(null),n=u.useRef(null),a=u.useRef(!1),i=u.useRef(new Set);return u.useEffect(()=>{t.current!==r.pathname&&(t.current=r.pathname,h0(r.pathname))},[r.pathname]),u.useEffect(()=>{if(e?.id&&n.current!==e.id&&(n.current=e.id,u0(e.id,{email:e.email||null,user_timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}),!a.current)){const o=yj(),l=window.__VID_EXP__?.distinct_id;if(o&&l&&l!=="bot")try{o.alias(e.id),console.log("[PostHog] Aliased vid_did to user:",e.id)}catch(d){console.warn("[PostHog] Alias failed:",d)}a.current=!0}
604!e?.id&&n.current&&(n.current=null,a.current=!1)},[e?.id,e?.email]),u.useEffect(()=>{const o=window.__VID_EXP__;if(!(!o||o.is_bot)&&Object.keys(o.experiments).length!==0)for(const[l,d]of Object.entries(o.experiments)){const c=`${l}:${d}`;i.current.has(c)||(i.current.add(c),bE(l,d))}},[r.pathname]),null}const fv="v5",bs="https://vidacious.ai",ni={title:"Vidacious | AI Video Ads That Outperform Static by 2.7x",description:"Create viral UGC-style video ads with AI actors in minutes. No filming, no actors, no editing required. Generate professional ad creatives at scale.",image:`${bs}/og-image.png?${fv}`,url:bs};function wE(r){if(!r||r.startsWith("http://")||r.startsWith("https://"))return r;const e=r.startsWith("/")?r:`/${r}`;return`${bs}${e}`}function jE(r,e){const t=e||fv,n=wE(r),a=n.includes("?")?"&":"?";return`${n}${a}v=${t}`}const kE=r=>({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:(r[0]?.path==="/"?r:[{name:"Home",path:"/"},...r]).map((t,n)=>({"@type":"ListItem",position:n+1,name:t.name,item:`${bs}${t.path==="/"?"":t.path}`}))}),NE={"@context":"https://schema.org","@type":"Organization",name:"Vidacious",alternateName:"Vidacious AI",url:bs,logo:`${bs}/logo.png`,description:"AI-powered video advertising platform that creates UGC-style video ads with synthetic actors.",foundingDate:"2024",knowsAbout:["AI Video Generation","UGC Video Ads","Synthetic Media","AI Actors","Text-to-Speech","Video Marketing","Performance Advertising"],sameAs:["https://x.com/Vidacious_AI","https://www.instagram.com/vidacious_ai","https://www.facebook.com/vidaciousai/","https://linkedin.com/company/vidacious"],contactPoint:{"@type":"ContactPoint",email:"[email protected]",contactType:"customer service"}},SE={"@context":"https://schema.org","@type":"SoftwareApplication",name:"Vidacious",applicationCategory:"MultimediaApplication",operatingSystem:"Web",description:"Create viral UGC-style video ads with AI actors in minutes. No filming, no actors, no editing required.",url:bs,offers:{"@type":"AggregateOffer",lowPrice:"0",highPrice:"299",priceCurrency:"USD",offerCount:"4"},featureList:["AI-generated video actors","Natural text-to-speech in 175+ languages","Auto-generated captions with animations","Batch video generation","Developer API access"],screenshot:`${bs}/og-image.png`,aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",ratingCount:"127",bestRating:"5"}},EE=(r,e,t)=>({"@context":"https://schema.org","@type":"WebPage",name:r,description:e,url:t,isPartOf:{"@type":"WebSite",name:"Vidacious",url:"https://vidacious.ai"},publisher:{"@type":"Organization",name:"Vidacious",url:"https://vidacious.ai"}}),CE=(r,e,t,n,a)=>({"@context":"https://schema.org","@type":"Article",headline:r,description:e,url:t,datePublished:n,author:{"@type":"Person",name:a||"Vidacious Team"},publisher:{"@type":"Organization",name:"Vidacious",url:"https://vidacious.ai",logo:{"@type":"ImageObject",url:"https://vidacious.ai/logo.png"}}}),TE=r=>({"@context":"https://schema.org","@type":"FAQPage",mainEntity:r.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))});function Hs({title:r,description:e=ni.description,image:t,url:n=ni.url,type:a="website",publishedTime:i,author:o="Vidacious",noIndex:l=!1,jsonLd:d,faqItems:c,structuredData:h,imageVersion:m,breadcrumbs:f,answerBlock:p}){const v=r?`${r} | Vidacious`:ni.title,x=t?jE(t,m):ni.image,b=h||(()=>{switch(d){case"organization":return NE;case"webpage":return EE(v,e,n);case"article":return CE(v,e,n,i,o);case"faq":return c?TE(c):null;case"software":return SE;default:return null}})(),j=f&&f.length>0?kE(f):null;return s.jsxs(fb,{children:[s.jsx("title",{children:v}),s.jsx("meta",{name:"title",content:v}),s.jsx("meta",{name:"description",content:e}),s.jsx("meta",{name:"author",content:o}),l&&s.jsx("meta",{name:"robots",content:"noindex, nofollow"}),s.jsx("meta",{property:"og:type",content:a}),s.jsx("meta",{property:"og:url",content:n}),s.jsx("meta",{property:"og:title",content:v}),s.jsx("meta",{property:"og:description",content:e}),s.jsx("meta",{property:"og:image",content:x}
604),s.jsx("meta",{property:"og:image:width",content:"1200"}),s.jsx("meta",{property:"og:image:height",content:"630"}),s.jsx("meta",{property:"og:image:alt",content:v}),s.jsx("meta",{property:"og:site_name",content:"Vidacious"}),i&&s.jsx("meta",{property:"article:published_time",content:i}),a==="article"&&o&&s.jsx("meta",{property:"article:author",content:o}),s.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),s.jsx("meta",{name:"twitter:url",content:n}),s.jsx("meta",{name:"twitter:title",content:v}),s.jsx("meta",{name:"twitter:description",content:e}),s.jsx("meta",{name:"twitter:image",content:x}),s.jsx("meta",{name:"twitter:site",content:"@Vidacious_AI"}),s.jsx("link",{rel:"canonical",href:n}),p&&s.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"WebPage",name:v,url:n,speakable:{"@type":"SpeakableSpecification",cssSelector:[".aeo-answer-block"]},mainEntity:{"@type":"Question",name:`What is ${r||"Vidacious"}?`,acceptedAnswer:{"@type":"Answer",text:p}}})}),b&&s.jsx("script",{type:"application/ld+json",children:JSON.stringify(b)}),j&&s.jsx("script",{type:"application/ld+json",children:JSON.stringify(j)})]})}const gv="hasViewedPricing",xv="hasExploredVoices";function Tc(r,e){return e?`${r}_${e}`:r}function PE(r,e){const[t,n]=u.useState(!1),[a,i]=u.useState(!1),[o,l]=u.useState(!1),[d,c]=u.useState(!0),h=u.useCallback(()=>e?e.includes(" ")||e.length>15:!1,[e]);return u.useEffect(()=>{if(!r){i(!1),l(!1);return}i(localStorage.getItem(Tc(gv,r))==="true"),l(localStorage.getItem(Tc(xv,r))==="true")},[r]),u.useEffect(()=>{(async()=>{if(!r){c(!1);return}try{const{count:f,error:p}=await W.from("jobs").select("*",{count:"exact",head:!0}).eq("user_id",r).eq("status","ready");if(p)throw p;n((f??0)>0)}catch(f){console.error("Error checking completed videos:",f)}finally{c(!1)}})()},[r]),{hasCompletedVideo:t,hasSetDisplayName:h(),hasViewedPricing:a,hasExploredVoices:o,isLoading:d}}function AE(r,e){const t={pricing:gv,voices:xv};localStorage.setItem(Tc(t[r],e),"true")}const IE={marketers:{headline:"AI Video Ads That Outperform by 2.7x",subheadline:"Paste a script or product URL. Get scroll-stopping video ads with AI actors in under 2 minutes.",primaryCta:{text:"Create Your First Ad Free",link:"/auth"},secondaryCta:{text:"See It in Action",link:"#how-it-works"},features:["1,200+ AI actors across demographics","175+ languages with natural accents","Auto captions & keyword highlights","Bulk generation for A/B testing"],stats:[{value:"1,200+",label:"AI Actors"},{value:"< 2 min",label:"Avg. Delivery"},{value:"175+",label:"Languages"}]},creators:{headline:"Your Face. Your Voice. Passive Income.",subheadline:"License your likeness for AI-powered ads and earn 30% royalties on every use. Record once, earn forever.",primaryCta:{text:"Apply as Creator",link:"/creators/become"},secondaryCta:{text:"See Earnings Calculator",link:"/creators/become#calculator"},features:["Earn royalties on every use","Full control over brand usage","PayPal or Stripe payouts","Usage dashboard & analytics"],stats:[{value:"$2.4M+",label:"Paid to Creators"},{value:"1,200+",label:"AI Actors"},{value:"30%",label:"Royalty Rate"}]},developers:{headline:"Video Generation at Scale",subheadline:"Build AI video generation into your product with our REST API. Webhooks, SDKs, and enterprise-grade infrastructure.",primaryCta:{text:"View API Docs",link:"/developers"},secondaryCta:{text:"Try Playground",link:"/developers/playground"},features:["RESTful API with versioning","Real-time webhooks","Official JS, Python, Go SDKs","99.9% uptime SLA"],stats:[{value:"99.9%",label:"Uptime"},{value:"<2s",label:"API Latency"},{value:"1M+",label:"API Calls/mo"}]}},RE=[{id:"marketers",label:"For Marketers",icon:Dt},{id:"creators",label:"For Creators",icon:ur},{id:"developers",label:"For Developers",icon:Nf}];function ru(){const{user:r}=Ee(),e=Xt(),{trackCTAClick:t}=Ba(),{hasCompletedVideo:n}=PE(r?.id),[a,i]=u.useState("marketers"),o=IE[a],l=!!r&&n,d=()=>a==="marketers"?r?"/create":"/try":o.primaryCta.link,c=()=>a==="marketers"&&l?"Create Another Ad":o.primaryCta.text,h=()=>{const f=d();t(c(),`hero_${a}`,f)},m=()=>{t(o.secondaryCta.text,`hero_${a}`,o.secondaryCta.link)};return s.jsxs("div",{className:"w-full",children:[s.jsx("div",{className:"flex justify-center mb-10",children:s.jsx("div",{className:"inline-flex items-center p-1 rounded-full bg-secondary/50 backdrop-blur-sm border border-border/50",children:RE.map(f=>s.jsxs("button",{onClick:()=>i(f.id),className:Y("relative px-3 sm:px-4 md:px-6 py-2.5 rounded-full text-xs sm:text-sm font-medium transition-all duration-300 flex items-center gap-1.5 sm:gap-2 min-w-[44px] min-h-[44px] justify-center",a===f.id?"text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[a===f.id&&s.jsx(ae.div,{layoutId:"activeTab",className:"absolute inset-0 bg-gradient-to-r from-primary to-accent rounded-full",transition:{type:"spring",bounce:.2,duration:.6}}),s.jsx(f.icon,{className:"w-4 h-4 relative z-10 shrink-0"}),s.jsx("span",{className:"relative z-10 text-xs sm:text-sm",children:f.label.replace("For ","")})]},f.id))})}),s.jsx(pt,{mode:"popLayout",children:s.jsxs(ae.div,{initial:{opacity:0,y:8}
604,animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.15,ease:"easeOut"},className:"text-center",children:[s.jsxs("h1",{className:"text-4xl md:text-6xl lg:text-7xl font-bold font-display mb-6 leading-tight",children:[o.headline.split(" ").slice(0,-2).join(" "),s.jsx("span",{className:"block gradient-text glow-text",children:o.headline.split(" ").slice(-2).join(" ")})]}),s.jsx("p",{className:"text-lg md:text-xl text-muted-foreground mb-8 max-w-2xl mx-auto",children:o.subheadline}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 mb-12",children:[s.jsx(ie,{variant:"hero",size:"xl",asChild:!0,onClick:h,children:s.jsxs(be,{to:d(),children:[s.jsx(Bt,{className:"w-5 h-5"}),c()]})}),s.jsxs(ie,{variant:"glass",size:"xl",onClick:()=>{m();const f=o.secondaryCta.link;if(f.startsWith("#")){(()=>{const v=document.querySelector(f);if(v)v.scrollIntoView({behavior:"smooth"});else{window.scrollTo({top:window.innerHeight*2,behavior:"smooth"});const x=(g=0)=>{const b=document.querySelector(f);b?b.scrollIntoView({behavior:"smooth"}):g<10&&setTimeout(()=>x(g+1),100)};setTimeout(()=>x(),300)}})();return}f.startsWith("/")&&e(f)},children:[s.jsx(Qc,{className:"w-5 h-5"}),o.secondaryCta.text]})]}),a==="marketers"&&!l&&s.jsx("p",{className:"text-sm text-muted-foreground -mt-6 mb-8",children:"No credit card required. 3 free videos included."}),s.jsx("div",{className:"flex flex-wrap justify-center gap-6 md:gap-12 mb-12",children:o.stats.map(f=>s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-2xl md:text-3xl font-bold gradient-text",children:f.value}),s.jsx("div",{className:"text-sm text-muted-foreground",children:f.label})]},f.label))}),s.jsx("div",{className:"flex flex-wrap justify-center gap-3 md:gap-4",children:o.features.map(f=>s.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-secondary/50 border border-border/50 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-primary"}),s.jsx("span",{children:f})]},f))}),s.jsxs("div",{className:"mt-12 flex items-center justify-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ae.div,{animate:{x:[0,6,0]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",delay:.3},children:s.jsx(Jr,{className:"w-5 h-5 text-primary/30"})}),s.jsx(ae.div,{animate:{x:[0,6,0]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",delay:.15},children:s.jsx(Jr,{className:"w-5 h-5 text-primary/50"})}),s.jsx(ae.div,{animate:{x:[0,6,0]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},children:s.jsx(Jr,{className:"w-6 h-6 text-primary/80"})})]}),s.jsx(ie,{variant:"hero",size:"xl",className:"h-16 px-14 text-xl font-bold rounded-xl text-white [background:linear-gradient(90deg,#00D1FF_0%,#7000FF_100%)] hover:brightness-110 transition-all dark:drop-shadow-[0_0_20px_rgba(0,209,255,0.3)]",asChild:!0,onClick:()=>t("Claim Offer",`hero_${a}`,"https://vidacious.ai/pricing"),children:s.jsx("a",{href:"https://vidacious.ai/pricing",children:"Claim Offer"})}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ae.div,{animate:{x:[0,-6,0]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},children:s.jsx(Wo,{className:"w-6 h-6 text-primary/80"})}),s.jsx(ae.div,{animate:{x:[0,-6,0]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",delay:.15},children:s.jsx(Wo,{className:"w-5 h-5 text-primary/50"})}),s.jsx(ae.div,{animate:{x:[0,-6,0]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",delay:.3},children:s.jsx(Wo,{className:"w-5 h-5 text-primary/30"})})]})]})]},a)})]})}const Nl=async(r,e)=>{try{return await r.play(),!0}catch(t){if(!r.muted){r.muted=!0;try{return await r.play(),!0}catch(n){return e?.(n),!1}}return e?.(t),!1}},ME=r=>r?r.startsWith("/")||r.startsWith("data:")||r.startsWith("blob:"):!1,vv=r=>{if(!(!r||ME(r)))return"anonymous"},yv="cnocqjydxkzeytrirrsn",bv="generated-videos",su="cdn.vidacious.ai",_v=new RegExp(`https://${yv}\\.supabase\\.co/storage/v1/object/public/${bv}/(.+)`);function OE(r){if(!r)return null;const e=r.match(_v);return e&&e[1]?`https://${su}/videos/${e[1]}`:r}function DE(r){if(!r)return null;const e=new RegExp(`https://${su}/videos/(.+)`),t=r.match(e);return t&&t[1]?`https://${yv}.supabase.co/storage/v1/object/public/${bv}/${t[1]}`:r}function LE(r){return r?_v.test(r):!1}function UA(r,e,t=!0){return!r&&!e?null:t&&e?`https://${su}/videos/${e}`:t&&r&&LE(r)?OE(r):r||null}const $E=8,FE=6,VE=75,Sl=[{x:"2%",y:"18%",rotation:-12,size:140,delay:0,duration:4,parallaxSpeed:.3},{x:"12%",y:"38%",rotation:8,size:120,delay:.3,duration:4.5,parallaxSpeed:.5},{x:"82%",y:"20%",rotation:-6,size:130,delay:.6,duration:3.8,parallaxSpeed:.4},{x:"85%",y:"42%",rotation:12,size:125,delay:.2,duration:4.2,parallaxSpeed:.6},{x:"3%",y:"62%",rotation:10,size:135,delay:.5,duration:4.3,parallaxSpeed:.2},{x:"10%",y:"80%",rotation:-14,size:115,delay:.1,duration:3.9,parallaxSpeed:.7},{x:"83%",y:"68%",rotation:10,size:120,delay:.4,duration:4.1,parallaxSpeed:.35},{x:"88%",y:"85%",rotation:-8,size:130,delay:.7,duration:4.4,parallaxSpeed:.55}],Mm=[{video:"/videos/Dom_Beige_Shirt_Vidacious.mp4",thumbnail:null},{video:"/videos/Vic_Vidacious_Gym.mp4",thumbnail:null},{video:"/videos/Matt_Kitchen_Vidacious.mp4",thumbnail:null},{video:"/videos/Peter_Vidacious.mp4",thumbnail:null},{video:"/videos/Dom_Outside_Vidacious.mp4",thumbnail:null},{video:"/videos/Vic_Rack_Vidacious.mp4",thumbnail:null},{video:"/videos/Matt_K_Outside_Vidacious.mp4",thumbnail:null},{video:"/videos/Vic_Vidacious_Bed.mp4",thumbnail:null}];async function zE(){try{const{data:r,error:e}=await W.from("actors").select("preview_video_url, hero_order, name, image_url").eq("is_hero_featured",!0).eq("is_active",!0).not("preview_video_url","is",null).order("hero_order",{ascending:!0,nullsFirst:!1}).order("name",{ascending:!0}).limit($E);if(e)throw e;return r&&r.length>0?r.map(t=>({video:t.preview_video_url,thumbnail:t.image_url})):Mm}catch(r){return console.error("Error fetching hero actors:",r),Mm}}function wv(r=!0){const{data:e=[],isLoading:t}=Pl({queryKey:["hero-actors"],queryFn:zE,staleTime:3e5,gcTime:6e5,enabled:r});return{videos:e,isLoaded:!t}}
604function Om(r){r.muted=!0,r.defaultMuted=!0,r.volume=0,r.playsInline=!0,r.loop=!0,r.autoplay=!0,r.preload="auto",r.setAttribute("muted",""),r.setAttribute("autoplay",""),r.setAttribute("playsinline","true"),r.setAttribute("webkit-playsinline","true")}function jv(r){return Array.from(new Set([DE(r),r].filter(e=>!!e)))}function kv(r,e,t,n=0){const[a,i]=u.useState(!1),[o,l]=u.useState(!1),d=u.useRef(!1);return u.useEffect(()=>{i(!1),l(!1),d.current=!1},[e]),u.useEffect(()=>{const c=r.current;if(!c||!e||!t||o)return;Om(c);let h=!1;const m=()=>{h||d.current||!c.paused&&c.currentTime>0&&(d.current=!0,i(!0))},f=async()=>{if(h||document.hidden)return;Om(c);const j=await Nl(c);h||j&&!c.paused&&c.currentTime>0&&m()},p=()=>{d.current||f()},v=()=>m(),x=()=>{!document.hidden&&d.current&&c.paused&&Nl(c),!document.hidden&&!d.current&&f()},g=()=>{d.current&&c.paused&&Nl(c)};c.addEventListener("canplaythrough",p),c.addEventListener("playing",v),c.addEventListener("waiting",g),c.addEventListener("stalled",g),c.addEventListener("pause",g),document.addEventListener("visibilitychange",x);const b=window.setTimeout(()=>{c.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA?f():c.readyState===0&&c.load()},n*VE);return()=>{h=!0,window.clearTimeout(b),c.removeEventListener("canplaythrough",p),c.removeEventListener("playing",v),c.removeEventListener("waiting",g),c.removeEventListener("stalled",g),c.removeEventListener("pause",g),document.removeEventListener("visibilitychange",x)}},[r,e,t,o,n]),{hasStartedPlayback:a,hasError:o,setHasError:l}}function nu(){const[r]=u.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1024px)").matches),e=u.useRef(null),{scrollY:t}=Fy(),{videos:n,isLoaded:a}=wv(r);if(!r)return null;const i=n.map((o,l)=>({...o,...Sl[l%Sl.length]}));return!a||i.length===0?s.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none hidden lg:block",children:Sl.slice(0,4).map((o,l)=>s.jsx("div",{className:"absolute rounded-2xl bg-secondary/30 animate-pulse",style:{left:o.x,top:o.y,width:`${o.size}px`,aspectRatio:"9/16"}},l))}):s.jsx("div",{ref:e,className:"absolute inset-0 overflow-hidden pointer-events-none",children:i.map((o,l)=>s.jsx(HE,{...o,index:l,scrollY:t},`${o.video}-${l}`))})}const HE=u.forwardRef(function({video:e,thumbnail:t,x:n,y:a,rotation:i,size:o,delay:l,duration:d,parallaxSpeed:c,index:h,scrollY:m},f){const p=u.useRef(null),[v,x]=u.useState(!1),g=u.useMemo(()=>jv(e),[e]),[b,j]=u.useState(0);u.useEffect(()=>{j(0)},[e]);const k=g[b]??e,{hasStartedPlayback:y,hasError:w,setHasError:S}=kv(p,k,!0,h),N=Fo(m,[0,1e3],[0,300*c]),_=Fo(m,[0,1e3],[i,i+10*c]),C=Fo(m,[0,400,800],[1,1,0]),O=!!t||y||w,R=()=>{if(b<g.length-1){j(M=>M+1);return}S(!0)};return s.jsx(ae.div,{ref:f,className:"absolute pointer-events-auto hidden lg:block",style:{left:n,top:a,y:N,rotate:v?0:_,opacity:O?C:0},initial:{scale:.8},animate:{scale:v?1.15:1},transition:{scale:{duration:.3,ease:"easeOut"}},onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:s.jsx(ae.div,{animate:{y:[0,-20,0]},transition:{duration:d,repeat:1/0,ease:"easeInOut",delay:l},children:s.jsxs("div",{className:"relative rounded-2xl overflow-hidden border border-white/10",style:{width:`${o}px`,aspectRatio:"9/16",boxShadow:v?"0 35px 60px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(var(--primary-rgb), 0.3)":"0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 0, 0, 0.3)"},children:[s.jsx("div",{className:"absolute -inset-8 rounded-3xl blur-2xl -z-10 transition-opacity duration-300",style:{opacity:v?.6:.4,background:h%2===0?"radial-gradient(ellipse at center, hsl(var(--primary) / 0.4), transparent 70%)":"radial-gradient(ellipse at center, hsl(var(--accent) / 0.4), transparent 70%)"}}),t&&s.jsx("img",{src:t,alt:"",className:"absolute inset-0 w-full h-full object-cover",loading:"eager"}),!w&&s.jsx("video",{ref:p,"data-hero-preview":"true",src:k,crossOrigin:vv(k),className:`relative w-full h-full object-cover transition-opacity duration-500 ${y?"opacity-100":"opacity-0"}`,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",disablePictureInPicture:!0,onError:R},k),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/30 via-trans
604parent to-black/10 pointer-events-none"}),s.jsx(ae.div,{className:"absolute inset-0 bg-gradient-to-tr from-transparent via-white/10 to-transparent pointer-events-none",initial:{opacity:0,x:"-100%"},animate:{opacity:v?1:0,x:v?"100%":"-100%"},transition:{duration:.6}})]})})})});function au(){const[r]=u.useState(()=>typeof window<"u"&&window.matchMedia("(max-width: 1023px)").matches),{videos:e,isLoaded:t}=wv(r),n=e.slice(0,FE),a=u.useRef(null),i=n.length*108;return r?s.jsx("div",{ref:a,className:"lg:hidden w-full overflow-hidden py-4 min-h-[180px]",children:t&&n.length>0?s.jsxs("div",{className:"flex gap-3 px-4 animate-marquee-scroll",style:{"--marquee-distance":`-${i}px`,animationDuration:"20s"},children:[n.map((o,l)=>s.jsx(Dm,{thumbnail:o.thumbnail,video:o.video,index:l,priority:l<3},`primary-${l}`)),n.map((o,l)=>s.jsx(Dm,{thumbnail:o.thumbnail,video:o.video,index:l+n.length,priority:!1},`duplicate-${l}`))]}):s.jsx("div",{className:"flex gap-3 px-4",children:[...Array(4)].map((o,l)=>s.jsx("div",{className:"flex-shrink-0 w-24 rounded-xl bg-secondary/50 animate-pulse",style:{aspectRatio:"9/16"}},l))})}):null}function Dm({thumbnail:r,video:e,index:t,priority:n}){const a=u.useRef(null),i=u.useMemo(()=>jv(e),[e]),[o,l]=u.useState(0);u.useEffect(()=>{l(0)},[e]);const d=i[o]??e,{hasStartedPlayback:c,hasError:h,setHasError:m}=kv(a,d,!0,t),f=()=>{if(o<i.length-1){l(p=>p+1);return}m(!0)};return s.jsxs("div",{className:"relative flex-shrink-0 w-24 rounded-xl overflow-hidden shadow-lg border border-border/30",style:{aspectRatio:"9/16"},children:[r?s.jsx("img",{src:r,alt:"",className:"absolute inset-0 w-full h-full object-cover will-change-transform",loading:n?"eager":"lazy",style:{animation:`ken-burns 6s ease-in-out ${t*.8}s infinite`,opacity:c?0:1,transition:"opacity 500ms ease"}}):s.jsx("div",{className:"absolute inset-0 w-full h-full bg-gradient-to-b from-secondary to-secondary/80"}),!h&&s.jsx("video",{ref:a,"data-hero-preview":"true",src:d,crossOrigin:vv(d),muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onError:f,className:"absolute inset-0 w-full h-full object-cover",style:{opacity:c?1:0,transition:"opacity 500ms ease"}},d)]})}function UE(){const{trackPageView:r}=Ba();return u.useEffect(()=>{r("home")},[r]),s.jsxs("section",{className:"relative min-h-screen flex items-center justify-center overflow-hidden noise-bg",style:{paddingTop:"calc(var(--promo-banner-height, 0px) + var(--campaign-banner-height, 0px) + var(--header-height))"},children:[s.jsx("div",{className:"absolute inset-0",children:s.jsx("div",{className:"absolute top-1/3 left-1/3 w-[600px] h-[600px] bg-gradient-radial from-primary/12 via-accent/8 to-transparent rounded-full blur-[120px]"})}),s.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.02)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.02)_1px,transparent_1px)] bg-[size:64px_64px]"}),s.jsx(nu,{}),s.jsx("div",{className:"container relative z-10 px-4 py-8 md:py-20",children:s.jsxs("div",{className:"max-w-5xl mx-auto",children:[s.jsx(au,{}),s.jsx("div",{className:"text-center mb-8 animate-fade-in",children:s.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/20 backdrop-blur-sm border border-primary/30",children:[s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),s.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),s.jsx("span",{className:"text-sm font-medium text-primary",children:"AI Video Ads in Under 2 Minutes"})]})}),s.jsx("div",{className:"animate-fade-in",style:{animationDelay:"0.1s",animationFillMode:"both"},children:s.jsx(ru,{})})]})})]})}function BE(){const{trackPageView:r}=Ba();return u.useEffect(()=>{r("home")},[r]),s.jsxs("section",{className:"relative min-h-screen flex items-center justify-center overflow-hidden noise-bg",style:{paddingTop:"calc(var(--promo-banner-height, 0px) + var(--campaign-banner-height, 0px) + var(--header-height))"},children:[s.jsx("div",{className:"absolute inset-0",children:s.jsx("div",{className:"absolute top-1/4 right-1/4 w-[500px] h-[500px] bg-gradient-radial from-
604accent/15 via-primary/8 to-transparent rounded-full blur-[100px]"})}),s.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.02)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.02)_1px,transparent_1px)] bg-[size:64px_64px]"}),s.jsx(nu,{}),s.jsx("div",{className:"container relative z-10 px-4 py-8 md:py-20",children:s.jsxs("div",{className:"max-w-5xl mx-auto",children:[s.jsx(au,{}),s.jsxs("div",{className:"text-center mb-6 animate-fade-in",children:[s.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Trusted by 2,000+ brands & agencies"}),s.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-secondary/50 backdrop-blur-sm border border-border/50",children:[s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),s.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"AI Video Ads That Outperform by 2.7x"})]})]}),s.jsx("div",{className:"animate-fade-in",style:{animationDelay:"0.1s",animationFillMode:"both"},children:s.jsx(ru,{})})]})})]})}function qE(){const{variant:r}=Lx("landing_hero_v2");return r==="variant_a"?s.jsx(UE,{}):r==="variant_b"?s.jsx(BE,{}):s.jsx(WE,{})}function WE(){const{trackPageView:r}=Ba();return u.useEffect(()=>{r("home")},[r]),s.jsxs("section",{className:"relative min-h-screen flex items-center justify-center overflow-hidden noise-bg",style:{paddingTop:"calc(var(--promo-banner-height, 0px) + var(--campaign-banner-height, 0px) + var(--header-height))"},children:[s.jsx("div",{className:"absolute inset-0",children:s.jsx("div",{className:"absolute top-1/3 left-1/3 w-[600px] h-[600px] bg-gradient-radial from-primary/12 via-accent/8 to-transparent rounded-full blur-[120px]"})}),s.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.02)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.02)_1px,transparent_1px)] bg-[size:64px_64px]"}),s.jsx(nu,{}),s.jsx("div",{className:"container relative z-10 px-4 py-8 md:py-20",children:s.jsxs("div",{className:"max-w-5xl mx-auto",children:[s.jsx(au,{}),s.jsx("div",{className:"text-center mb-8 animate-fade-in",children:s.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-secondary/50 backdrop-blur-sm border border-border/50",children:[s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),s.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"AI Video Ads That Outperform by 2.7x"})]})}),s.jsx("div",{className:"animate-fade-in",style:{animationDelay:"0.1s",animationFillMode:"both"},children:s.jsx(ru,{})})]})})]})}function or({children:r,minHeight:e="400px",rootMargin:t="200px",eager:n=!1,skeleton:a,className:i}){const[o,l]=u.useState(n),[d,c]=u.useState(n),h=u.useRef(null);return u.useEffect(()=>{if(n||d)return;const m=new IntersectionObserver(([f])=>{f.isIntersecting&&(l(!0),c(!0),m.disconnect())},{rootMargin:t,threshold:.01});return h.current&&m.observe(h.current),()=>m.disconnect()},[n,d,t]),d?s.jsx("div",{className:i,children:r}):s.jsx("div",{ref:h,className:`content-auto ${i||""}`,style:{minHeight:e,contain:"layout paint"},children:o?r:a||s.jsx("div",{className:"w-full h-full flex items-center justify-center",children:s.jsx(ht,{className:"w-full h-64 skeleton-optimized"})})})}function Nv(){const r=ot(),e=Xt(),t=yd(),n=()=>{t?.openPreferences()},a={Product:[{label:"AI Actors",href:"/features/ai-actors",isExternal:!1},{label:"AI Voices",href:"/features/ai-voices",isExternal:!1},{label:"AI Scripts",href:"/features/ai-scripts",isExternal:!1},{label:"Captions",href:"/features/captions",isExternal:!1},{label:"Pricing",href:"/pricing",isExternal:!1},{label:"URL-to-Ad",href:"/products/url-to-ad",isExternal:!1},{label:"Ad Clone",href:"/products/ad-clone",isExternal:!1},{label:"Showcase Studio",href:"/showcase-studio",isExternal:!1},{label:"Direct Publish",href:"/features/direct-publish",isExternal:!1},{label:"Extended Scripts",href:"/features/extended-scripts",isExternal:!1}],Platforms:[{label:"TikTok Ads",href:"/use-cases/tiktok-ads",isExternal:!1},{label:"UGC Ads",href:"/use-cases/ugc-ads",isExternal:!1},{label:"YouTube Shorts",href:"/use-cases/youtube-shorts",isExternal:!1},{label:"Instagram Reels",href:"/use-cases/instagram-reels",isExternal:!1},{label:"Facebook Ads",href:"/use-cases/facebook-ads",isExternal:!1}],Industries:[{label:"E-commerce",href:"/use-cases/ecommerce",isExternal:!1},{label:"Agencies",href:"/use-cases/agencies",isExternal:!1}
604,{label:"SaaS",href:"/use-cases/saas",isExternal:!1},{label:"Creators",href:"/use-cases/creators",isExternal:!1},{label:"All Use Cases",href:"/use-cases",isExternal:!1}],Learn:[{label:"Getting Started",href:"/blog/getting-started-with-ai-video-ads",isExternal:!1},{label:"Script Writing Guide",href:"/blog/writing-scripts-that-convert",isExternal:!1},{label:"Voice Settings",href:"/blog/advanced-voice-settings",isExternal:!1},{label:"Choosing Actors",href:"/blog/choosing-right-ai-actor",isExternal:!1},{label:"All Tutorials",href:"/blog",isExternal:!1}],Developers:[{label:"API Quickstart",href:"/developers/quickstart",isExternal:!1},{label:"API Reference",href:"/developers/reference",isExternal:!1},{label:"SDKs",href:"/developers/sdks",isExternal:!1},{label:"Authentication",href:"/developers/authentication",isExternal:!1},{label:"API Pricing",href:"/developers/pricing",isExternal:!1},{label:"Billing & Credits",href:"/developers/billing-credits",isExternal:!1},{label:"Webhooks",href:"/developers/webhooks",isExternal:!1},{label:"Rate Limits",href:"/developers/rate-limits",isExternal:!1},{label:"Playground",href:"/developers/playground",isExternal:!1},{label:"Sandbox",href:"/developers/sandbox",isExternal:!1}],Resources:[{label:"Help Center",href:"/help",isExternal:!1},{label:"All Docs",href:"/docs",isExternal:!1},{label:"Case Studies",href:"/case-studies",isExternal:!1},{label:"System Status",href:"/status",isExternal:!1},{label:"Startups",href:"/startups",isExternal:!1},{label:"Become a Creator",href:"/creators/become",isExternal:!1},{label:"Refer & Earn",href:"/refer",isExternal:!1}],Company:[{label:"About",href:"/about",isExternal:!1},{label:"Contact",href:"/contact",isExternal:!1},{label:"Privacy",href:"/privacy",isExternal:!1},{label:"Terms",href:"/terms",isExternal:!1},{label:"Cookies",href:"/cookies",isExternal:!1},{label:"Cookie Preferences",href:"#",isExternal:!1,isCookiePrefs:!0},{label:"GDPR",href:"/gdpr",isExternal:!1}]},i=l=>{const d=l.replace("#","");r.pathname!=="/"?(e("/"),setTimeout(()=>{document.getElementById(d)?.scrollIntoView({behavior:"smooth"})},100)):document.getElementById(d)?.scrollIntoView({behavior:"smooth"})},o=[{icon:E1,href:"https://x.com/Vidacious_AI",label:"X"},{icon:c1,href:"https://www.instagram.com/vidacious_ai",label:"Instagram"},{icon:r1,href:"https://www.facebook.com/vidaciousai/",label:"Facebook"},{icon:Ds,href:"mailto:[email protected]",label:"Email"}];return s.jsx("footer",{className:"py-16 pb-28 md:pb-16 border-t border-border bg-background",children:s.jsxs("div",{className:"container px-4 max-w-7xl mx-auto",children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-9 gap-8 lg:gap-6 xl:gap-8 mb-12",children:[s.jsxs("div",{className:"col-span-2 md:col-span-4 lg:col-span-2",children:[s.jsxs(ae.div,{initial:{opacity:0}
604,whileInView:{opacity:1},viewport:{once:!0},className:"flex items-center gap-2 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-r from-primary to-accent flex items-center justify-center",children:s.jsx(Dt,{className:"w-5 h-5 text-primary-foreground"})}),s.jsx("span",{className:"text-xl font-bold font-display",children:"Vidacious"})]}),s.jsx("p",{className:"text-muted-foreground text-sm mb-6 max-w-[200px] lg:max-w-[220px]",children:"AI video creation for marketers, creators, and developers."}),s.jsx("div",{className:"flex items-center gap-3",children:o.map(l=>s.jsx("a",{href:l.href,target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 rounded-lg bg-secondary hover:bg-primary/20 flex items-center justify-center transition-colors group","aria-label":l.label,children:s.jsx(l.icon,{className:"w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors"})},l.label))})]}),Object.entries(a).map(([l,d])=>s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold font-display mb-4 text-sm",children:l}),s.jsx("ul",{className:"space-y-2.5",children:d.map(c=>s.jsx("li",{children:c.isCookiePrefs?s.jsx("button",{onClick:n,className:"text-sm text-muted-foreground hover:text-primary transition-colors text-left",children:c.label}):c.isAnchor?s.jsx("button",{onClick:()=>i(c.href),className:"text-sm text-muted-foreground hover:text-primary transition-colors text-left",children:c.label}):c.isExternal||c.href.startsWith("mailto:")||c.href.startsWith("https://")?s.jsx("a",{href:c.href,className:"text-sm text-muted-foreground hover:text-primary transition-colors",...c.href.startsWith("mailto:")||c.href.startsWith("https://vidacious.ai")?{}:{target:"_blank",rel:"noopener noreferrer"},children:c.label}):s.jsx(be,{to:c.href,className:"text-sm text-muted-foreground hover:text-primary transition-colors",children:c.label})},c.label))})]},l))]}),s.jsxs("div",{className:"pt-8 border-t border-border flex flex-col md:flex-row items-center justify-between gap-4",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," Vidacious. All rights reserved."]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Questions? [email protected]"})]})]})})}function GE(){const{user:r}=Ee(),[e,t]=u.useState(!1),[n,a]=u.useState(!1);u.useEffect(()=>{if(sessionStorage.getItem("mobile-cta-dismissed")){a(!0);return}const l=()=>{window.scrollY>300?t(!0):t(!1)};return window.addEventListener("scroll",l,{passive:!0}),()=>window.removeEventListener("scroll",l)},[]);const i=()=>{a(!0),sessionStorage.setItem("mobile-cta-dismissed","true")};return n||r?null:s.jsx(pt,{children:e&&s.jsx(ae.div,{initial:{y:100,opacity:0},animate:{y:0,opacity:1},exit:{y:100,opacity:0},transition:{type:"spring",bounce:.2,duration:.5},className:"fixed bottom-0 left-0 right-0 z-50 md:hidden safe-area-pb",children:s.jsxs("div",{className:"bg-background/95 backdrop-blur-lg border-t border-border px-4 py-3 flex items-center gap-3",children:[s.jsx(ie,{variant:"hero",size:"lg",className:"flex-1 min-h-[48px]",asChild:!0,children:s.jsxs(be,{to:"/try",children:[s.jsx(Bt,{className:"w-4 h-4 mr-2"}),"Create Your First Ad Free"]})}),s.jsx("button",{onClick:i,className:"p-2 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Dismiss",children:s.jsx(lt,{className:"w-5 h-5"})})]})})})}const YE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20608%20173.7'%3e%3cpath%20fill='%2395BF47'%20d='M130.7%2032.9c-.1-.9-.9-1.3-1.5-1.4-.6-.1-12.6-.2-12.6-.2s-10.1-9.8-11.1-10.8-2.9-.7-3.7-.5c0%200-1.9.6-5.1%201.6-.5-1.7-1.3-3.8-2.4-5.9-3.6-6.9-8.8-10.5-15.2-10.5-.4%200-.9%200-1.3.1-.2-.2-.4-.4-.6-.7-2.8-3-6.3-4.4-10.5-4.3-8.2.2-16.3%206.1-23%2016.7-4.7%207.4-8.2%2016.7-9.2%2023.9-9.4%202.9-16%204.9-16.1%205-4.7%201.5-4.9%201.6-5.5%206.1C12.4%2055.3%200%20151.4%200%20151.4l104.1%2018%2045.1-11.2S130.8%2033.7%20130.7%2032.9zm-39.2-9.7c-2.4.7-5.1%201.6-8.1%202.5-.1-4.1-.6-9.9-2.5-14.9%206.3%201.2%209.3%208.2%2010.6%2012.4zM78%2027.4c-5.5%201.7-11.4%203.5-17.4%205.4%201.7-6.4%204.9-12.8%208.8-17%201.5-1.6%203.5-3.3%205.9-4.3%202.3%204.7%202.7%2011.4%202.7%2015.9zM66.8%205.8c1.9%200%203.5.4%204.9%201.3-2.2%201.1-4.4%202.8-6.4%205-5.2%205.6-9.2%2014.2-10.8%2022.6-5%201.5-9.8%203-14.3%204.4%203-13.2%2014-32.9%2
604026.6-33.3z'%3e%3c/path%3e%3cpath%20fill='%235E8E3E'%20d='M129.2%2031.5c-.6-.1-12.6-.2-12.6-.2s-10.1-9.8-11.1-10.8c-.4-.4-.9-.6-1.4-.6v149.5l45.1-11.2S130.8%2033.8%20130.7%2032.9c-.2-.9-.9-1.3-1.5-1.4z'%3e%3c/path%3e%3cpath%20fill='%23FFF'%20d='M79.1%2054.7l-5.2%2019.6s-5.8-2.7-12.8-2.2c-10.2.6-10.3%207-10.2%208.7.6%208.8%2023.6%2010.7%2024.9%2031.2%201%2016.2-8.6%2027.2-22.4%2028.1-16.6%201-25.7-8.7-25.7-8.7l3.5-14.9s9.2%206.9%2016.5%206.5c4.8-.3%206.5-4.2%206.3-7-.7-11.4-19.5-10.8-20.7-29.5-1-15.8%209.4-31.8%2032.3-33.3%209-.8%2013.5%201.5%2013.5%201.5z'%3e%3c/path%3e%3cpath%20fill='%23FFF'%20d='M210.3%2096.5c-5.2-2.8-7.9-5.2-7.9-8.5%200-4.2%203.7-6.9%209.6-6.9%206.8%200%2012.8%202.8%2012.8%202.8l4.8-14.6s-4.4-3.4-17.3-3.4c-18%200-30.5%2010.3-30.5%2024.8%200%208.2%205.8%2014.5%2013.6%2019%206.3%203.6%208.5%206.1%208.5%209.9%200%203.9-3.1%207-9%207-8.7%200-16.9-4.5-16.9-4.5l-5.1%2014.6s7.6%205.1%2020.3%205.1c18.5%200%2031.8-9.1%2031.8-25.5.1-8.9-6.6-15.2-14.7-19.8zm73.8-30.8c-9.1%200-16.3%204.3-21.8%2010.9l-.3-.1%207.9-41.4h-20.6l-20%20105.3h20.6l6.9-36c2.7-13.6%209.7-22%2016.3-22%204.6%200%206.4%203.1%206.4%207.6%200%202.8-.3%206.3-.9%209.1l-7.8%2041.2h20.6l8.1-42.6c.9-4.5%201.5-9.9%201.5-13.4%200-11.5-6.2-18.6-16.9-18.6zm63.5%200c-24.8%200-41.2%2022.4-41.2%2047.4%200%2016%209.9%2028.8%2028.4%2028.8%2024.3%200%2040.8-21.8%2040.8-47.4-.1-14.7-8.8-28.8-28-28.8zm-10.2%2060.4c-7%200-10-6-10-13.4%200-11.8%206.1-31.1%2017.3-31.1%207.3%200%209.7%206.3%209.7%2012.4%200%2012.7-6.1%2032.1-17%2032.1zm90.8-60.4c-13.9%200-21.8%2012.2-21.8%2012.2h-.3l1.2-11.1h-18.2c-.9%207.5-2.5%2018.8-4.2%2027.3l-14.3%2075.4h20.6l5.7-30.5h.4s4.2%202.7%2012.1%202.7c24.2%200%2040-24.8%2040-49.9.1-13.7-6.1-26.1-21.2-26.1zm-19.7%2060.7c-5.4%200-8.5-3-8.5-3l3.4-19.3c2.4-12.8%209.1-21.4%2016.3-21.4%206.3%200%208.2%205.8%208.2%2011.4%200%2013.3-7.9%2032.3-19.4%2032.3zm70.4-90.2c-6.6%200-11.8%2
60405.2-11.8%2012%200%206.1%203.9%2010.3%209.7%2010.3h.3c6.4%200%2012-4.3%2012.1-12%200-6-4-10.3-10.3-10.3zm-28.8%20104.2h20.6l14-73h-20.8zm87-73.2h-14.3l.7-3.4c1.2-7%205.4-13.3%2012.2-13.3%203.7%200%206.6%201%206.6%201l4-16.1s-3.6-1.8-11.2-1.8c-7.3%200-14.6%202.1-20.2%206.9-7%206-10.3%2014.6-12%2023.3l-.6%203.4h-9.6l-3%2015.5h9.6l-10.9%2057.7H509l10.9-57.7h14.2l3-15.5zm49.6.2s-12.9%2032.5-18.7%2050.2h-.3c-.4-5.7-5.1-50.2-5.1-50.2H541l12.4%2067.1c.3%201.5.1%202.4-.4%203.4-2.4%204.6-6.4%209.1-11.2%2012.4-3.9%202.8-8.2%204.6-11.7%205.8l5.7%2017.5c4.2-.9%2012.8-4.3%2020.2-11.2%209.4-8.8%2018.1-22.4%2027-40.9l25.2-54.1h-21.5z'%3e%3c/path%3e%3c/svg%3e",ZE="data:image/svg+xml,%3csvg%20clip-rule='evenodd'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20viewBox='90%2090%20380%20175'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m6.409%2010.559h4.487l6.337%2015.271h-4.742l-4.007-10.14-2.648%206.654h3.149l1.257%203.486h-10.242zm16.109%203.168c.46%200%20.961.041%201.462.164v-3.782h3.965v15.046c-.9
60409.409-2.872.91-4.834.91-3.557%200-6.614-2.024-6.614-6.062%200-4.037%202.944-6.265%206.021-6.265zm.501%209.067c.368%200%20.664-.072.961-.164v-5.54c-.297-.112-.593-.163-.982-.163-1.298%200-2.504.961-2.504%202.984%200%202.024%201.227%202.873%202.525%202.873zm11.99-9.067c3.301%200%206.112%202.229%206.112%206.154s-2.801%206.153-6.112%206.153c-3.312%200-6.133-2.228-6.133-6.153s2.78-6.154%206.133-6.154zm0%209.006c1.134%200%202.187-.91%202.187-2.852s-1.053-2.852-2.187-2.852c-1.135%200-2.167.91-2.167%202.852s.981%202.852%202.167%202.852zm7.063-12.624h3.986v3.782c.48-.092.981-.164%201.482-.164%203.097%200%205.969%202.024%205.969%205.99%200%204.191-3.056%206.317-6.674%206.317-1.554%200-3.537-.317-4.763-.889v-15.046zm4.855%2012.664c1.369%200%202.616-.981%202.616-3.005%200-1.891-1.226-2.78-2.555-2.78-.368%200-.664.041-.93.164v5.468c.225.092.521.164.869.164zm13.349-9.046c2.985%200%205.724%201.912%205.724%205.765%200%20.522-.02%201.022-.092%201.523h-7.431c.409%201.35%201.595%201.983%203.077%201.983%201.206%200%202.32-.296%203.577-.838v3.036c-1.165.593-2.555.838-3.986.838-3.782%200-6.726-2.279-6.726-6.153s2.668-6.154%205.857-6.154zm2.003%204.805c-.204-1.299-1.073-1.82-1.962-1.82s-1.615.552-1.912%201.82z'%20fill='%23eb1000'%20fill-rule='nonzero'%20transform='matrix(5.637%200%200%205.637%2093.9789%2098.073)'/%3e%3c/svg%3e",JE="data:image/svg+xml,%3csvg%20clip-rule='evenodd'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20viewBox='55%20120%20450%20170'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m79.444%2018.096c-.136%200-.26.088-.324.272-.82%202.34-1.928%203.732-2.84%203.732-.524%200-.736-.584-.736-1.5%200-2.292%201.372-7.152%202.064-9.368.08-.268.132-.508.132-.712%200-.644-.352-.96-1.224-.96-.94%200-1.952.368-2.936%202.092-.34-1.52-1.368-2.184-2.804-2.184-1.66%200-3.264%201.068-4.584%202.8s-2.872%202.3-4.04%202.02c.84-2.056%201.152-3.592%201.152-4.732%200-1.788-.884-2.868-2.312-2.868-2.172%200-3.424%202.072-3.424%204.252%200%201.684.764%203.416%202.444%204.256-1.408%203.184-3.464%206.064-4.244%206.064-1.008%200-1.304-4.932-1.248-8.46.036-2.024.204-2.128.204-2.74%200-.352-.228-.592-1.144-.592-2.136%200-2.796%201.808-2.896%203.884-.032.789-.156%201.571-.368%202.332-.892%203.184-2.732%205.6-3.932%205.6-.556%200-.708-.556-.708-1.284%200-2.292%201.284-5.156%201.284-7.6%200-1.796-.788-2.932-2.272-2.932-1.748%200-4.06%202.08-6.248%205.976.72-2.984%201.016-5.872-1.116-5.872-.463.007-.917.125-1.324.344-.279.131-.451.42-.432.728.204%203.176-2.56%2011.312-5.18%2011.312-.476%200-.708-.516-.708-1.348%200-2.296%201.368-7.144%202.056-9.364.088-.288.136-.536.136-.752%200-.608-.376-.92-1.228-.92-.936%200-1.952.356-2.932%202.08-.344-1.52-1.372-2.184-2.808-2.184-2.356%200-4.988%202.492-6.144%205.74-1.548%204.336-4.668%208.524-8.868%208.524-3.812%200-5.824-3.172-5.824-8.184%200-7.236%205.312-13.148%209.252-13.148%201.884%200%202.784%201.2%202.784%203.04%200%202.228-1.244%203.264-1.244%204.112%200%20.26.216.516.644.516%201.712%200%203.728-2.012%203.728-4.756s-2.228-4.752-6.168-4.752c-6.512%200-13.064%206.552-13.064%2014.948%200%206.68%203.296%2010.708%208.996%2010.708%203.888%200%207.284-3.024%209.116-6.552.208%202.924%201.536%204.452%203.56%204.452%201.8%200%203.256-1.072%204.368-2.956.428%201.972%201.564%202.936%203.04%202.936%201.692%200%203.108-1.072%204.456-3.064-.02%201.564.336%203.036%201.692%203.036.64%200%201.404-.148%201.54-.708%201.428-5.904%204.956-10.724%206.036-10.724.32%200%20.408.308.408.672%200%201.604-1.132%204.892-1.132%206.992%200%202.268.964%203.768%202.956%203.768%202.208%200%204.452-2.704%205.948-6.656.468%203.692%201.48%206.672%203.064%206.672%201.944%200%205.396-4.092%207.488-8.424.82.104%202.052.076%203.236-.76-.504%201.276-.8%202.672-.8%204.068%200%204.02%201.92%205.148%203.572%205.148%201.796%200%203.252-1.072%204.368-2.956.368%201.7%201.308%202.932%203.036%202.932%202.704%200%205.052-2.764%205.052-5.032%200-.6-.256-.964-.556-.964zm-56.124%203.792c-1.092%200-1.52-1.1-1.52-2.74%200-2.848%201.948-7.604%204.008-7.604.9%200%201.24%201.06%201.24%202.356%200%202.892-1.852%207.988-3.728%207.988zm37.404-8.5c-.652-.776-.888-1.832
604-.888-2.772%200-1.16.424-2.14.932-2.14s.664.5.664%201.196c0%201.164-.416%202.864-.708%203.716zm8.468%208.5c-1.092%200-1.52-1.264-1.52-2.74%200-2.748%201.948-7.604%204.024-7.604.9%200%201.22%201.052%201.22%202.356%200%202.892-1.82%207.988-3.724%207.988z'%20fill-rule='nonzero'%20transform='matrix(4.5%200%200%204.5%20100%20139.754)'/%3e%3c/svg%3e",XE="data:image/svg+xml,%3csvg%20width='2500'%20height='728'%20viewBox='0%200%20512%20149'%20xmlns='http://www.w3.org/2000/svg'%20preserveAspectRatio='xMidYMid'%3e%3cpath%20d='M.06%2027.679h17.852v39.662h37.651V27.679h17.875v97.358H55.563V84.542H17.912v40.495H.06V27.679zM129.993%2093.326c0%208.15-6.64%2014.782-14.788%2014.782-8.151%200-14.787-6.632-14.787-14.782V51.41h-16.93v41.916c0%2017.487%2014.229%2031.711%2031.717%2031.711%2017.484%200%2031.712-14.224%2031.712-31.711V51.41h-16.924v41.916M194.179%2051.901c-8.398%200-14.26%202.437-19.921%207.994V27.679h-16.985v59.705c0%2022.348%2016.158%2037.653%2034.311%2037.653%2020.181%200%2037.863-15.578%2037.863-36.567%200-20.723-16.305-36.569-35.268-36.569zm.422%2057.423c-11.509%200-20.31-9.612-20.31-20.854%200-11.244%208.801-20.859%2020.31-20.859%209.752%200%2018.558%209.615%2018.558%2020.859%200%2011.242-8.806%2020.854-18.558%2020.854zM257.974%2056.18c0-8.538%205.689-11.245%2011.917-11.245%205.014%200%2011.649%203.792%2015.979%208.398l11.103-13.001c-5.549-7.448-16.788-12.596-25.998-12.596-18.421%200-31.694%2010.7-31.694%2028.444%200%2032.91%2040.497%2022.478%2040.497%2040.902%200%205.682-5.551%2010.698-11.913%2010.698-10.026%200-13.278-4.876-17.881-10.024l-12.327%2012.729c7.86%209.617%2017.608%2014.495%2029.257%2014.495%2017.47%200%2031.556-10.835%2031.556-27.767%200-36.566-40.496-25.188-40.496-41.033M343.184%2050.947c-18.151%200-34.311%2015.296-34.311%2037.649v59.859h16.984v-32.369c5.662%205.553%2011.521%207.994%2019.922%207.994%2018.962%200%2035.269-15.844%2035.269-36.567%200-20.992-17.687-36.566-37.864-36.566zm3.018%2057.425c-11.508%200-20.31-9.625-20.31-20.859%200-11.244%208.802-20.859%2020.31-20.859%209.75%200%2018.557%209.615%2018.557%2020.859%200%2011.234-8.807%2020.859-18.557%2020.859zM506.069%20109.324c-10.018%200-12.862-4.332-12.862-10.971V68.965h15.572V54.069h-15.572v-19.64l-17.195%207.718v59.863c0%2015.306%2010.56%2023.027%2025.045%2023.027%202.167%200%205.15-.14%206.777-.541l4.199-15.438c-1.896.131-4.062.266-5.964.266'%20fill='%2345535E'/%3e%3cpath%20d='M461.278%2069.831c-3.256-5.602-7.836-10.093-13.562-13.474-4.279-2.491-8.716-4.072-13.716-4.751v-17.8c5-2.123%208.103-6.822%208.103-12.304%200-7.472-5.992-13.527-13.458-13.527-7.472%200-13.569%206.055-13.569%2013.527%200%205.482%202.924%2010.181%207.924%2012.304v17.808c-4%20.578-8.148%201.825-11.936%203.741-7.737-5.876-33.107-25.153-47.948-36.412.352-1.269.623-2.577.623-3.957%200-8.276-6.702-14.984-14.981-14.984S333.78%206.71%20333.78%2014.986c0%208.275%206.706%2014.985%2014.985%2014.985%202.824%200%205.436-.826%207.69-2.184l3.132%202.376%2043.036%2031.008c-2.275%202.089-4.394%204.465-6.089%207.131C393.099%2073.737%20391%2079.717%20391%2086.24v1.361c0%204.579.87%208.902%202.352%2012.963%201.305%203.546%203.213%206.77%205.576%209.685l-14.283%2014.318a11.501%2011.501%200%200%200-12.166%202.668%2011.499%2011.499%200%200%200-3.388%208.19c.001%203.093%201.206%206%203.394%208.187a11.5%2011.5%200%200%200%208.188%203.394%2011.51%2011.51%200%200%200%208.191-3.394%2011.514%2011.514%200%200%200%203.39-8.187c0-1.197-.185-2.365-.533-3.475l14.763-14.765c2.024%201.398%204.21%202.575%206.56%203.59%204.635%202.004%209.751%203.225%2015.35%203.225h1.026c6.19%200%2012.029-1.454%2017.518-4.428%205.784-3.143%2010.311-7.441%2013.731-12.928%203.438-5.502%205.331-11.581%205.331-18.269v-.334c0-6.579-1.523-12.649-4.722-18.21zm-18.038%2030.973c-4.007%204.453-8.613%207.196-13.82%207.196h-.858c-2.974%200-5.883-.822-8.731-2.317-3.21-1.646-5.65-3.994-7.647-6.967-2.064-2.918-3.184-6.104-3.184-9.482v-1.026c0-3.321.637-6.47%202.243-9.444%201.717-3.251%204.036-5.779%207.12-7.789%203.028-1.996%206.262-2.975%209.864-2.975h.335c3.266%200%206.358.644%209.276%202.137%202.973%201.592%205.402%203.767%207.285%206.628%201.829%202.862%202.917%205.949%203.267%209.312.055.699.083%201.415.083%202.099%200%204.564-1.744%208.791-5.233%2012.628z'%20fill='%23F8761F'/%3e%3c/svg%3e",KE="/assets/notion-BAls_aZw.svg",QE="/assets/webflow-BciFNe5-.svg",eC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20284%2075'%20fill='none'%3e%3cpath%20d='M0%200.5H27.9V9.3H9.1V27.5H25.5V36.3H9.1V55.5H0V0.5Z'%20fill='%23000'/%3e%3cpath%20d='M35.5%2017.5H44V55.5H35.5V17.5ZM39.8%200C42.8%200%2045.2%202.4%2045.2%205.3C45.2%208.3%2042.8%2010.7%2039.8%2010.7C36.8%2010.7%2034.4%208.3%2034.4%205.3C34.4%202.4%2036.8%200%2039.8%200Z'%20fill='%23000'/%3e%3cpath%20d='M83.5%201
6047.5H92V53.7C92%2066.5%2083.5%2072.5%2073%2072.5C63.2%2072.5%2057.5%2067%2055.5%2060.5L63.5%2057C64.5%2060.5%2068%2063.8%2073%2063.8C79%2063.8%2083.5%2060.5%2083.5%2053.5V49.5C81%2052.5%2077%2055%2072%2055C62%2055%2053.5%2046.5%2053.5%2036C53.5%2025.5%2062%2017%2072%2017C77%2017%2081%2019.5%2083.5%2022.5V17.5ZM73.5%2046.5C79.5%2046.5%2083.5%2042%2083.5%2036C83.5%2030%2079.5%2025.5%2073.5%2025.5C67.5%2025.5%2063.5%2030%2063.5%2036C63.5%2042%2067.5%2046.5%2073.5%2046.5Z'%20fill='%23000'/%3e%3cpath%20d='M102%2017.5H110.5V22C113%2019%20117.5%2016.5%20122.5%2016.5C128.5%2016.5%20133%2019.5%20135%2023.5C138%2019%20143%2016.5%20148.5%2016.5C156%2016.5%20162%2022%20162%2031V55.5H153.5V32.5C153.5%2027.5%20150.5%2024.5%20146%2024.5C141.5%2024.5%20138%2028%20138%2032.5V55.5H129.5V32.5C129.5%2027.5%20126.5%2024.5%20122%2024.5C117.5%2024.5%20114%2028%20114%2032.5V55.5H102V17.5Z'%20fill='%23000'/%3e%3cpath%20d='M193%2017.5H201.5V55.5H193V50.5C190%2054%20186%2056%20181%2056C171%2056%20163%2047%20163%2036.5C163%2026%20171%2017%20181%2017C186%2017%20190%2019%20193%2022.5V17.5ZM182.5%2047C189%2047%20193.5%2042%20193.5%2036.5C193.5%2031%20189%2026%20182.5%2026C176%2026%20171.5%2031%20171.5%2036.5C171.5%2042%20176%2047%20182.5%2047Z'%20fill='%23000'/%3e%3c/svg%3e",tC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='76.57'%20height='32'%20viewBox='0%200%20512%20214'%3e%3cpath%20fill='%23635BFF'%20d='M512%20110.08c0-36.409-17.636-65.138-51.342-65.138c-33.85%200-54.33%2028.73-54.33%2064.854c0%2042.808%2024.179%2064.426%2058.88%2064.426c16.925%200%2029.725-3.84%2039.396-9.244v-28.445c-9.67%204.836-20.764%207.823-34.844%207.823c-13.796%200-26.027-4.836-27.591-21.618h69.547c0-1.85.284-9.245.284-12.658m-70.258-13.511c0-16.071%209.814-22.756%2018.774-22.756c8.675%200%2017.92%206.685%2017.92%2022.756zm-90.31-51.627c-13.939%200-22.899%206.542-27.876%2011.094l-1.85-8.818h-31.288v165.83l35.555-7.537l.143-40.249c5.12%203.698%2012.657%208.96%2025.173%208.96c25.458%200%2048.64-20.48%2048.64-65.564c-.142-41.245-23.609-63.716-48.498-63.716m-8.534%2097.991c-8.391%200-13.37-2.986-16.782-6.684l-.143-52.765c3.698-4.124%208.818-6.968%2016.925-6.968c12.942%200%2021.902%2014.506%2021.902%2033.137c0%2019.058-8.818%2033.28-21.902%2033.28M241.493%2036.551l35.698-7.68V0l-35.698%207.538zm0%2010.809h35.698v124.444h-35.698zm-38.257%2010.524L200.96%2047.36h-30.72v124.444h35.556V87.467c8.39-10.951%2022.613-8.96%2027.022-7.396V47.36c-4.551-1.707-21.191-4.836-29.582%2010.524m-71.112-41.386l-34.702%207.395l-.142%20113.92c0%2021.05%2015.787%2036.551%2036.836%2036.551c11.662%200%2020.195-2.133%2024.888-4.693V140.8c-4.55%201.849-27.022%208.391-27.022-12.658V77.653h27.022V47.36h-27.022zM35.982%2083.484c0-5.546%204.551-7.68%2012.09-7.68c10.808%200%2024.461%203.272%2035.27%209.103V51.484c-11.804-4.693-23.466-6.542-35.27-6.542C19.2%2044.942%200%2060.018%200%2085.192c0%2039.252%2054.044%2032.995%2054.044%2049.92c0%206.541-5.688%208.675-13.653%208.675c-11.804%200-26.88-4.836-38.827-11.378v33.849c13.227%205.689%2026.596%208.106%2038.827%208.106c29.582%200%2049.92-14.648%2049.92-40.106c-.142-42.382-54.329-34.845-54.329-50.774'/%3e%3c/svg%3e",rC={Shopify:YE,Adobe:ZE,Canva:JE,HubSpot:XE,Notion:KE,Webflow:QE,Figma:eC,Stripe:tC},sC=[{name:"Shopify"},{name:"Adobe"},{name:"Canva"},{name:"HubSpot"},{name:"Notion"},{name:"Webflow"},{name:"Figma"},{name:"Stripe"}],nC=()=>s.jsx("section",{className:"py-10 md:py-14 border-t border-border/40 animate-fade-in",style:{animationDelay:"0.4s",animationFillMode:"both"},children:s.jsxs("div",{className:"container max-w-5xl",children:[s.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-5 md:gap-x-12",children:sC.map(r=>{const e=rC[r.name];return s.jsx("span",{className:"opacity-35 hover:opacity-75 transition-opacity duration-300 cursor-default select-none",children:s.jsx("img",{src:e,alt:r.name,className:"h-6 md:h-8 w-auto brightness-0 dark:invert"})},r.name)})}),s.jsxs("p",{className:"text-center mt-6 text-sm text-muted-foreground/60",children:["Trusted by"," ",s.jsx("span",{className:"font-semibold text-muted-foreground",children:"2,000+ brands and agencies worldwide"})]}),s.jsxs("div",{className:"flex flex-wrap justify-center gap-4 md:gap-8 mt-3",children:[s.jsx("span",{className:"text-xs text-muted-foreground
604/50",children:"1M+ videos generated"}),s.jsx("span",{className:"text-xs text-muted-foreground/30",children:"â¢"}),s.jsx("span",{className:"text-xs text-muted-foreground/50",children:"$2.4M+ paid to creators"}),s.jsx("span",{className:"text-xs text-muted-foreground/30",children:"â¢"}),s.jsx("span",{className:"text-xs text-muted-foreground/50",children:"4.8-star avg rating"})]})]})}),aC=[{question:"What are AI UGC ads?",answer:"AI UGC ads are video advertisements generated by AI that look like creator-made content. You provide a script, select an AI actor, and the platform produces a lip-synced video in under 2 minutes â no filming or editing required. They are designed for TikTok, Instagram Reels, and YouTube Shorts."},{question:"How do AI UGC ads work?",answer:"Write or generate a script, choose from 1,200+ AI actors, and click generate. The AI synthesizes voice, matches lip movements, and renders a ready-to-use video in under 2 minutes. Everything happens in-browser."},{question:"Are AI UGC ads effective?",answer:"Video ads generate 2.7x more engagement than static images (Meta, Wistia). AI UGC ads perform well for direct-response campaigns where speed and iteration matter. They are most effective when testing multiple hooks and scaling into new markets quickly."},{question:"How do AI UGC ads compare to using real creators?",answer:"AI UGC ads cost ~$10 vs. $150â500+ per creator video and deliver in minutes instead of days. Traditional creators offer deeper personal authenticity. Choose AI when speed, cost, or testing volume is the priority."},{question:"Can I try Vidacious for free?",answer:"Yes. New users get 3 free videos (30 credits) in their first month, then 1 free video (10 credits) every month. No credit card required."},{question:"How does pricing work?",answer:"10 credits per video. Subscriptions start at $10/video for 5+ videos/month. One-time credit packs start at $12/video with no commitment. Unused subscription credits roll over up to 2à your plan allocation."},{question:"How long does video generation take?",answer:"Videos generate in under 2 minutes. You can generate multiple videos simultaneously."},{question:"Can I use videos for commercial advertising?",answer:"Yes. All paid plans include full commercial usage rights for social media ads, websites, emails, and any marketing channel."},{question:"Is it safe to upload your face to AI?",answer:"All AI actors sign a licensing agreement and complete identity verification. You control which content categories your avatar appears in and earn royalties on every use."},{question:"How do actors earn royalties from AI?",answer:"Actors earn 30% of the credit cost each time their avatar is used. Payouts are available via PayPal or Stripe Connect with a $50 minimum threshold."},{question:"What languages and accents are supported?",answer:"175+ languages including English, Spanish, French, German, Japanese, Korean, Chinese, Hindi, Arabic, and more. Each includes natural voice synthesis with regional accents."},{question:"Which platforms are videos optimized for?",answer:"Videos export in 9:16 vertical format optimized for TikTok, Instagram Reels, YouTube Shorts, Facebook, and LinkedIn."},{question:"How long can my video scripts be?",answer:"Every video includes up to 1,500 characters (~2 minutes) at the standard rate of 10 credits. Need more? Extended Scripts let you go beyond â each additional 1,500-character block costs 10 more credits. You'll see the exact cost before confirming. Maximum script length is 7,500 characters (~10 minutes)."},{question:"What formats and aspect ratios are supported?",answer:"9:16 vertical (TikTok, Reels, Shorts), 16:9 horizontal, and 1:1 square. All videos export as MP4."},{question:"Can I cancel anytime?",answer:"Yes. All plans are month-to-month with
604no long-term commitment. Cancel anytime from your account settings."}],iC=u.lazy(()=>F(()=>import("./ProductShowcaseSection-C2nl08Gl.js"),__vite__mapDeps([108,1,2,5,15,14,16])).then(r=>({default:r.ProductShowcaseSection}))),oC=u.lazy(()=>F(()=>import("./ResultsSection-CXOusWqt.js"),__vite__mapDeps([109,1,5,15,14,2,16])).then(r=>({default:r.ResultsSection}))),lC=u.lazy(()=>F(()=>import("./InteractiveDemo-BNAi993z.js"),__vite__mapDeps([110,1,19,5,111,15,14,2,16])).then(r=>({default:r.InteractiveDemo}))),cC=u.lazy(()=>F(()=>import("./HowItWorksSection-OXD_UKzx.js"),__vite__mapDeps([100,1,5,101,15,14,2,16])).then(r=>({default:r.HowItWorksSection}))),dC=u.lazy(()=>F(()=>import("./UrlToAdModule-C3gFlSJZ.js"),__vite__mapDeps([112,1,2,5,15,14,16])).then(r=>({default:r.UrlToAdModule}))),uC=u.lazy(()=>F(()=>import("./VideoTestimonialSection-bLNFRg7L.js"),__vite__mapDeps([113,1,14,114,79,36,5,115,15,2,16])).then(r=>({default:r.VideoTestimonialSection}))),hC=u.lazy(()=>F(()=>import("./LanguagesSection-B84v5vFw.js"),__vite__mapDeps([116,1,14,5,32,15,2,16])).then(r=>({default:r.LanguagesSection}))),mC=u.lazy(()=>F(()=>import("./ActorShowcaseSection-BNeOCYFA.js"),__vite__mapDeps([117,1,2,5,15,14,16])).then(r=>({default:r.ActorShowcaseSection}))),pC=u.lazy(()=>F(()=>import("./PricingSectionWithExperiment-CqCSjtZy.js"),__vite__mapDeps([118,1,2,5,15,14,16])).then(r=>({default:r.PricingSectionWithExperiment}))),fC=u.lazy(()=>F(()=>import("./CreditPackSection-CRMhMrSq.js"),__vite__mapDeps([119,1,2,5,42,15,14,16])).then(r=>({default:r.CreditPackSection}))),gC=u.lazy(()=>F(()=>import("./FAQSection-DmKrMkqs.js"),__vite__mapDeps([120,1,5,15,14,2,16])).then(r=>({default:r.FAQSection}))),xC=u.lazy(()=>F(()=>import("./CTASection-ebMbJLnh.js"),__vite__mapDeps([121,1,2,5,15,14,16])).then(r=>({default:r.CTASection}))),Lm="AI UGC ads are high-converting video advertisements generated entirely by artificial intelligence, designed to outperform static image ads by 2.7x. Vidacious creates these ads by combining realistic AI actors with natural voice and frame-perfect lip-sync from a simple script or product URLâno filming required, no credit card needed. The platform offers 1,200+ consented AI actors across demographics, 175+ languages with regional accents, auto-generated captions, and batch generation for A/B testing at scale. AI UGC ads cost 90% less than traditional creator content (~$10 vs. $150-500+) and deliver in under 2 minutes. All plans are month-to-month and can be canceled anytime. Videos are optimized for TikTok, Instagram Reels, and YouTube Shorts.",vC=()=>{const e=window.location.hash?.slice(1)==="pricing";return u.useEffect(()=>{const t=window.location.hash?.slice(1);if(!t)return;let n=0;const a=15,i=()=>{const l=document.getElementById(t);if(l){l.scrollIntoView({behavior:"smooth"});return}n++,n<a&&setTimeout(i,400)},o=setTimeout(i,200);return()=>clearTimeout(o)},[]),s.jsxs(s.Fragment,{children:[s.jsx(Hs,{description:"Create AI video ads that outperform static images by 2.7x. 1,200+ AI actors, 175+ languages, under 2 minutes. Free to start.",url:"https://vidacious.ai",jsonLd:"software",faqItems:aC,answerBlock:Lm,structuredData:void 0}),s.jsx(Hs,{jsonLd:"organization"}),s.jsx("div",{className:"aeo-answer-block sr-only","aria-hidden":"true",dangerouslySetInnerHTML:{__html:`<!-- AEO: ${Lm} -->`}}),s.jsxs("main",{className:"min-h-screen bg-background",children:[s.jsx(qE,{}),s.jsx(nC,{}),s.jsx(or,{minHeight:"600px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(iC,{})})}),s.jsx(or,{minHeight:"400px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(oC,{})})}),s.jsx(or,{minHeight:"500px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(lC,{})})}),s.jsx(or,{minHeight:"400px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(cC,{})})}),s.jsx(or,{minHeight:"300px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(dC,{})})}),s.jsx(or,{minHeight:"400px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(uC,{})})}),s.jsx(or,{minHeight:"500px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(hC,{})})}),s.jsx(or,{minHeight:"500px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(mC,{})})}),s.jsx(or,{minHeight:"600px",eager:e,children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(pC,{})})}),s.jsx(or,{minHeight:"400px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(fC,{})})}),s.jsx(or,{minHeight:"400px",eager:!0,children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(gC,{})})}),s.jsx(or,{minHeight:"300px",children:s.jsx(u.Suspense,{fallback:null,children:s.jsx(xC,{})})}),s.jsx(Nv,{}),s.jsx(GE,{})]})]})};var $o="Checkbox",[yC]=js($o),[bC,iu]=yC($o);function _C(r){const{__scopeCheckbox:e,checked:t,children:n,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:d,required:c,value:h="on",internal_do_not_use_render:m}=r,[f,p]=kn({prop:t,defaultProp:a??!1,onChange:d,caller:$o}),[v,x]=u.useState(null),[g,b]=u.useState(null),j=u.useRef(!1),k=v?!!o||!!v.closest("form"):!0,y={checked:f,disabled:i,setChecked:p,control:v,setControl:x,name:l,form:o,value:h,hasConsumerStoppedPropagationRef:j,required:c,defaultChecked:vs(a)?!1:a,isFormControl:k,bubbleInput:g,setBubbleInput:b};return s.jsx(bC,{scope:e,...y,children:wC(m)?m(y):n})}var Sv="CheckboxTrigger",Ev=u.forwardRef(({__scopeCheckbox:r,onKeyDown:e,onClick:t,...n},a)=>{const{control:i,value:o,disabled:l,checked:d,required:c,setControl:h,setChecked:m,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:v}=iu(Sv,r),x=Ft(a,h),g=u.useRef(d);return u.useEffect(()=>{const b=i?.form;if(b){const j=()=>m(g.current);return b.addEventListener("reset",j),()=>b.removeEventListener("reset",j)}},[i,m]),s.jsx(ft.button,{type:"button",role:"checkbox","aria-checked":vs(d)?"mixed":d,"aria-required":c,"data-state":Iv(d),"data-disabled":l?"":void 0,disabled:l,value:o,...n,ref:x,onKeyDown:mt(e,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:mt(t,b=>{m(j=>vs(j)?!0:!j),v&&p&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});
604Ev.displayName=Sv;var ou=u.forwardRef((r,e)=>{const{__scopeCheckbox:t,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:d,onCheckedChange:c,form:h,...m}=r;return s.jsx(_C,{__scopeCheckbox:t,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:c,name:n,form:h,value:d,internal_do_not_use_render:({isFormControl:f})=>s.jsxs(s.Fragment,{children:[s.jsx(Ev,{...m,ref:e,__scopeCheckbox:t}),f&&s.jsx(Av,{__scopeCheckbox:t})]})})});ou.displayName=$o;var Cv="CheckboxIndicator",Tv=u.forwardRef((r,e)=>{const{__scopeCheckbox:t,forceMount:n,...a}=r,i=iu(Cv,t);return s.jsx(Bs,{present:n||vs(i.checked)||i.checked===!0,children:s.jsx(ft.span,{"data-state":Iv(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:e,style:{pointerEvents:"none",...r.style}})})});Tv.displayName=Cv;var Pv="CheckboxBubbleInput",Av=u.forwardRef(({__scopeCheckbox:r,...e},t)=>{const{control:n,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:l,disabled:d,name:c,value:h,form:m,bubbleInput:f,setBubbleInput:p}=iu(Pv,r),v=Ft(t,p),x=vp(i),g=yp(n);u.useEffect(()=>{const j=f;if(!j)return;const k=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(k,"checked").set,S=!a.current;if(x!==i&&w){const N=new Event("click",{bubbles:S});j.indeterminate=vs(i),w.call(j,vs(i)?!1:i),j.dispatchEvent(N)}},[f,x,i,a]);const b=u.useRef(vs(i)?!1:i);return s.jsx(ft.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:l,disabled:d,name:c,value:h,form:m,...e,tabIndex:-1,ref:v,style:{...e.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Av.displayName=Pv;function wC(r){return typeof r=="function"}function vs(r){return r==="indeterminate"}function Iv(r){return vs(r)?"indeterminate":r?"checked":"unchecked"}const Pc=u.forwardRef(({className:r,...e},t)=>s.jsx(ou,{ref:t,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),...e,children:s.jsx(Tv,{className:Y("flex items-center justify-center text-current"),children:s.jsx(Ue,{className:"h-4 w-4"})})}));Pc.displayName=ou.displayName;var qe;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},r.getValidEnumValues=a=>{const i=r.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of i)o[l]=a[l];return r.objectValues(o)},r.objectValues=a=>r.objectKeys(a).map(function(i){return a[i]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},r.find=(a,i)=>{for(const o of a)if(i(o))return o},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(qe||(qe={}));var $m;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})($m||($m={}));const ve=qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hs=r=>{switch(typeof r){case"undefined":return ve.undefined;case"string":return ve.string;case"number":return Number.isNaN(r)?ve.nan:ve.number;case"boolean":return ve.boolean;case"function":return ve.function;case"bigint":return ve.bigint;case"symbol":return ve.symbol;case"object":return Array.isArray(r)?ve.array:r===null?ve.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?ve.promise:typeof Map<"u"&&r instanceof Map?ve.map:typeof Set<"u"&&r instanceof Set?ve.set:typeof Date<"u"&&r instanceof Date?ve.date:ve.object;default:return ve.unknown}}
vendor: 39,484 bytes, line 604
604,oe=qe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class wr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let l=n,d=0;for(;d<o.path.length;){const c=o.path[d];d===o.path.length-1?(l[c]=l[c]||{_errors:[]},l[c]._errors.push(t(o))):l[c]=l[c]||{_errors:[]},l=l[c],d++}}};return a(this),n}static assert(e){if(!(e instanceof wr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,qe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}wr.create=r=>new wr(r);const Ac=(r,e)=>{let t;switch(r.code){case oe.invalid_type:r.received===ve.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case oe.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,qe.jsonStringifyReplacer)}`;break;case oe.unrecognized_keys:t=`Unrecognized key(s) in object: ${qe.joinValues(r.keys,", ")}`;break;case oe.invalid_union:t="Invalid input";break;case oe.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${qe.joinValues(r.options)}`;break;case oe.invalid_enum_value:t=`Invalid enum value. Expected ${qe.joinValues(r.options)}, received '${r.received}'`;break;case oe.invalid_arguments:t="Invalid function arguments";break;case oe.invalid_return_type:t="Invalid function return type";break;case oe.invalid_date:t="Invalid date";break;case oe.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:qe.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case oe.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case oe.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case oe.custom:t="Invalid input";break;case oe.invalid_intersection_types:t="Intersection results could not be merged";break;case oe.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case oe.not_finite:t="Number must be finite";break;default:t=e.defaultError,qe.assertNever(r)}return{message:t}};let jC=Ac;function kC(){return jC}const NC=r=>{const{data:e,path:t,errorMaps:n,issueData:a}=r,i=[...t,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const d=n.filter(c=>!!c).slice().reverse();for(const c of d)l=c(o,{data:e,defaultError:l}).message;return{...a,path:i,message:l}};function xe(r,e){const t=kC(),n=NC({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===Ac?void 0:Ac].filter(a=>!!a)});r.common.issues.push(n)}class ar{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if(a.status==="aborted")return Ce;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const a of t){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return ar.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return Ce;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const Ce=Object.freeze({status:"aborted"}),da=r=>({status:"dirty",value:r}),mr=r=>({status:"valid",value:r}),Fm=r=>r.status==="aborted",Vm=r=>r.status==="dirty",yn=r=>r.status==="valid",ro=r=>typeof Promise<"u"&&r instanceof Promise;var ye;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(ye||(ye={}));class _s{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const zm=(r,e)=>{if(yn(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new wr(r.common.issues);return this._error=t,this._error}}};function Me(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,l)=>{const{message:d}=r;return o.code==="invalid_enum_value"?{message:d??l.defaultError}:typeof l.data>"u"?{message:d??n??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:d??t??l.defaultError}},description:a}}class Be{get description(){return this._def.description}_getType(e){return hs(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:hs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ar,ctx:{common:e.parent.common,data:e.data,parsedType:hs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ro(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hs(e)},a=this._parseSync({data:e,path:n.path,parent:n});return zm(n,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hs(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return yn(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>yn(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hs(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(ro(a)?a:Promise.resolve(a));return zm(n,i)}refine(e,t){const n=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{const o=e(a),l=()=>i.addIssue({code:oe.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new wn({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return ys.create(this,this._def)}nullable(){return jn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ir.create(this)}promise(){return io.create(this,this._def)}or(e){return no.create([this,e],this._def)}and(e){return ao.create(this,e,this._def)}transform(e){return new wn({...Me(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Oc({...Me(this._def),innerType:this,defaultValue:t,typeName:Te.ZodDefault})}brand(){return new YC({typeName:Te.ZodBranded,type:this,...Me(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Dc({...Me(this._def),innerType:this,catchValue:t,typeName:Te.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return lu.create(this,e)}readonly(){return Lc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SC=/^c[^\s-]{8,}$/i,EC=/^[0-9a-z]+$/,CC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,TC=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,PC=/^[a-z0-9_-]{21}$/i,AC=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,IC=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,RC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,MC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let El;const OC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,DC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,LC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,$C=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,FC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Rv="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",zC=new RegExp(`^${Rv}$`);function Mv(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function HC(r){return new RegExp(`^${Mv(r)}$`)}function UC(r){let e=`${Rv}T${Mv(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function BC(r,e){return!!((e==="v4"||!e)&&OC.test(r)||(e==="v6"||!e)&&LC.test(r))}function qC(r,e){if(!AC.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function WC(r,e){return!!((e==="v4"||!e)&&DC.test(r)||(e==="v6"||!e)&&$C.test(r))}class ps extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ve.string){const i=this._getOrReturnCtx(e);return xe(i,{code:oe.invalid_type,expected:ve.string,received:i.parsedType}),Ce}const n=new ar;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?xe(a,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&xe(a,{code:oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")RC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"email",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")El||(El=new RegExp(MC,"u")),El.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"emoji",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")TC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"uuid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")PC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"nanoid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")SC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"cuid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")EC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"cuid2",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")CC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"ulid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),xe(a,{validation:"url",code:oe.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"regex",code:oe.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?UC(i).test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?zC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?HC(i).test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?IC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"duration",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?BC(e.data,i.version)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"ip",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?qC(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"jwt",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?WC(e.data,i.version)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"cidr",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?FC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"base64",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?VC.test(e.data)||(a=this._getOrReturnCtx(e,a),xe(a,{validation:"base64url",code:oe.invalid_string,message:i.message}),n.dirty()):qe.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),{validation:t,code:oe.invalid_string,...ye.errToObj(n)})}_addCheck(e){return new ps({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ye.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ye.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ye.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ye.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ye.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ye.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ye.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ye.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ye.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ye.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ye.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ye.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ye.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ye.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ye.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ye.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ye.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...ye.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ye.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ye.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ye.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ye.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ye.errToObj(t)})}nonempty(e){return this.min(1,ye.errToObj(e))}trim(){return new ps({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ps({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ps({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ps.create=r=>new ps({checks:[],typeName:Te.ZodString,coerce:r?.coerce??!1,...Me(r)});function GC(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,i=Number.parseInt(r.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}class bn extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ve.number){const i=this._getOrReturnCtx(e);return xe(i,{code:oe.invalid_type,expected:ve.number,received:i.parsedType}),Ce}let n;const a=new ar;for(const i of this._def.checks)i.kind==="int"?qe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),xe(n,{code:oe.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),xe(n,{code:oe.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),xe(n,{code:oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?GC(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),xe(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),xe(n,{code:oe.not_finite,message:i.message}),a.dirty()):qe.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ye.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ye.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ye.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ye.toString(t))}setLimit(e,t,n,a){return new bn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:ye.toString(a)}]})}_addCheck(e){return new bn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ye.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ye.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ye.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ye.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ye.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ye.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&qe.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}bn.create=r=>new bn({checks:[],typeName:Te.ZodNumber,coerce:r?.coerce||!1,...Me(r)});class Ca extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ve.bigint)return this._getInvalidInput(e);let n;const a=new ar;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),xe(n,{code:oe.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),xe(n,{code:oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),xe(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):qe.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return xe(t,{code:oe.invalid_type,expected:ve.bigint,received:t.parsedType}),Ce}gte(e,t){return this.setLimit("min",e,!0,ye.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ye.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ye.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ye.toString(t))}setLimit(e,t,n,a){return new Ca({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:ye.toString(a)}]})}_addCheck(e){return new Ca({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ye.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ye.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Ca.create=r=>new Ca({checks:[],typeName:Te.ZodBigInt,coerce:r?.coerce??!1,...Me(r)});class Ic extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ve.boolean){const n=this._getOrReturnCtx(e);return xe(n,{code:oe.invalid_type,expected:ve.boolean,received:n.parsedType}),Ce}return mr(e.data)}}Ic.create=r=>new Ic({typeName:Te.ZodBoolean,coerce:r?.coerce||!1,...Me(r)});class so extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ve.date){const i=this._getOrReturnCtx(e);return xe(i,{code:oe.invalid_type,expected:ve.date,received:i.parsedType}),Ce}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return xe(i,{code:oe.invalid_date}),Ce}const n=new ar;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),xe(a,{code:oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):qe.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new so({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ye.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ye.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}so.create=r=>new so({checks:[],coerce:r?.coerce||!1,typeName:Te.ZodDate,...Me(r)});class Hm extends Be{_parse(e){if(this._getType(e)!==ve.symbol){const n=this._getOrReturnCtx(e);return xe(n,{code:oe.invalid_type,expected:ve.symbol,received:n.parsedType}),Ce}return mr(e.data)}}Hm.create=r=>new Hm({typeName:Te.ZodSymbol,...Me(r)});class Um extends Be{_parse(e){if(this._getType(e)!==ve.undefined){const n=this._getOrReturnCtx(e);return xe(n,{code:oe.invalid_type,expected:ve.undefined,received:n.parsedType}),Ce}return mr(e.data)}}Um.create=r=>new Um({typeName:Te.ZodUndefined,...Me(r)});class Bm extends Be{_parse(e){if(this._getType(e)!==ve.null){const n=this._getOrReturnCtx(e);return xe(n,{code:oe.invalid_type,expected:ve.null,received:n.parsedType}),Ce}return mr(e.data)}}Bm.create=r=>new Bm({typeName:Te.ZodNull,...Me(r)});class qm extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return mr(e.data)}}qm.create=r=>new qm({typeName:Te.ZodAny,...Me(r)});class Wm extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return mr(e.data)}}Wm.create=r=>new Wm({typeName:Te.ZodUnknown,...Me(r)});class ws extends Be{_parse(e){const t=this._getOrReturnCtx(e);return xe(t,{code:oe.invalid_type,expected:ve.never,received:t.parsedType}),Ce}}ws.create=r=>new ws({typeName:Te.ZodNever,...Me(r)});class Gm extends Be{_parse(e){if(this._getType(e)!==ve.undefined){const n=this._getOrReturnCtx(e);return xe(n,{code:oe.invalid_type,expected:ve.void,received:n.parsedType}),Ce}return mr(e.data)}}Gm.create=r=>new Gm({typeName:Te.ZodVoid,...Me(r)});class Ir extends Be{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==ve.array)return xe(t,{code:oe.invalid_type,expected:ve.array,received:t.parsedType}),Ce;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,l=t.data.length<a.exactLength.value;(o||l)&&(xe(t,{code:o?oe.too_big:oe.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(xe(t,{code:oe.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(xe(t,{code:oe.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,l)=>a.type._parseAsync(new _s(t,o,t.path,l)))).then(o=>ar.mergeArray(n,o));const i=[...t.data].map((o,l)=>a.type._parseSync(new _s(t,o,t.path,l)));return ar.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Ir({...this._def,minLength:{value:e,message:ye.toString(t)}})}max(e,t){return new Ir({...this._def,maxLength:{value:e,message:ye.toString(t)}})}length(e,t){return new Ir({...this._def,exactLength:{value:e,message:ye.toString(t)}})}nonempty(e){return this.min(1,e)}}Ir.create=(r,e)=>new Ir({type:r,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...Me(e)});function Qs(r){if(r instanceof bt){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=ys.create(Qs(n))}return new bt({...r._def,shape:()=>e})}else return r instanceof Ir?new Ir({...r._def,type:Qs(r.element)}):r instanceof ys?ys.create(Qs(r.unwrap())):r instanceof jn?jn.create(Qs(r.unwrap())):r instanceof Us?Us.create(r.items.map(e=>Qs(e))):r}class bt extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=qe.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==ve.object){const c=this._getOrReturnCtx(e);return xe(c,{code:oe.invalid_type,expected:ve.object,received:c.parsedType}),Ce}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof ws&&this._def.unknownKeys==="strip"))for(const c in a.data)o.includes(c)||l.push(c);const d=[];for(const c of o){const h=i[c],m=a.data[c];d.push({key:{status:"valid",value:c},value:h._parse(new _s(a,m,a.path,c)),alwaysSet:c in a.data})}if(this._def.catchall instanceof ws){const c=this._def.unknownKeys;if(c==="passthrough")for(const h of l)d.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(c==="strict")l.length>0&&(xe(a,{code:oe.unrecognized_keys,keys:l}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const h of l){const m=a.data[h];d.push({key:{status:"valid",value:h},value:c._parse(new _s(a,m,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const c=[];for(const h of d){const m=await h.key,f=await h.value;c.push({key:m,value:f,alwaysSet:h.alwaysSet})}return c}).then(c=>ar.mergeObjectSync(n,c)):ar.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return ye.errToObj,new bt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{const a=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:ye.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new bt({...this._def,unknownKeys:"strip"})}passthrough(){return new bt({...this._def,unknownKeys:"passthrough"})}extend(e){return new bt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new bt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Te.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new bt({...this._def,catchall:e})}pick(e){const t={};for(const n of qe.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new bt({...this._def,shape:()=>t})}omit(e){const t={};for(const n of qe.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new bt({...this._def,shape:()=>t})}deepPartial(){return Qs(this)}partial(e){const t={};for(const n of qe.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new bt({...this._def,shape:()=>t})}required(e){const t={};for(const n of qe.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ys;)i=i._def.innerType;t[n]=i}return new bt({...this._def,shape:()=>t})}keyof(){return Ov(qe.objectKeys(this.shape))}}bt.create=(r,e)=>new bt({shape:()=>r,unknownKeys:"strip",catchall:ws.create(),typeName:Te.ZodObject,...Me(e)});bt.strictCreate=(r,e)=>new bt({shape:()=>r,unknownKeys:"strict",catchall:ws.create(),typeName:Te.ZodObject,...Me(e)});bt.lazycreate=(r,e)=>new bt({shape:r,unknownKeys:"strip",catchall:ws.create(),typeName:Te.ZodObject,...Me(e)});class no extends Be{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function a(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new wr(l.ctx.common.issues));return xe(t,{code:oe.invalid_union,unionErrors:o}),Ce}if(t.common.async)return Promise.all(n.map(async i=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const d of n){const c={...t,common:{...t.common,issues:[]},parent:null},h=d._parseSync({data:t.data,path:t.path,parent:c});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(d=>new wr(d));return xe(t,{code:oe.invalid_union,unionErrors:l}),Ce}}get options(){return this._def.options}}no.create=(r,e)=>new no({options:r,typeName:Te.ZodUnion,...Me(e)});function Rc(r,e){const t=hs(r),n=hs(e);if(r===e)return{valid:!0,data:r};if(t===ve.object&&n===ve.object){const a=qe.objectKeys(e),i=qe.objectKeys(r).filter(l=>a.indexOf(l)!==-1),o={...r,...e};for(const l of i){const d=Rc(r[l],e[l]);if(!d.valid)return{valid:!1};o[l]=d.data}return{valid:!0,data:o}}else if(t===ve.array&&n===ve.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<r.length;i++){const o=r[i],l=e[i],d=Rc(o,l);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return t===ve.date&&n===ve.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class ao extends Be{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(i,o)=>
vendor: 4,181 bytes, line 604
604{if(Fm(i)||Fm(o))return Ce;const l=Rc(i.value,o.value);return l.valid?((Vm(i)||Vm(o))&&t.dirty(),{status:t.value,value:l.data}):(xe(n,{code:oe.invalid_intersection_types}),Ce)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ao.create=(r,e,t)=>new ao({left:r,right:e,typeName:Te.ZodIntersection,...Me(t)});class Us extends Be{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ve.array)return xe(n,{code:oe.invalid_type,expected:ve.array,received:n.parsedType}),Ce;if(n.data.length<this._def.items.length)return xe(n,{code:oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&n.data.length>this._def.items.length&&(xe(n,{code:oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...n.data].map((o,l)=>{const d=this._def.items[l]||this._def.rest;return d?d._parse(new _s(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>ar.mergeArray(t,o)):ar.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Us({...this._def,rest:e})}}Us.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Us({items:r,typeName:Te.ZodTuple,rest:null,...Me(e)})};class Ym extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ve.map)return xe(n,{code:oe.invalid_type,expected:ve.map,received:n.parsedType}),Ce;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([l,d],c)=>({key:a._parse(new _s(n,l,n.path,[c,"key"])),value:i._parse(new _s(n,d,n.path,[c,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const d of o){const c=await d.key,h=await d.value;if(c.status==="aborted"||h.status==="aborted")return Ce;(c.status==="dirty"||h.status==="dirty")&&t.dirty(),l.set(c.value,h.value)}return{status:t.value,value:l}})}else{const l=new Map;for(const d of o){const c=d.key,h=d.value;if(c.status==="aborted"||h.status==="aborted")return Ce;(c.status==="dirty"||h.status==="dirty")&&t.dirty(),l.set(c.value,h.value)}return{status:t.value,value:l}}}}Ym.create=(r,e,t)=>new Ym({valueType:e,keyType:r,typeName:Te.ZodMap,...Me(t)});class Ta extends Be{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ve.set)return xe(n,{code:oe.invalid_type,expected:ve.set,received:n.parsedType}),Ce;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(xe(n,{code:oe.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(xe(n,{code:oe.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const i=this._def.valueType;function o(d){const c=new Set;for(const h of d){if(h.status==="aborted")return Ce;h.status==="dirty"&&t.dirty(),c.add(h.value)}return{status:t.value,value:c}}const l=[...n.data.values()].map((d,c)=>i._parse(new _s(n,d,n.path,c)));return n.common.async?Promise.all(l).then(d=>o(d)):o(l)}min(e,t){return new Ta({...this._def,minSize:{value:e,message:ye.toString(t)}})}max(e,t){return new Ta({...this._def,maxSize:{value:e,message:ye.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ta.create=(r,e)=>new Ta({valueType:r,minSize:null,maxSize:null,typeName:Te.ZodSet,...Me(e)});class Zm extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Zm.create=(r,e)=>new Zm({getter:r,typeName:Te.ZodLazy,...Me(e)});class Mc extends Be{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return xe(t,{received:t.data,code:oe.invalid_literal,expected:this._def.value}),Ce}
vendor: 9,209 bytes, line 604
604return{status:"valid",value:e.data}}get value(){return this._def.value}}Mc.create=(r,e)=>new Mc({value:r,typeName:Te.ZodLiteral,...Me(e)});function Ov(r,e){return new _n({values:r,typeName:Te.ZodEnum,...Me(e)})}class _n extends Be{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return xe(t,{expected:qe.joinValues(n),received:t.parsedType,code:oe.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return xe(t,{received:t.data,code:oe.invalid_enum_value,options:n}),Ce}return mr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return _n.create(e,{...this._def,...t})}exclude(e,t=this._def){return _n.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}_n.create=Ov;class Jm extends Be{_parse(e){const t=qe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ve.string&&n.parsedType!==ve.number){const a=qe.objectValues(t);return xe(n,{expected:qe.joinValues(a),received:n.parsedType,code:oe.invalid_type}),Ce}if(this._cache||(this._cache=new Set(qe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=qe.objectValues(t);return xe(n,{received:n.data,code:oe.invalid_enum_value,options:a}),Ce}return mr(e.data)}get enum(){return this._def.values}}Jm.create=(r,e)=>new Jm({values:r,typeName:Te.ZodNativeEnum,...Me(e)});class io extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ve.promise&&t.common.async===!1)return xe(t,{code:oe.invalid_type,expected:ve.promise,received:t.parsedType}),Ce;const n=t.parsedType===ve.promise?t.data:Promise.resolve(t.data);return mr(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}io.create=(r,e)=>new io({type:r,typeName:Te.ZodPromise,...Me(e)});class wn extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{xe(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async l=>{if(t.value==="aborted")return Ce;const d=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return d.status==="aborted"?Ce:d.status==="dirty"||t.value==="dirty"?da(d.value):d});{if(t.value==="aborted")return Ce;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?Ce:l.status==="dirty"||t.value==="dirty"?da(l.value):l}}if(a.type==="refinement"){const o=l=>{const d=a.refinement(l,i);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?Ce:(l.status==="dirty"&&t.dirty(),o(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?Ce:(l.status==="dirty"&&t.dirty(),o(l.value).then(()=>({status:t.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!yn(o))return Ce;const l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>yn(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:t.value,value:l})):Ce);qe.assertNever(a)}}wn.create=(r,e,t)=>new wn({schema:r,typeName:Te.ZodEffects,effect:e,...Me(t)});wn.createWithPreprocess=(r,e,t)=>new wn({schema:e,effect:{type:"preprocess",transform:r},typeName:Te.ZodEffects,...Me(t)});class ys extends Be{_parse(e){return this._getType(e)===ve.undefined?mr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ys.create=(r,e)=>new ys({innerType:r,typeName:Te.ZodOptional,...Me(e)});class jn extends Be{_parse(e){return this._getType(e)===ve.null?mr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}jn.create=(r,e)=>new jn({innerType:r,typeName:Te.ZodNullable,...Me(e)});class Oc extends Be{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===ve.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Oc.create=(r,e)=>new Oc({innerType:r,typeName:Te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Me(e)});class Dc extends Be{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ro(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new wr(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new wr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Dc.create=(r,e)=>new Dc({innerType:r,typeName:Te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Me(e)});class Xm extends Be{_parse(e){if(this._getType(e)!==ve.nan){const n=this._getOrReturnCtx(e);return xe(n,{code:oe.invalid_type,expected:ve.nan,received:n.parsedType}),Ce}return{status:"valid",value:e.data}}}Xm.create=r=>new Xm({typeName:Te.ZodNaN,...Me(r)});class YC extends Be{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class lu extends Be{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ce:i.status==="dirty"?(t.dirty(),da(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ce:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new lu({in:e,out:t,typeName:Te.ZodPipeline})}}class Lc extends Be{_parse(e){const t=this._def.innerType._parse(e),n=a=>(yn(a)&&(a.value=Object.freeze(a.value)),a);return ro(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}}Lc.create=(r,e)=>new Lc({innerType:r,typeName:Te.ZodReadonly,...Me(e)});var Te;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(Te||(Te={}));const $c=ps.create,BA=bn.create,qA=Ic.create;ws.create;const WA=Ir.create,ZC=bt.create;no.create;ao.create;Us.create;const GA=Mc.create,YA=_n.create;io.create;ys.create;jn.create;const JC={"gmail.com":{name:"Gmail",url:"https://mail.google.com"},"googlemail.com":{name:"Gmail",url:"https://mail.google.com"},"outlook.com":{name:"Outlook",url:"https://outlook.live.com"},"hotmail.com":{name:"Outlook",url:"https://outlook.live.com"},"live.com":{name:"Outlook",url:"https://outlook.live.com"},"msn.com":{name:"Outlook",url:"https://outlook.live.com"},"yahoo.com":{name:"Yahoo Mail",url:"https://mail.yahoo.com"},"yahoo.co.uk":{name:"Yahoo Mail",url:"https://mail.yahoo.com"},"icloud.com":{name:"iCloud Mail",url:"https://www.icloud.com/mail"},"me.com":{name:"iCloud Mail",url:"https://www.icloud.com/mail"},"mac.com":{name:"iCloud Mail",url:"https://www.icloud.com/mail"},"protonmail.com":{name:"ProtonMail",url:"https://mail.proton.me"},"proton.me":{name:"ProtonMail",url:"https://mail.proton.me"},"zoho.com":{name:"Zoho Mail",url:"https://mail.zoho.com"},"aol.com":{name:"AOL Mail",url:"https://mail.aol.com"}};function Km({email:r,className:e}
604){const t=r.split("@")[1]?.toLowerCase(),n=t?JC[t]:null;if(!n)return null;const a=()=>{window.open(n.url,"_blank","noopener,noreferrer")};return s.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:a,className:e,children:["Open ",n.name,s.jsx(Fs,{className:"w-3.5 h-3.5 ml-1.5"})]})}const XC={signup:{cooldownSeconds:300,friendlyName:"sign up"},resend:{cooldownSeconds:60,friendlyName:"resend verification"},password_reset:{cooldownSeconds:120,friendlyName:"reset password"},login:{cooldownSeconds:60,friendlyName:"sign in"}},Tr="vidacious_rate_limits";function KC(r,e){if(!r)return{isRateLimited:!1,retryAfter:0,reason:"",friendlyMessage:""};const t=r.message||r?.error_description||String(r)||"",n=t.toLowerCase();console.log("[RateLimit] Checking error:",{rawMessage:t,action:e});const a=n.includes("rate")||n.includes("limit")||n.includes("too many")||n.includes("429")||n.includes("exceeded")||n.includes("security purposes")||n.includes("try again")&&n.includes("seconds");if(console.log("[RateLimit] Detection result:",{isRateLimited:a,message:n}),!a)return{isRateLimited:!1,retryAfter:0,reason:"",friendlyMessage:""};let i=Number(XC[e].cooldownSeconds);const o=n.match(/after (\d+) seconds?/i);o&&(i=Number(o[1]));const l=n.match(/(\d+) minutes?/i);l&&(i=Number(l[1])*60);let d="too_many_attempts";n.includes("email")?d="email_rate_limit":n.includes("security")&&(d="security_cooldown");const c=Math.floor(i/60),h=i%60;let m="";c>0&&h>0?m=`${c} minute${c>1?"s":""} and ${h} second${h>1?"s":""}`:c>0?m=`${c} minute${c>1?"s":""}`:m=`${h} second${h>1?"s":""}`;const f=`We're protecting your account. Please try again in ${m}.`;return{isRateLimited:!0,retryAfter:i,reason:d,friendlyMessage:f}}function Dv(r){if(r<=0)return"";const e=Math.floor(r/60),t=r%60;return e>0?t>0?`${e}m ${t}s`:`${e}m`:`${t}s`}function QC(){const[r,e]=u.useState({isRateLimited:!1,retryAfter:0,action:null,attemptCount:0});u.useEffect(()=>{try{const a=localStorage.getItem(Tr);if(a){const i=JSON.parse(a),o=Date.now();for(const[d,c]of Object.entries(i))if(c.cooldownEndsAt>o){const h=Math.ceil((c.cooldownEndsAt-o)/1e3);e({isRateLimited:!0,retryAfter:h,action:d,attemptCount:c.attemptCount});break}const l={};for(const[d,c]of Object.entries(i))c.cooldownEndsAt>o&&(l[d]=c);Object.keys(l).length>0?localStorage.setItem(Tr,JSON.stringify(l)):localStorage.removeItem(Tr)}}catch{}},[]),u.useEffect(()=>{if(r.retryAfter>0){const a=setTimeout(()=>{e(i=>{const o=i.retryAfter-1;if(o<=0){try{localStorage.removeItem(Tr)}catch{}return{isRateLimited:!1,retryAfter:0,action:null,attemptCount:0}}return{...i,retryAfter:o}})},1e3);return()=>clearTimeout(a)}},[r.retryAfter]);const t=u.useCallback((a,i)=>{const o=KC(a,i);if(o.isRateLimited){const l=Date.now()+o.retryAfter*1e3;e(d=>({isRateLimited:!0,retryAfter:o.retryAfter,action:i,attemptCount:d.attemptCount+1}));try{const d=localStorage.getItem(Tr),c=d?JSON.parse(d):{},h=c[i]?.attemptCount||0;c[i]={cooldownEndsAt:l,attemptCount:h+1},localStorage.setItem(Tr,JSON.stringify(c))}catch{}}return o},[]),n=u.useCallback(a=>{e({isRateLimited:!1,retryAfter:0,action:null,attemptCount:0});try{if(a){const i=localStorage.getItem(Tr);if(i){const o=JSON.parse(i);delete o[a],Object.keys(o).length>0?localStorage.setItem(Tr,JSON.stringify(o)):localStorage.removeItem(Tr)}}else localStorage.removeItem(Tr)}catch{}},[]);return{...r,handleRateLimitError:t,clearRateLimit:n,formatCooldownTime:Dv}}function Qm({retryAfter:r,onGoogleSignIn:e,isGoogleLoading:t,className:n}){return s.jsx(ae.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:Y("bg-amber-500/10 border border-amber-500/20 rounded-lg p-4",n),children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"shrink-0 mt-0.5",children:s.jsx(Pn,{className:"w-5 h-5 text-amber-500"})}),s.jsxs("div",{className:"flex-1 space-y-3",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-foreground text-sm flex items-center gap-2",children:s.jsx("span",{children:"Account protection active"})}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"We're protecting your account from unauthorized access. Please wait before trying again."})]}),s.jsxs("div",{className:"flex items-center gap-2 bg-background/50 rounded-md px-3 py-2 w-fit",children:[s.jsx(Ls,{className:"w-4 h-4 text-amber-500"}),s.jsxs("span",{className:"text-sm font-medium",children:["Try again in ",s.jsx("span",{className:"text-amber-500 font-mono",children:Dv(r)})]})]}),e&&s.jsxs("div",{className:"pt-2 border-t border-amber-500/10",children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Can't wait? Use a faster sign-in method:"}),s.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:e,disabled:t,className:"gap-2",children:[s.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",children:[s.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),s.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),s.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),s.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),t?"Redirecting...":"Continue with Google"]})]})]})]})})}async function e3(){try{const e=[navigator.userAgent,navigator.language,`${screen.width}x${screen.height}`,screen.colorDepth?.toString()||"24",new Date().getTimezoneOffset().toString(),(navigator.hardwareConcurrency||0).toString(),(navigator.maxTouchPoints||0).toString(),t3()].join("|"),n=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",
604n);return Array.from(new Uint8Array(a)).map(o=>o.toString(16).padStart(2,"0")).join("")}catch(r){return console.error("[Fingerprint] Failed to generate:",r),`fallback-${crypto.randomUUID()}`}}function t3(){try{const r=document.createElement("canvas"),e=r.getContext("2d");return e?(r.width=200,r.height=50,e.textBaseline="top",e.font="14px Arial",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText("Vidacious",2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText("fingerprint",4,30),r.toDataURL().slice(-50)):"no-canvas"}catch{return"canvas-error"}}const Ur=20,ai={total:0,limit:Ur,offset:0,hasMore:!1};function ZA(){const{user:r}=Ee(),[e,t]=u.useState(null),[n,a]=u.useState(!0),[i,o]=u.useState(!1),l=u.useCallback(async()=>{if(!r){a(!1);return}try{a(!0);const{data:c,error:h}=await W.functions.invoke("partner-actions",{body:{action:"get_profile_only"}});if(h){t(null);return}t(c?.partner||null)}catch{t(null)}finally{a(!1)}},[r]);u.useEffect(()=>{l()},[l]);const d=u.useCallback(async()=>{if(!r||e)return e;try{o(!0);const{data:c,error:h}=await W.functions.invoke("partner-actions",{body:{action:"join_partner_program"}});if(h)throw h;return c?.partner?(t(c.partner),ne.success("Welcome to the Partner Program! ð"),c.partner):null}catch(c){const h=c instanceof Error?c.message:"Failed to join partner program";throw ne.error(h),c}finally{o(!1)}},[r,e]);return{partner:e,loading:n,joining:i,joinProgram:d,refresh:l}}function JA(r={}){const{readOnly:e=!1}=r,{user:t}=Ee(),[n,a]=u.useState(null),[i,o]=u.useState([]),[l,d]=u.useState([]),[c,h]=u.useState([]),[m,f]=u.useState([]),[p,v]=u.useState(null),[x,g]=u.useState(!0),[b,j]=u.useState(!1),[k,y]=u.useState(!1),[w,S]=u.useState({connected:!1,details_submitted:!1,payouts_enabled:!1}),[N,_]=u.useState(ai),[C,O]=u.useState(ai),[R,M]=u.useState(ai),[L,A]=u.useState(ai),V=u.useCallback(async(T,z={})=>{const{data:q,error:ce}=await W.functions.invoke("partner-actions",{body:{action:T,...z}});if(ce){const pe=ce.message||"";throw ce.name==="FunctionsHttpError"||pe.includes("401")||pe.includes("Unauthorized")||pe.includes("non-2xx")?new Error("SESSION_EXPIRED"):new Error(pe)}if(!q.success)throw new Error(q.error||"Action failed");return q},[]),G=u.useCallback(async()=>{if(!t){g(!1);return}try{g(!0);const z=await V("get_profile_only");if(a(z.partner),!z.partner&&e){g(!1);return}if(z.partner){const Ae=await V("get_stats",{referralsLimit:Ur,referralsOffset:0,commissionsLimit:Ur,commissionsOffset:0,payoutsLimit:Ur,payoutsOffset:0,creditRewardsLimit:Ur,creditRewardsOffset:0});if(o(Ae.referrals||[]),d(Ae.commissions||[]),h(Ae.payouts||[]),f(Ae.creditRewards||[]),v(Ae.ambassadorApplication||null),Ae.pagination){const We=Ae.pagination.referrals||{},He=Ae.pagination.commissions||{},et=Ae.pagination.payouts||{},At=Ae.pagination.creditRewards||{};_({total:We.total||Ae.referrals?.length||0,limit:We.limit||Ur,offset:We.offset||0,hasMore:(We.offset||0)+(Ae.referrals?.length||0)<(We.total||0)}),O({total:He.total||Ae.commissions?.length||0,limit:He.limit||Ur,offset:He.offset||0,hasMore:(He.offset||0)+(Ae.commissions?.length||0)<(He.total||0)}),M({total:et.total||Ae.payouts?.length||0,limit:et.limit||Ur,offset:et.offset||0,hasMore:(et.offset||0)+(Ae.payouts?.length||0)<(et.total||0)}),A({total:At.total||Ae.creditRewards?.length||0,limit:At.limit||Ur,offset:At.offset||0,hasMore:(At.offset||0)+(Ae.creditRewards?.length||0)<(At.total||0)})}if(z.partner?.reward_type==="cash"||z.partner?.stripe_connect_id){const We=await V("check_account_status");S({connected:We.connected,details_submitted:We.details_submitted,payouts_enabled:We.payouts_enabled})}}}catch(T){(T instanceof Error?T.message:"")==="SESSION_EXPIRED"?a(null):console.error("Error fetching partner data:",T)}finally{g(!1)}},[t,V,e]);u.useEffect(()=>{G()},[G]);const se=u.useCallback(async()=>{if(!t||n)return n;try{y(!0);const T=await V("join_partner_program");return T?.partner?(a(T.partner),ne.success("Welcome to the Partner Program! ð"),await G(),T.partner):null}catch(T){const z=T instanceof Error?T.message:"Failed to join partner program";throw ne.error(z),T}finally{y(!1)}},[t,n,V,G]),re=u.useCallback(async()=>{try{const T=await V("create_connect_account");return T.url&&window.open(T.url,"_blank"),T}catch(T){const z=T instanceof Error?T.message:"Failed to set up Stripe";throw ne.error(z),T}},[V]),Z=u.useCallback(async T=>{try{await V("toggle_reward_type",{reward_type:T}),ne.success(`Switched to ${T==="credits"?"credit rewards":"cash commissions"}`),await G()}catch(z){const q=z instanceof Error?z.message:"Failed to switch reward type";throw ne.error(q),z}},[V,G]),P=u.useCallback(async()=>{try{const T=await V("request_payout");return ne.success("Payout initiated successfully!"),await G(),T}catch(T){const z=T instanceof Error?T.message:"Failed to request payout";throw ne.error(z),T}},[V,G]),E=u.useCallback(async T=>{try{const z=await V("submit_ambassador_application",T);return ne.success("Ambassador application submitted! We'll review it soon."),await G(),z}catch(z){const q=z instanceof Error?z.message:"Failed to submit application";throw ne.error(q),z}},[V,G]),U=u.useCallback((T="/")=>n?.referral_code?`https://vidacious.ai${T}?ref=${n.referral_code}`:"",[n?.referral_code]),J=u.useCallback(async()=>
604{if(!(!N.hasMore||b)){j(!0);try{const T=N.offset+N.limit,z=await V("get_stats",{referralsLimit:N.limit,referralsOffset:T,commissionsLimit:0,commissionsOffset:0,payoutsLimit:0,payoutsOffset:0,creditRewardsLimit:0,creditRewardsOffset:0});if(z?.referrals?.length>0){o(ce=>[...ce,...z.referrals]);const q=z.pagination?.referrals||{};_({total:q.total||N.total,limit:N.limit,offset:T,hasMore:T+z.referrals.length<(q.total||N.total)})}else _(q=>({...q,hasMore:!1}))}catch(T){console.error("Error loading more referrals:",T)}finally{j(!1)}}},[N,b,V]),te=u.useCallback(async()=>{if(!(!C.hasMore||b)){j(!0);try{const T=C.offset+C.limit,z=await V("get_stats",{referralsLimit:0,referralsOffset:0,commissionsLimit:C.limit,commissionsOffset:T,payoutsLimit:0,payoutsOffset:0,creditRewardsLimit:0,creditRewardsOffset:0});if(z?.commissions?.length>0){d(ce=>[...ce,...z.commissions]);const q=z.pagination?.commissions||{};O({total:q.total||C.total,limit:C.limit,offset:T,hasMore:T+z.commissions.length<(q.total||C.total)})}else O(q=>({...q,hasMore:!1}))}catch(T){console.error("Error loading more commissions:",T)}finally{j(!1)}}},[C,b,V]),D=u.useCallback(async()=>{if(!(!R.hasMore||b)){j(!0);try{const T=R.offset+R.limit,z=await V("get_stats",{referralsLimit:0,referralsOffset:0,commissionsLimit:0,commissionsOffset:0,payoutsLimit:R.limit,payoutsOffset:T,creditRewardsLimit:0,creditRewardsOffset:0});if(z?.payouts?.length>0){h(ce=>[...ce,...z.payouts]);const q=z.pagination?.payouts||{};M({total:q.total||R.total,limit:R.limit,offset:T,hasMore:T+z.payouts.length<(q.total||R.total)})}else M(q=>({...q,hasMore:!1}))}catch(T){console.error("Error loading more payouts:",T)}finally{j(!1)}}},[R,b,V]),ee=u.useCallback(async()=>{if(!(!L.hasMore||b)){j(!0);try{const T=L.offset+L.limit,z=await V("get_stats",{referralsLimit:0,referralsOffset:0,commissionsLimit:0,commissionsOffset:0,payoutsLimit:0,payoutsOffset:0,creditRewardsLimit:L.limit,creditRewardsOffset:T});if(z?.creditRewards?.length>0){f(ce=>[...ce,...z.creditRewards]);const q=z.pagination?.creditRewards||{};A({total:q.total||L.total,limit:L.limit,offset:T,hasMore:T+z.creditRewards.length<(q.total||L.total)})}else A(q=>({...q,hasMore:!1}))}catch(T){console.error("Error loading more credit rewards:",T)}finally{j(!1)}}},[L,b,V]);return{partner:n,referrals:i,commissions:l,payouts:c,creditRewards:m,ambassadorApplication:p,loading:x,loadingMore:b,joining:k,connectStatus:w,joinProgram:se,setupStripeConnect:re,toggleRewardType:Z,requestPayout:P,submitAmbassadorApplication:E,getReferralLink:U,refresh:G,referralsPagination:N,commissionsPagination:C,payoutsPagination:R,creditRewardsPagination:L,loadMoreReferrals:J,loadMoreCommissions:te,loadMorePayouts:D,loadMoreCreditRewards:ee}}function ep(){if(typeof window>"u")return null;const r=localStorage.getItem("vidacious_referral_code"),e=localStorage.getItem("vidacious_referral_expiry");return!r||!e?null:new Date(e)<new Date?(localStorage.removeItem("vidacious_referral_code"),localStorage.removeItem("vidacious_referral_expiry"),null):r}function r3({referralCode:r}){return s.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-primary/10 border border-primary/20 mb-4",children:[s.jsx("div",{className:"p-1.5 rounded-full bg-primary/20",children:s.jsx(fo,{className:"h-4 w-4 text-primary"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"text-sm font-medium text-primary",children:"You've been invited!"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Get +5 bonus credits when you sign up"})]})]})}const tp=(r,e)=>Promise.race([r,new Promise((t,n)=>setTimeout(()=>n(new Error("Request timed out. Please check your connection and try again.")),e))]),s3=ZC({email:$c().email("Please enter a valid email address"),password:$c().min(6,"Password must be at least 6 characters")}),n3=r=>{const e={length:r.length>=8,lowercase:/[a-z]/.test(r),uppercase:/[A-Z]/.test(r),number:/[0-9]/.test(r),special:/[^a-zA-Z0-9]/.test(r)},t=Object.values(e).filter(Boolean).length;let n,a;return t<=1?(n="Weak",a="bg-destructive"):t<=2?(n="Fair",a="bg-orange-500"):t<=3?(n="Good",a="bg-yellow-500"):(n="Strong",a="bg-green-500"),{checks:e,score:t,label:n,color:a}};function Lv(){const[r]=Tn(),e=r.get("creator")==="true",t=r.get("context")==="developer",n=r.get("mode")==="reset"||r.get("mode")==="reset-password",a=r.get("token"),i=r.get("mode")!=="signup",o=r.get("verified")==="1",l=r.get("ref"),d=!!l,c=n&&!!a;console.log("[Auth] Mounting with URL params:",{mode:r.get("mode"),token:a?`${a.substring(0,8)}...`:null,isResetMode:n,hasToken:!!a,isUrlPasswordReset:c});const[h,m]=u.useState(i),[f,p]=u.useState(!1),[v,x]=u.useState(c),[g,b]=u.useState(!1),[j,k]=u.useState(!1),[y,w]=u.useState(null),[S,N]=u.useState(!1),[_,C]=u.useState(!1),[O,R]=u.useState(""),[M,L]=u.useState(""),[A,V]=u.useState(""),[G,se]=u.useState(""),[re,Z]=u.useState(""),[P,E]=u.useState(!1),[U,J]=u.useState(!1),[te,D]=u.useState(!1),[ee,T]=u.useState(!1),[z,q]=u.useState(!1),[ce,pe]=u.useState(!0),[ke,de]=u.useState(!1),[_e,$e]=u.useState({}),[st,Ae]=u.useState(!1),{isRateLimited:We,retryAfter:He,handleRateLimitError:et,clearRateLimit:At,formatCooldownTime:Kt}=QC(),{signIn:qt,signUp:Dr,user:Nr,isLoading:xt,resendVerificationEmail
604:Vt}=Ee(),Qt=Xt();u.useEffect(()=>{const K=r.get("code");if(!K)return;let X=!1;return(async()=>{D(!0);try{const{error:ue}=await W.auth.exchangeCodeForSession(K);if(ue)throw ue;ne.success("Email verified! Redirectingâ¦")}catch(ue){console.error("Failed to exchange verification code for session:",ue),ne.error("Verification link is invalid or expired. Please request a new one."),b(!0)}finally{X||D(!1)}})(),()=>{X=!0}},[r]),u.useEffect(()=>{o&&ne.info("If you verified via email, please sign in to continue.")},[o]),u.useEffect(()=>{c&&(console.log("[Auth] Forcing password reset mode from URL params"),x(!0),p(!1))},[c]),u.useEffect(()=>{const K=()=>{console.log("[Auth] Password recovery ready - switching to reset mode"),x(!0),p(!1),se(""),Z(""),ne.info("You can now set a new password.")};return window.addEventListener("password_recovery_ready",K),()=>window.removeEventListener("password_recovery_ready",K)},[]);const Ge=u.useMemo(()=>n3(G),[G]),er=r.get("redirect"),Tt=r.get("plan"),tr=r.get("interval"),Wt=r.get("pack"),pr=u.useMemo(()=>{const K=sessionStorage.getItem("invite_redirect");if(K&&(sessionStorage.removeItem("invite_redirect"),K.startsWith("/")&&!K.startsWith("//")))return K;const X=sessionStorage.getItem("google_auth_redirect");if(X&&(sessionStorage.removeItem("google_auth_redirect"),X.startsWith("/")&&!X.startsWith("//")))return X;if(!er)return null;const ue=er.trim();if(!ue.startsWith("/")||ue.startsWith("//"))return null;let we=ue;const ze=new URLSearchParams;Tt&&ze.set("plan",Tt),tr&&ze.set("interval",tr),Wt&&ze.set("pack",Wt);const Pt=ze.toString();return Pt&&(we+=(ue.includes("?")?"&":"?")+Pt),we},[er,Tt,tr,Wt]),Sr=()=>{if(pr)return pr;if(Tt||Wt){const X=new URLSearchParams;return Tt&&X.set("plan",Tt),tr&&X.set("interval",tr),Wt&&X.set("pack",Wt),`/pricing?${X.toString()}`}return e?h?"/creator-dashboard":"/creator-onboarding":r.get("context")==="developer"?"/console/overview":"/dashboard"};u.useEffect(()=>{if(v||c){console.log("[Auth] In password reset mode - skipping redirect",{isPasswordReset:v,isUrlPasswordReset:c});return}!xt&&Nr&&Qt(Sr(),{replace:!0})},[Nr,xt,Qt,v,c]);const Er=()=>{try{return s3.parse({email:M,password:G}),$e({}),!0}catch(K){if(K instanceof wr){const X={};K.errors.forEach(ue=>{ue.path[0]==="email"&&(X.email=ue.message),ue.path[0]==="password"&&(X.password=ue.message)}),$e(X)}return!1}},Mn=async K=>{if(K.preventDefault(),!!Er()){D(!0);try{if(h){Qa(ce);const{error:X}=await tp(qt(M,G),1e4);if(X){const ue=et(X,"login");if(ue.isRateLimited)ne.error(ue.friendlyMessage);else if(X.message.includes("Invalid login credentials"))ne.error("Invalid email or password. Please try again.");else if(X.message.includes("Email not confirmed"))R(M),b(!0),ne.info("Please verify your email to continue.");else if(X.message.includes("banned")||X.message.includes("User is banned"))try{const{data:we}=await W.functions.invoke("check-deleted-account",{body:{email:M}});we?.is_deleted&&we?.can_recover?(k(!0),w({days_remaining:we.days_remaining}),R(M)):ne.error("This account has been suspended. Please contact support.")}catch{ne.error("This account has been suspended. Please contact support.")}else ne.error(X.message)}else ne.success("Welcome back!"),gc({authMethod:"email",authType:"login"}),Qt(Sr())}else{Qa(ce);const X=r.get("context"),{error:ue}=await tp(Dr(M,G,A.trim()||void 0,l,X),1e4);if(ue){const we=et(ue,"signup");we.isRateLimited?ne.error(we.friendlyMessage):ue.message.includes("already registered")?ne.error("This email is already registered. Please sign in instead."):ne.error(ue.message)}else{At("resend"),gc({authMethod:"email",authType:"signup"});try{const{data:{user:we}}=await W.auth.getUser();if(we){await W.functions.invoke("send-verification-on-signup",{body:{userId:we.id,email:we.email}});const ze=await e3();W.functions.invoke("record-signup-fingerprint",{body:{userId:we.id,referralCode:ep(),fingerprint:ze,userAgent:navigator.userAgent,email:we.email}}).catch(Pt=>console.error("[Auth] Fingerprint recording failed:",Pt))}}catch(we){console.error("Failed to send verification email:",we)}ne.success("Account created! Check your email to unlock your free credits."),Qt(Sr())}}}catch(X){const ue=X instanceof Error&&X.message.includes("timed out")?X.message:"Unable to connect. Please check your internet connection and try again.";ne.error(ue)}finally{D(!1)}}},Ne=async()=>
604{if(He>0||st)return;const K=O||M;if(!K){ne.error("Please enter your email address.");return}Ae(!0);try{const{error:X}=await Vt(K);if(X){const ue=et(X,"resend");ue.isRateLimited?ne.error(ue.friendlyMessage):X.message.includes("already confirmed")||X.message.includes("already verified")?(ne.success("Your email is already verified! You can sign in now."),b(!1),m(!0)):ne.error(X.message)}else ne.success("Verification email sent! Check your inbox and click the link.")}catch{ne.error("Failed to resend email. Please try again.")}finally{Ae(!1)}},Fe=()=>{b(!1),k(!1),w(null),C(!1),R("")},Ye=async()=>{const K=O||M;if(!(!K||S)){N(!0);try{const{data:X,error:ue}=await W.functions.invoke("send-recovery-email",{body:{email:K}});ue?ne.error("Failed to send recovery email. Please try again."):(C(!0),ne.success("Recovery email sent! Check your inbox."))}catch{ne.error("Failed to send recovery email. Please try again.")}finally{N(!1)}}},Ze=async()=>{T(!0);try{if(Qa(ce),Uh(),sessionStorage.setItem("google_auth_redirect",Sr()),cv()){const{data:K,error:X}=await W.auth.signInWithOAuth({provider:"google",options:{redirectTo:window.location.origin,skipBrowserRedirect:!0}});if(X){ne.error(X.message||"Failed to sign in with Google."),T(!1);return}if(K?.url){window.location.href=K.url;return}}else{const K=await lv.auth.signInWithOAuth("google",{redirect_uri:window.location.origin});K?.error&&(ne.error(K.error.message||"Failed to sign in with Google."),T(!1))}}catch{ne.error("Failed to sign in with Google. Please try again."),T(!1)}},Ve=async()=>{q(!0);try{Qa(ce),Uh();const K="com.vidacious.ai.identifier.service",X=`${window.location.origin}/auth/apple-callback`,ue=crypto.randomUUID(),we=crypto.randomUUID();sessionStorage.setItem("apple_auth_state",ue),sessionStorage.setItem("apple_auth_nonce",we),sessionStorage.setItem("apple_auth_redirect",Sr());const ze=new URLSearchParams({client_id:K,redirect_uri:X,response_type:"code id_token",response_mode:"fragment",scope:"openid",state:ue,nonce:we});window.location.href=`https://appleid.apple.com/auth/authorize?${ze.toString()}`}catch(K){console.error("[Auth] Apple sign-in error:",K),ne.error("Failed to sign in with Apple. Please try again."),q(!1)}};u.useEffect(()=>{Nr&&(async()=>{const X=Hj();if(!X)return;const{data:{session:ue}}=await W.auth.getSession();if(ue?.access_token){console.log("[Auth] Updating post-OAuth attribution:",X);try{const{error:we}=await W.functions.invoke("update-user-attribution",{body:{utm_source:X.utm_source,utm_medium:X.utm_medium,utm_campaign:X.utm_campaign,utm_term:X.utm_term,utm_content:X.utm_content,gclid:X.gclid,fbclid:X.fbclid,ttclid:X.ttclid,msclkid:X.msclkid,twclid:X.twclid,li_fat_id:X.li_fat_id,landing_page:X.landing_page,referrer_url:X.referrer_url}});we?console.error("[Auth] Failed to update OAuth attribution:",we):console.log("[Auth] Successfully updated OAuth attribution")}catch(we){console.error("[Auth] Error updating OAuth attribution:",we)}finally{Uj()}}})()},[Nr]);const ct=async K=>{K.preventDefault();try{$c().email("Please enter a valid email address").parse(M),$e({})}catch(X){X instanceof wr&&$e({email:X.errors[0].message});return}D(!0);try{const{data:X,error:ue}=await W.functions.invoke("request-password-reset",{body:{email:M}});if(ue){const we=et(ue,"password_reset");we.isRateLimited?ne.error(we.friendlyMessage):ne.error(ue.message)}else X?.error?ne.error(X.error):(ne.success("Password reset email sent! Check your inbox."),p(!1))}catch{ne.error("Failed to send reset email. Please try again.")}finally{D(!1)}},jt=async K=>{if(K.preventDefault(),G.length<8){$e({password:"Password must be at least 8 characters"});return}if(G!==re){$e({confirmPassword:"Passwords do not match"});return}if(!a){ne.error("Invalid reset link. Please request a new one.");return}$e({}),D(!0);try{const{data:X,error:ue}=await W.functions.invoke("verify-reset-token",{body:{token:a,newPassword:G}});if(ue){let we="Failed to update password. Please try again.";try{if(ue.context&&typeof ue.context.json=="function"){const ze=await ue.context.json();ze?.error&&(we=ze.error)}}catch{ue.message?.includes("non-2")&&(we="This reset link has already been used or expired. Please request a new one.")}ne.error(we)}else if(X?.error)ne.error(X.error);else if(X?.success){if(X.email){const{error:we}=await qt(X.email,G);we?(ne.success("Password updated! Please sign in with your new password."),Qt("/auth?mode=login",{replace:!0})):(ne.success("Password updated successfully! Welcome back."),Qt("/dashboard",{replace:!0}))}else ne.success("Password updated successfully! You can now sign in."),Qt("/auth?mode=login",{replace:!0});x(!1),se(""),Z("")}}catch{ne.error("Failed to update password. Please try again.")}finally{D(!1)}};return xt?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-primary border-t-transparent roun
604ded-full"})}):s.jsxs(s.Fragment,{children:[s.jsx(Hs,{title:"Sign In",description:"Sign in to Vidacious to create AI-powered UGC video ads. Access your dashboard, manage campaigns, and generate professional videos.",url:"https://vidacious.ai/auth",noIndex:!0}),s.jsxs("div",{className:"min-h-screen bg-background flex",children:[s.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:s.jsxs(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"w-full max-w-md",children:[s.jsxs(be,{to:"/",className:"flex items-center gap-2 mb-8",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-r from-primary to-accent flex items-center justify-center",children:s.jsx(Dt,{className:"w-6 h-6 text-primary-foreground"})}),s.jsx("span",{className:"text-xl font-bold font-display",children:"Vidacious"})]}),s.jsxs(es,{variant:"elevated",children:[s.jsxs(to,{children:[e&&s.jsxs("div",{className:"flex items-center gap-2 text-primary mb-2",children:[s.jsx(Bt,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Creator Program"})]}),t&&!e&&s.jsxs("div",{className:"flex items-center gap-2 text-primary mb-2",children:[s.jsx(k1,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Developer API Access"})]}),s.jsx(ds,{className:"text-2xl",children:j?"Account Deleted":g?"Check your email":v?"Set new password":f?"Reset your password":h?"Welcome back":e?"Join the Creator Program":"Create your account"}),s.jsx(us,{children:j?"Your account was recently deleted but can still be recovered":g?`We sent a verification link to ${O||M}`:v?"Choose a strong password for your account":f?"Enter your email and we'll send you a reset link":h?e?"Sign in to access your creator dashboard":t?"Sign in to access the Developer Console":"Sign in to continue creating video ads that convert":e?"Start earning passive income with your likeness":t?"Create an account to get your API key and start building":"Paste a script or URL. Get video ads in minutes."})]}),s.jsxs(Lo,{children:[!h&&!g&&!v&&!f&&d&&s.jsx(r3,{referralCode:l||ep()||""}),j?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-full bg-orange-500/10 flex items-center justify-center",children:s.jsx(on,{className:"w-8 h-8 text-orange-500"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"This account was deleted"}),s.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm",children:["The account for ",s.jsx("span",{className:"font-medium text-foreground",children:O||M})," was recently deleted.",y?.days_remaining&&s.jsxs(s.Fragment,{children:[" You have ",s.jsxs("span",{className:"font-medium text-foreground",children:[y.days_remaining," days"]})," to recover it before it's permanently removed."]})]})]})]}),_?s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-3",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Ue,{className:"w-5 h-5 text-green-500 flex-shrink-0 mt-0.5"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Recovery email sent! Check your inbox for a link to restore your account."})]})}),s.jsx(Km,{email:O||M})]}):s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"We can send a recovery link to your email to restore your account, including all your credits and video history."}),s.jsx(ie,{onClick:Ye,disabled:S,className:"w-full",children:S?s.jsxs(s.Fragment,{children:[s.jsx(on,{className:"w-4 h-4 mr-2 animate-spin"})," Sendingâ¦"]}):s.jsxs(s.Fragment,{children:[s.jsx(Ds,{className:"w-4 h-4 mr-2"})," Send Recovery Email"]})})]}),s.jsx("div",{className:"pt-4 border-t",children:s.jsxs("button",{type:"button",onClick:Fe,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(_i,{className:"w-4 h-4"}),"Back to sign in"]})})]}):g?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx(Ds,{className:"w-8 h-8 text-primary"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Click the link in your email"}),s.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm",children:["We sent a verification link to ",s.jsx("span",{className:"font-medium text-foreground",children:O||M})]})]})]}),s.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-6 h-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:s.jsx("span",{className:"text-xs font-bold text-primary",children:"1"})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Open your email inbox"})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-6 h-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:s.jsx("span",{className:"text-xs font-bold text-primary",children:"2"})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Find the email from Vidacious (check spam if needed)"})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-6 h-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:s.jsx("span",{className:"text-xs font-bold text-primary",children:"3"})}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Click the ",s.jsx("strong",{children:'"Verify Email"'})," button"]})]})]}),s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsx(Km,{email:O||M}),We&&He>0&&s.jsx(Qm,{retryAfter:He,onGoogleSignIn:Ze,isGoogleLoading:ee}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Didn't receive it?"}),s.jsx("button",{type:"button",onClick:Ne,disabled:He>0||st,className:"text-primary hover:underline font-medium disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-1",children:st?s.jsx(on,{className:"w-3 h-3 animate-spin"}):He>0?`Resend in ${Kt(He)}`:"Resend email"})]})]}),s.jsx("div",{className:"pt-4 border-t",children:s.jsxs("button",{type:"button",onClick:Fe,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(_i,{className:"w-4 h-4"}),"Use a different email"]})})]}):v?s.jsxs("form",{id:"vid_password_update",name:"Password Update",onSubmit:jt,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"New Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(hi,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),s.jsx(Gr,{type:P?"text":"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",className:"pl-10 pr-10",value:G,onChange:K=>se(K.target.value),"data-clarity-mask":"true"}),s.jsx("button",{type:"button",onClick:()=>E(!P),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:P?s.jsx(Go,{className:"w-5 h-5"}):s.jsx(ui,{className:"w-5 h-5"})})]}),_e.password&&s.jsx("p",{className:"text-sm text-destructive",children:_e.password}),G&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:`h-full transition-all duration-300 ${Ge.color}`,style:{width:`${Ge.score/5*100}%`}})}),s.jsx("span",{className:"text-xs text-muted-foreground",children:Ge.label})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-1 text-xs",children:[s.jsxs("div",{className:`flex items-center gap-1 ${Ge.checks.length?"text-green-500":"text-muted-foreground"}`,children:[Ge.checks.length?s.jsx(Ue,{className:"w-3 h-3"}):s.jsx(lt,{className:"w-3 h-3"}),"8+ characters"]}),s.jsxs("div",{className:`flex items-center gap-1 ${Ge.checks.uppercase?"text-green-500":"text-muted-foreground"}`,children:[Ge.checks.uppercase?s.jsx(Ue,{className:"w-3 h-3"}):s.jsx(lt,{className:"w-3 h-3"}),"Uppercase"]}),s.jsxs("div",{className:`flex items-center gap-1 ${Ge.checks.number?"text-green-500":"text-muted-foreground"}`,children:[Ge.checks.number?s.jsx(Ue,{className:"w-3 h-3"}):s.jsx(lt,{className:"w-3 h-3"}),"Number"]}),s.jsxs("div",{className:`flex items-center gap-1 ${Ge.checks.special?"text-green-500":"text-muted-foreground"}`,children:[Ge.checks.special?s.jsx(Ue,{className:"w-3 h-3"}):s.jsx(lt,{className:"w-3 h-3"}),"Special char"]})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Confirm Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(hi,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),s.jsx(Gr,{type:U?"text":"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",className:"pl-10 pr-10",value:re,onChange:K=>Z(K.target.value),"data-clarity-mask":"true"}),s.jsx("button",{type:"button",onClick:()=>J(!U),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:U?s.jsx(Go,{className:"w-5 h-5"}):s.jsx(ui,{className:"w-5 h-5"})})]}),_e.confirmPassword&&s.jsx("p",{className:"text-sm text-destructive",children:_e.confirmPassword})]}),s.jsx(ie,{type:"submit",variant:"hero",className:"w-full",disabled:te||!G||!re,children:te?s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-primary-foreground border-t-transparent roun
604ded-full"}):s.jsxs(s.Fragment,{children:["Update Password",s.jsx(nr,{className:"w-4 h-4"})]})})]}):f?s.jsxs("form",{id:"vid_forgot_password_form",name:"Forgot Password",onSubmit:ct,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(Ds,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),s.jsx(Gr,{type:"email",placeholder:"[email protected]",className:"pl-10",value:M,onChange:K=>L(K.target.value)})]}),_e.email&&s.jsx("p",{className:"text-sm text-destructive",children:_e.email})]}),s.jsx(ie,{type:"submit",variant:"hero",className:"w-full",disabled:te,children:te?s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-primary-foreground border-t-transparent rounded-full"}):s.jsxs(s.Fragment,{children:["Send Reset Link",s.jsx(nr,{className:"w-4 h-4"})]})}),s.jsx("div",{className:"text-center",children:s.jsx("button",{type:"button",onClick:()=>{p(!1),$e({})},className:"text-sm text-primary hover:underline font-medium",children:"Back to sign in"})})]}):s.jsxs("form",{id:h?"vid_login_form":"vid_signup_form",name:h?"Login":"Sign Up",onSubmit:Mn,className:"space-y-4",children:[!h&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"First Name"}),s.jsxs("div",{className:"relative",children:[s.jsx(go,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),s.jsx(Gr,{type:"text",placeholder:"Your first name",className:"pl-10",value:A,onChange:K=>V(K.target.value),autoComplete:"given-name"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"So we can personalize your experience"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(Ds,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),s.jsx(Gr,{type:"email",placeholder:"[email protected]",className:"pl-10",value:M,onChange:K=>L(K.target.value)})]}),_e.email&&s.jsx("p",{className:"text-sm text-destructive",children:_e.email})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-sm font-medium",children:"Password"}),h&&s.jsx("button",{type:"button",onClick:()=>{p(!0),$e({})},className:"text-xs text-primary hover:underline",children:"Forgot password?"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(hi,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),s.jsx(Gr,{type:P?"text":"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",className:"pl-10 pr-10",value:G,onChange:K=>se(K.target.value),"data-clarity-mask":"true"}),s.jsx("button",{type:"button",onClick:()=>E(!P),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:P?s.jsx(Go,{className:"w-5 h-5"}):s.jsx(ui,{className:"w-5 h-5"})})]}),_e.password&&s.jsx("p",{className:"text-sm text-destructive",children:_e.password}),!h&&G&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:`h-full transition-all duration-300 ${Ge.color}`,style:{width:`${Ge.score/5*100}%`}})}),s.jsx("span",{className:"text-xs text-muted-foreground",children:Ge.label})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-1 text-xs",children:[s.jsxs("div",{className:`flex items-center gap-1 ${Ge.checks.length?"text-green-500":"text-muted-foreground"}`,children:[Ge.checks.length?s.jsx(Ue,{className:"w-3 h-3"}):s.jsx(lt,{className:"w-3 h-3"}),"8+ characters"]}),s.jsxs("div",{className:`flex items-center gap-1 ${Ge.checks.uppercase?"text-green-500":"text-muted-foreground"}`,children:[Ge.checks.uppercase?s.jsx(Ue,{className:"w-3 h-3"}):s.jsx(lt,{className:"w-3 h-3"}),"Uppercase"]}),s.jsxs("div",{className:`flex items-center gap-1 ${Ge.checks.number?"text-green-500":"text-muted-foreground"}`,children:[Ge.checks.number?s.jsx(Ue,{className:"w-3 h-3"}):s.jsx(lt,{className:"w-3 h-3"}),"Number"]}),s.jsxs("div",{className:`flex items-center gap-1 ${Ge.checks.special?"text-green-500":"text-muted-foreground"}`,children:[Ge.checks.special?s.jsx(Ue,{className:"w-3 h-3"}):s.jsx(lt,{className:"w-3 h-3"}),"Special char"]})]})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Pc,{id:"remember-me",checked:ce,onCheckedChange:K=>pe(K===!0)}),s.jsx("label",{htmlFor:"remember-me",className:"text-sm text-muted-foreground cursor-pointer select-none",children:"Remember me"})]}),!h&&s.jsxs("div",{className:"flex items-start space-x-2",children:[s.jsx(Pc,{id:"agree-terms",checked:ke,onCheckedChange:K=>de(K===!0),className:"mt-0.5"}),s.jsxs("label",{htmlFor:"agree-terms",className:"text-sm text-muted-foreground cursor-pointer select-none leading-relaxed",children:["I agree to the"," ",s.jsx("a",{href:"/terms",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 hover:underline transition-colors",children:"Terms of Service"})," ","and"," ",s.jsx("a",{href:"/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 hover:underline transition-colors",children:"Privacy Policy"})]})]}),We&&He>0&&s.jsx(Qm,{retryAfter:He,onGoogleSignIn:Ze,isGoogleLoading:ee}),s.jsx(ie,{type:"submit",variant:"hero",className:"w-full",disabled:te||We&&He>0||!h&&!ke,children:te?s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-primary-foreground border-t-transparent roun
604ded-full"}):We&&He>0?s.jsxs(s.Fragment,{children:["Try again in ",Kt(He)]}):s.jsxs(s.Fragment,{children:[h?"Sign In":"Create Account",s.jsx(nr,{className:"w-4 h-4"})]})}),s.jsxs("div",{className:"relative my-4",children:[s.jsx("div",{className:"absolute inset-0 flex items-center",children:s.jsx("span",{className:"w-full border-t border-border"})}),s.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:s.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"Or continue with"})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(ie,{type:"button",variant:"outline",className:"w-full",onClick:Ze,disabled:ee||z,children:ee?s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-foreground border-t-transparent rounded-full"}):s.jsxs(s.Fragment,{children:[s.jsxs("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",children:[s.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),s.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),s.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),s.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Google"]})}),s.jsx(ie,{type:"button",variant:"outline",className:"w-full",onClick:Ve,disabled:z||ee,children:z?s.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-foreground border-t-transparent rounded-full"}):s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}),"Apple"]})})]})]}),!f&&!g&&!v&&s.jsx("div",{className:"mt-6 text-center",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:[h?"Don't have an account?":"Already have an account?"," ",s.jsx("button",{onClick:()=>{m(!h),$e({})},className:"text-primary hover:underline font-medium",children:h?"Sign up":"Sign in"})]})})]})]})]})}),s.jsx("div",{className:"hidden lg:flex flex-1 bg-gradient-to-br from-primary/20 via-background to-accent/20 items-center justify-center p-12",children:s.jsxs(ae.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.2},className:"text-center",children:[s.jsx("div",{className:"w-32 h-32 rounded-3xl bg-gradient-to-r from-primary to-accent mx-auto mb-8 flex items-center justify-center shadow-glow",children:s.jsx(Dt,{className:"w-16 h-16 text-primary-foreground"})}),s.jsx("h2",{className:"text-3xl font-bold font-display mb-4",children:g?"Almost there!":"AI Video Ads That Convert."}),s.jsx("p",{className:"text-muted-foreground max-w-md",children:g?"Just one more step to verify your email and unlock your account.":"Paste a script or URL. Get scroll-stopping video ads. Scale what converts."})]})})]})]})}const a3=Object.freeze(Object.defineProperty({__proto__:null,default:Lv},Symbol.toStringTag,{value:"Module"}));var $v="AlertDialog",[i3]=js($v,[Op]),ts=Op(),Fv=r=>{const{__scopeAlertDialog:e,...t}=r,n=ts(e);return s.jsx(co,{...n,...t,modal:!0})};Fv.displayName=$v;var o3="AlertDialogTrigger",Vv=u.forwardRef((r,e)=>{const{__scopeAlertDialog:t,...n}=r,a=ts(t);return s.jsx(uo,{...a,...n,ref:e})});Vv.displayName=o3;var l3="AlertDialogPortal",zv=r=>{const{__scopeAlertDialog:e,...t}=r,n=ts(e);return s.jsx(lo,{...n,...t})};zv.displayName=l3;var c3="AlertDialogOverlay",Hv=u.forwardRef((r,e)=>{const{__scopeAlertDialog:t,...n}=r,a=ts(t);return s.jsx(Nn,{...a,...n,ref:e})});Hv.displayName=c3;
604var hn="AlertDialogContent",[d3,u3]=i3(hn),h3=Ey("AlertDialogContent"),Uv=u.forwardRef((r,e)=>{const{__scopeAlertDialog:t,children:n,...a}=r,i=ts(t),o=u.useRef(null),l=Ft(e,o),d=u.useRef(null);return s.jsx(Sy,{contentName:hn,titleName:Bv,docsSlug:"alert-dialog",children:s.jsx(d3,{scope:t,cancelRef:d,children:s.jsxs(Sn,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:mt(a.onOpenAutoFocus,c=>{c.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[s.jsx(h3,{children:n}),s.jsx(p3,{contentRef:o})]})})})});Uv.displayName=hn;var Bv="AlertDialogTitle",qv=u.forwardRef((r,e)=>{const{__scopeAlertDialog:t,...n}=r,a=ts(t);return s.jsx(En,{...a,...n,ref:e})});qv.displayName=Bv;var Wv="AlertDialogDescription",Gv=u.forwardRef((r,e)=>{const{__scopeAlertDialog:t,...n}=r,a=ts(t);return s.jsx(Cn,{...a,...n,ref:e})});Gv.displayName=Wv;var m3="AlertDialogAction",Yv=u.forwardRef((r,e)=>{const{__scopeAlertDialog:t,...n}=r,a=ts(t);return s.jsx(Pa,{...a,...n,ref:e})});Yv.displayName=m3;var Zv="AlertDialogCancel",Jv=u.forwardRef((r,e)=>{const{__scopeAlertDialog:t,...n}=r,{cancelRef:a}=u3(Zv,t),i=ts(t),o=Ft(e,a);return s.jsx(Pa,{...i,...n,ref:o})});Jv.displayName=Zv;var p3=({contentRef:r})=>{const e=`\`${hn}\` requires a description for the component to be accessible for screen reader users. 605 606You can add a description to the \`${hn}\` by passing a \`${Wv}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 607 608Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${hn}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 609 610For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return u.useEffect(()=>{document.getElementById(r.current?.getAttribute("aria-describedby"))||console.warn(e)},[e,r]),null},f3=Fv,g3=Vv,x3=zv,Xv=Hv,Kv=Uv,Qv=Yv,ey=Jv,ty=qv,ry=Gv;const sy=f3,XA=g3,v3=x3,ny=u.forwardRef(({className:r,...e},t)=>s.jsx(Xv,{className:Y("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",r),...e,ref:t}));ny.displayName=Xv.displayName;const cu=u.forwardRef(({className:r,...e},t)=>s.jsxs(v3,{children:[s.jsx(ny,{}),s.jsx(Kv,{ref:t,className:Y("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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...e})]}));cu.displayName=Kv.displayName;const du=({className:r,...e})=>s.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",r),...e});du.displayName="AlertDialogHeader";const uu=({className:r,...e})=>s.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...e});uu.displayName="AlertDialogFooter";const hu=u.forwardRef(({className:r,...e},t)=>s.jsx(ty,{ref:t,className:Y("text-lg font-semibold",r),...e}));hu.displayName=ty.displayName;const mu=u.forwardRef(({className:r,...e},t)=>s.jsx(ry,{ref:t,className:Y("text-sm text-muted-foreground",r),...e}));mu.displayName=ry.displayName;const pu=u.forwardRef(({className:r,...e},t)=>s.jsx(Qv,{ref:t,className:Y(vd(),r),...e}));pu.displayName=Qv.displayName;const fu=u.forwardRef(({className:r,...e},t)=>s.jsx(ey,{ref:t,className:Y(vd({variant:"outline"}),"mt-2 sm:mt-0",r),...e}));fu.displayName=ey.displayName;const rp=Cy,sp=Ty,Fc=u.forwardRef(({className:r,children:e,...t},n)=>s.jsxs(Dp,{ref:n,className:Y("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
610ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...t,children:[e,s.jsx(Py,{asChild:!0,children:s.jsx(Rr,{className:"h-4 w-4 opacity-50"})})]}));Fc.displayName=Dp.displayName;const ay=u.forwardRef(({className:r,...e},t)=>s.jsx(Fp,{ref:t,className:Y("flex cursor-default items-center justify-center py-1",r),...e,children:s.jsx(wf,{className:"h-4 w-4"})}));ay.displayName=Fp.displayName;const iy=u.forwardRef(({className:r,...e},t)=>s.jsx(Vp,{ref:t,className:Y("flex cursor-default items-center justify-center py-1",r),...e,children:s.jsx(Rr,{className:"h-4 w-4"})}));iy.displayName=Vp.displayName;const Vc=u.forwardRef(({className:r,children:e,position:t="popper",...n},a)=>s.jsx(Ay,{children:s.jsxs(Lp,{ref:a,className:Y("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md 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",t==="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",r),position:t,...n,children:[s.jsx(ay,{}),s.jsx(Iy,{className:Y("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),s.jsx(iy,{})]})}));Vc.displayName=Lp.displayName;const y3=u.forwardRef(({className:r,...e},t)=>s.jsx(zp,{ref:t,className:Y("py-1.5 pl-8 pr-2 text-sm font-semibold",r),...e}));y3.displayName=zp.displayName;const zc=u.forwardRef(({className:r,children:e,...t},n)=>s.jsxs($p,{ref:n,className:Y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",r),...t,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Ry,{children:s.jsx(Ue,{className:"h-4 w-4"})})}),s.jsx(My,{children:e})]}));zc.displayName=$p.displayName;const b3=u.forwardRef(({className:r,...e},t)=>s.jsx(Hp,{ref:t,className:Y("-mx-1 my-1 h-px bg-muted",r),...e}));b3.displayName=Hp.displayName;const _3=[{category:"Video Generation",items:[{name:"Standard AI Video (1080p HD)",credits:"10 credits"}]},{category:"Add-ons",items:[{name:"Motion (natural movement)",credits:"+5 credits"},{name:"Auto Captions",credits:"+1 credit"}]},{category:"Audio & Voice",items:[{name:"Voice Clone Setup",credits:"Coming Soon"},{name:"Voice Synthesis",credits:"Coming Soon"}]},{category:"Coming Soon",items:[{name:"Styled Captions",credits:"Coming Soon"},{name:"Translation",credits:"Coming Soon"},{name:"Hook Generator",credits:"Coming Soon"}]}];function np({children:r}){return s.jsxs(m0,{children:[s.jsx(_j,{asChild:!0,children:r||s.jsx("button",{className:"inline-flex items-center justify-center",children:s.jsx(Tf,{className:"w-3.5 h-3.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer"})})}),s.jsxs(bd,{className:"sm:max-w-md",children:[s.jsx(_d,{children:s.jsx(wd,{className:"text-lg font-semibold",children:"Credit Rate Sheet"})}),s.jsxs("div",{className:"space-y-4 max-h-[60vh] overflow-y-auto",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Different features have different credit costs:"}),_3.map(e=>s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-sm font-medium text-foreground",children:e.category}),s.jsx("div",{className:"bg-secondary/50 rounded-lg overflow-hidden",children:e.items.map((t,n)=>s.jsxs("div",{className:`flex items-center justify-between px-3 py-2 text-sm ${n!==e.items.length-1?"border-b border-border/50":""}`,children:[s.jsx("span",{className:"text-muted-foreground",children:t.name}),s.jsx("span",{className:"font-medium text-foreground",children:t.credits})]},t.name))})]},e.category)),s.jsxs("div",{className:"pt-2 border-t border-border space-y-2",children:[s.jsxs("h4",{className:"text-sm font-medium text-foreground flex items-center gap-1.5",children:[s.jsx("span",{children:"ð
"})," Annual Billing Benefits"]}),s.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-lg p-3 space-y-2",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsx("strong",{className:"text-foreground",children:"All credits upfront:"})," Annual subscribers receive their full year's credit allocation immediately upon purchaseâno monthly resets or waiting."]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsx("strong",{className:"text-foreground",children:"Pay 10 months, get 12:"})," Annual plans include 16.67% savings compared to monthly billing."]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsx("strong",{className:"text-foreground",children:"Rollover policy:"})," Unused credits carry over within your billing period. Credits are forfeited upon cancellation or downgrade."]})]})]}),s.jsx("div",{className:"pt-2 border-t border-border",children:s.jsxs("p",{className:"text-xs text-muted-foreground",children:["ð¡ ",s.jsx("strong",{children:"Tip:"})," 10 credits = 1 standard video. Choose your monthly video count and we handle the rest."]})})]})]})]})}function w3({className:r,showLink:e=!0}){return s.jsx(xo,{children:s.jsxs(Ht,{delayDuration:200,children:[s.jsx(Ut,{asChild:!0,children:s.jsx("button",{className:`inline-flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors ${r}`,"aria-label":"How credits work",children:s.jsx(Ia,{className:"w-4 h-4"})})}),s.jsx($t,{side:"top",className:"max-w-[280px] p-4",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold text-sm mb-1",children:"How Credits Work"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Typically ",s.jsx("strong",{className:"text-foreground",children:"10 credits"})," per video. Add-ons cost extra. Final cost shown before export."]}
610)]}),s.jsxs("div",{className:"border-t pt-2",children:[s.jsx("p",{className:"text-xs font-medium mb-1.5",children:"Add-ons cost extra:"}),s.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1",children:[s.jsxs("li",{className:"flex justify-between",children:[s.jsx("span",{children:"⢠Motion (natural movement)"}),s.jsx("span",{className:"font-medium text-foreground",children:"+5 credits"})]}),s.jsxs("li",{className:"flex justify-between",children:[s.jsx("span",{children:"⢠Auto captions"}),s.jsx("span",{className:"font-medium text-foreground",children:"+1 credit"})]})]})]}),s.jsxs("div",{className:"border-t pt-2",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsx("strong",{className:"text-foreground",children:"Free Plan:"})," 10 credits/month (1 video) after your first month, resets on the 1st"]}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[s.jsx("strong",{className:"text-foreground",children:"New users:"})," 30 credits (3 videos) in your first month"]}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[s.jsx("strong",{className:"text-foreground",children:"Example:"})," 100 credits = up to 10 videos (without add-ons)"]})]}),e&&s.jsx(be,{to:"/developers/billing-credits",className:"text-xs text-primary hover:underline block pt-1",children:"Learn more about credits â"})]})})]})})}const ii={free:{credits:10,videos:1,monthlyPrice:0},...Object.fromEntries(Object.entries(Oe).map(([r,e])=>[r,{credits:e.credits,videos:e.videos,pricePerVideo:10,monthlyPrice:e.price}])),...Object.fromEntries(Object.entries(Xe).map(([r,e])=>[r,{credits:e.credits,videos:e.videos,pricePerVideo:e.pricePerVideo,monthlyPrice:e.price}])),starter:{credits:100,videos:10,pricePerVideo:11,monthlyPrice:110},creator:{credits:200,videos:20,pricePerVideo:10,monthlyPrice:200},pro500:{credits:500,videos:50,pricePerVideo:10,monthlyPrice:500},pro1000:{credits:1e3,videos:100,pricePerVideo:10,monthlyPrice:1e3},pro2000:{credits:2e3,videos:200,pricePerVideo:10,monthlyPrice:2e3}};function j3({open:r,onClose:e,onConfirm:t,currentPlan:n,targetPlanKey:a,targetPlanName:i,currentCredits:o,currentCreditAllocation:l,subscriptionEnd:d,isTestMode:c}){const h=ii[n]||ii.free,m=ii[a]||ii.free,f=h.videos-m.videos,p=h.credits-m.credits,v=m.credits*2,x=Math.max(0,o-v),g=n.startsWith("volume"),b=a.startsWith("volume"),j=g&&!b,k=h.pricePerVideo||10,y=m.pricePerVideo||10,w=y>k,S=d?new Date(d).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,N=[];f>0&&N.push({label:"Monthly video capacity",detail:`${h.videos} â ${m.videos} videos/mo (â${f})`}),p>0&&N.push({label:"Monthly credit allocation",detail:`${h.credits} â ${m.credits} credits/mo (â${p})`}),(j||w)&&N.push({label:"Volume discount",detail:`$${k.toFixed(2)}/video â $${y.toFixed(2)}/video`}),x>0&&N.push({label:"Credits at risk",detail:`${x.toFixed(0)} credits exceed your new rollover cap (${v})`});const _=["1,200+ AI actors & all languages","Auto captions & commercial license","Up to 2-minute video length","All export formats"];return s.jsx(sy,{open:r,onOpenChange:C=>!C&&e(),children:s.jsxs(cu,{className:"max-w-md",children:[s.jsxs(du,{children:[s.jsxs(hu,{className:"flex items-center gap-2",children:[s.jsx("div",{className:"p-1.5 rounded-full bg-amber-500/10",children:s.jsx(td,{className:"w-4 h-4 text-amber-500"})}),"Confirm Downgrade"]}),s.jsx(mu,{asChild:!0,children:s.jsxs("div",{className:"space-y-4 pt-1",children:[s.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg bg-muted/50 border border-border",children:[s.jsxs("div",{className:"flex-1 text-center",children:[s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground font-medium",children:"Current"}),s.jsxs("p",{className:"font-semibold text-foreground text-sm mt-0.5",children:[h.videos," Videos/mo"]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["$",h.monthlyPrice,"/mo"]})]}),s.jsx(Zc,{className:"w-4 h-4 text-amber-500 shrink-0"}),s.jsxs("div",{className:"flex-1 text-center",children:[s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground font-medium",children:"New"}),s.jsxs("p",{className:"font-semibold text-foreground text-sm mt-0.5",children:[m.videos," Videos/mo"]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["$",m.monthlyPrice,"/mo"]})]})]}),c&&s.jsx("div",{className:"bg-blue-500/10 border border-blue-500/20 rounded-lg px-3 py-2",children:s.jsx("p",{className:"text-xs text-blue-600 dar
610k:text-blue-400 font-medium",children:"𧪠Test Mode â change takes effect instantly"})}),N.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-xs font-semibold text-foreground uppercase tracking-wide flex items-center gap-1.5",children:[s.jsx(S1,{className:"w-3.5 h-3.5 text-amber-500"}),"What changes"]}),s.jsx("div",{className:"space-y-1.5",children:N.map((C,O)=>s.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md bg-amber-500/5 border border-amber-500/10",children:[s.jsx(lt,{className:"w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:C.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:C.detail})]})]},O))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-xs font-semibold text-foreground uppercase tracking-wide flex items-center gap-1.5",children:[s.jsx(Pn,{className:"w-3.5 h-3.5 text-primary"}),"What stays the same"]}),s.jsx("div",{className:"grid grid-cols-2 gap-1",children:_.map((C,O)=>s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(Ue,{className:"w-3 h-3 text-primary shrink-0"}),s.jsx("span",{children:C})]},O))})]}),s.jsxs("div",{className:"bg-muted/50 border border-border rounded-lg px-3 py-2 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(qs,{className:"w-3.5 h-3.5 text-muted-foreground"}),s.jsx("p",{className:"text-xs font-medium text-foreground",children:"Credit rollover"})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Credits up to ",v," (2à your new allocation) will carry over.",x>0?` You currently have ${o.toFixed(0)} credits â ${x.toFixed(0)} exceed the cap and will be forfeited.`:` Your current ${o.toFixed(0)} credits are within the cap and will carry over.`]})]}),!c&&S&&s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-blue-500/5 border border-blue-500/10",children:[s.jsx(Zb,{className:"w-3.5 h-3.5 text-blue-500 shrink-0"}),s.jsxs("p",{className:"text-xs text-blue-600 dark:text-blue-400",children:["Takes effect ",s.jsx("strong",{children:S})," â you keep full access until then"]})]})]})})]}),s.jsxs(uu,{children:[s.jsx(fu,{onClick:e,children:"Keep Current Plan"}),s.jsx(pu,{onClick:t,className:"bg-amber-600 hover:bg-amber-700 text-white",children:"Confirm Downgrade"})]})]})})}function k3({className:r,variant:e="default"}){return s.jsx(xo,{children:s.jsxs(Ht,{delayDuration:200,children:[s.jsx(Ut,{asChild:!0,children:s.jsx(rt,{variant:"secondary",className:`bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20 cursor-help ${r}`,children:e==="compact"?"Save 16%":"2 months free"})}),s.jsx($t,{side:"top",className:"max-w-[220px]",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"font-semibold text-sm",children:"Save with Annual Billing"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Pay for ",s.jsx("strong",{className:"text-foreground",children:"10 months"}),", get ",s.jsx("strong",{className:"text-foreground",children:"12 months"})," of access."]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["That's ",s.jsx("strong",{className:"text-green-600 dark:text-green-400",children:"2 months free"})," â a ",s.jsx("strong",{className:"text-green-600 dark:text-green-400",children:"16% savings!"})]}),s.jsx("p",{className:"text-xs text-muted-foreground border-t pt-2 mt-2",children:"All credits delivered upfront."})]})})]})})}function N3(){return s.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(qs,{className:"w-3.5 h-3.5"}),s.jsx("span",{children:"We accept Card, PayPal, and more"})]})}function S3({onRedemptionSuccess:r,variant:e="card"}){const{user:t}=Ee(),[n,a]=u.useState(""),[i,o]=u.useState(!1),[l,d]=u.useState(null),[c,h]=u.useState(null),m=async p=>{if(p.preventDefault(),!t){ne.error("Please sign in to redeem a promo code");return}const v=n.trim();if(!v){d("Please enter a promo code");return}if(v.length<3||v.length>50){d("Invalid promo code format");return}o(!0),d(null),h(null);try{const x=await W.functions.invoke("redeem-promo-code",{body:{code:v}});if(x.error){const k=x.error.context;let y="Failed to redeem promo code";
610if(k&&typeof k=="object")try{const w=await k.json?.();w?.error&&(y=w.error)}catch{x.error.message&&(y=x.error.message)}x.data?.error&&(y=x.data.error),d(y);return}const g=x.data;if(!g?.success){d(g?.error||"Failed to redeem promo code");return}const b=g.credits_granted||0,j=g.message||`Promo code redeemed! You received ${b} credits.`;h(j),a(""),ne.success(j),r?.()}catch(x){console.error("Promo code error:",x),d(x.message||"An unexpected error occurred")}finally{o(!1)}},f=s.jsxs("form",{onSubmit:m,className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(N1,{className:"w-4 h-4 text-primary"}),s.jsx("span",{children:"Have a promo code?"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Gr,{type:"text",placeholder:"Enter code",value:n,onChange:p=>{a(p.target.value.toUpperCase()),d(null),h(null)},disabled:i,maxLength:50,className:"flex-1 uppercase"}),s.jsx(ie,{type:"submit",disabled:i||!n.trim(),size:"default",children:i?s.jsx(Mt,{className:"w-4 h-4 animate-spin"}):"Apply"})]}),l&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[s.jsx(Jb,{className:"w-4 h-4 shrink-0"}),s.jsx("span",{children:l})]}),c&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[s.jsx(Ue,{className:"w-4 h-4 shrink-0"}),s.jsx("span",{children:c})]})]});return e==="inline"?f:s.jsx(es,{className:"p-4",children:f})}const E3=["4K video export","Custom credit allocations","Dedicated account manager","SLA guarantee (99.9%)","White-label options","Priority API access","Custom integrations"];function C3({className:r,animationDelay:e=.3}){return s.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:e},className:r,children:s.jsxs(es,{className:"h-full p-6 border-2 border-dashed border-border bg-card/50 flex flex-col",children:[s.jsxs("div",{className:"mb-4",children:[s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground mb-2",children:[s.jsx(Yb,{className:"w-3.5 h-3.5"}),"Organizations"]}),s.jsx("h3",{className:"font-semibold font-display text-lg mb-1",children:"Enterprise"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"For large teams with custom needs."})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("span",{className:"text-3xl font-bold font-display",children:"Custom"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Tailored to your needs"})]}),s.jsx("div",{className:"border-t border-border my-4"}),s.jsx("ul",{className:"space-y-3 mb-6 flex-grow",children:E3.map(t=>s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:t})]},t))}),s.jsx(ie,{variant:"outline",className:"w-full",asChild:!0,onClick:()=>_t("enterprise_contact_clicked",{}),children:s.jsxs(be,{to:"/contact",children:["Talk to Sales",s.jsx(nr,{className:"w-4 h-4 ml-2"})]})})]})})}const Hc="vidacious_currency_locale",T3=60*60*1e3;function P3(){try{const r=localStorage.getItem(Hc);if(!r)return null;const e=JSON.parse(r);return Date.now()-e.cachedAt>T3?(localStorage.removeItem(Hc),null):e}catch{return null}}function A3(r){try{localStorage.setItem(Hc,JSON.stringify({...r,cachedAt:Date.now()}))}catch{}}function gu(){const[r,e]=u.useState({currencyCode:"USD",currencyName:"US Dollar",exchangeRate:1}),[t,n]=u.useState(!0);u.useEffect(()=>{const c=P3();if(c){e({currencyCode:c.currencyCode,currencyName:c.currencyName,exchangeRate:c.exchangeRate}),n(!1);return}let h=!1;return(async()=>{try{const{data:m,error:f}=await W.functions.invoke("geo-currency");if(h)return;if(f||!m?.currencyCode){n(!1);return}e({currencyCode:m.currencyCode,currencyName:m.currencyName||"US Dollar",exchangeRate:m.exchangeRate??1}),A3({countryCode:m.countryCode||"US",currencyCode:m.currencyCode,currencySymbol:m.currencySymbol||"$",currencyName:m.currencyName||"US Dollar",exchangeRate:m.exchangeRate??1})}catch{}finally{h||n(!1)}})(),()=>{h=!0}},[]);const a=r.currencyCode!=="USD",i=u.useMemo(()=>{try{return new Intl.NumberFormat(void 0,{style:"currency",currency:r.currencyCode,maximumFractionDigits:0,minimumFractionDigits:0})}catch{return new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:0,minimumFractionDigits:0})}},[r.currencyCode]),o=u.useMemo(()=>new Intl.NumberFormat(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}),[]),l=u.useCallback(c=>{const h=a?Math.round(c*r.exchangeRate):c;return i.format(h)},[a,r.exchangeRate,i]),d=u.useCallback(c=>{const h=a?Math.round(c*r.exchangeRate):c;return o.format(h)},[a,r.exchangeRate,o]);return{currencyCode:r.currencyCode,currencyName:r.currencyName,exchangeRate:r.exchangeRate,isLocalCurrency:a,isLoading:t,formatPrice:l,formatPriceValue:d}}function I3(){const[r,e]=u.useState(!1),{formatPrice:t}=gu(),n=[{name:"Monthly Credits",tooltip:"1 video = 10 credits. Add-ons cost extra.",free:"10",standard:"50â1,000",highVolume:"1,200â10,000",enterprise:"Custom"},{name:"Approx. Videos/mo",free:"1",standard:"5â100",highVolume:"120â1,000",enterprise:"Custom"},{name:"Price per Video",free:"Free",standard:t(10),highVolume:`${t(9)}â${t(9.5)}`,enterprise:"Volume pricing"},{name:"Max Video Duration",free:"120 sec",standard:"120 sec",highVolume:"120 sec",enterprise:"Custom"},{name:"AI Actors",free:"1,200+",standard:"1,200+",highVolume:"1,200+",enterprise:"1,200+"},{name:"Credit Rollover",tooltip:"Unused subscription credits roll over up to 2Ã allocation. Free credits do not roll over.",free:!1,standard:!0,highVolume:!0,enterprise:!0},{name:"Commercial Rights",free:!0,standard:!0,highVolume:!0,enterprise:!0},{name:"Languages",free:"175+",standard:"175+",highVolume:"175+",enterprise:"175+",expanded:!0},{name:"Premium Voice Library",free:!0,standard:!0,highVolume:!0,enterprise:!0,expanded:!0},{name:"Auto Captions",tooltip:"+1 credit per video",free:!0,standard:!0,highVolume:!0,enterprise:!0,expanded:!0},{name:"API Access",free:!1,standard:!0,highVolume:!0,enterprise:!0,expanded:!0},{name:"Priority Support",free:!1,standard:!1,highVolume:!0,enterprise:!0,expanded:!0},{name:"Team Collaboration",free:!1,standard:!1,highVolume:!1,enterprise:!0,expanded:!0},{name:"Dedicated Account Mgr",free:!1,standard:!1,highVolume:!1,enterprise:!0,expanded:!0}],a=[{key:"free",name:"Free",recommended:!1},{key:"standard",name:"Standard",recommended:!0},{key:"highVolume",name:"High-Volume",recommended:!1},{key:"enterprise",name:"Enterprise",recommended:!1}],i=r?n:n.filter(l=>!l.expanded),o=()=>{const l=!r;e(l),l&&_t("compare_plans_expanded")};return s.jsxs("section",{id:"compare",className:"max-w-4xl mx-auto mb-16","aria-label":"Plan comparison",children:[s.jsx("h2",{className:"text-2xl font-bold font-display text-center mb-8",children:"Compare All Plans"}),s.jsx("div",{className:"relative overflow-x-auto border border-border rounded-lg",children:s.jsxs("table",{className:"w-full text-sm border-collapse min-w-[600px]",role:"grid",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-muted/30",children:[s.jsx("th",{scope:"col",className:"text-left px-4 py-3 font-medium text-muted-foreground sticky left-0 bg-muted/30 z-10 min-w-[140px]",children:"Features"}),a.map(l=>s.jsx("th",{scope:"col",className:`px-4 py-3 text-center font-semibold min-w-[110px] ${l.recommended?"bg-primary/5 border-x-2 border-t-2 border-primary/30":""}`,children:s.jsxs("div",{className:"flex flex-col items-center gap-1",children:[s.jsx("span",{children:l.name}),l.recommended&&s.jsx(rt,{variant:"default",className:"text-[10px] px-1.5 py-0",children:"Recommended"})]})},l.key))]})}),s.jsx("tbody",{children:i.map((l,d)=>s.jsxs("tr",{className:`${d!==i.length-1?"border-b border-border/50":""} hover:bg-muted/20 transition-colors`,children:[s.jsx("td",{className:"px-4 py-3 sticky left-0 bg-background z-10",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-sm text-foreground",children:l.name}),l.tooltip&&s.jsx(xo,{children:s.jsxs(Ht,{delayDuration:200,children:[s.jsx(Ut,{asChild:!0,children:s.jsx("button",{className:"text-muted-foreground hover:text-foreground","aria-label":`Info about ${l.name}`,children:s.jsx(Tf,{className:"w-3.5 h-3.5"})})}),s.jsx($t,{side:"right",className:"max-w-[220px]",children:s.jsx("p",{className:"text-xs",children:l.tooltip})})]})})]})}),a.map(c=>s.jsx("td",{className:`px-4 py-3 text-center ${c.recommended?"bg-primary/5 border-x-2 border-primary/30":""}`,children:s.jsx(R3,{value:l[c.key]})},c.key))]},l.name))})]})}),s.jsx("div",{className:"flex justify-center mt-4",children:s.jsx(ie,{variant:"ghost",size:"sm",onClick:o,className:"text-sm text-muted-foreground hover:text-foreground gap-1.5",children:r?s.jsxs(s.Fragment,{children:["Show fewer features",s.jsx(wf,{className:"w-4 h-4"})]}):s.jsxs(s.Fragment,{children:["Show all features",s.jsx(Rr,{className:"w-4 h-4"})]})})}),s.jsx("p",{className:"text-center text-xs text-muted-foreground mt-3",children:"Unused free monthly credits don't roll over. Paid subscription credits roll over up to 2Ã your allocation."})]})}function R3({value:r}){return typeof r=="string"?s.jsx("span",{className:"text-sm font-medium text-foreground",children:r}):r?s.jsx(Ue,{className:"w-4 h-4 text-green-500 mx-auto","aria-label":"Included"}
610):s.jsx(lt,{className:"w-4 h-4 text-muted-foreground/30 mx-auto","aria-label":"Not included"})}const M3=[{icon:Pn,label:"Secure Checkout"},{icon:qs,label:"Cancel Anytime"},{icon:Ls,label:"2-Min Delivery"},{icon:ur,label:"Trusted by Creators"}],O3=u.forwardRef(function({className:e},t){return s.jsx(ae.div,{ref:t,initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},className:`flex flex-wrap items-center justify-center gap-4 md:gap-8 py-6 ${e??""}`,children:M3.map(n=>s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(n.icon,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"text-sm font-medium",children:n.label})]},n.label))})}),oo=[{id:"tryit",name:"Quick Top-Up",nameForNewUsers:"Try It",credits:10,videos:1,price:12,priceINR:999,pricePerVideo:12,description:"1 HD video, no expiry",descriptionForNewUsers:"1 HD video, 120s, commercial rights",popular:!1},{id:"starter",name:"Starter",credits:20,videos:2,price:22,priceINR:1799,pricePerVideo:11,description:"2 HD videos, credits never expire",descriptionForNewUsers:"2 HD videos, 1,200+ actors, 175+ languages",popular:!0},{id:"minipack",name:"Mini Pack",credits:50,videos:5,price:50,priceINR:3999,pricePerVideo:10,description:"5 HD videos, best per-video rate",descriptionForNewUsers:"5 HD videos, best per-video rate",popular:!1}],D3=[{id:"standard",name:"Standard",credits:100,videos:10,price:69,priceINR:5799,pricePerVideo:6.9,description:"10 HD videos, great for regular API usage",popular:!1},{id:"pro-pack",name:"Pro Pack",credits:200,videos:20,price:119,priceINR:9999,pricePerVideo:5.95,description:"20 HD videos, ideal for scaling",popular:!0},{id:"mega-pack",name:"Mega Pack",credits:500,videos:50,price:249,priceINR:20999,pricePerVideo:4.98,description:"50 HD videos, best value for high-volume",popular:!1}],KA=[...oo,...D3];Object.fromEntries(oo.map(r=>[r.id,r]));const L3=["Credits never expire","Full 120s videos","No watermark","Commercial rights"],QA="Credits never expire ⢠No watermark ⢠Commercial rights included";function $3(r,e){return e?r.name:r.nameForNewUsers??r.name}function F3(r,e){return e?r.description:r.descriptionForNewUsers??r.description}function V3({className:r}){const[e,t]=u.useState(null),[n,a]=u.useState({}),{user:i,session:o}=Ee(),{isTestMode:l,isEligible:d}=ir(),{campaign:c}=Fa(),{subscription:h}=Ns(),m=Xt(),{formatPrice:f}=gu(),p=h.subscribed,v=c?.applies_to_packs&&c.discount_percent>0,x=k=>n[k]||1,g=(k,y)=>a(w=>({...w,[k]:y})),b=k=>v&&c?.discount_percent?k*(1-c.discount_percent/100):k,j=async k=>{if(!i||!o?.access_token){sessionStorage.setItem("pending_pack_purchase",k),_t("pricing_cta_clicked",{cta_type:"credit_pack",pack_id:k,is_logged_in:!1}),m(`/auth?mode=signup&redirect=/pricing&pack=${k}`);return}const y=d&&l;l&&!d&&ne.warning("Credit packs are processed in live mode (real payments)",{description:"Switching to live mode for this purchase",duration:4e3}),t(k);const w=x(k),S=oo.find(N=>N.id===k);_t("checkout_started",{purchase_type:"credit_pack",pack_id:k,pack_price:S?.price??0,quantity:w});try{const{data:N,error:_}=await W.functions.invoke("create-credit-pack-checkout",{headers:{Authorization:`Bearer ${o.access_token}`},body:{packId:k,isTestMode:y,quantity:w}});if(_)throw _;if(N?.error)throw new Error(N.error);if(!N?.url)throw new Error("No checkout URL received");window.self!==window.top?(window.open(N.url,"_blank"),ne.success("Secure checkout opened in a new tab")):window.location.href=N.url}catch(N){console.error("Pack checkout error:",N),ne.error(N?.message||"Failed to start checkout. Please try again.")}finally{t(null)}};return s.jsxs(ae.section,{id:"packs",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:Y("scroll-mt-24",r),children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 mb-4 rounded-full bg-primary/10 text-primary text-sm font-medium",children:[s.jsx(_r,{className:"w-4 h-4"}),"Top Up Anytime",v&&s.jsxs(rt,{className:"ml-2 bg-primary text-primary-foreground",children:[c.discount_percent,"% OFF"]})]}),s.jsx("h2",{className:"text-2xl md:text-3xl font-bold font-display mb-2",children:"One-Time Credit Packs"}),s.jsx("p",{className:"text-muted-foreground max-w-lg mx-auto",children:"Buy credits whenever you need them. No subscription required â packs stack with your existing balance."})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-3xl mx-auto mb-6",children:oo.map(k=>{const y=x(k.id),w=k.price*y,S=b(w),N=S<w,_=k.videos*y,C=$3(k,p),O=F3(k,p),R=k.maxQuantity??5;return s.jsxs(es,{className:Y("relative overflow-hidden transition-all duration-300",k.popular&&"border-primary shadow-lg ring-1 ring-primary/20"),children:[k.popular&&s.jsx("div",{className:"absolute top-0 right-0",children:s.jsxs(rt,{className:"rounded-none rounded-bl-lg bg-primary text-primary-foreground",children:[s.jsx(Bt,{className:"w-3 h-3 mr-1"}),"Popular"]})}),s.jsxs(Lo,{className:"p-6",children:[s.jsxs("div",{className:"text-center mb-4",children:[s.jsx("h3",{className:"text-lg font-semibold mb-1",children:C}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:O}),k.allowQuantity&&s.jsxs("div",{className:"flex items-center justify-center gap-3 mb-3",children:[s.jsx(ie,{variant:"outline",size:"icon",className:"h-7 w-7",disabled:y<=1,onClick:()=>g(k.id,y-1),children:s.jsx(Rf,{className:"w-3.5 h-3.5"})}),s.jsx("span",{className:"text-sm font-semibold w-6 text-center",children:y}),s.jsx(ie,{variant:"outline",size:"icon",className:"h-7 w-7",disabled:y>=R,onClick:()=>g(k.id,y+1),children:s.jsx(mn,{className:"w-3.5 h-3.5"})})]}),s.jsx("div",{className:"flex items-baseline justify-center gap-2 mb-2",children:N?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-3xl font-bold",children:f(S)}),s.jsx("span",{className:"text-lg text-muted-foreground line-through",children:f(w)})]}):s.jsx("span",{className:"text-3xl font-bold",children:f(w)})}),s.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm",children:[s.jsxs(rt,{variant:"secondary",className:"font-normal",children:[_," video",_>1?"s":""]}),s.jsxs("span",{className:"text-muted-foreground",children:[f(N?S/_:k.pricePerVideo),"/video"]})]})]}),s.jsx(ie,{onClick:()=>j(k.id),disabled:e!==null,className:"w-full",variant:k.popular?"default":"outline",children:e===k.id?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(_r,{className:"w-4 h-4 mr-2"}),"Buy Now"]})})]})]},k.id)})}),s.jsx("div",{className:"flex flex-wrap justify-center gap-x-6 gap-y-2 text-sm text-muted-foreground",children:L3.map(k=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Ue,{className:"w-4 h-4 text-primary"}),s.jsx("span",{children:k})]},k))}),s.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-6",children:["Need videos regularly?"," ",s.jsx("a",{href:"#standard",className:"text-primary hover:underline font-medium",children:"Subscribe for better value"})," ","â as low as ",f(9),"/video with volume plans."]})]})}function z3({variant:r}){return r==="marketer"?s.jsxs("div",{className:"bg-muted/50 border border-border rounded-lg px-4 py-3 flex items-center justify-between gap-3 max-w-3xl mx-auto",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx($s,{className:"w-4 h-4 text-primary shrink-0"}),s.jsx("span",{children:"Building with our API?"})]}),s.jsxs(be,{to:"/developers/pricing",className:"flex items-center gap-1 text-sm font-medium text-primary hover:underline shrink-0",children:["View API Pricing",s.jsx(nr,{className:"w-3 h-3"})]})]}):s.jsxs("div",{className:"bg-muted/50 border border-border rounded-lg px-4 py-3 flex items-center justify-between gap-3 max-w-5xl mx-auto",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Bt,{className:"w-4 h-4 text-primary shrink-0"}),s.jsx("span",{children:"Looking for subscription plans?"})]}),s.jsxs(be,{to:"/pricing",className:"flex items-center gap-1 text-sm font-medium text-primary hover:underline shrink-0",children:["View Creator Plans",s.jsx(nr,{className:"w-3 h-3"})]})]})}function H3(){const[r,e]=Tn(),{user:t,session:n}=Ee(),{startCheckout:a,subscription:i}=Ns(),o=u.useRef(!1);u.useEffect(()=>{if(o.current||!t||!n?.access_token||i.subscribed)return;const l=r.get("plan"),d=r.get("interval"),c=r.get("pack"),h=sessionStorage.getItem("pending_pack_purchase"),m=c||h;
610if(m){o.current=!0,sessionStorage.removeItem("pending_pack_purchase"),_t("auth_completed_with_intent",{intended_plan:m,cta_type:"credit_pack",did_proceed_to_checkout:!0});const f=new URLSearchParams(r);f.delete("pack"),e(f,{replace:!0}),U3(m,n.access_token);return}if(l){o.current=!0;const f=d==="yearly";_t("auth_completed_with_intent",{intended_plan:l,intended_interval:d||"monthly",cta_type:"subscription",did_proceed_to_checkout:!0});const p=new URLSearchParams(r);p.delete("plan"),p.delete("interval"),e(p,{replace:!0}),B3(l,f,a)}},[t,n,r,e,i.subscribed,a])}async function U3(r,e){try{ne.loading("Starting checkout...",{id:"pending-checkout"});const{data:t,error:n}=await W.functions.invoke("create-credit-pack-checkout",{headers:{Authorization:`Bearer ${e}`},body:{packId:r,isTestMode:!1,quantity:1}});if(n)throw n;if(t?.error)throw new Error(t.error);if(!t?.url)throw new Error("No checkout URL received");ne.dismiss("pending-checkout"),ne.success("Opening checkout..."),window.self!==window.top?window.open(t.url,"_blank"):window.location.href=t.url}catch(t){console.error("Pending pack checkout error:",t),ne.dismiss("pending-checkout"),ne.error(t?.message||"Failed to start checkout. Please try again.")}}async function B3(r,e,t){try{ne.loading("Starting checkout...",{id:"pending-checkout"}),await t(r,e),ne.dismiss("pending-checkout"),ne.success("Opening checkout...")}catch(n){console.error("Pending subscription checkout error:",n),ne.dismiss("pending-checkout"),ne.error(n?.message||"Failed to start checkout. Please try again.")}}const ua=[{videos:5,credits:50,monthlyPrice:50,key:"standard5"},{videos:10,credits:100,monthlyPrice:100,key:"standard10",popular:!0},{videos:20,credits:200,monthlyPrice:200,key:"standard20"},{videos:30,credits:300,monthlyPrice:300,key:"standard30"},{videos:40,credits:400,monthlyPrice:400,key:"standard40"},{videos:50,credits:500,monthlyPrice:500,key:"standard50"},{videos:60,credits:600,monthlyPrice:600,key:"standard60"},{videos:80,credits:800,monthlyPrice:800,key:"standard80"},{videos:100,credits:1e3,monthlyPrice:1e3,key:"standard100"}],ha=[{videos:120,credits:1200,monthlyPrice:1140,pricePerVideo:9.5,key:"volume120"},{videos:200,credits:2e3,monthlyPrice:1800,pricePerVideo:9,key:"volume200"},{videos:300,credits:3e3,monthlyPrice:2700,pricePerVideo:9,key:"volume300"},{videos:400,credits:4e3,monthlyPrice:3600,pricePerVideo:9,key:"volume400"},{videos:500,credits:5e3,monthlyPrice:4500,pricePerVideo:9,key:"volume500"},{videos:750,credits:7500,monthlyPrice:6750,pricePerVideo:9,key:"volume750"},{videos:1e3,credits:1e4,monthlyPrice:9e3,pricePerVideo:9,key:"volume1000"}],Cl=r=>Math.round(r*10),ap=r=>r*12,ip=10,q3={starter:"standard5",standard:"standard10",pro:"standard20",...Object.fromEntries(ua.map(r=>[r.key,r.key])),...Object.fromEntries(ha.map(r=>[r.key,r.key]))};function oy(){const[r,e]=u.useState(!1),[t,n]=u.useState(ua[1].key),[a,i]=u.useState(ha[0].key),[o,l]=u.useState(null),[d,c]=u.useState(!1),[h,m]=u.useState(null),[f,p]=u.useState(null),[v]=Tn(),{user:x}=Ee(),{subscription:g,startCheckout:b,checkSubscription:j}=Ns(),{campaign:k}=Fa(),{formatPrice:y,isLocalCurrency:w,currencyName:S}=gu(),N=k?.applies_to_subscriptions&&k.discount_percent>0,_=T=>N?Math.round(T*(1-k.discount_percent/100)):T;H3();const C=u.useRef(!1),O=u.useRef(null),R=u.useRef(null),M=[{question:"How does pricing work?",answer:`Simple and transparent: each video costs 10 credits (${y(10)}/video on standard plans). Just pick how many videos you need per month â from 5 to 1,000 â and you're set. High-volume plans (120+ videos/month) include volume discounts. Prefer no commitment? One-time credit packs are also available from ${y(10)}/video.`},{question:"What is the maximum video length?",answer:"All videos can be up to 120 seconds (2 minutes) in duration. This applies to all plans, including free users."},{question:"What happens if I go over my plan's monthly limit?",answer:"You cannot exceed your limits. To get more credits immediately, you can upgrade your plan. High-volume users can contact us for custom overage arrangements."},{question:"Do unused credits roll over into the next month?",answer:"Yes! Unused credits carry over to the next billing period (up to 2Ã your monthly allocation). If you downgrade, credits above 2Ã your new allocation will be forfeited when the change takes effect."},{question:"Do free monthly credits roll over?",answer:"No. Free monthly credits reset on the 1st of each month and do not roll over. To keep unused credits between months, upgrade to a paid subscription plan."},{question:"Can I upgrade or downgrade at any time?",answer:"Yes! You can change your plan at any time from your account settings. Upgrades take effect immediately with prorated billing. Downgrades take effect at the end of your billing cycle."},{question:"What's included in every plan?",answer:"All plans include: 1,200+ AI actors, 175+ languages, up to 120 seconds per video, script-to-video generation, auto captions, commercial usage rights, multiple formats (9:16, 16:9, 1:1), and delivery in under 2 minutes."},{question:"Can I cancel at any time?",answer:"Yes, cancel anytime from your account settings. You'll retain access until the end of your billing period."}];u.useEffect(()=>{if(!C.current){C.current=!0;const T=x?.created_at?Math.floor((Date.now()-new Date(x.created_at).getTime())/(1e3*60*60*24)):void 0;_t("pricing_page_viewed",{has_active_subscription:g.hasActiveEntitlement,current_plan:g.plan,is_yearly_toggle:r,credits_remaining:g.credits,source_page:d
610ocument.referrer||"direct",triggered_by:(()=>{const z=document.referrer||"";return z.includes("/videos")||z.includes("/exports")?"export_paywall":z.includes("/create")?"credit_limit":z.includes("/dashboard")?"dashboard":"navigation"})(),...T!==void 0?{days_since_signup:T}:{}})}},[g.hasActiveEntitlement,g.plan,r,g.credits,x?.created_at]),u.useEffect(()=>{x?.id&&(AE("pricing",x.id),W.functions.invoke("track-education-event",{body:{event_name:"pricing_viewed",payload:{source:(()=>{const T=document.referrer||"";return T.includes("/videos")||T.includes("/exports")?"export_paywall":T.includes("/create")?"credit_limit":T.includes("/dashboard")?"dashboard":"navigation"})()}}}).catch(()=>{}))},[x?.id]),u.useEffect(()=>{const T=v.get("plan");if(!T)return;const z=q3[T.toLowerCase()];if(!z)return;const q=ua.some(pe=>pe.key===z),ce=ha.some(pe=>pe.key===z);q?(n(z),setTimeout(()=>{O.current?.scrollIntoView({behavior:"smooth",block:"center"})},100)):ce&&(i(z),setTimeout(()=>{R.current?.scrollIntoView({behavior:"smooth",block:"center"})},100))},[v]),u.useEffect(()=>{v.get("canceled")==="true"&&ne.info("Checkout was canceled. You can try again when ready.")},[v]),u.useEffect(()=>{j()},[]);const L=ua.find(T=>T.key===t),A=ha.find(T=>T.key===a),V=r?Cl(L.monthlyPrice):L.monthlyPrice,G=r?ap(L.videos):L.videos,se=r?Cl(A.monthlyPrice):A.monthlyPrice,re=r?ap(A.videos):A.videos,Z=r?A.videos*12*ip-Cl(A.monthlyPrice):A.videos*ip-A.monthlyPrice,P=T=>{const z=oa[T]??0;return g.hasActiveEntitlement&&g.effectiveTier===z},E=T=>{const z=oa[T]??0,q=g.effectiveTier;return P(T)?{text:"Current Plan",action:"current",icon:s.jsx(Ue,{className:"w-4 h-4 mr-2"})}:g.hasActiveEntitlement?z>q?{text:`Upgrade to ${z} Videos/mo`,action:"upgrade",icon:s.jsx(Fl,{className:"w-4 h-4 mr-2"})}:{text:`Downgrade to ${z} Videos/mo`,action:"downgrade",icon:s.jsx(Zc,{className:"w-4 h-4 mr-2"})}:{text:`Get ${z} Videos/Month`,action:"get"}},U=async(T,z)=>{if(!x){ne.error("Please sign in to subscribe");return}const q=oa[T]??0;if(_t("pricing_plan_selected",{plan_id:T,plan_name:`${q} Videos/mo`,billing_cycle:r?"yearly":"monthly",action:z,source_page:"/pricing"},{immediate:!0}),z!=="current"){if(z==="downgrade"){m({key:T,name:`${q} Videos/mo`,isDowngrade:!0});return}if(z==="upgrade"&&g.subscribed){m({key:T,name:`${q} Videos/mo`,isDowngrade:!1}),p({loading:!0,immediateCharge:0,daysRemaining:0,currency:"USD"});try{const pe=Ui(g.isTestMode)[T],ke=r?pe.yearly.priceId:pe.monthly.priceId,{data:de,error:_e}=await W.functions.invoke("preview-proration",{body:{newPriceId:ke,isTestMode:g.isTestMode}});if(_e)throw _e;de.success?p({loading:!1,immediateCharge:de.immediateCharge,daysRemaining:de.daysRemaining,currency:de.currency}):p({loading:!1,immediateCharge:0,daysRemaining:0,currency:"USD",error:de.error||"Failed to preview proration"})}catch(ce){console.error("Proration preview error:",ce),p({loading:!1,immediateCharge:0,daysRemaining:0,currency:"USD",error:"Unable to calculate proration"})}return}await J(T)}},J=async T=>{l(T);const z=window.self!==window.top,q=oa[T]??0;_t("checkout_started",{plan_type:"subscription",plan_id:T,plan_name:`${q} Videos/mo`,billing_cycle:r?"yearly":"monthly",credits_remaining:g.credits,source_page:"/pricing"},{immediate:!0});try{z||c(!0);const ce=v.get("intent"),pe=v.get("jobId"),ke=v.get("returnTo");await b(T,r,{intent:ce,intentJobId:pe,returnTo:ke}),z&&(l(null),ne.success("Secure checkout opened in a new tab"))}catch(ce){console.error("Checkout error:",ce);const pe=ce?.message||"Failed to start checkout. Please try again.";ne.error(pe),c(!1),l(null)}},te=async T=>{l(T);try{const q=Ui(g.isTestMode)[T];if(!q)throw new Error("Invalid plan selected");const ce=r?q.yearly.priceId:q.monthly.priceId,{data:pe,error:ke}=await W.functions.invoke("update-subscription",{body:{newPriceId:ce,isTestMode:g.isTestMode}});if(pe?.error==="No Stripe customer found"||pe?.error==="No active subscription found"||ke&&ke.message?.includes("No Stripe customer found")||ke&&ke.message?.includes("No active subscription found")){await J(T);return}if(ke)throw ke;if(pe?.success)ne.success(pe.message),await j();else throw new Error(pe?.error||"Failed to update subscription")}catch(z){const q=z?.message||String(z);if(q.includes("No Stripe customer found")||q.includes("No active subscription found")){await J(T);return}console.error("Subscription update error:",z),ne.error(q||"Failed to update subscription. Please try again.")}finally{l(null)}},D=async()=>
610{if(!h)return;const{key:T,isDowngrade:z}=h;m(null),p(null),g.subscribed?await te(T):await J(T)},ee=()=>{m(null),p(null)};return d?s.jsxs("div",{className:"min-h-screen bg-background flex flex-col items-center justify-center gap-4",children:[s.jsx(Mt,{className:"w-8 h-8 animate-spin text-primary"}),s.jsx("p",{className:"text-muted-foreground",children:"Redirecting to Stripe..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Hs,{title:"AI Video Ad Pricing | From $10/Video",description:"AI video ads from $10/video. Pick your monthly volume (5â1,000 videos), cancel anytime. Annual plans get 2 months free. No credit card for free trial.",url:"https://vidacious.ai/pricing",breadcrumbs:[{name:"Pricing",path:"/pricing"}]}),s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("main",{className:"pb-16",style:{paddingTop:"calc(var(--campaign-banner-height, 0px) + var(--promo-banner-height, 0px) + 6rem)"},children:s.jsxs("div",{className:"container px-4",children:[s.jsxs(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-12",children:[s.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 mb-4 rounded-full bg-primary/10 text-primary text-sm font-medium",children:[s.jsx(Bt,{className:"w-4 h-4"}),"Simple, transparent pricing"]}),s.jsxs("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold font-display mb-4",children:["Choose How Many"," ",s.jsx("span",{className:"gradient-text",children:"Videos"})," ","You Need"]}),s.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto mb-8",children:"No tiers. No tricks. Just pick your monthly video count and go."}),s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsxs("div",{className:"inline-flex items-center gap-3 p-1 rounded-full bg-muted/50 border border-border",children:[s.jsx("button",{onClick:()=>{e(!1),_t("pricing_billing_cycle_toggled",{selected_cycle:"monthly"})},className:`px-4 py-2 rounded-full text-sm font-medium transition-all ${r?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"}`,children:"Monthly"}),s.jsxs("button",{onClick:()=>{e(!0),_t("pricing_billing_cycle_toggled",{selected_cycle:"yearly"})},className:`px-4 py-2 rounded-full text-sm font-medium transition-all flex items-center gap-2 ${r?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:["Annual",s.jsx(k3,{})]})]}),r&&s.jsxs(ae.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:"text-sm text-muted-foreground",children:[s.jsx("strong",{className:"text-green-600 dark:text-green-400",children:"2 months free"})," â all credits delivered upfront."]})]}),s.jsx(N3,{})]}),s.jsx(V3,{className:"mb-12"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 max-w-4xl mx-auto mb-12",children:[s.jsx(ae.div,{ref:O,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:s.jsxs(es,{className:`h-full p-6 border bg-card flex flex-col relative ${P(t)?"border-primary ring-2 ring-primary/20":""}`,children:[P(t)&&s.jsx(rt,{className:"absolute -top-3 left-1/2 -translate-x-1/2 bg-primary text-primary-foreground shadow-md",children:"Your Plan"}),s.jsxs("div",{className:"mb-4",children:[s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground mb-2",children:[s.jsx(go,{className:"w-3.5 h-3.5"}),"Individuals and small teams"]}),s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(_r,{className:"w-5 h-5 text-primary"}),s.jsx("h3",{className:"font-semibold text-lg",children:"Standard Plans"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"1,200+ AI actors, 175+ languages, 120s HD videos. Script to video in under 2 min."})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"text-sm font-medium text-muted-foreground mb-2 block",children:"How many videos do you need?"}),s.jsxs(rp,{value:t,onValueChange:n,children:[s.jsx(Fc,{className:"w-full",children:s.jsx(sp,{})}),s.jsx(Vc,{children:ua.map(T=>s.jsx(zc,{value:T.key,children:s.jsxs("div",{className:"flex items-center justify-between w-full gap-4",children:[s.jsxs("span",{children:[T.videos," videos/month"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[P(T.key)&&s.jsx(rt,{variant:"outline",className:"text-xs border-primary text-primary",children:"Current"}),T.popular&&!P(T.key)&&s.jsx(rt,{variant:"secondary",className:"text-xs",children:"Popular"})]})]})},T.key))})]})]}),s.jsxs("div",{className:"mb-6",children:[N&&s.jsxs(rt,{className:"mb-2 bg-primary/10 text-primary border-primary/30",children:[k.discount_percent,"% OFF Subscriptions"]}),s.jsxs("div",{className:"flex items-baseline flex-wrap gap-x-2 gap-y-0.5",children:[N?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-3xl sm:text-4xl font-bold whitespace-nowrap",children:y(_(V))}),s.jsx("span",{className:"text-base text-muted-foreground line-through whitespace-nowrap",children:y(V)})]}):s.jsx("span",{className:"text-3xl sm:text-4xl font-bold whitespace-nowrap",children:y(V)}),s.jsxs("span",{className:"text-muted-foreground",children:["/",r?"year":"month"]})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[G," videos ",r?"per year":"per month"]}),s.jsx(w3,{}),s.jsx(np,{})]}),r&&s.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[s.jsxs(rt,{variant:"outline",className:"text-xs bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20",children:["2 months free (save ",y(L.monthlyPrice*2),")"]}),s.jsx(rt,{variant:"outline",className:"text-xs bg-primary/10 text-primary border-primary/20",children:"All credits upfront"})]})]}),s.jsxs("ul",{className:"space-y-2 mb-6 flex-grow",children:[s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"Up to 120 seconds per video"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"1,200+ AI actors"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"175+ languages"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"Script-to-video in 2 min"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"Auto captions (+1 credit)"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"Commercial usage rights"})]})]}),x?(()=>{const T=E(t),z=T.action==="current";return s.jsx(ie,{className:"w-full",variant:z?"secondary":T.action==="downgrade"?"outline":"default",onClick:()=>U(t,T.action),disabled:o===t||z,children:o===t?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"w-4 h-4 mr-2 animate-spin"}),"Loading..."]}):s.jsxs(s.Fragment,{children:[T.icon,T.text]})})})():s.jsx(ie,{variant:"outline",className:"w-full",asChild:!0,children:s.jsx(be,{to:`/auth?mode=signup&redirect=/pricing&plan=${t}&interval=${r?"yearly":"monthly"}`,children:"Sign Up to Subscribe"})})]})}),s.jsx(ae.div,{ref:R,initial:{opacity:0,y:20}
610,animate:{opacity:1,y:0},transition:{delay:.2},children:s.jsxs(es,{className:`h-full p-6 border bg-card flex flex-col relative ${P(a)?"border-primary ring-2 ring-primary/20":"border-primary/30 ring-1 ring-primary/10"}`,children:[P(a)&&s.jsx(rt,{className:"absolute -top-3 left-1/2 -translate-x-1/2 bg-primary text-primary-foreground shadow-md",children:"Your Plan"}),s.jsxs("div",{className:"mb-4",children:[s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground mb-2",children:[s.jsx(ur,{className:"w-3.5 h-3.5"}),"Teams and agencies"]}),s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(Lf,{className:"w-5 h-5 text-primary"}),s.jsx("h3",{className:"font-semibold text-lg",children:"High-Volume Plans"}),s.jsx(rt,{className:"bg-primary/10 text-primary border-primary/20 text-xs",children:"Save at scale"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Everything in Standard plus volume discounts, priority support, and API access."})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"text-sm font-medium text-muted-foreground mb-2 block",children:"How many videos do you need?"}),s.jsxs(rp,{value:a,onValueChange:i,children:[s.jsx(Fc,{className:"w-full",children:s.jsx(sp,{})}),s.jsx(Vc,{children:ha.map(T=>s.jsx(zc,{value:T.key,children:s.jsxs("div",{className:"flex items-center justify-between w-full gap-4",children:[s.jsxs("span",{children:[T.videos," videos/month"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[P(T.key)&&s.jsx(rt,{variant:"outline",className:"text-xs border-primary text-primary",children:"Current"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:N?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"line-through",children:y(T.pricePerVideo)})," ",y(T.pricePerVideo*(1-k.discount_percent/100)),"/video"]}):s.jsxs(s.Fragment,{children:[y(T.pricePerVideo),"/video"]})})]})]})},T.key))})]})]}),s.jsxs("div",{className:"mb-6",children:[N&&s.jsxs(rt,{className:"mb-2 bg-primary/10 text-primary border-primary/30",children:[k.discount_percent,"% OFF Subscriptions"]}),s.jsxs("div",{className:"flex items-baseline flex-wrap gap-x-2 gap-y-0.5",children:[N?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-3xl sm:text-4xl font-bold whitespace-nowrap",children:y(_(se))}),s.jsx("span",{className:"text-base text-muted-foreground line-through whitespace-nowrap",children:y(se)})]}):s.jsx("span",{className:"text-3xl sm:text-4xl font-bold whitespace-nowrap",children:y(se)}),s.jsxs("span",{className:"text-muted-foreground",children:["/",r?"year":"month"]})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[re.toLocaleString()," videos ",r?"per year":"per month"]}),s.jsx(np,{})]}),s.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[s.jsxs(rt,{variant:"outline",className:"text-xs bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20",children:["Save ",y(Z)," vs standard"]}),r&&s.jsx(rt,{variant:"outline",className:"text-xs bg-primary/10 text-primary border-primary/20",children:"All credits upfront"})]})]}),s.jsxs("ul",{className:"space-y-2 mb-6 flex-grow",children:[s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{className:"font-medium",children:"Everything in Standard, plus:"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"Up to 120 seconds per video"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"Volume discount pricing"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"Priority support"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"Team collaboration"})]}),s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ue,{className:"w-4 h-4 text-foreground shrink-0"}),s.jsx("span",{children:"API access"})]})]}),x?(()=>{const T=E(a),z=T.action==="current";return s.jsx(ie,{className:"w-full",variant:z?"secondary":T.action==="downgrade"?"outline":"default",onClick:()=>U(a,T.action),disabled:o===a||z,children:o===a?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"w-4 h-4 mr-2 animate-spin"}),"Loading..."]}):s.jsxs(s.Fragment,{children:[T.icon,T.text]})})})():s.jsx(ie,{variant:"outline",className:"w-full",asChild:!0,children:s.jsx(be,{to:`/auth?mode=signup&redirect=/pricing&plan=${a}&interval=${r?"yearly":"monthly"}`,children:"Sign Up to Subscribe"})})]})})]}),s.jsx(O3,{}),s.jsx(ae.div,{initial:{opacity:0,y:20}
610,animate:{opacity:1,y:0},transition:{delay:.25},className:"max-w-md mx-auto mt-12",children:s.jsx(S3,{onRedemptionSuccess:()=>j(),variant:"card"})}),s.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"max-w-md mx-auto mb-16 mt-8",children:s.jsx(C3,{className:"w-full",animationDelay:.4})}),s.jsx(ae.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"mt-8",children:s.jsx(I3,{})}),s.jsx(ae.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"max-w-3xl mx-auto mb-12",children:s.jsxs(be,{to:"/products/url-to-ad",onClick:()=>_t("url_to_ad_crosslink_clicked",{source:"pricing"}),className:"flex items-center gap-4 p-5 rounded-xl border border-border bg-card hover:border-primary/30 transition-colors group",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center shrink-0",children:s.jsx(_r,{className:"w-5 h-5 text-primary"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-sm",children:"Need ads fast? Try URL-to-Ad"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste any product URL and generate video ads instantly"})]}),s.jsx(nr,{className:"w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]})}),w&&s.jsxs("p",{className:"text-xs text-muted-foreground text-center mb-8",children:["Prices shown in ",S," are approximate. You'll be charged in USD at checkout."]}),s.jsx("div",{className:"mb-8",children:s.jsx(z3,{variant:"marketer"})}),s.jsxs(ae.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"max-w-3xl mx-auto",children:[s.jsx("h2",{className:"text-lg font-medium text-muted-foreground mb-6",children:"Pricing FAQ"}),s.jsx("div",{className:"border border-border rounded-lg overflow-hidden",children:s.jsx(nv,{type:"single",collapsible:!0,children:M.map((T,z)=>s.jsxs(Qd,{value:`faq-${z}`,className:"border-b border-border last:border-b-0 px-6",children:[s.jsx(eu,{className:"text-left hover:no-underline py-4",children:s.jsx("span",{className:"font-medium text-sm",children:T.question})}),s.jsx(tu,{className:"text-muted-foreground text-sm pb-4",children:T.answer})]},z))})})]})]})}),s.jsx(Nv,{}),s.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:M.map(T=>({"@type":"Question",name:T.question,acceptedAnswer:{"@type":"Answer",text:T.answer}}))})}})]}),h?.isDowngrade&&s.jsx(j3,{open:!!h,onClose:ee,onConfirm:D,currentPlan:g.plan,targetPlanKey:h.key,targetPlanName:h.name,currentCredits:g.credits,currentCreditAllocation:g.creditAllocation,subscriptionEnd:g.subscriptionEnd,isTestMode:g.isTestMode}),s.jsx(sy,{open:!!h&&!h.isDowngrade,onOpenChange:T=>!T&&ee(),children:s.jsxs(cu,{children:[s.jsxs(du,{children:[s.jsxs(hu,{className:"flex items-center gap-2",children:[s.jsx(Fl,{className:"w-5 h-5 text-primary"}),"Confirm Upgrade"]}),s.jsx(mu,{asChild:!0,children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{children:["You're about to upgrade to ",h?.name,"."]}),f&&!f.loading&&!f.error?s.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-lg p-4 space-y-2",children:[s.jsx("p",{className:"font-medium",children:"Credit Impact Summary:"}),s.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground",children:[s.jsxs("li",{children:["Prorated charge today: ",s.jsxs("span",{className:"font-medium text-foreground",children:["$",(f.immediateCharge/100).toFixed(2)]})]}),s.jsxs("li",{children:["Days remaining: ",s.jsx("span",{className:"font-medium text-foreground",children:f.daysRemaining})]}),s.jsx("li",{children:"New credits added immediately"})]})]}):f?.loading?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Mt,{className:"w-4 h-4 animate-spin"}),"Calculating proration..."]}):null]})})]}),s.jsxs(uu,{children:[s.jsx(fu,{onClick:ee,children:"Cancel"}),s.jsx(pu,{onClick:D,children:"Confirm Upgrade"})]})]})})]})}const W3=Object.freeze(Object.defineProperty({__proto__:null,default:oy},Symbol.toStringTag,{value:"Module"})),G3=()=>{const r=ot();return u.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",r.pathname)},[r.pathname]),s.jsxs(s.Fragment,{children:[s.jsx(Hs,{title:"Page Not Found",description:"The page you're looking for doesn't exist. Return to Vidacious homepage to create AI-powered video ads.",noIndex:!0}),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center px-4",children:[s.jsx("h1",{className:"mb-4 text-6xl font-bold text-primary",children:"404"}),s.jsx("p",{className:"mb-6 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("p",{className:"mb-8 text-sm text-muted-foreground max-w-md mx-auto",children:"The page you're looking for doesn't exist or has been moved."}),s.jsx(ie,{asChild:!0,children:s.jsxs(be,{to:"/",children:[s.jsx(Ma,{className:"w-4 h-4 mr-2"}),"Return to Home"]})})]})})]})};var xu={};(function r(e,t,n,a){var i=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!e.OffscreenCanvas)return!1;try{var P=new OffscreenCanvas(1,1),E=P.getContext("2d");E.fillRect(0,0,1,1);var U=P.transferToImageBitmap();E.createPattern(U,"no-repeat")}catch{return!1}return!0}();function d(){}function c(P){var E=t.exports.Promise,U=E!==void 0?E:e.Promise;return typeof U=="function"?new U(P):(P(d,d),null)}
vendor: 4,125 bytes, lines 610-611
610var h=function(P,E){return{transform:function(U){if(P)return U;if(E.has(U))return E.get(U);var J=new OffscreenCanvas(U.width,U.height),te=J.getContext("2d");return te.drawImage(U,0,0),E.set(U,J),J},clear:function(){E.clear()}}}(l,new Map),m=function(){var P=Math.floor(16.666666666666668),E,U,J={},te=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(E=function(D){var ee=Math.random();return J[ee]=requestAnimationFrame(function T(z){te===z||te+P-1<z?(te=z,delete J[ee],D()):J[ee]=requestAnimationFrame(T)}),ee},U=function(D){J[D]&&cancelAnimationFrame(J[D])}):(E=function(D){return setTimeout(D,P)},U=function(D){return clearTimeout(D)}),{frame:E,cancel:U}}(),f=function(){var P,E,U={};function J(te){function D(ee,T){te.postMessage({options:ee||{},callback:T})}te.init=function(T){var z=T.transferControlToOffscreen();te.postMessage({canvas:z},[z])},te.fire=function(T,z,q){if(E)return D(T,null),E;var ce=Math.random().toString(36).slice(2);return E=c(function(pe){function ke(de){de.data.callback===ce&&(delete U[ce],te.removeEventListener("message",ke),E=null,h.clear(),q(),pe())}te.addEventListener("message",ke),D(T,ce),U[ce]=ke.bind(null,{data:{callback:ce}})}),E},te.reset=function(){te.postMessage({reset:!0});for(var T in U)U[T](),delete U[T]}}return function(){if(P)return P;if(!n&&i){var te=["var CONFETTI, SIZE = {}, module = {};","("+r.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` 611`);try{P=new Worker(URL.createObjectURL(new Blob([te])))}catch(D){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("ð Could not load worker",D),null}J(P)}return P}}(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function v(P,E){return E?E(P):P}function x(P){return P!=null}function g(P,E,U){return v(P&&x(P[E])?P[E]:p[E],U)}function b(P){return P<0?0:Math.floor(P)}function j(P,E){return Math.floor(Math.random()*(E-P))+P}function k(P){return parseInt(P,16)}function y(P){return P.map(w)}function w(P){var E=String(P).replace(/[^0-9a-f]/gi,"");return E.length<6&&(E=E[0]+E[0]+E[1]+E[1]+E[2]+E[2]),{r:k(E.substring(0,2)),g:k(E.substring(2,4)),b:k(E.substring(4,6))}}function S(P){var E=g(P,"origin",Object);return E.x=g(E,"x",Number),E.y=g(E,"y",Number),E}function N(P){P.width=document.documentElement.clientWidth,P.height=document.documentElement.clientHeight}function _(P){var E=P.getBoundingClientRect();P.width=E.width,P.height=E.height}function C(P){var E=document.createElement("canvas");return E.style.position="fixed",E.style.top="0px",E.style.left="0px",E.style.pointerEvents="none",E.style.zIndex=P,E}function O(P,E,U,J,te,D,ee,T,z){P.save(),P.translate(E,U),P.rotate(D),P.scale(J,te),P.arc(0,0,1,ee,T,z),P.restore()}function R(P){var E=P.angle*(Math.PI/180),U=P.spread*(Math.PI/180);return{x:P.x,y:P.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:P.startVelocity*.5+Math.random()*P.startVelocity,angle2D:-E+(.5*U-Math.random()*U),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:P.color,shape:P.shape,tick:0,totalTicks:P.ticks,decay:P.decay,drift:P.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:P.gravity*3,ovalScalar:.6,scalar:P.scalar,flat:P.flat}}function M(P,E){E.x+=Math.cos(E.angle2D)*E.velocity+E.drift,E.y+=Math.sin(E.angle2D)*E.velocity+E.gravity,E.velocity
611*=E.decay,E.flat?(E.wobble=0,E.wobbleX=E.x+10*E.scalar,E.wobbleY=E.y+10*E.scalar,E.tiltSin=0,E.tiltCos=0,E.random=1):(E.wobble+=E.wobbleSpeed,E.wobbleX=E.x+10*E.scalar*Math.cos(E.wobble),E.wobbleY=E.y+10*E.scalar*Math.sin(E.wobble),E.tiltAngle+=.1,E.tiltSin=Math.sin(E.tiltAngle),E.tiltCos=Math.cos(E.tiltAngle),E.random=Math.random()+2);var U=E.tick++/E.totalTicks,J=E.x+E.random*E.tiltCos,te=E.y+E.random*E.tiltSin,D=E.wobbleX+E.random*E.tiltCos,ee=E.wobbleY+E.random*E.tiltSin;if(P.fillStyle="rgba("+E.color.r+", "+E.color.g+", "+E.color.b+", "+(1-U)+")",P.beginPath(),o&&E.shape.type==="path"&&typeof E.shape.path=="string"&&Array.isArray(E.shape.matrix))P.fill(se(E.shape.path,E.shape.matrix,E.x,E.y,Math.abs(D-J)*.1,Math.abs(ee-te)*.1,Math.PI/10*E.wobble));else if(E.shape.type==="bitmap"){var T=Math.PI/10*E.wobble,z=Math.abs(D-J)*.1,q=Math.abs(ee-te)*.1,ce=E.shape.bitmap.width*E.scalar,pe=E.shape.bitmap.height*E.scalar,ke=new DOMMatrix([Math.cos(T)*z,Math.sin(T)*z,-Math.sin(T)*q,Math.cos(T)*q,E.x,E.y]);ke.multiplySelf(new DOMMatrix(E.shape.matrix));var de=P.createPattern(h.transform(E.shape.bitmap),"no-repeat");de.setTransform(ke),P.globalAlpha=1-U,P.fillStyle=de,P.fillRect(E.x-ce/2,E.y-pe/2,ce,pe),P.globalAlpha=1}else if(E.shape==="circle")P.ellipse?P.ellipse(E.x,E.y,Math.abs(D-J)*E.ovalScalar,Math.abs(ee-te)*E.ovalScalar,Math.PI/10*E.wobble,0,2*Math.PI):O(P,E.x,E.y,Math.abs(D-J)*E.ovalScalar,Math.abs(ee-te)*E.ovalScalar,Math.PI/10*E.wobble,0,2*Math.PI);else if(E.shape==="star")for(var _e=Math.PI/2*3,$e=4*E.scalar,st=8*E.scalar,Ae=E.x,We=E.y,He=5,et=Math.PI/He;He--;)Ae=E.x+Math.cos(_e)*st,We=E.y+Math.sin(_e)*st,P.lineTo(Ae,We),_e+=et,Ae=E.x+Math.cos(_e)*$e,We=E.y+Math.sin(_e)*$e,P.lineTo(Ae,We),_e+=et;else P.moveTo(Math.floor(E.x),Math.floor(E.y)),P.lineTo(Math.floor(E.wobbleX),Math.floor(te)),P.lineTo(Math.floor(D),Math.floor(ee)),P.lineTo(Math.floor(J),Math.floor(E.wobbleY));return P.closePath(),P.fill(),E.tick<E.totalTicks}function L(P,E,U,J,te){var D=E.slice(),ee=P.getContext("2d"),T,z,q=c(function(ce){function pe(){T=z=null,ee.clearRect(0,0,J.width,J.height),h.clear(),te(),ce()}function ke(){n&&!(J.width===a.width&&J.height===a.height)&&(J.width=P.width=a.width,J.height=P.height=a.height),!J.width&&!J.height&&(U(P),J.width=P.width,J.height=P.height),ee.clearRect(0,0,J.width,J.height),D=D.filter(function(de){return M(ee,de)}),D.length?T=m.frame(ke):pe()}T=m.frame(ke),z=pe});return{addFettis:function(ce){return D=D.concat(ce),q},canvas:P,promise:q,reset:function(){T&&m.cancel(T),z&&z()}}}function A(P,E){var U=!P,J=!!g(E||{},"resize"),te=!1,D=g(E,"disableForReducedMotion",Boolean),ee=i&&!!g(E||{},"useWorker"),T=ee?f():null,z=U?N:_,q=P&&T?!!P.__confetti_initialized:!1,ce=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,pe;function ke(_e,$e,st){for(var Ae=g(_e,"particleCount",b),We=g(_e,"angle",Number),He=g(_e,"spread",Number),et=g(_e,"startVelocity",Number),At=g(_e,"decay",Number),Kt=g(_e,"gravity",Number),qt=g(_e,"drift",Number),Dr=g(_e,"colors",y),Nr=g(_e,"ticks",Number),xt=g(_e,"shapes"),Vt=g(_e,"scalar"),Qt=!!g(_e,"flat"),Ge=S(_e),er=Ae,Tt=[],tr=P.width*Ge.x,Wt=P.height*Ge.y;er--;)Tt.push(R({x:tr,y:Wt,angle:We,spread:He,startVelocity:et,color:Dr[er%Dr.length],shape:xt[j(0,xt.length)],ticks:Nr,decay:At,gravity:Kt,drift:qt,scalar:Vt,flat:Qt}));return pe?pe.addFettis(Tt):(pe=L(P,Tt,z,$e,st),pe.promise)}function de(_e){var $e=D||g(_e,"disableForReducedMotion",Boolean),st=g(_e,"zIndex",Number);if($e&&ce)return c(function(et){et()});U&&pe?P=pe.canvas:U&&!P&&(P=C(st),document.body.appendChild(P)),J&&!q&&z(P);var Ae={width:P.width,height:P.height};T&&!q&&T.init(P),q=!0,T&&(P.__confetti_initialized=!0);function We(){if(T){var et={getBoundingClientRect:function(){if(!U)return P.getBoundingClientRect()}};z(et),T.postMessage({resize:{width:et.width,height:et.height}});return}Ae.width=Ae.height=null}function He(){pe=null,J&&(te=!1,e.removeEventListener("resize",We)),U&&P&&(document.body.contains(P)&&document.body.removeChild(P),P=null,q=!1)}return J&&!te&&(te=!0,e.addEventListener("resize",We,!1)),T?T.fire(_e,Ae,He):ke(_e,Ae,He)}return de.reset=function(){T&&T.reset(),pe&&pe.reset()},de}var V;function G(){return V||(V=A(null,{useWorker:!0,resize:!0})),V}function se(P,E,U,J,te,D,ee){var T=new Path2D(P),z=new Path2D;z.addPath(T,new DOMMatrix(E));var q=new Path2D;return q.addPath(z,new DOMMatrix([Math.cos(ee)*te,Math.sin(ee)*te,-Math.sin(ee)*D,Math.cos(ee)*D,U,J])),q}function re(P){if(!o)throw new Error("path confetti are not supported in this browser");var E,U;typeof P=="string"?E=P:(E=P.path,U=P.matrix);var J=new Path2D(E),te=document.createElement("canvas"),D=te.getContext("2d");if(!U){for(var ee=1e3,T=ee,z=ee,q=0,ce=0,pe,ke,de=0;de<ee;de+=2)for(var _e=0;_e<ee;_e+=2)D.isPointInPath(J,de,_e,"nonzero")&&(T=Math.min(T,de),z=Math.min(z,_e),q=Math.max(q,de),ce=Math.max(ce,_e));pe=q-T,ke=ce-z;var $e=10,st=Math.min($e/pe,$e/ke);U=[st,0,0,st,-Math.round(pe/2+T)*st,-Math.round(ke/2+z)*st]}return{type:"path",path:E,matrix:U}}function Z(P){var E,U=1,J="#000000",te='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof P=="string"?E=P:(E=P.text,U="scalar"in P?P.scalar:U,te="fontFamily"in P?P.fontFamily:te,J="color"in P?P.color:J);var D=10*U,ee=""+D+"px "+te,T=new OffscreenCanvas(D,D),z=T.getContext("2d");z.font=ee;var q=z.measureText(E),ce=Math.ceil(q.actualBoundingBoxRight+q.actualBoundingBoxLeft),pe=Math.ceil(q.actualBoundingBoxAscent+q.actualBoundingBoxDescent),ke=2,de=q.actualBoundingBoxLeft+ke,_e=q.actualBoundingBoxAscent+ke;ce+=ke+ke,pe+=ke+ke,T=new OffscreenCanvas(ce,pe),z=T.getContext("2d"),z.font=ee,z.fillStyle=J,z.fillText(E,de,_e);var $e=1/U;return{type:"bitmap",bitmap:T.transferToImageBitmap(),matrix:[$e,0,0,$e,-ce*$e/2,-pe*$e/2]}}t.exports=function(){return G().apply(this,arguments)},t.exports.reset=function(){G().reset()},t.exports.create=A,t.exports.shapeFromPath=re,t.exports.shapeFromText=Z})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),xu,!1);const op=xu.exports;xu.exports.create;const lp=()=>{const e=Date.now()+3e3,t={startVelocity:30,spread:360,ticks:60,zIndex:9999},n=(i,o)=>Math.random()*(o-i)+i,a=setInterval(()=>{const i=e-Date.now();if(i<=0)return clearInterval(a);const o=50*(i/3e3);op({...t,particleCount:o,origin:{x:n(.1,.3),y:Math.random()-.2},colors:["#f59e0b","#f97316","#22c55e","#8b5cf6","#06b6d4"]}),op({...t,particleCount:o,origin:{x:n(.7,.9),y:Math.random()-.2},colors:["#f59e0b","#f97316","#22c55e","#8b5cf6","#06b6d4"]})},250)};function Y3(){const[r]=Tn(),e=Xt(),{user:t,profile:n,refreshProfile:a}=Ee(),{checkSubscription:i}=Ns(),[o,l]=u.useState("loading"),[d,c]=u.useState(""),[h,m]=u.useState(!1),[f,p]=u.useState(!1),[v,x]=u.useState(null),[g,b]=u.useState(!0),j=async N=>{l("success"),h||(m(!0),setTimeout(()=>lp(),300)),N!==void 0&&x(N),await a(),await i()};u.useEffect(()=>{(async()=>{b(!0);const _=r.get("success"),C=r.get("error"),O=r.get("token"),R=r.get("email"),M=r.get("email");if(C||_==="verified"||_==="already_verified"){let L=null;if(t){const{data:A}=await W.from("profiles").select("email_verified, credits").eq("user_id",t.id).single();L=A}else if(M){const{data:A}=await W.from("profiles").select("email_verified, credits").eq("email",M).maybeSingle();L=A}if(L?.email_verified){await j(L.credits),b(!1);return}}if(_==="verified"){const L=r.get("credits");if(L){const A=parseInt(L,10);if(!isNaN(A)){await j(A),b(!1);return}}if(t){const{data:A}=await W.from("profiles").select("credits").eq("user_id",t.id).single();await j(A?.credits)}else l("success"),h||(m(!0),setTimeout(()=>lp(),300));b(!1);return}if(_==="already_verified"){l("already_verified"),b(!1);return}if(C){switch(C){case"token_expired":l("expired"),c("Your verification link has expired. Please request a new one.");break;
611case"invalid_token":l("error"),c("This verification link is no longer valid. Request a new one below.");break;case"missing_params":l("error"),c("Invalid verification link. Please use the link from your email.");break;default:l("error"),c("Something went wrong. Please try again or contact support.")}b(!1);return}if(O&&R){try{window.location.href=`https://cnocqjydxkzeytrirrsn.supabase.co/functions/v1/verify-email?token=${encodeURIComponent(O)}&email=${encodeURIComponent(R)}`}catch{l("error"),c("Failed to verify email. Please try again."),b(!1)}return}if(t){const{data:L}=await W.from("profiles").select("email_verified, credits").eq("user_id",t.id).single();if(L?.email_verified){l("already_verified"),x(L.credits),b(!1);return}}l("loading"),b(!1)})()},[r,t,a,i,h]);const k=async()=>{if(!t){e("/auth?mode=login");return}if(!f){p(!0);try{const{data:N,error:_}=await W.functions.invoke("resend-verification-email");if(_){_.message?.includes("429")?ne.error("Please wait before requesting another email"):ne.error("Failed to send verification email");return}if(N?.error==="rate_limited"){ne.error(N.message||"Please wait before requesting another email");return}if(N?.message==="Email already verified"){const{data:C}=await W.from("profiles").select("credits").eq("user_id",t.id).single();await j(C?.credits),ne.success("Your email is already verified! ð");return}ne.success("Verification email sent! Check your inbox."),c("")}catch(N){console.error("Failed to resend:",N),ne.error("Failed to send verification email. Please try again later.")}finally{p(!1)}}},y=()=>{e("/dashboard")},w=()=>{e("/create")},S=()=>{e("/auth?mode=login")};return g&&o==="loading"?s.jsxs(s.Fragment,{children:[s.jsx(Hs,{title:"Verify Email | Vidacious",description:"Verify your email address to unlock all Vidacious features.",noIndex:!0}),s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background to-muted/30 p-4",children:s.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"w-full max-w-md",children:s.jsx(es,{className:"w-full overflow-hidden",children:s.jsxs(to,{className:"text-center",children:[s.jsx("div",{className:"mx-auto mb-4 w-16 h-16 rounded-full bg-muted flex items-center justify-center",children:s.jsx(Mt,{className:"w-8 h-8 text-primary animate-spin"})}),s.jsx(ds,{children:"Verifying your email..."}),s.jsx(us,{children:"Please wait while we verify your email address."})]})})})})]}):s.jsxs(s.Fragment,{children:[s.jsx(Hs,{title:"Verify Email | Vidacious",description:"Verify your email address to unlock all Vidacious features.",noIndex:!0}),s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background to-muted/30 p-4",children:s.jsx(ae.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"w-full max-w-md",children:s.jsxs(es,{className:"w-full overflow-hidden",children:[o==="success"&&s.jsx("div",{className:"h-2 bg-gradient-to-r from-green-500 via-emerald-500 to-teal-500"}),s.jsxs(to,{className:"text-center",children:[o==="loading"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mx-auto mb-4 w-16 h-16 rounded-full bg-muted flex items-center justify-center",children:s.jsx(Mt,{className:"w-8 h-8 text-primary animate-spin"})}),s.jsx(ds,{children:"Verifying your email..."}),s.jsx(us,{children:"Please wait while we verify your email address."})]}),o==="success"&&s.jsxs(s.Fragment,{children:[s.jsx(ae.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",duration:.6,delay:.2},className:"mx-auto mb-4 w-20 h-20 rounded-full bg-gradient-to-br from-green-500/20 to-emerald-500/20 flex items-center justify-center",children:s.jsx(wi,{className:"w-10 h-10 text-green-500"})}),s.jsxs(ae.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.4},children:[s.jsx(ds,{className:"text-2xl bg-gradient-to-r from-green-600 to-emerald-600 bg-clip-text text-transparent",children:"ð Email Verified!"}),s.jsx(us,{className:"text-base mt-2",children:"Welcome to Vidacious! Your account is now fully activated."})]})]}),o==="already_verified"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mx-auto mb-4 w-16 h-16 rounded-full bg-blue-500/10 flex items-center justify-center",children:s.jsx(wi,{className:"w-8 h-8 text-blue-500"})}),s.jsx(ds,{className:"text-blue-600",children:"Already Verified"}),s.jsx(us,{children:"Your email address is already verified. You have full access to all features."})]}),o==="expired"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mx-auto mb-4 w-16 h-16 rounded-full bg-amber-500/10 flex items-center justify-center",children:s.jsx(Ls,{className:"w-8 h-8 text-amber-500"})}),s.jsx(ds,{className:"text-amber-600",children:"Link Expired"}),s.jsx(us,{children:"Your verification link has expired (links are valid for 24 hours)."})]}),o==="error"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mx-auto mb-4 w-16 h-16 rounded-full bg-red-500/10 flex items-center justify-center",children:s.jsx(kf,{className:"w-8 h-8 text-red-500"})}),s.jsx(ds,{className:"text-red-600",children:"Verification Failed"}),s.jsx(us,{children:d})]})]}),s.jsxs(Lo,{className:"space-y-4",children:[o==="success"&&s.jsxs(s.Fragment,{children:[s.jsx(ae.div,{initial:{opacity:0,scale:.95}
611,animate:{opacity:1,scale:1},transition:{delay:.6},className:"p-4 rounded-xl bg-gradient-to-r from-amber-500/10 via-orange-500/10 to-amber-500/10 border border-amber-500/20",children:s.jsxs("div",{className:"flex items-center justify-center gap-3",children:[s.jsx("div",{className:"p-2 rounded-lg bg-amber-500/20",children:s.jsx(fo,{className:"w-5 h-5 text-amber-500"})}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"font-semibold text-amber-600 dark:text-amber-400",children:"+30 credits unlocked!"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:v!==null?s.jsxs(s.Fragment,{children:["Your balance: ",s.jsxs("span",{className:"font-medium text-foreground",children:[v," credits"]})]}):s.jsx(s.Fragment,{children:"Ready to create amazing videos"})})]})]})}),s.jsxs(ae.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.8},className:"space-y-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"What you've unlocked:"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[s.jsxs("div",{className:"flex items-center justify-center gap-2 p-2 rounded-lg bg-secondary/50",children:[s.jsx(Bt,{className:"w-4 h-4 text-primary"}),s.jsx("span",{children:"Full video access"})]}),s.jsxs("div",{className:"flex items-center justify-center gap-2 p-2 rounded-lg bg-secondary/50",children:[s.jsx(Ni,{className:"w-4 h-4 text-primary"}),s.jsx("span",{children:"HD downloads"})]})]})]}),s.jsxs(ae.div,{initial:{opacity:0}
611,animate:{opacity:1},transition:{delay:1},className:"flex flex-col gap-2 pt-2",children:[s.jsxs(ie,{onClick:w,className:"w-full gap-2 bg-gradient-to-r from-primary to-primary/80",children:[s.jsx(Ni,{className:"w-4 h-4"}),"Create your first video"]}),s.jsx(ie,{variant:"outline",onClick:y,className:"w-full",children:"Go to Dashboard"})]})]}),o==="already_verified"&&s.jsx(ie,{onClick:y,className:"w-full",children:"Go to Dashboard"}),o==="expired"&&s.jsxs(ae.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-3",children:[s.jsx("div",{className:"p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:s.jsxs("p",{className:"text-sm text-amber-700 dark:text-amber-300 text-center",children:[s.jsx(on,{className:"w-4 h-4 inline mr-1.5 -mt-0.5"}),"No worries! Click below to get a fresh link."]})}),t?s.jsxs(ie,{onClick:k,className:"w-full gap-2",disabled:f,children:[f?s.jsx(Mt,{className:"w-4 h-4 animate-spin"}):s.jsx(Ds,{className:"w-4 h-4"}),f?"Sending...":"Get New Verification Link"]}):s.jsx(ie,{onClick:S,className:"w-full",children:"Log in to Request New Link"}),s.jsx(ie,{variant:"outline",onClick:y,className:"w-full",children:"Continue to Dashboard"})]}),o==="error"&&s.jsxs(s.Fragment,{children:[t?s.jsxs(ie,{onClick:k,className:"w-full gap-2",disabled:f,children:[f?s.jsx(Mt,{className:"w-4 h-4 animate-spin"}):s.jsx(Ds,{className:"w-4 h-4"}),f?"Sending...":"Send New Verification Email"]}):s.jsx(ie,{onClick:S,className:"w-full",children:"Log in to Request New Link"}),s.jsx(ie,{variant:"outline",onClick:y,className:"w-full",children:"Continue to Dashboard"})]}),o==="loading"&&!r.get("token")&&s.jsx("div",{className:"text-center text-sm text-muted-foreground",children:s.jsx("p",{children:"If you arrived here directly, please use the verification link from your email."})})]})]})})})]})}function Z3({to:r}){return typeof window<"u"&&window.location.replace(r),null}const J3=u.lazy(()=>F(()=>import("./ExperimentDebugOverlay-CdUBl3SZ.js"),__vite__mapDeps([122,1,15,14,2,5,16])).then(r=>({default:r.ExperimentDebugOverlay}))),X3=B(()=>F(()=>import("./MobileCallback-Bwt_u1Tj.js"),__vite__mapDeps([123,1,15,14,2,5,16]))),K3=B(()=>F(()=>import("./AppleCallback-lqKLqEhi.js"),__vite__mapDeps([124,1,2,15,14,5,16]))),Q3=B(()=>F(()=>import("./RecoverAccount-wVr_PNXH.js"),__vite__mapDeps([125,1,2,5,15,14,16]))),eT=B(()=>F(()=>import("./Dashboard-CkOSf2Sh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])));B(()=>F(()=>import("./CreatorDashboard-CQzQitVe.js"),__vite__mapDeps([126,1,15,14,2,5,16])).then(r=>({default:r.CreatorDashboard})));const tT=B(()=>F(()=>import("./CreatorDashboardPage-CZqzrLZS.js"),__vite__mapDeps([127,1,126,15,14,2,5,16,8]))),rT=B(()=>F(()=>import("./DashboardTest-C2XsmNaj.js"),__vite__mapDeps([128,1,2,3,4,5,6,7,8,126,15,14,16,9,10,11,12]))),sT=B(()=>F(()=>import("./CreateVideoV2-CQvEvCgA.js"),__vite__mapDeps([17,1,2,14,18,10,11,5,12,19,20,7,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,15,41,42,43,44,45,46,47,48,4,49,50,51,52,53,16]))),nT=B(()=>F(()=>import("./VoiceOutputDemo-DT7im8rf.js"),__vite__mapDeps([129,1,15,14,2,5,16]))),aT=B(()=>F(()=>import("./CheckoutSuccess-DF2pkT8Y.js"),__vite__mapDeps([130,1,2,9,10,11,5,12,42,15,14,16]))),iT=B(()=>F(()=>import("./Settings-CRijON7k.js"),__vite__mapDeps([54,1,4,55,5,2,9,10,11,12,56,57,58,43,59,60,7,42,61,62,63,64,65,66,67,68,69,70,71,48,72,15,14,16]))),oT=B(()=>F(()=>import("./Scripts-CSETMmPv.js"),__vite__mapDeps([131,1,19,4,2,10,11,5,12,34,93,37,50,22,132,83,51,69,84,43,15,14,16]))),lT=B(()=>F(()=>import("./Voices-C6kgIcG-.js"),__vite__mapDeps([97,1,39,98,37,5,27,34,96,2,91,15,14,16]))),cT=B(()=>F(()=>import("./Actors-CSt-Jxfn.js"),__vite__mapDeps([94,1,2,9,10,11,5,12,18,30,27,95,34,96,14,23,26,45,91,15,16]))),dT=B(()=>F(()=>import("./Exports-CI0yugE1.js"),__vite__mapDeps([73,1,26,23,74,75,76,2,9,10,11,5,12,77,33,78,79,80,81,44,82,50,83,84,43,62,14,4,19,64,20,66,49,85,7,86,87,88,89,34,90,91,92,93,15,16]))),uT=B(()=>F(()=>import("./Campaigns-CthLE8D2.js"),__vite__mapDeps([133,1,81,2,9,10,11,5,12,62,82,134,93,83,51,43,84,135,15,14,16]))),hT=B(()=>F(()=>import("./Feed-LfH8gaNh.js"),__vite__mapDeps([136,1,2,5,32,137,14,18,138,12,85,27,139,6,68,140,7,13,15,16]))),mT=
611B(()=>F(()=>import("./Following-PjUR4aZd.js"),__vite__mapDeps([141,1,2,68,30,140,27,5,142,143,72,38,15,14,16]))),pT=B(()=>F(()=>import("./WhatsNew-BB-29QTx.js"),__vite__mapDeps([144,1,2,37,5,15,14,16]))),fT=B(()=>F(()=>import("./Credits-DcfmFVve.js"),__vite__mapDeps([145,1,146,15,2,147,5,4,148,37,149,61,60,7,42,9,10,11,12,150,20,14,16]))),cp=B(()=>F(()=>import("./TrustCenter-BFKxXhHJ.js").then(r=>r.T),__vite__mapDeps([151,1,2,152,106,91,5]))),gT=B(()=>F(()=>import("./CreatorAgreement-D73pzpVg.js"),__vite__mapDeps([153,1,2,154,15,14,5,16]))),xT=B(()=>F(()=>import("./Blog-bA3fVfUw.js"),__vite__mapDeps([155,1,2,156,5,15,14,16]))),vT=B(()=>F(()=>import("./BlogPost-BeMcNTQZ.js"),__vite__mapDeps([157,1,2,156,5,91,158,85,159,92,15,14,16]))),yT=B(()=>F(()=>import("./HelpCenter-BdD6bGY0.js"),__vite__mapDeps([160,1,2,15,14,5,16])));B(()=>F(()=>import("./APIDocs-nvdc4f4R.js"),__vite__mapDeps([161,1,2,15,14,5,16])));const bT=B(()=>F(()=>import("./Tutorials-WogddvLx.js"),__vite__mapDeps([162,1,2,163,15,14,5,16]))),_T=B(()=>F(()=>import("./CaseStudies-Cd_HQhQ5.js"),__vite__mapDeps([164,1,2,165,166,163,115,15,14,5,16]))),wT=B(()=>F(()=>import("./CaseStudyDetail-BaDTb9EV.js"),__vite__mapDeps([167,1,2,158,159,101,165,166,163,5,15,14,16]))),jT=B(()=>F(()=>import("./About-DHwnHFdj.js"),__vite__mapDeps([168,1,2,5,163,169,15,14,16]))),kT=B(()=>F(()=>import("./Careers-MYY-wzgi.js"),__vite__mapDeps([170,1,2,5,27,15,14,16]))),NT=B(()=>F(()=>import("./Press-BK2ehli3.js"),__vite__mapDeps([171,1,2,5,44,15,14,16]))),ST=B(()=>F(()=>import("./Contact-Bs97dswA.js"),__vite__mapDeps([172,1,2,19,4,5,111,15,14,16]))),ET=B(()=>F(()=>import("./Partners-pEZJjHRx.js"),__vite__mapDeps([173,1,2,5,102,15,14,16]))),CT=B(()=>F(()=>import("./BrandAssets-B6u2YjLk.js"),__vite__mapDeps([174,1,5,31,15,14,2,16]))),TT=B(()=>F(()=>import("./FeedbackThanks-DtF_gS4q.js"),__vite__mapDeps([175,1,2,15,14,5,16]))),PT=B(()=>F(()=>import("./Developers-jBUifcaA.js"),__vite__mapDeps([104,1,2,5,105,106,107,15,14,16]))),AT=B(()=>F(()=>import("./Quickstart-DaWR0MVf.js"),__vite__mapDeps([176,1,2,45,15,14,5,16]))),IT=B(()=>F(()=>import("./APIReference-uXp0s4nI.js"),__vite__mapDeps([177,1,2,178,106,15,14,5,16]))),RT=B(()=>F(()=>import("./Authentication-DnyAJJGj.js"),__vite__mapDeps([179,1,2,45,178,43,15,14,5,16]))),MT=B(()=>F(()=>import("./SDKs-Do4V_lzx.js"),__vite__mapDeps([180,1,2,15,14,5,16]))),OT=B(()=>F(()=>import("./Webhooks-Cd3KUkZA.js"),__vite__mapDeps([181,1,2,45,178,15,14,5,16]))),DT=B(()=>F(()=>import("./RateLimits-B2fwgvgF.js"),__vite__mapDeps([182,1,2,45,178,15,14,5,16]))),LT=B(()=>F(()=>import("./Playground-BPi_yM2Q.js"),__vite__mapDeps([183,1,2,19,4,45,5,43,15,14,16]))),$T=B(()=>F(()=>import("./ApiPricing-CyCjqJ2G.js"),__vite__mapDeps([184,1,2,20,5,15,14,16]))),FT=B(()=>F(()=>import("./BillingCreditsDoc-XPLMkjRI.js"),__vite__mapDeps([185,1,2,20,15,14,5,16]))),VT=B(()=>F(()=>import("./Sandbox-CGTzw-63.js"),__vite__mapDeps([186,1,2,45,15,14,5,16]))),zT=B(()=>F(()=>import("./Testing-DuHikvpZ.js"),__vite__mapDeps([187,1,2,15,14,5,16]))),HT=B(()=>F(()=>import("./ConsoleOverview-CqQMp5pY.js"),__vite__mapDeps([188,1,2,57,11,5,15,14,16]))),UT=B(()=>F(()=>import("./ConsoleApiKeys-DauHBppt.js"),__vite__mapDeps([189,1,56,4,57,2,5,58,43,15,14,16]))),BT=B(()=>F(()=>import("./ConsoleWebhooks-CZLlsof9.js"),__vite__mapDeps([190,1,59,4,2,5,43,15,14,16]))),qT=B(()=>F(()=>import("./ConsoleUsage-B_9kOrgn.js"),__vite__mapDeps([191,1,146,15,148,5,37,14,2,16]))),WT=B(()=>F(()=>import("./ConsoleBilling-DnR1PTer.js"),__vite__mapDeps([192,1,149,2,5,61,147,4,42,150,148,37,15,14,16]))),GT=B(()=>F(()=>import("./ConsoleLimits-BVpeEco7.js"),__vite__mapDeps([193,1,150,4,57,15,14,2,5,16]))),YT=B(()=>F(()=>import("./ConsoleSandbox-h-4VVQQ_.js"),__vite__mapDeps([194,1,45,2,5,15,14,16]))),ZT=B(()=>F(()=>import("./Studio-CBLPgtyX.js"),__vite__mapDeps([195,1,2,110,19,5,111,15,14,16,44,102,95]))),JT=B(()=>F(()=>import("./API-DXWEJKWO.js"),__vite__mapDeps([196,1,2,5,105,15,14,16]))),XT=B(()=>F(()=>import("./UrlToAd-Dq6_y-0F.js"),__vite__mapDeps([197,1,2,198,86,199,15,14,5,16,102,111]))),KT=B(()=>F(()=>import("./AdClone-6Cmoq5GR.js"),__vite__mapDeps([200,1,2,5,102,15,14,16]))),QT=B(()=>F(()=>import("./ContextReply-BBNFVQ4K.js"),__vite__mapDeps([201,1,2,5,111,15,14,16])));B(()=>F(()=>import("./ProductVideo-Lg7w3cVF.js"),__vite__mapDeps([202,1,2,5,42,102,15,14,16])));const eP=B(()=>F(()=>import("./ShowcaseStudioLanding-CuC-gcdf.js"),__vite__mapDeps([203,1,5,65,47,204,2,102,163,15,14,16]))),tP=B(()=>F(()=>import("./GuestSandbox-BCFYSkpi.js"),__vite__mapDeps([205,1,19,2,5,15,14,16]))),rP=B(()=>F(()=>import("./AdClone-CfIeNHY1.js"),__vite__mapDeps([206,1,4,198,40,15,2,5,32,14,16
611]))),sP=B(()=>F(()=>import("./UrlToAdWizard-CS7w4VL6.js"),__vite__mapDeps([207,1,2,19,198,86,5,51,15,14,16]))),dp=B(()=>F(()=>import("./ShowcaseStudio-D1OerKUJ.js"),__vite__mapDeps([208,1,143,5,102,40,15,209,210,19,2,51,101,42,111,211,212,135,14,16]))),nP=B(()=>F(()=>import("./ContextReplyWizard-B1G-B0PT.js"),__vite__mapDeps([213,1,2,143,5,19,85,111,15,14,16]))),aP=B(()=>F(()=>import("./SceneGenerator-aiqGfSl1.js"),__vite__mapDeps([214,1,40,15,19,4,14,95,44,143,5,2,16]))),iP=B(()=>F(()=>import("./UseCases-DE-Qijbm.js"),__vite__mapDeps([103,1,2,5,102,15,14,16]))),oP=B(()=>F(()=>import("./Ecommerce-HWMIzxUp.js"),__vite__mapDeps([215,1,2,216,14,5,102,32,15,16]))),lP=B(()=>F(()=>import("./Agencies-CNwwTby9.js"),__vite__mapDeps([217,1,2,216,14,199,15,5,16]))),cP=B(()=>F(()=>import("./UGCAds-C5eOIWH0.js"),__vite__mapDeps([218,1,2,216,14,5,32,163,15,16]))),dP=B(()=>F(()=>import("./TikTokAds-CKD_6K9y.js"),__vite__mapDeps([219,1,2,216,14,5,32,95,163,15,16]))),uP=B(()=>F(()=>import("./YouTubeShorts-D07hJTQa.js"),__vite__mapDeps([220,1,2,216,14,5,66,32,163,15,16]))),hP=B(()=>F(()=>import("./InstagramReels-Cpt53lYA.js"),__vite__mapDeps([221,1,2,216,14,5,32,163,27,15,16]))),mP=B(()=>F(()=>import("./FacebookAds-BbqBcy2t.js"),__vite__mapDeps([222,1,2,216,14,5,32,163,15,16]))),pP=B(()=>F(()=>import("./SaaS-CtxIAgQt.js"),__vite__mapDeps([223,1,2,216,14,5,32,15,16]))),fP=B(()=>F(()=>import("./Creators-Ckn2ZCYC.js"),__vite__mapDeps([224,1,2,216,14,5,32,15,16]))),gP=B(()=>F(()=>import("./Features-h8bObp05.js"),__vite__mapDeps([99,1,100,5,101,15,14,2,16,82,102,95]))),xP=B(()=>F(()=>import("./AIActors-D0h-gN1c.js"),__vite__mapDeps([225,1,2,5,46,226,15,14,16]))),vP=B(()=>F(()=>import("./AIVoices-uLuTOZsU.js"),__vite__mapDeps([227,1,2,5,15,14,16]))),yP=B(()=>F(()=>import("./BatchGeneration-D48F0_cn.js"),__vite__mapDeps([228,1,2,5,15,14,16]))),bP=B(()=>F(()=>import("./AIScripts-B2LwHwrY.js"),__vite__mapDeps([229,1,2,5,44,163,15,14,16]))),_P=B(()=>F(()=>import("./Captions-DwVSSaVs.js"),__vite__mapDeps([230,1,2,5,82,231,15,14,16]))),wP=B(()=>F(()=>import("./DirectPublish-CJ5tz8mC.js"),__vite__mapDeps([232,1,2,5,66,15,14,16]))),jP=B(()=>F(()=>import("./ExtendedScripts-BZO7OnyF.js"),__vite__mapDeps([233,1,2,5,20,15,14,16]))),kP=B(()=>F(()=>import("./VsSynthesia-DyOWkXca.js"),__vite__mapDeps([234,1,2,5,15,14,16]))),NP=B(()=>F(()=>import("./VsHeygen-eYyktem4.js"),__vite__mapDeps([235,1,2,5,15,14,16]))),SP=B(()=>F(()=>import("./Learn-BTCucQ8e.js"),__vite__mapDeps([236,1,2,5,15,14,16]))),EP=B(()=>F(()=>import("./GettingStarted-GTlZi-cL.js"),__vite__mapDeps([237,1,2,5,15,14,16]))),CP=B(()=>F(()=>import("./ScriptWriting-Ct5QETG_.js"),__vite__mapDeps([238,1,2,5,163,111,15,14,16]))),TP=B(()=>F(()=>import("./VoiceSelection-DtbvP7fE.js"),__vite__mapDeps([239,1,2,5,15,14,16]))),PP=B(()=>F(()=>import("./VideoBestPractices-D_feAVE4.js"),__vite__mapDeps([240,1,2,5,90,95,163,15,14,16]))),AP=B(()=>F(()=>import("./Docs-7JFpVWOe.js"),__vite__mapDeps([241,1,2,242,243,14,25,244,245,90,5,15,16]))),IP=B(()=>F(()=>import("./DocArticle-CDmA0hVF.js"),__vite__mapDeps([246,1,242,2,243,14,25,244,245,90,247,19,139,159,5,211,15,16]))),RP=B(()=>F(()=>import("./ActorDetail-Cpc9gMuS.js"),__vite__mapDeps([248,1,2,14,138,12,85,30,32,9,10,11,5,137,27,139,6,68,249,140,211,15,16]))),MP=B(()=>F(()=>import("./VoiceDetail-CYJ1fPWC.js"),__vite__mapDeps([250,1,2,15,14,5,16]))),Tl=B(()=>F(()=>import("./WatchVideo-UwwmURoG.js"),__vite__mapDeps([251,1,2,81,80,5,12,85,95,15,14,16]))),OP=B(()=>F(()=>import("./StatusPage-CE-Jk_4o.js"),__vite__mapDeps([252,1,2,253,14,15,5,16]))),up=B(()=>F(()=>import("./Partners-BN4jOfgk.js"),__vite__mapDeps([254,1,2,255,5,20,169,15,14,16]))),DP=B(()=>F(()=>import("./PartnerDashboard-CJnP_N_E.js"),__vite__mapDeps([256,1,2,255,5,12,72,4,65,85,163,169,178,20,15,14,16]))),LP=B(()=>F(()=>import("./AmbassadorApplication-CcAN9203.js"),__vite__mapDeps([257,1,4,19,255,2,169,5,15,14,16])));B(()=>F(()=>import("./Affiliates-B2bhKpuF.js"),__vite__mapDeps([258,1,2,259,5,260,15,14,16])));B(()=>F(()=>import("./AffiliateDashboard-DAaWPE1S.js"),__vite__mapDeps([261,1,2,178,259,169,7,65,72,15,14,5,16])));const $P=B(()=>F(()=>import("./AcceptInvite-DEhC7-Jb.js"),__vite__mapDeps([262,1,2,15,14,5,16]))),hp=B(()=>F(()=>
611import("./BecomeCreator-BE3HRyNY.js"),__vite__mapDeps([263,1,2,264,39,4,265,260,5,115,266,95,114,79,15,14,16]))),FP=B(()=>F(()=>import("./CreatorOnboarding-TCsMe8I4.js"),__vite__mapDeps([267,1,19,68,4,268,39,41,269,270,23,25,2,5,245,15,14,16])));B(()=>F(()=>import("./CreatorAvatarSetup-Cq0ZS1_b.js"),__vite__mapDeps([271,1,2,114,79,32,5,166,43,40,15,209,245,14,16])));const VP=B(()=>F(()=>import("./CreatorAvatarSetupPage-BdzZKDY1.js"),__vite__mapDeps([272,1,2,15,14,5,16]))),zP=B(()=>F(()=>import("./CreatorSubmit-DX-xE4Kg.js"),__vite__mapDeps([273,1,2,55,4,45,135,49,43,95,42,274,226,163,6,19,5,44,275,265,276,166,15,14,16]))),HP=B(()=>F(()=>import("./CreatorPayouts-BoCvTbdW.js"),__vite__mapDeps([277,1,278,45,4,48,5,279,75,266,39,21,63,2,15,14,16]))),UP=B(()=>F(()=>import("./CreatorAnalytics-BLv_WdsU.js"),__vite__mapDeps([280,1,281,282,76,283,75,284,5,285,286,163,15,27,2,12,14,16]))),BP=B(()=>F(()=>import("./CreatorSubmissions-CQuYb_NU.js"),__vite__mapDeps([287,1,2,5,288,15,14,16]))),qP=B(()=>F(()=>import("./CreatorSettings-UtytvPHC.js"),__vite__mapDeps([289,1,4,45,2,281,19,62,68,48,268,39,41,269,270,25,23,226,265,290,291,5,292,245,15,14,16]))),WP=B(()=>F(()=>import("./CreatorContent-BgAz_Aph.js"),__vite__mapDeps([293,1,2,45,281,287,5,288,15,14,16]))),GP=B(()=>F(()=>import("./CreatorMonetization-BIlslYHV.js"),__vite__mapDeps([294,1,2,48,4,45,5,37,283,75,278,279,266,39,21,63,281,15,14,16]))),YP=B(()=>F(()=>import("./CreatorAcademy-S4K0Tv2C.js"),__vite__mapDeps([295,1,2,14,247,39,78,79,296,32,15,5,16]))),ZP=B(()=>F(()=>import("./CreatorAcademyGuide-CYmMm2w1.js"),__vite__mapDeps([297,1,2,243,14,247,39,32,15,5,16]))),JP=B(()=>F(()=>import("./CreatorManual-BSvn7kFS.js"),__vite__mapDeps([298,1,2,15,14,5,16]))),XP=B(()=>F(()=>import("./MyClonePage-BAoGTBD7.js"),__vite__mapDeps([299,1,2,290,264,5,7,245,15,14,16]))),KP=B(()=>F(()=>import("./CreatorSharePage-Crrt5Thc.js"),__vite__mapDeps([300,1,24,23,2,68,249,30,138,12,85,5,27,14,265,140,169,15,16]))),QP=B(()=>F(()=>import("./CreatorSupport-CPC8k_Yi.js"),__vite__mapDeps([301,1,2]))),eA=B(()=>F(()=>import("./SignMock-BQjLGrqT.js"),__vite__mapDeps([302,1,2,45,291,15,14,5,16]))),tA=B(()=>F(()=>import("./VerifyPaypal-snC8hBJh.js"),__vite__mapDeps([303,1,2,5,15,14,16]))),rA=B(()=>F(()=>import("./SupportAdmin-DOfYqGtz.js"),__vite__mapDeps([304,1,305,4,19,211,306,43,38,178,68,70,212,135,62,7,226,72,25,244,29,37,111,2,15,14,5,16]))),sA=B(()=>F(()=>import("./ModeratorDashboard-BnWsiyAw.js"),__vite__mapDeps([307,1,2,305,4,19,211,306,43,38,178,68,70,212,135,62,7,226,72,25,244,29,37,111,20,5,308,292,22,309,15,14,16]))),nA=B(()=>F(()=>import("./Admin-D5zP1OT6.js").then(r=>r.A),__vite__mapDeps([310,1,2,43,28,115,22,204,152,211,106,21]))),aA=B(()=>F(()=>import("./StartupsLanding-BONThr8e.js"),__vite__mapDeps([311,1,2,35,36,5,68,110,19,111,15,14,16,312,61]))),iA=B(()=>F(()=>import("./StartupsApply-Cait5Un4.js"),__vite__mapDeps([313,1,2,55,4,19,5,15,14,16]))),oA=B(()=>F(()=>import("./StartupsThanks-DN_6ap5J.js"),__vite__mapDeps([314,1,2,5,15,14,16]))),mp=B(()=>F(()=>import("./EmailPreferences-DCuW9Ktd.js"),__vite__mapDeps([315,1,2,4,62,45,292,15,14,5,16]))),lA=B(()=>F(()=>import("./AccountSuspended-DUQf46u6.js"),__vite__mapDeps([316,1,2,15,14,5,16]))),cA=B(()=>F(()=>import("./ViewCampaign-DaWOUfI5.js"),__vite__mapDeps([317,1,2,15,14,5,16]))),dA=new Oy;function le({children:r}){return s.jsx(u.Suspense,{fallback:s.jsx(q4,{}),children:s.jsx(sn,{children:r})})}function Re({children:r}){return s.jsx(u.Suspense,{fallback:s.jsx(Hr,{}),children:s.jsx(sn,{children:r})})}function uA(){const r=ot();return u.useEffect(()=>{yb()},[]),u.useEffect(()=>{const e=t=>{console.error("[Global] Unhandled promise rejection:",t.reason),t.preventDefault()};return window.addEventListener("unhandledrejection",e),()=>window.removeEventListener("unhandledrejection",e)},[]),s.jsxs($y,{location:r,children:[s.jsxs(I,{element:s.jsx(Rm,{}),children:[s.jsx(I,{index:!0,element:s.jsx(sn,{children:s.jsx(vC,{})})}),s.jsx(I,{path:"/pricing",element:s.jsx(sn,{children:s.jsx(oy,{})})}),s.jsx(I,{path:"/features",element:s.jsx(le,{children:s.jsx(gP,{})})}),s.jsx(I,{path:"/use-cases",element:s.jsx(le,{children:s.jsx(iP,{})})}),s.jsx(I,{path:"/products/studio",element:s.jsx(le,{children:s.jsx(ZT,{})})}),s.jsx(I,{path:"/products/api",element:s.jsx(le,{children:s.jsx(JT,{})})}),s.jsx(I,{path:"/products/url-to-ad",element:s.jsx(le,{children:s.jsx(XT,{})})}),s.jsx(I,{path:"/products/ad-clone",element:s.jsx(le,{children:s.jsx(KT,{})})}),s.jsx(I,{path:"/products/context-reply",element:s.jsx(le,{children:s.jsx(QT,{})})}),s.jsx(I,{path:"/products/product-video",element:s.jsx(Se,{to:"/showcase-studio",replace:!0})}),s.jsx(I,{path:"/showcase-studio",element:s.jsx(le,{children:s.jsx(eP,{})})}),s.jsx(I,{path:"/try",element:s.jsx(le,{children:s.jsx(tP,{})})}),s.jsx(I,{path:"/url-to-ad",element:s.jsx(Se,{to:"/products/url-to-ad",replace:!0})}),s.jsx(I,{path:"/startups",element:s.jsx(le,{children:s.jsx(aA,{})})}),s.jsx(I,{path:"/creators/clone",element:s.jsx(Se,{to:"/creators/become#private-clone",replace:!0})}),s.jsx(I,{path:"/creators/become",element:s.jsx(le,{children:s.jsx(hp,{})})}),s.jsx(I,{path:"/features/ai-actors",element:s.jsx(le,{children:s.jsx(xP,{})})}),s.jsx(I,{path:"/features/ai-voices",element:s.jsx(le,{children:s.jsx(vP,{})})}),s.jsx(I,{path:"/features/captions",element:s.jsx(le,{children:s.jsx(_P,{})})}),s.jsx(I,{path:"/features/batch-generation",element:s.jsx(le,{children:s.jsx(yP,{})})}),s.jsx(I,{path:"/features/ai-scripts",element:s.jsx(le,{children:s.jsx(bP,{})})}),s.jsx(I,{path:"/features/direct-publish",element:s.jsx(le,{children:s.jsx(wP,{})})}),s.jsx(I,{path:"/features/extended-scripts",element:s.jsx(le,{children:s.jsx(jP,{})})})]}),s.jsx(I,{path:"/startups/apply",element:s.jsx(le,{children:s.jsx(iA,{})})}),s.jsx(I,{path:"/startups/thanks",element:s.jsx(le,{children:s.jsx(oA,{})})}),s.jsx(I,{path:"/auth",element:s.jsx(Lv,{})}),s.jsx(I,{path:"/auth/mobile-callback",element:s.jsx(le,{children:s.jsx(X3,{})})}),s.jsx(I,{path:"/auth/apple-callback",element:s.jsx(le,{children:s.jsx(K3,{})})}),s.jsx(I,{path:"/verify-email",element:s.jsx(Y3,{})}),s.jsx(I,{path:"/recover-account",element:s.jsx(le,{children:s.jsx(Q3,{})})}),s.jsx(I,{path:"/checkout/success",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(aT,{})})})}),s.jsx(I,{path:"/dashboard",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(eT,{})})})}),s.jsx(I,{path:"/dashboard-test",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(rT,{})})})}),s.jsx(I,{path:"/create",element:s.jsx(Pe,{children:s.jsx(u.Suspense,{fallback:s.jsx(W4,{}),children:s.jsx(sn,{children:s.jsx(sT,{})})})})}),s.jsx(I,{path:"/create-v2",element:s.jsx(Se,{to:"/create",replace:!0})}),s.jsx(I,{path:"/voiceoutput2",element:s.jsx(le,{children:s.jsx(nT,{})})}),s.jsx(I,{path:"/jobs",element:s.jsx(Se,{to:"/videos",replace:!0})}),s.jsx(I,{path:"/exports",element:s.jsx(Se,{to:"/videos",replace:!0})}),s.jsx(I,{path:"/settings",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(iT,{})})})}),s.jsx(I,{path:"/scripts",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(oT,{})})})}),s.jsx(I,{path:"/voices",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(lT,{})})})}),s.jsx(I,{path:"/videos",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(dT,{})})})}),s.jsx(I,{path:"/campaigns",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(uT,{})})})}),s.jsx(I,{path:"/actors",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(cT,{})})})}),s.jsx(I,{path:"/feed",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(hT,{})})})}),s.jsx(I,{path:"/following",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(mT,{})})})}),s.jsx(I,{path:"/dashboard/whats-new",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(pT,{})})})}),s.jsx(I,{path:"/credits",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(fT,{})})})}),s.jsx(I,{path:"/dashboard/url-to-ad",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(sP,{})})})}),s.jsx(I,{path:"/create/ad-clone",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(rP,{})})})}),s.jsx(I,{path:"/create/product-video",element:s.jsx(Se,{to:"/showcase",replace:!0})}),s.jsx(I,{path:"/showcase",element:s.jsx(Pe,{children:s.jsx(pl,{allowedRoles:["superadmin","admin","mod","tester"],children:s.jsx(Re,{children:s.jsx(dp,{})})})})}),s.jsx(I,{path:"/showcase/:sessionId",element:s.jsx(Pe,{children:s.jsx(pl,{allowedRoles:["superadmin","admin","mod","tester"],children:s.jsx(Re,{children:s.jsx(dp,{})})})})}),s.jsx(I,{path:"/create/context-reply",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(nP,{})})})}),s.jsx(I,{path:"/create/scene-generator",element:s.jsx(Pe,{children:s.jsx(pl,{allowedRoles:["superadmin","admin","mod","tester"],children:s.jsx(Re,{children:s.jsx(aP,{})})})})}),s.jsx(I,{path:"/trust",element:s.jsx(le,{children:s.jsx(cp,{})})}),s.jsx(I,{path:"/trust/:section",element:s.jsx(le,{children:s.jsx(cp,{})})}),s.jsx(I,{path:"/privacy",element:s.jsx(Se,{to:"/trust/privacy",replace:!0})}),s.jsx(I,{path:"/terms",element:s.jsx(Se,{to:"/trust/terms",replace:!0})}),s.jsx(I,{path:"/cookies",element:s.jsx(Se,{to:"/trust/cookies",replace:!0})}),s.jsx(I,{path:"/gdpr",element:s.jsx(Se,{to:"/trust/gdpr",replace:!0})}),s.jsx(I,{path:"/trust-center",element:s.jsx(Se,{to:"/trust",replace:!0})}),s.jsx(I,{path:"/creator-agreement",element:s.jsx(le,{children:s.jsx(gT,{})})}),s.jsx(I,{path:"/resources/help-center",element:s.jsx(Se,{to:"/help",replace:!0})}),s.jsx(I,{path:"/help-center",element:s.jsx(Se,{to:"/help",replace:!0})}),s.jsx(I,{path:"/resources/blog",element:s.jsx(Se,{to:"/blog",replace:!0})}),s.jsx(I,{path:"/resources/tutorials",element:s.jsx(Se,{to:"/help",replace:!0})}),s.jsx(I,{path:"/resources/case-studies",element:s.jsx(Se,{to:"/case-studies",replace:!0})}),s.jsxs(I,{element:s.jsx(Rm,{}),children:[s.jsx(I,{path:"/blog",element:s.jsx(le,{children:s.jsx(xT,{})})}),s.jsx(I,{path:"/blog/:slug",element:s.jsx(le,{children:s.jsx(vT,{})})}),s.jsx(I,{path:"/help",element:s.jsx(le,{children:s.jsx(yT,{})})}),s.jsx(I,{path:"/tutorials",element:s.jsx(le,{children:s.jsx(bT,{})})}),s.jsx(I,{path:"/case-studies",element:s.jsx(le,{children:s.jsx(_T,{})})}),s.jsx(I,{path:"/case-studies/:slug",element:s.jsx(le,{children:s.jsx(wT,{})})})]}),s.jsx(I,{path:"/docs",element:s.jsx(le,{children:s.jsx(AP,{})})}),s.jsx(I,{path:"/docs/:slug",element:s.jsx(le,{children:s.jsx(IP,{})})}),s.jsx(I,{path:"/api-docs",element:s.jsx(Se,{to:"/docs?category=developers",replace:!0})}),s.jsx(I,{path:"/about",element:s.jsx(le,{children:s.jsx(jT,{})})}),s.jsx(I,{path:"/careers",element:s.jsx(le,{children:s.jsx(kT,{})})}),s.jsx(I,{path:"/press",element:s.jsx(le,{children:s.jsx(NT,{})})}),s.jsx(I,{path:"/contact",element:s.jsx(le,{children:s.jsx(ST,{})})}),s.jsx(I,{path:"/partners",element:s.jsx(le,{children:s.jsx(ET,{})})}),s.jsx(I,{path:"/brand-assets",element:s.jsx(le,{children:s.jsx(CT,{})})}),s.jsx(I,{path:"/feedback-thanks",element:s.jsx(le,{children:s.jsx(TT,{})})}),s.jsx(I,{path:"/developers",element:s.jsx(le,{children:s.jsx(PT,{})})}),s.jsx(I,{path:"/developers/quickstart",element:s.jsx(le,{children:s.jsx(AT,{})})}),s.jsx(I,{path:"/developers/reference",element:s.jsx(le,{children:s.jsx(IT,{})})}),s.jsx(I,{path:"/developers/authentication",element:s.jsx(le,{children:s.jsx(RT,{})})}),s.jsx(I,{path:"/developers/sdks",element:s.jsx(le,{children:s.jsx(MT,{})})}),s.jsx(I,{path:"/developers/webhooks",element:s.jsx(le,{children:s.jsx(OT,{})})}),s.jsx(I,{path:"/developers/rate-limits",element:s.jsx(le,{children:s.jsx(DT,{})})}),s.jsx(I,{path:"/developers/playground",element:s.jsx(le,{children:s.jsx(LT,{})})}),s.jsx(I,{path:"/developers/pricing",element:s.jsx(le,{children:s.jsx($T,{})})}),s.jsx(I,{path:"/api-pricing",element:s.jsx(Se,{to:"/developers/pricing",replace:!0})}),s.jsx(I,{path:"/developers/billing-credits",element:s.jsx(le,{children:s.jsx(FT,{})})}),s.jsx(I,{path:"/developers/sandbox",element:s.jsx(le,{children:s.jsx(VT,{})})}),s.jsx(I,{path:"/developers/testing",element:s.jsx(le,{children:s.jsx(zT,{})})}),s.jsx(I,{path:"/use-cases/ecommerce",element:s.jsx(le,{children:s.jsx(oP,{})})}),s.jsx(I,{path:"/use-cases/agencies",element:s.jsx(le,{children:s.jsx(lP,{})})}),s.jsx(I,{path:"/use-cases/ugc-ads",element:s.jsx(le,{children:s.jsx(cP,{})})}),s.jsx(I,{path:"/use-cases/tiktok-ads",element:s.jsx(le,{children:s.jsx(dP,{})})}),s.jsx(I,{path:"/use-cases/youtube-shorts",element:s.jsx(le,{children:s.jsx(uP,{})})}),s.jsx(I,{path:"/use-cases/instagram-reels",element:s.jsx(le,{children:s.jsx(hP,{})})}),s.jsx(I,{path:"/use-cases/facebook-ads",element:s.jsx(le,{children:s.jsx(mP,{})})}),s.jsx(I,{path:"/use-cases/saas",element:s.jsx(le,{children:s.jsx(pP,{})})}),s.jsx(I,{path:"/use-cases/creators",element:s.jsx(le,{children:s.jsx(fP,{})})}),s.jsx(I,{path:"/vs/synthesia",element:s.jsx(le,{children:s.jsx(kP,{})})}),s.jsx(I,{path:"/vs/heygen",element:s.jsx(le,{children:s.jsx(NP,{})})}),s.jsx(I,{path:"/learn",element:s.jsx(le,{children:s.jsx(SP,{})})}),s.jsx(I,{path:"/learn/getting-started",element:s.jsx(le,{children:s.jsx(EP,{})})}),s.jsx(I,{path:"/learn/script-writing",element:s.jsx(le,{children:s.jsx(CP,{})})}),s.jsx(I,{path:"/learn/voice-selection",element:s.jsx(le,{children:s.jsx(TP,{})})}),s.jsx(I,{path:"/learn/video-best-practices",element:s.jsx(le,{children:s.jsx(PP,{})})}),s.jsx(I,{path:"/actors/:actorSlug",element:s.jsx(le,{children:s.jsx(RP,{})})}),s.jsx(I,{path:"/voices/:voiceSlug",element:s.jsx(le,{children:s.jsx(MP,{})})}),s.jsx(I,{path:"/s/:slug",element:s.jsx(le,{children:s.jsx(Tl,{})})}),s.jsx(I,{path:"/watch/:jobId",element:s.jsx(le,{children:s.jsx(Tl,{})})}),s.jsx(I,{path:"/video/:jobId",element:s.jsx(le,{children:s.jsx(Tl,{})})}),s.jsx(I,{path:"/status",element:s.jsx(le,{children:s.jsx(OP,{})})}),s.jsx(I,{path:"/refer",element:s.jsx(le,{children:s.jsx(up,{})})}),s.jsx(I,{path:"/partners/program",element:s.jsx(le,{children:s.jsx(up,{})})}),s.jsx(I,{path:"/partners/dashboard",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(DP,{})})})}),s.jsx(I,{path:"/partners/ambassadors",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(LP,{})})})}),s.jsx(I,{path:"/affiliates",element:s.jsx(Se,{to:"/partners/program",replace:!0})}),s.jsx(I,{path:"/affiliates/dashboard",element:s.jsx(Se,{to:"/partners/dashboard",replace:!0})}),s.jsx(I,{path:"/invite/:token",element:s.jsx(le,{children:s.jsx($P,{})})}),s.jsx(I,{path:"/become-creator",element:s.jsx(le,{children:s.jsx(hp,{})})}),s.jsx(I,{path:"/creators",element:s.jsx(Se,{to:"/creators/become",replace:!0})}),s.jsx(I,{path:"/c/:creatorSlug",element:s.jsx(le,{children:s.jsx(KP,{})})}),s.jsx(I,{path:"/creators/onboarding",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(FP,{})})})}),s.jsx(I,{path:"/creators/avatar-setup",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(VP,{})})})}),s.jsx(I,{path:"/creators/dashboard",element:s.jsx(Se,{to:"/creator-dashboard",replace:!0})}),s.jsx(I,{path:"/creators/submit",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(zP,{})})})}),s.jsx(I,{path:"/creators/payouts",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(HP,{})})})}),s.jsx(I,{path:"/creators/insights",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(UP,{})})})}),s.jsx(I,{path:"/creators/analytics",element:s.jsx(Se,{to:"/creators/insights",replace:!0})}),s.jsx(I,{path:"/creators/submissions",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(BP,{})})})}),s.jsx(I,{path:"/creators/earnings",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(GP,{})})})}),s.jsx(I,{path:"/creators/settings",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(qP,{})})})}),s.jsx(I,{path:"/creators/content",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(WP,{})})})}),s.jsx(I,{path:"/creators/my-clone",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(XP,{})})})}),s.jsx(I,{path:"/creators/identity",element:s.jsx(Se,{to:"/creators/settings#clone-identity",replace:!0})}),s.jsx(I,{path:"/creators/monetization",element:s.jsx(Se,{to:"/creators/earnings",replace:!0})}),s.jsx(I,{path:"/creators/growth",element:s.jsx(Se,{to:"/creator-dashboard",replace:!0})}),s.jsx(I,{path:"/creators/academy",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(YP,{})})})}),s.jsx(I,{path:"/creators/academy/:slug",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(ZP,{})})})}),s.jsx(I,{path:"/creators/manual",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(JP,{})})})}),s.jsx(I,{path:"/creators/supp
611ort",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(QP,{})})})}),s.jsx(I,{path:"/creators/sign-mock",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(eA,{})})})}),s.jsx(I,{path:"/creators/verify-paypal",element:s.jsx(le,{children:s.jsx(tA,{})})}),s.jsx(I,{path:"/become-a-creator",element:s.jsx(Se,{to:"/become-creator",replace:!0})}),s.jsx(I,{path:"/creator-onboarding",element:s.jsx(Se,{to:"/creators/onboarding",replace:!0})}),s.jsx(I,{path:"/creator-dashboard",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(tT,{})})})}),s.jsx(I,{path:"/creator-submit",element:s.jsx(Se,{to:"/creators/submit",replace:!0})}),s.jsx(I,{path:"/creator-payouts",element:s.jsx(Se,{to:"/creators/payouts",replace:!0})}),s.jsx(I,{path:"/creator-analytics",element:s.jsx(Se,{to:"/creators/insights",replace:!0})}),s.jsx(I,{path:"/creator-submissions",element:s.jsx(Se,{to:"/creators/submissions",replace:!0})}),s.jsx(I,{path:"/creator-earnings",element:s.jsx(Se,{to:"/creators/earnings",replace:!0})}),s.jsx(I,{path:"/creator-settings",element:s.jsx(Se,{to:"/creators/settings",replace:!0})}),s.jsx(I,{path:"/creator/dashboard",element:s.jsx(Se,{to:"/creator-dashboard",replace:!0})}),s.jsx(I,{path:"/creator/submit",element:s.jsx(Se,{to:"/creators/submit",replace:!0})}),s.jsx(I,{path:"/creator/payouts",element:s.jsx(Se,{to:"/creators/payouts",replace:!0})}),s.jsx(I,{path:"/creator/analytics",element:s.jsx(Se,{to:"/creators/insights",replace:!0})}),s.jsx(I,{path:"/creator/submissions",element:s.jsx(Se,{to:"/creators/submissions",replace:!0})}),s.jsx(I,{path:"/creator/earnings",element:s.jsx(Se,{to:"/creators/earnings",replace:!0})}),s.jsx(I,{path:"/creator/settings",element:s.jsx(Se,{to:"/creators/settings",replace:!0})}),s.jsx(I,{path:"/creator/onboarding",element:s.jsx(Se,{to:"/creators/onboarding",replace:!0})}),s.jsx(I,{path:"/creator/support",element:s.jsx(Se,{to:"/creators/support",replace:!0})}),s.jsxs(I,{element:s.jsx(Pe,{children:s.jsx(u.Suspense,{fallback:s.jsx(Hr,{}),children:s.jsx(fE,{})})}),children:[s.jsx(I,{path:"/console",element:s.jsx(Se,{to:"/console/overview",replace:!0})}),s.jsx(I,{path:"/console/overview",element:s.jsx(u.Suspense,{fallback:s.jsx(Hr,{}),children:s.jsx(HT,{})})}),s.jsx(I,{path:"/console/api-keys",element:s.jsx(u.Suspense,{fallback:s.jsx(Hr,{}),children:s.jsx(UT,{})})}),s.jsx(I,{path:"/console/webhooks",element:s.jsx(u.Suspense,{fallback:s.jsx(Hr,{}),children:s.jsx(BT,{})})}),s.jsx(I,{path:"/console/usage",element:s.jsx(u.Suspense,{fallback:s.jsx(Hr,{}),children:s.jsx(qT,{})})}),s.jsx(I,{path:"/console/billing",element:s.jsx(u.Suspense,{fallback:s.jsx(Hr,{}),children:s.jsx(WT,{})})}),s.jsx(I,{path:"/console/limits",element:s.jsx(u.Suspense,{fallback:s.jsx(Hr,{}),children:s.jsx(GT,{})})}),s.jsx(I,{path:"/console/sandbox",element:s.jsx(u.Suspense,{fallback:s.jsx(Hr,{}),children:s.jsx(YT,{})})})]}),s.jsx(I,{path:"/admin",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(nA,{})})})}),s.jsx(I,{path:"/admin/support",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(rA,{})})})}),s.jsx(I,{path:"/admin/moderator",element:s.jsx(Se,{to:"/moderator-dashboard",replace:!0})}),s.jsx(I,{path:"/moderator-dashboard",element:s.jsx(Pe,{children:s.jsx(Re,{children:s.jsx(sA,{})})})}),s.jsx(I,{path:"/email-preferences",element:s.jsx(le,{children:s.jsx(mp,{})})}),s.jsx(I,{path:"/unsubscribe",element:s.jsx(le,{children:s.jsx(mp,{})})}),s.jsx(I,{path:"/account-suspended",element:s.jsx(le,{children:s.jsx(lA,{})})}),s.jsx(I,{path:"/email/view/:emailId",element:s.jsx(le,{children:s.jsx(cA,{})})}),s.jsx(I,{path:"/sitemap.xml",element:s.jsx(Z3,{to:"https://cnocqjydxkzeytrirrsn.supabase.co/functions/v1/serve-sitemap"})}),s.jsx(I,{path:"*",element:s.jsx(sn,{children:s.jsx(G3,{})})})]},r.pathname)}const hA=()=>s.jsx(gE,{level:"page",fallback:(r,e)=>s.jsx(vE,{error:r,reset:e}),name:"App",children:s.jsx(pS,{children:s.jsx(p_,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:s.jsx(Dy,{client:dA,children:s.jsx(Wj,{children:s.jsx(ak,{children:s.jsx(Gj,{children:s.jsx(ok,{children:s.jsx(tk,{children:s.jsx(xo,{children:s.jsxs(Pj,{children:[s.jsx(u_,{}),s.jsx(W_,{}),s.jsx(Ly,{children:s.jsx(B4,{children:s.jsxs(pk,{children:[s.jsx(_E,{}),s.jsx(H4,{}),s.jsx(U4,{}),s.jsx(lk,{}),s.jsx(uk,{}),s.jsx(ck,{}),s.jsx(z4,{}),s.jsx(uA,{}),s.jsx(u.Suspense,{fallback:null,children:s.jsx(J3,{})})]})})})]})})})})})})})})})})});Mj();typeof requestIdleCallback=="function"?requestIdleCallback(()=>Vh()):setTimeout(()=>
611Vh(),0);qp(document.getElementById("root")).render(s.jsx(Kp,{children:s.jsx(hA,{})}));export{_r as $,nr as A,ie as B,es as C,m0 as D,Ls as E,Lx as F,Wo as G,Jr as H,Gr as I,Q as J,rk as K,Mt as L,vc as M,yc as N,Rr as O,Ao as P,Bi as Q,sy as R,Hs as S,cu as T,go as U,Dt as V,du as W,lt as X,hu as Y,mu as Z,F as _,Lo as a,Z4 as a$,td as a0,uu as a1,fu as a2,pu as a3,Ht as a4,Ut as a5,$t as a6,Kc as a7,zl as a8,vn as a9,XA as aA,Jb as aB,Tf as aC,p1 as aD,Yb as aE,jd as aF,n1 as aG,j1 as aH,Of as aI,Qc as aJ,v1 as aK,Sf as aL,B0 as aM,W0 as aN,G0 as aO,Y0 as aP,Bk as aQ,Kb as aR,PA as aS,Ba as aT,ir as aU,Ds as aV,TA as aW,CA as aX,zh as aY,jA as aZ,op as a_,Io as aa,Ha as ab,Wd as ac,Ro as ad,w1 as ae,T1 as af,Es as ag,on as ah,xo as ai,a5 as aj,cx as ak,wc as al,gu as am,t1 as an,ji as ao,b1 as ap,ui as aq,Pc as ar,rp as as,Fc as at,sp as au,Vc as av,zc as aw,m1 as ax,C1 as ay,wi as az,jf as b,Xc as b$,qs as b0,Zb as b1,Nv as b2,hi as b3,Fs as b4,Go as b5,ZC as b6,$c as b7,Gb as b8,fo as b9,VA as bA,Kj as bB,Ex as bC,to as bD,ds as bE,e1 as bF,wf as bG,AE as bH,Mf as bI,yr as bJ,ZA as bK,E1 as bL,br as bM,Zi as bN,y5 as bO,UA as bP,kN as bQ,fb as bR,l5 as bS,Af as bT,_f as bU,oo as bV,$3 as bW,Rf as bX,QA as bY,Qb as bZ,a1 as b_,Fa as ba,Lf as bb,np as bc,Fl as bd,j3 as be,Ui as bf,Zc as bg,f0 as bh,bl as bi,HA as bj,Pn as bk,Gd as bl,Yd as bm,Mo as bn,un as bo,Vx as bp,_j as bq,Ea as br,Ss as bs,Nf as bt,jc as bu,S3 as bv,nv as bw,Qd as bx,eu as by,tu as bz,kf as c,NA as c$,hk as c0,Ra as c1,Ia as c2,r1 as c3,ga as c4,d1 as c5,Nb as c6,ya as c7,k1 as c8,Ni as c9,vd as cA,yj as cB,za as cC,us as cD,i1 as cE,ki as cF,ed as cG,z3 as cH,KA as cI,mv as cJ,D3 as cK,h0 as cL,u0 as cM,bA as cN,_A as cO,wA as cP,Jt as cQ,ks as cR,o1 as cS,v4 as cT,If as cU,c1 as cV,nC as cW,GE as cX,y1 as cY,JA as cZ,Ma as c_,Vd as ca,zd as cb,h1 as cc,Hd as cd,po as ce,mo as cf,kb as cg,Xb as ch,Pf as ci,Ff as cj,Qe as ck,Sa as cl,Ji as cm,dx as cn,Qr as co,b5 as cp,g5 as cq,hx as cr,c5 as cs,h5 as ct,mx as cu,k5 as cv,Yi as cw,nN as cx,iN as cy,p5 as cz,ht as d,vv as d0,Nl as d1,IA as d2,RA as d3,mi as d4,s1 as d5,KN as d6,y4 as d7,WA as d8,YA as d9,xS as dA,vS as dB,$f as dC,$s as dD,qA as dE,va as dF,N3 as dG,O3 as dH,F3 as dI,L3 as dJ,aC as dK,PE as dL,xa as dM,yt as dN,qk as dO,Hk as dP,yd as dQ,AA as dR,Jc as dS,LA as dT,$A as dU,DA as dV,Ua as dW,wr as dX,BA as dY,N1 as dZ,kA as d_,v5 as da,OA as db,x5 as dc,S1 as dd,MA as de,GA as df,Sm as dg,l1 as dh,FA as di,SS as dj,zA as dk,jN as dl,NN as dm,SA as dn,EA as dp,w4 as dq,Tu as dr,o4 as ds,d4 as dt,c4 as du,Tx as dv,WN as dw,yS as dx,tm as dy,Gi as dz,bd as e,_d as f,wd as g,Bt as h,g0 as i,_i as j,rt as k,Ue as l,Y as m,Ee as n,Eo as o,Ns as p,dv as q,Mx as r,W as s,uv as t,ne as u,_t as v,mn as w,So as x,ur as y,Df as z};
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.