PageSourceSearch

https://the-gazel.lovable.app/assets/index-D4z10nuM.js

js the-gazel.lovable.app collected 2026-10-03 03:49:38 UTC 942,809 bytes, 566 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-BpHD5WX1.js","assets/vendor-CbTYwD9p.js","assets/Dashboard-TFblRLTt.js","assets/ui-BcZpBtGC.js","assets/useProfile-DNQzgHXa.js","assets/SEO-CgT-2K41.js","assets/router-C21RS5Se.js","assets/useReferrals-TdoCYuZ0.js","assets/triangle-alert-CPsavpTR.js","assets/CurrencyDisplay-Czr68xmm.js","assets/progress-DuoHXgLN.js","assets/useTransactions-Ctswy7_w.js","assets/useDeductions-CgaSxkdv.js","assets/CAGRDisplay-CtkXHRld.js","assets/tooltip-hz-ElT_q.js","assets/info-sZCfrrpQ.js","assets/trending-down-BgsDNpCw.js","assets/dollar-sign-CkLyGziu.js","assets/shield-check-d4RULj7r.js","assets/lightbulb-nlKOZTga.js","assets/plus-D-sfk7Tc.js","assets/Transactions-DUhtMHHS.js","assets/format-BE36S-lJ.js","assets/constants-DQX8fu4l.js","assets/startOfYear-CRigkeXM.js","assets/link-CeE4291a.js","assets/AddTransactionDialog-CevsjreJ.js","assets/EnhancedFileProcessingDialog-Cuaq7slU.js","assets/radio-group-DcQHkWF5.js","assets/switch-DoKIjmrj.js","assets/table-BNsqH6tu.js","assets/_commonjs-dynamic-modules-TDtrdbi3.js","assets/pdf-BdCkjr-F.js","assets/tag-BL1vAu_k.js","assets/wifi-f30AOVcZ.js","assets/copy-CFvJCTp6.js","assets/separator-BVOZ6prZ.js","assets/square-pen-CdhzvT4d.js","assets/checkbox-BiZMpq0L.js","assets/DeleteTransactionDialog-BLklHN6o.js","assets/alert-dialog-xcP2gqm-.js","assets/trash-2-DGkDE4Jg.js","assets/calendar-Us87jvyd.js","assets/addDays-D89suC5w.js","assets/startOfMonth-B_Q_39m-.js","assets/endOfMonth-IkHClgta.js","assets/addMonths-BNlrzca5.js","assets/isBefore-CyIoE_lR.js","assets/addWeeks-D_oo18r2.js","assets/min-Ch49NU_L.js","assets/addYears-C56uVqUN.js","assets/popover-CTfeJmYh.js","assets/rotate-ccw-DXZfGi4l.js","assets/deviceDetection-DV8JASKr.js","assets/landmark-p4qrnlrG.js","assets/user-BCFYjlcR.js","assets/pencil-B7aBvMO7.js","assets/Deductions-CMcJFZYp.js","assets/PremiumFeature-B48A-p7Q.js","assets/skeleton-8_H0rhmR.js","assets/gem-Ky2B3fRN.js","assets/formatters-Dsb8yaw-.js","assets/jspdf.plugin.autotable-DwhxRVu1.js","assets/form-P_thZwXU.js","assets/search-CXjFA5Kr.js","assets/database-Bwn3mXMs.js","assets/useLanguageUpdate-Dj5ai-pN.js","assets/reportExport-XisCb4l-.js","assets/filter-Bpil-bHR.js","assets/circle-x-DULZ0KX-.js","assets/useMileageDeductions-BkuAuWHM.js","assets/circle-plus-B-gHvF90.js","assets/Reports-i5_2uXef.js","assets/useTransactionReports-CJJtk5rA.js","assets/budgetAnalytics-D4gKf59v.js","assets/parseISO-jbOw4T8D.js","assets/endOfYear-D2YKXj2B.js","assets/isWithinInterval-qRk7nEIg.js","assets/chart-ClSHdui2.js","assets/generateCategoricalChart-DYrwdEfj.js","assets/BarChart-D5jsJyIN.js","assets/CartesianGrid-SzDDLKj6.js","assets/printer-MTt7laol.js","assets/file-spreadsheet-CV-wxNi2.js","assets/Settings-ev3mWkP7.js","assets/file-down-BgZth-Wv.js","assets/smartphone-DoDDnW72.js","assets/calendar-clock-BoUWnyKO.js","assets/accordion-XINSscrR.js","assets/index-DIquWniE.js","assets/eye-DHwVhvdt.js","assets/BusinessSettingsPage-C0suO1so.js","assets/JoinOrganizationForm-DOKP8dvW.js","assets/useQuery-Bg5MGr3j.js","assets/useMutation-Bk0igXSc.js","assets/save-0Opp16Tl.js","assets/log-in-fMrWgvHg.js","assets/Products-Crn-r-Ab.js","assets/chart-no-axes-gantt-DgXaQ5Kx.js","assets/workflow-BLQAs09L.js","assets/repeat-6WWf74Qp.js","assets/Analytics-CYBjf6jo.js","assets/LineChart-BhXoY2SJ.js","assets/AreaChart-Lnslq1O_.js","assets/PieChart-CmqT1C-m.js","assets/slider-n6A2X-RK.js","assets/circle-help-R9urral2.js","assets/Calendar-DPSbw0Em.js","assets/constructNow-D_8vzHsU.js","assets/flag-H9FEiF2-.js","assets/list-BMNkBzod.js","assets/Budgeting-BAqZWcDy.js","assets/chart-line-4eHNrb4W.js","assets/KnowledgeBase-pCY98Do1.js","assets/volume-2-BRFdkhoZ.js","assets/play-CSAYtYxV.js","assets/bookmark-WgMBFSl9.js","assets/AuthSuccess-CVD851e8.js","assets/PaymentSuccess-C8TTX1ks.js","assets/PaymentCanceled-CrLg-w-R.js","assets/ResetPassword-BSXMswF6.js","assets/Privacy-eSMcHC4U.js","assets/Terms-CktJcd8z.js","assets/TaxEstimates-DmU8fRWc.js","assets/ellipsis-D8GNdPqL.js","assets/TaxDocuments-BUJ5FCmg.js","assets/TaxFilingStatus-BHsfn70t.js","assets/ComplianceCenter-AtcszdIy.js","assets/history-BQkU5XHC.js","assets/TaxStrategyPlanning-BQeGojN0.js","assets/target-BQ980pRN.js","assets/PrioritySupport-CwJ2vb-5.js","assets/AIConsultations-wD3b-jUc.js","assets/CustomReports-BkkaR8NW.js","assets/DataExport-K8XjOkO7.js","assets/PrioritySupport-8fZnzojA.js","assets/LinkedAccounts-CKOFCkwv.js","assets/BusinessProjections-CzIRdgjx.js","assets/subMonths-DrFKZOdS.js","assets/Planner-Dq9Czicc.js","assets/useProjects-DRRL-e24.js","assets/link-2-CmK4ztnv.js","assets/layout-grid-CYhmWsrl.js","assets/PlannerBoard-ky6G6K1J.js","assets/pen-aj6dR5TI.js","assets/getDay-Dgre31D1.js","assets/differenceInDays-D5twGJod.js","assets/Referrals-BsATvo1j.js","assets/share-2-B7IRUMbD.js","assets/gift-CuYSoSOC.js","assets/MileageTracking-caUL6G-q.js","assets/monitor-Dgvb7IMw.js","assets/Invoicing-C-Ru3pId.js","assets/CPADashboard-C0DzWrXz.js","assets/ellipsis-vertical-BRivTFCD.js","assets/isPast-DfR6HMHj.js","assets/CPAView-1D5aIfqg.js","assets/DemoGuide-hHbcvEjr.js","assets/Blog-C-4HWBvg.js","assets/useBlogPosts-CgfddYGZ.js","assets/BlogCard-BPqQd-q1.js","assets/BlogPost-BQWNutLk.js","assets/AdminCommunications-BP1uwMJh.js","assets/AdminOrganizations-RTGuTxDF.js","assets/Admin-B8v6fYqQ.js","assets/activity-CKaM8sIU.js","assets/EmailTest-19vcUWVt.js","assets/AdminEmailCampaigns-DwXMp7S4.js","assets/AdminPaymentRecovery-CfGMwNV5.js","assets/AdminConversion-DHCouKLV.js","assets/AdminMonitoring-Dflz8o_2.js","assets/AdminSecurity-cPGJMsrl.js","assets/AdminRBAC-CohYCo5N.js","assets/AdminMfaEnroll-DY7h5Wd_.js","assets/Install-CDWolx5U.js","assets/Projects-Cc_TbVys.js","assets/useEventProjectGenerator-uUcKjjbn.js","assets/ProjectBoard-jF9_fUdf.js","assets/folder-open-B3Sb1ehr.js","assets/ProjectsSubscriptionGate-C6ZxMpnX.js","assets/FaithLayout-CAfjTPhh.js","assets/calendar-days-BXCcnQwb.js","assets/useFaithSubscription-C5hE3AjC.js","assets/FaithDashboardPage-DLirdeeY.js","assets/useDonations--CM1K82a.js","assets/useDonors-CMLzjtsO.js","assets/useExpenses-BpMxpFXg.js","assets/FaithUploadPage-BB1sHh-r.js","assets/collapsible-C8JpDEd5.js","assets/file-check-BcpABLkL.js","assets/FaithSettingsPage-C-Rbhz-Y.js","assets/usePayments-Ca4fZO3u.js","assets/useFaithExpenseCategories-D28-JNU6.js","assets/FaithDonorsPage-HjiNjw-L.js","assets/FaithPageHeader-DqvCDfVV.js","assets/FaithEmptyState-39ixNIVb.js","assets/FaithFilterBar-DNpcGvbA.js","assets/FaithDonorMatchesPage-CFMeNYsY.js","assets/FaithDonationsPage-BJM2APmJ.js","assets/FaithExpensesPage-8b3-Q7qr.js","assets/FaithFundsPage-BVkkgsDR.js","assets/FaithReportsPage-BCX9yTL1.js","assets/subYears-DWVD9lP3.js","assets/FaithStatementsPage-DTkJlq08.js","assets/useStatements-BOf9Q1HJ.js","assets/FaithStatementDetailPage-2Q0t0_Z-.js","assets/statementAggregation-BPyehOGS.js","assets/orgTypeLabels-COGmZ5zm.js","assets/FaithPublicStatementPage-C-u6uNui.js","assets/FaithPayPage-C8ZRL10f.js","assets/AcceptInvitePage-Di8Gha6C.js","assets/FaithFinancialReportPage-GLGlcGKO.js","assets/CoopDashboardPage-Pitd1727.js","assets/receipt-text-BDuc8Q-l.js","assets/CoopNav-Dh0DiAdM.js","assets/useContributions-DXvSKsHo.js","assets/useLoans-D6UTaWaf.js","assets/useRepayments-BViyJ28U.js","assets/CoopContributionsPage-BkoCvxfg.js","assets/useCoopSettings-hCFMYuJc.js","assets/CoopLoansPage-DuZZUIwY.js","assets/CoopLoanDetailPage-Zf-u5Q7m.js","assets/CoopAdminPage-BOGKa6lt.js","assets/CoopReportsPage-Ds_UhKUG.js","assets/CAPLayout-f16BNrmi.js","assets/scroll-text-BQffjgWO.js","assets/CAPOrgLayout-BbU6LUUZ.js","assets/CAPApplicationsPage-D6WJW7Fk.js","assets/useCAP-C6cwOzrK.js","assets/cap-CE2BV5Kl.js","assets/CAPVerificationPage-bK8niewN.js","assets/CAPPlansPage-CZx0ltZt.js","assets/CAPCostConfigPage-Dz-F48ym.js","assets/CAPLedgerPage-C28-9J11.js","assets/CAPReportsPage-3NQRknO0.js","assets/CAPImpactPage-Dpg-lPAt.js","assets/CAPCPAPage-DVdk62jw.js","assets/CAPRe
1newalsPage-Zq4wXdIy.js","assets/CAPAuditLogPage-b19DS5Ck.js","assets/CAPLandingPage-B2vLf1Jt.js","assets/CAPApplyPage-tQ63uqgb.js","assets/CAPStatusPage-DaJBprwa.js","assets/web-D3zZxHy0.js","assets/web-D4cYw5lr.js"])))=>i.map(i=>d[i]);
2var H0=Object.defineProperty;var Kd=n=>{throw TypeError(n)};var W0=(n,e,t)=>e in n?H0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var he=(n,e,t)=>W0(n,typeof e!="symbol"?e+"":e,t),bc=(n,e,t)=>e.has(n)||Kd("Cannot "+t);var U=(n,e,t)=>(bc(n,e,"read from private field"),t?t.call(n):e.get(n)),Ie=(n,e,t)=>e.has(n)?Kd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),Se=(n,e,t,r)=>(bc(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),it=(n,e,t)=>(bc(n,e,"access private method"),t);var lo=(n,e,t,r)=>({set _(s){Se(n,e,s,t)},get _(){return U(n,e,r)}});import{j as l,P as Ce,c as Fu,a as Gi,u as He,B as J0,b as Jo,d as Un,e as mt,f as ie,R as Y0,g as $u,h as Nt,i as Bm,k as qm,l as Gm,m as Hm,F as Wm,D as Jm,n as K0,I as Q0,o as Ym,p as Km,S as Uu,q as zu,r as Ci,O as Pa,C as ja,s as Qm,T as Oa,t as Ra,v as Xm,w as Zm,x as eg,L as tg,y as ng,z as rg,A as X0}from"./ui-BcZpBtGC.js";import{b as Hi,g as sg,d as Et,r as y,a as Y,c as Z0,e as Ia}from"./vendor-CbTYwD9p.js";import{u as wr,L as jt,a as Wi,N as Ai,B as e_,R as t_,b as W}from"./router-C21RS5Se.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();var fl={},Qd=Hi;fl.createRoot=Qd.createRoot,fl.hydrateRoot=Qd.hydrateRoot;const n_="modulepreload",r_=function(n){return"/"+n},Xd={},H=function(e,t,r){let s=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(t.map(c=>{if(c=r_(c),c in Xd)return;Xd[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":n_,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((p,v)=>{f.addEventListener("load",p),f.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})},s_=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>H(async()=>{const{default:r}=await Promise.resolve().then(()=>Gs);return{default:r}},void 0).then(({default:r})=>r(...t)):e=fetch,(...t)=>e(...t)};class Vu extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}}class i_ extends Vu{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class o_ extends Vu{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class a_ extends Vu{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var pl;(function(n){n.Any="any",n.ApNortheast1="ap-northeast-1",n.ApNortheast2="ap-northeast-2",n.ApSouth1="ap-south-1",n.ApSoutheast1="ap-southeast-1",n.ApSoutheast2="ap-southeast-2",n.CaCentral1="ca-central-1",n.EuCentral1="eu-central-1",n.EuWest1="eu-west-1",n.EuWest2="eu-west-2",n.EuWest3="eu-west-3",n.SaEast1="sa-east-1",n.UsEast1="us-east-1",n.UsWest1="us-west-1",n.UsWest2="us-west-2"})(pl||(pl={}));var c_=function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})};class l_{constructor(e,{headers:t={},customFetch:r,region:s=pl.Any}={}){this.url=e,this.headers=t,this.region=s,this.fetch=s_(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var r;return c_(this,void 0,void 0,function*(){try{const{headers:s,method:i,body:o}=t;let a={},{region:c}=t;c||(c=this.region),c&&c!=="any"&&(a["x-region"]=c);let u;o&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",u=o):typeof o=="str
2ing"?(a["Content-Type"]="text/plain",u=o):typeof FormData<"u"&&o instanceof FormData?u=o:(a["Content-Type"]="application/json",u=JSON.stringify(o)));const d=yield this.fetch(`${this.url}/${e}`,{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),s),body:u}).catch(b=>{throw new i_(b)}),f=d.headers.get("x-relay-error");if(f&&f==="true")throw new o_(d);if(!d.ok)throw new a_(d);let p=((r=d.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),v;return p==="application/json"?v=yield d.json():p==="application/octet-stream"?v=yield d.blob():p==="text/event-stream"?v=d:p==="multipart/form-data"?v=yield d.formData():v=yield d.text(),{data:v,error:null}}catch(s){return{data:null,error:s}}})}}var St={},Bu={},Na={},Ji={},Da={},Ma={},u_=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Ms=u_();const d_=Ms.fetch,ig=Ms.fetch.bind(Ms),og=Ms.Headers,h_=Ms.Request,f_=Ms.Response,Gs=Object.freeze(Object.defineProperty({__proto__:null,Headers:og,Request:h_,Response:f_,default:ig,fetch:d_},Symbol.toStringTag,{value:"Module"})),p_=sg(Gs);var La={};Object.defineProperty(La,"__esModule",{value:!0});let m_=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
2de=e.code}};La.default=m_;var ag=Et&&Et.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ma,"__esModule",{value:!0});const g_=ag(p_),v_=ag(La);let y_=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=g_.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Object.assign({},this.headers),this.headers[e]=t,this}then(e,t){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const r=this.fetch;let s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var o,a,c;let u=null,d=null,f=null,p=i.status,v=i.statusText;if(i.ok){if(this.method!=="HEAD"){const x=await i.text();x===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=x:d=JSON.parse(x))}const m=(o=this.headers.Prefer)===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),g=(a=i.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");m&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(d)&&(d.length>1?(u={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,f=null,p=406,v="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{const m=await i.text();try{u=JSON.parse(m),Array.isArray(u)&&i.status===404&&(d=[],u=null,p=200,v="OK")}catch{i.status===404&&m===""?(p=204,v="No Content"):u={message:m}}if(u&&this.isMaybeSingle&&(!((c=u==null?void 0:u.details)===null||c===void 0)&&c.includes("0 rows"))&&(u=null,p=200,v="OK"),u&&this.shouldThrowOnError)throw new v_.default(u)}return{error:u,data:d,count:f,status:p,statusText:v}});return this.shouldThrowOnError||(s=s.catch(i=>{var o,a,c;return{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:`${(a=i==null?void 0:i.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(c=i==null?void 0:i.code)!==null&&c!==void 0?c:""}`},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}returns(){return this}overrideTypes(){return this}};Ma.default=y_;var b_=Et&&Et.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Da,"__esModule",{value:!0});const w_=b_(Ma);let x_=class extends w_.default{select(e){let t=!1;const r=(e??"*").split("").map(s=>/\s/.test(s)&&!t?"":(s==='"'&&(t=!t),s)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:s,referencedTable:i=s}={}){const o=i?`${i}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:s=r}={}){const i=typeof s>"u"?"offset":`${s}.offset`,o=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(o,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
2explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:s=!1,wal:i=!1,format:o="text"}={}){var a;const c=[e?"analyze":null,t?"verbose":null,r?"settings":null,s?"buffers":null,i?"wal":null].filter(Boolean).join("|"),u=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${u}"; options=${c};`,o==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Da.default=x_;var __=Et&&Et.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ji,"__esModule",{value:!0});const S_=__(Da);let E_=class extends S_.default{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(s=>typeof s=="string"&&new RegExp("[,()]").test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:s}={}){let i="";s==="plain"?i="pl":s==="phrase"?i="ph":s==="websearch"&&(i="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const s=r?`${r}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}};Ji.default=E_;var T_=Et&&Et.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Na,"__esModule",{value:!0});const si=T_(Ji);let k_=class{constructor(e,{headers:t={},schema:r,fetch:s}){this.url=e,this.headers=t,this.schema=r,this.fetch=s}select(e,{head:t=!1,count:r}={}){const s=t?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(a=>/\s/.test(a)&&!i?"":(a==='"'&&(i=!i),a)).join("");return this.url.searchParams.set("select",o),r&&(this.headers.Prefer=`count=${r}`),new si.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:r=!0}={}){const s="POST",i=[];if(this.headers.Prefer&&i.push(this.headers.Prefer),t&&i.push(`count=${t}`),r||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(e)){const o=e.reduce((a,c)=>a.concat(Object.keys(c)),[]);if(o.length>0){const a=[...new Set(o)].map(c=>`"${c}"`);this.url.searchParams.set("columns",a.join(","))}}return new si.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:s,defaultToNull:i=!0}={}){const o="POST",a=[`resolution=${r?"ignore":"merge"}-duplicates`];if(t!==void 0&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&a.push(this.headers.Prefer),s&&a.push(`count=${s}`),i||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){const c=e.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(c.length>0){const u=[...new Set(c)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new si.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){const r="PATCH",s=[];return this.headers.Prefer&&s.push(this.headers.Prefer),t&&s.push(`count=${t}`),this.headers.Prefer=s.join(","),new si.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){const t="DELETE",r=[];return e&&r.push(`count=${e}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new si.default({method:t,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Na.default=k_;var Fa={},$a={};Object.defineProperty($a,"__esModule",{value:!0});$a.version=void 0;$a.version="0.0.0-automated";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.DEFAULT_HEADERS=void 0;const C_=$a;Fa.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${C_.version}`};var cg=Et&&Et.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};
2Object.defineProperty(Bu,"__esModule",{value:!0});const A_=cg(Na),P_=cg(Ji),j_=Fa;let O_=class lg{constructor(e,{headers:t={},schema:r,fetch:s}={}){this.url=e,this.headers=Object.assign(Object.assign({},j_.DEFAULT_HEADERS),t),this.schemaName=r,this.fetch=s}from(e){const t=new URL(`${this.url}/${e}`);return new A_.default(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new lg(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:r=!1,get:s=!1,count:i}={}){let o;const a=new URL(`${this.url}/rpc/${e}`);let c;r||s?(o=r?"HEAD":"GET",Object.entries(t).filter(([d,f])=>f!==void 0).map(([d,f])=>[d,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([d,f])=>{a.searchParams.append(d,f)})):(o="POST",c=t);const u=Object.assign({},this.headers);return i&&(u.Prefer=`count=${i}`),new P_.default({method:o,url:a,headers:u,schema:this.schemaName,body:c,fetch:this.fetch,allowEmpty:!1})}};Bu.default=O_;var Hs=Et&&Et.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(St,"__esModule",{value:!0});St.PostgrestError=St.PostgrestBuilder=St.PostgrestTransformBuilder=St.PostgrestFilterBuilder=St.PostgrestQueryBuilder=St.PostgrestClient=void 0;const ug=Hs(Bu);St.PostgrestClient=ug.default;const dg=Hs(Na);St.PostgrestQueryBuilder=dg.default;const hg=Hs(Ji);St.PostgrestFilterBuilder=hg.default;const fg=Hs(Da);St.PostgrestTransformBuilder=fg.default;const pg=Hs(Ma);St.PostgrestBuilder=pg.default;const mg=Hs(La);St.PostgrestError=mg.default;var R_=St.default={PostgrestClient:ug.default,PostgrestQueryBuilder:dg.default,PostgrestFilterBuilder:hg.default,PostgrestTransformBuilder:fg.default,PostgrestBuilder:pg.default,PostgrestError:mg.default};const{PostgrestClient:I_,PostgrestQueryBuilder:GL,PostgrestFilterBuilder:HL,PostgrestTransformBuilder:WL,PostgrestBuilder:JL,PostgrestError:YL}=R_,N_="2.11.2",D_={"X-Client-Info":`realtime-js/${N_}`},M_="1.0.0",gg=1e4,L_=1e3;var vs;(function(n){n[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed"})(vs||(vs={}));var Ct;(function(n){n.closed="closed",n.errored="errored",n.joined="joined",n.joining="joining",n.leaving="leaving"})(Ct||(Ct={}));var en;(function(n){n.close="phx_close",n.error="phx_error",n.join="phx_join",n.reply="phx_reply",n.leave="phx_leave",n.access_token="access_token"})(en||(en={}));var ml;(function(n){n.websocket="websocket"})(ml||(ml={}));var Rr;(function(n){n.Connecting="connecting",n.Open="open",n.Closing="closing",n.Closed="closed"})(Rr||(Rr={}));class F_{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const t=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,t,r)}_decodeBroadcast(e,t,r){const s=t.getUint8(1),i=t.getUint8(2);let o=this.HEADER_LENGTH+2;const a=r.decode(e.slice(o,o+s));o=o+s;const c=r.decode(e.slice(o,o+i));o=o+i;const u=JSON.parse(r.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:c,payload:u}}}class vg{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Ve;(function(n){n.abstime="abstime",n.bool="bool",n.date="date",n.daterange="daterange",n.float4="float4",n.float8="float8",n.int2="int2",n.int4="int4",n.int4range="int4range",n.int8="int8",n.int8range="int8range",n.json="json",n.jsonb="jsonb",n.money="money",n.numeric="numeric",n.oid="oid",n.reltime="reltime",n.text="text",n.time="time",n.timestamp="timestamp",n.timestamptz="timestamptz",n.timetz="timetz",n.tsrange="tsrange",n.tstzrange="tstzrange"})(Ve||(Ve={}));const Zd=(n,e,t={})=>{var r;const s=(r=t.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(e).reduce((i,o)=>(i[o]=$_(o,n,e,s),i),{})},$_=(n,e,t,r)=>{const s=e.find(a=>a.name===n),i=s==null?void 0:s.type,o=t[n];
2return i&&!r.includes(i)?yg(i,o):gl(o)},yg=(n,e)=>{if(n.charAt(0)==="_"){const t=n.slice(1,n.length);return B_(e,t)}switch(n){case Ve.bool:return U_(e);case Ve.float4:case Ve.float8:case Ve.int2:case Ve.int4:case Ve.int8:case Ve.numeric:case Ve.oid:return z_(e);case Ve.json:case Ve.jsonb:return V_(e);case Ve.timestamp:return q_(e);case Ve.abstime:case Ve.date:case Ve.daterange:case Ve.int4range:case Ve.int8range:case Ve.money:case Ve.reltime:case Ve.text:case Ve.time:case Ve.timestamptz:case Ve.timetz:case Ve.tsrange:case Ve.tstzrange:return gl(e);default:return gl(e)}},gl=n=>n,U_=n=>{switch(n){case"t":return!0;case"f":return!1;default:return n}},z_=n=>{if(typeof n=="string"){const e=parseFloat(n);if(!Number.isNaN(e))return e}return n},V_=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(e){return console.log(`JSON parse error: ${e}`),n}return n},B_=(n,e)=>{if(typeof n!="string")return n;const t=n.length-1,r=n[t];if(n[0]==="{"&&r==="}"){let i;const o=n.slice(1,t);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>yg(e,a))}return n},q_=n=>typeof n=="string"?n.replace(" ","T"):n,bg=n=>{let e=n;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};class wc{constructor(e,t,r={},s=gg){this.channel=e,this.event=t,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var r;return this._hasReceived(e)&&t((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var eh;(function(n){n.SYNC="sync",n.JOIN="join",n.LEAVE="leave"})(eh||(eh={}));class wi{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(t==null?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=wi.syncState(this.state,s,i,o),this.pendingDiffs.forEach(c=>{this.state=wi.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(r.diff,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=wi.syncDiff(this.state,s,i,o),a())}),this.onJoin((s,i,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:o})}),this.onLeave((s,i,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,r,s){const i=this.cloneDeep(e),o=this.transformState(t),a={},c={};return this.map(i,(u,d)=>{o[u]||(c[u]=d)}),this.map(o,(u,d)=>{const f=i[u];if(f){const p=d.map(g=>g.presence_ref),v=f.map(g=>g.presence_ref),b=d.filter(g=>v.indexOf(g.presence_ref)<0),m=f.filter(g=>p.indexOf(g.presence_ref)<0);b.length>0&&(a[u]=b),m.length>0&&(c[u]=m)}else a[u]=d}),this.syncDiff(i,{joins:a,leaves:c},r,s)}static syncDiff(e,t,r,s){const{joins:i,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(i,(a,c)=>{var u;
2const d=(u=e[a])!==null&&u!==void 0?u:[];if(e[a]=this.cloneDeep(c),d.length>0){const f=e[a].map(v=>v.presence_ref),p=d.filter(v=>f.indexOf(v.presence_ref)<0);e[a].unshift(...p)}r(a,d,c)}),this.map(o,(a,c)=>{let u=e[a];if(!u)return;const d=c.map(f=>f.presence_ref);u=u.filter(f=>d.indexOf(f.presence_ref)<0),e[a]=u,s(a,u,c),u.length===0&&delete e[a]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,r)=>{const s=e[r];return"metas"in s?t[r]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):t[r]=s,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var th;(function(n){n.ALL="*",n.INSERT="INSERT",n.UPDATE="UPDATE",n.DELETE="DELETE"})(th||(th={}));var nh;(function(n){n.BROADCAST="broadcast",n.PRESENCE="presence",n.POSTGRES_CHANGES="postgres_changes",n.SYSTEM="system"})(nh||(nh={}));var Pn;(function(n){n.SUBSCRIBED="SUBSCRIBED",n.TIMED_OUT="TIMED_OUT",n.CLOSED="CLOSED",n.CHANNEL_ERROR="CHANNEL_ERROR"})(Pn||(Pn={}));class qu{constructor(e,t={config:{}},r){this.topic=e,this.params=t,this.socket=r,this.bindings={},this.state=Ct.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new wc(this,en.join,this.params,this.timeout),this.rejoinTimer=new vg(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Ct.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Ct.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=Ct.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Ct.errored,this.rejoinTimer.scheduleTimeout())}),this._on(en.reply,{},(s,i)=>{this._trigger(this._replyEventName(i),s)}),this.presence=new wi(this),this.broadcastEndpointURL=bg(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(e,t=this.timeout){var r,s;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:i,presence:o,private:a}}=this.params;this._onError(d=>e==null?void 0:e(Pn.CHANNEL_ERROR,d)),this._onClose(()=>e==null?void 0:e(Pn.CLOSED));const c={},u={broadcast:i,presence:o,postgres_changes:(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(d=>d.filter))!==null&&s!==void 0?s:[],private:a};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:u},c)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:d})=>{var f;if(this.socket.setAuth(),d===void 0){e==null||e(Pn.SUBSCRIBED);return}else{const p=this.bindings.postgres_changes,v=(f=p==null?void 0:p.length)!==null&&f!==void 0?f:0,b=[];for(let m=0;m<v;m++){const g=p[m],{filter:{event:x,schema:S,table:E,filter:P}}=g,C=d&&d[m];if(C&&C.event===x&&C.schema===S&&C.table===E&&C.filter===P)b.push(Object.assign(Object.assign({},g),{id:C.id}));else{this.unsubscribe(),e==null||e(Pn.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=b,e&&e(Pn.SUBSCRIBED);return}}).receive("error",d=>{e==null||e(Pn.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(Pn.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){return this._on(e,t,r)}async send(e,t={}){var r,s;if(!this._canPush()&&e.type==="broadcast"){const{event:i,payload:o}=e,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=t.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,c;const u=this._push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Ct.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(en.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(r=>{const s=new wc(this,en.leave,{},e);s.receive("ok",()=>{t(),r("ok")}).receive("timeout",()=>{t(),r("timed out")}).receive("error",()=>{r("error")}),s.send(),this._canPush()||s.trigger("ok",{})})}async _fetchWithTimeout(e,t,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:s.signal}));return clearTimeout(i),o}_push(e,t,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new wc(this,e,t,r);return this._canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}_onMessage(e,t,r){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,r){var s,i;const o=e.toLocaleLowerCase(),{close:a,error:c,leave:u,join:d}=en;if(r&&[a,c,u,d].indexOf(o)>=0&&r!==this._joinRef())return;let p=this._onMessage(o,t,r);if(t&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(v=>{var b,m,g;return((b=v.filter)===null||b===void 0?void 0:b.event)==="*"||((g=(m=v.filter)===null||m===void 0?void 0:m.event)===null||g===void 0?void 0:g.toLocaleLowerCase())===o}).map(v=>v.callback(p,r)):(i=this.bindings[o])===null||i===void 0||i.filter(v=>{var b,m,g,x,S,E;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in v){const P=v.id,C=(b=v.filter)===null||b===void 0?void 0:b.event;return P&&((m=t.ids)===null||m===void 0?void 0:m.includes(P))&&(C==="*"||(C==null?void 0:C.toLocaleLowerCase())===((g=t.data)===null||g===void 0?void 0:g.type.toLocaleLowerCase()))}else{const P=(S=(x=v==null?void 0:v.filter)===null||x===void 0?void 0:x.event)===null||S===void 0?void 0:S.toLocaleLowerCase();return P==="*"||P===((E=t==null?void 0:t.event)===null||E===void 0?void 0:E.toLocaleLowerCase())}else return v.type.toLocaleLowerCase()===o}).map(v=>{if(typeof p=="object"&&"ids"in p){const b=p.data,{schema:m,table:g,commit_timestamp:x,type:S,errors:E}=b;p=Object.assign(Object.assign({},{schema:m,table:g,commit_timestamp:x,eventType:S,new:{},old:{},errors:E}),this._getPayloadRecords(b))}v.callback(p,r)})}_isClosed(){return this.state===Ct.closed}_isJoined(){return this.state===Ct.joined}_isJoining(){return this.state===Ct.joining}_isLeaving(){return this.state===Ct.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,r){const s=e.toLocaleLowerCase(),i={type:s,filter:t,callback:r};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,t){const r=e.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&qu.isEqual(s.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(en.close,{},e)}_onError(e){this._on(en.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Ct.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=Zd(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=Zd(e.columns,e.old_record)),t}}const G_=()=>{},H_=typeof WebSocket<"u",W_=`
3  addEventListener("message", (e) => {
4    if (e.data.event === "start") {
5      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
6    }
7  });`;class J_{constructor(e,t){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=D_,this.params={},this.timeout=gg,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=G_,this.conn=null,this.sendBuffer=[],this.serializer
7=new F_,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=i=>{let o;return i?o=i:typeof fetch>"u"?o=(...a)=>H(async()=>{const{default:c}=await Promise.resolve().then(()=>Gs);return{default:c}},void 0).then(({default:c})=>c(...a)):o=fetch,(...a)=>o(...a)},this.endPoint=`${e}/${ml.websocket}`,this.httpEndpoint=bg(e),t!=null&&t.transport?this.transport=t.transport:this.transport=null,t!=null&&t.params&&(this.params=t.params),t!=null&&t.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t!=null&&t.timeout&&(this.timeout=t.timeout),t!=null&&t.logger&&(this.logger=t.logger),t!=null&&t.heartbeatIntervalMs&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);const s=(r=t==null?void 0:t.params)===null||r===void 0?void 0:r.apikey;if(s&&(this.accessTokenValue=s,this.apiKey=s),this.reconnectAfterMs=t!=null&&t.reconnectAfterMs?t.reconnectAfterMs:i=>[1e3,2e3,5e3,1e4][i-1]||1e4,this.encode=t!=null&&t.encode?t.encode:(i,o)=>o(JSON.stringify(i)),this.decode=t!=null&&t.decode?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new vg(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(t==null?void 0:t.fetch),t!=null&&t.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(t==null?void 0:t.worker)||!1,this.workerUrl=t==null?void 0:t.workerUrl}this.accessToken=(t==null?void 0:t.accessToken)||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(H_){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new Y_(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),H(async()=>{const{default:e}=await import("./browser-BpHD5WX1.js").then(t=>t.b);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>{this.conn=new e(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:M_}))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,t??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.disconnect(),e}log(e,t,r){this.logger(e,t,r)}connectionState(){switch(this.conn&&this.conn.readyState){case vs.connecting:return Rr.Connecting;case vs.open:return Rr.Open;case vs.closing:return Rr.Closing;default:return Rr.Closed}}isConnected(){return this.connectionState()===Rr.Open}channel(e,t={config:{}}){const r=new qu(`realtime:${e}`,t,this);return this.channels.push(r),r}push(e){const{topic:t,event:r,payload:s,ref:i}=e,o=()=>{this.encode(e,a=>{var c;(c=this.conn)===null||c===void 0||c.send(a)})};this.log("push",`${t} ${r} (${i})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){let t=e||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(t){let r=null;try{r=JSON.parse(atob(t.split(".")[1]))}catch{}if(r&&r.exp&&!(Math.floor(Date.now()/1e3)-r.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`);this.accessTokenValue=t,this.channels.forEach(s=>{t&&s.updateJoinPayload({access_token:t}),s.joinedOnce&&s._isJoined()&&s._push(en.access_token,{access_token:t})})}}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(L_,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>
70&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t._joinRef()!==e._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:s,payload:i,ref:o}=t;o&&o===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${i.status||""} ${r} ${s} ${o&&"("+o+")"||""}`,i),this.channels.filter(a=>a._isMember(r)).forEach(a=>a._trigger(s,i,o)),this.stateChangeCallbacks.message.forEach(a=>a(t))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this.workerRef.terminate()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(en.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;const r=e.match(/\?/)?"&":"?",s=new URLSearchParams(t);return`${e}${r}${s}`}_workerObjectUrl(e){let t;if(e)t=e;else{const r=new Blob([W_],{type:"application/javascript"});t=URL.createObjectURL(r)}return t}}class Y_{constructor(e,t,r){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=vs.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=r.close}}class Gu extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function et(n){return typeof n=="object"&&n!==null&&"__isStorageError"in n}class K_ extends Gu{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class vl extends Gu{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var Q_=function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})};const wg=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>H(async()=>{const{default:r}=await Promise.resolve().then(()=>Gs);return{default:r}},void 0).then(({default:r})=>r(...t)):e=fetch,(...t)=>e(...t)},X_=()=>Q_(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield H(()=>Promise.resolve().then(()=>Gs),void 0)).Response:Response}),yl=n=>{if(Array.isArray(n))return n.map(t=>yl(t));if(typeof n=="function"||n!==Object(n))return n;const e={};return Object.entries(n).forEach(([t,r])=>{const s=t.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=yl(r)}),e};var Xr=function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})};const xc=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),Z_=(n,e,t)=>Xr(void 0,void 0,void 0,function*(){const r=yield X_();n instanceof r&&!(t!=null&&t.noResolveJson)?n.json().then(s=>{e(new K_(xc(s),n.status||500))}).catch(s=>{e(new vl(xc(s),s))}):e(new vl(xc(n),n))}),eS=(n,e,t,r)=>{const s={method:n,headers:(e==null?void 0:e.headers)||{}};return n==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),r&&(s.body=JSON.stringify(r)),Object.assign(Object.assign({},s),t))};function Yi(n,e,t,r,s,i){return Xr(this,void 0,void 0,function*(){return new Promise((o,a)=>
7{n(t,eS(e,r,s,i)).then(c=>{if(!c.ok)throw c;return r!=null&&r.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>Z_(c,a,r))})})}function Yo(n,e,t,r){return Xr(this,void 0,void 0,function*(){return Yi(n,"GET",e,t,r)})}function Kn(n,e,t,r,s){return Xr(this,void 0,void 0,function*(){return Yi(n,"POST",e,r,s,t)})}function tS(n,e,t,r,s){return Xr(this,void 0,void 0,function*(){return Yi(n,"PUT",e,r,s,t)})}function nS(n,e,t,r){return Xr(this,void 0,void 0,function*(){return Yi(n,"HEAD",e,Object.assign(Object.assign({},t),{noResolveJson:!0}),r)})}function xg(n,e,t,r,s){return Xr(this,void 0,void 0,function*(){return Yi(n,"DELETE",e,r,s,t)})}var wt=function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})};const rS={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},rh={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class sS{constructor(e,t={},r,s){this.url=e,this.headers=t,this.bucketId=r,this.fetch=wg(s)}uploadOrUpdate(e,t,r,s){return wt(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},rh),s);let a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,c&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),s!=null&&s.headers&&(a=Object.assign(Object.assign({},a),s.headers));const u=this._removeEmptyFolders(t),d=this._getFinalPath(u),f=yield this.fetch(`${this.url}/object/${d}`,Object.assign({method:e,body:i,headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{})),p=yield f.json();return f.ok?{data:{path:u,id:p.Id,fullPath:p.Key},error:null}:{data:null,error:p}}catch(i){if(et(i))return{data:null,error:i};throw i}})}upload(e,t,r){return wt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,r)})}uploadToSignedUrl(e,t,r,s){return wt(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let c;const u=Object.assign({upsert:rh.upsert},s),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",u.cacheControl)):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);const f=yield this.fetch(a.toString(),{method:"PUT",body:c,headers:d}),p=yield f.json();return f.ok?{data:{path:i,fullPath:p.Key},error:null}:{data:null,error:p}}catch(c){if(et(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(e,t){return wt(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e);const s=Object.assign({},this.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const i=yield Kn(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new Gu("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(r){if(et(r))return{data:null,error:r};throw r}})}update(e,t,r){return wt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,r)})}move(e,t,r){return wt(this,void 0,void 0,function*(){try{return{data:yield Kn(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,de
7stinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(et(s))return{data:null,error:s};throw s}})}copy(e,t,r){return wt(this,void 0,void 0,function*(){try{return{data:{path:(yield Kn(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(et(s))return{data:null,error:s};throw s}})}createSignedUrl(e,t,r){return wt(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),i=yield Kn(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(s){if(et(s))return{data:null,error:s};throw s}})}createSignedUrls(e,t,r){return wt(this,void 0,void 0,function*(){try{const s=yield Kn(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:s.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(s){if(et(s))return{data:null,error:s};throw s}})}download(e,t){return wt(this,void 0,void 0,function*(){const s=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),o=i?`?${i}`:"";try{const a=this._getFinalPath(e);return{data:yield(yield Yo(this.fetch,`${this.url}/${s}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(et(a))return{data:null,error:a};throw a}})}info(e){return wt(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{const r=yield Yo(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:yl(r),error:null}}catch(r){if(et(r))return{data:null,error:r};throw r}})}exists(e){return wt(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{return yield nS(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(et(r)&&r instanceof vl){const s=r.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,t){const r=this._getFinalPath(e),s=[],i=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&s.push(i);const a=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});c!==""&&s.push(c);let u=s.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${u}`)}}}remove(e){return wt(this,void 0,void 0,function*(){try{return{data:yield xg(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(et(t))return{data:null,error:t};throw t}})}list(e,t,r){return wt(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},rS),t),{prefix:e||""});return{data:yield Kn(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},r),error:null}}catch(s){if(et(s))return{data:null,error:s};throw s}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const iS="2.7.1",oS={"X-Client-Info":`storage-js/${iS}`};var rs=function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})};class aS{constructor(e,t={},r){this.url=e,this.headers=Object.assign(Object.assign({},oS),t),this.fetch=wg(r)}listBuckets(){return rs(this,void 0,void 0,function*(){try{return{data:yield Yo(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(et(e))return{data:null,error:e};throw e}})}getBucket(e){return rs(this,void 0,void 0,function*(){try{return{data:yield Yo(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(et(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return rs(this,void 0,void 0,function*(){try{return{data:yield Kn(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(et(r))return{data:null,error:r};throw r}})}updateBucket(e,t){return rs(this,void 0,void 0,function*(){try{return{data:yield tS(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(et(r))return{data:null,error:r};throw r}})}emptyBucket(e){return rs(this,void 0,void 0,function*(){try{return{data:yield Kn(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(et(t))return{data:null,error:t};throw t}})}deleteBucket(e){return rs(this,void 0,void 0,function*(){try{return{data:yield xg(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(et(t))return{data:null,error:t};throw t}})}}class cS extends aS{constructor(e,t={},r){super(e,t,r)}from(e){return new sS(this.url,this.headers,e,this.fetch)}}const lS="2.49.4";let fi="";typeof Deno<"u"?fi="deno":typeof document<"u"?fi="web":typeof navigator<"u"&&navigator.product==="ReactNative"?fi="react-native":fi="node";const uS={"X-Client-Info":`supabase-js-${fi}/${lS}`},dS={headers:uS},hS={schema:"public"},fS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},pS={};var mS=function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})};const gS=n=>{let e;return n?e=n:typeof fetch>"u"?e=ig:e=fetch,(...t)=>e(...t)},vS=()=>typeof Headers>"u"?og:Headers,yS=(n,e,t)=>{const r=gS(t),s=vS();return(i,o)=>mS(void 0,void 0,void 0,function*(){var a;const c=(a=yield e())!==null&&a!==void 0?a:n;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",n),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(i,Object.assign(Object.assign({},o),{headers:u}))})};var bS=function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})};function wS(n){return n.replace(/\/$/,"")}function xS(n,e){const{db:t,auth:r,realtime:s,global:i}=n,{db:o,auth:a,realtime:c,global:u}=e,d={db:Object.assign(Object.assign({},o),t),auth:Object.assign(Object.assign({},a),r),realtime:Object.assign(Object.assign({},c),s),global:Object.assign(Object.assign({},u),i),accessToken:()=>bS(this,void 0,void 0,function*(){return""})};return n.accessToken?d.accessToken=n.accessToken:delete d.accessToken,d}const _g="2.69.1",hs=30*1e3,bl=3,_c=bl*hs,_S="http://localhost:9999",SS="supabase.auth.token",ES={"X-Client-Info":`gotrue-js/${_g}`},wl="X-Supabase-Api-Version",Sg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},TS=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,kS=6e5;
7class Hu extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}}function we(n){return typeof n=="object"&&n!==null&&"__isAuthError"in n}class CS extends Hu{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}function AS(n){return we(n)&&n.name==="AuthApiError"}class Eg extends Hu{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class xr extends Hu{constructor(e,t,r,s){super(e,r,s),this.name=t,this.status=r}}class Gn extends xr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function PS(n){return we(n)&&n.name==="AuthSessionMissingError"}class Sc extends xr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class uo extends xr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class ho extends xr{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function jS(n){return we(n)&&n.name==="AuthImplicitGrantRedirectError"}class sh extends xr{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class xl extends xr{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function Ec(n){return we(n)&&n.name==="AuthRetryableFetchError"}class ih extends xr{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}}class xi extends xr{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const oh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),ah=` 	
8\r=`.split(""),OS=(()=>{const n=new Array(128);for(let e=0;e<n.length;e+=1)n[e]=-1;for(let e=0;e<ah.length;e+=1)n[ah[e].charCodeAt(0)]=-2;for(let e=0;e<oh.length;e+=1)n[oh[e].charCodeAt(0)]=e;return n})();function Tg(n,e,t){const r=OS[n];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)t(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(n)}"`)}}function ch(n){const e=[],t=o=>{e.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{NS(o,r,t)};for(let o=0;o<n.length;o+=1)Tg(n.charCodeAt(o),s,i);return e.join("")}function RS(n,e){if(n<=127){e(n);return}else if(n<=2047){e(192|n>>6),e(128|n&63);return}else if(n<=65535){e(224|n>>12),e(128|n>>6&63),e(128|n&63);return}else if(n<=1114111){e(240|n>>18),e(128|n>>12&63),e(128|n>>6&63),e(128|n&63);return}throw new Error(`Unrecognized Unicode codepoint: ${n.toString(16)}`)}function IS(n,e){for(let t=0;t<n.length;t+=1){let r=n.charCodeAt(t);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(n.charCodeAt(t+1)-56320&65535|s)+65536,t+=1}RS(r,e)}}function NS(n,e,t){if(e.utf8seq===0){if(n<=127){t(n);return}for(let r=1;r<6;r+=1)if(!(n>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=n&31;else if(e.utf8seq===3)e.codepoint=n&15;else if(e.utf8seq===4)e.codepoint=n&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(n<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|n&63,e.utf8seq-=1,e.utf8seq===0&&t(e.codepoint)}}function DS(n){const e=[],t={queue:0,queuedBits:0},r=s=>{e.push(s)};for(let s=0;s<n.length;s+=1)Tg(n.charCodeAt(s),t,r);return new Uint8Array(e)}function MS(n){const e=[];return IS(n,t=>e.push(t)),new Uint8Array(e)}function LS(n){return Math.round(Date.now()/1e3)+n}function FS(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n=="x"?e:e&3|8).toString(16)})}const un=()=>typeof window<"u"&&typeof document<"u",kr={tested:!1,writable:!1},_i=()=>{if(!un())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(kr.tested)return kr.writable;const n=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(n,n),globalThis.localStorage.removeItem(n),kr.tested=!0,kr.writable=!0}catch{kr.tested=!0,kr.writable=!1}return kr.writable};function $S(n){const e={},t=new URL(n);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEac
8h((s,i)=>{e[i]=s})}catch{}return t.searchParams.forEach((r,s)=>{e[s]=r}),e}const kg=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>H(async()=>{const{default:r}=await Promise.resolve().then(()=>Gs);return{default:r}},void 0).then(({default:r})=>r(...t)):e=fetch,(...t)=>e(...t)},US=n=>typeof n=="object"&&n!==null&&"status"in n&&"ok"in n&&"json"in n&&typeof n.json=="function",Cg=async(n,e,t)=>{await n.setItem(e,JSON.stringify(t))},fo=async(n,e)=>{const t=await n.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},po=async(n,e)=>{await n.removeItem(e)};class Ua{constructor(){this.promise=new Ua.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}Ua.promiseConstructor=Promise;function Tc(n){const e=n.split(".");if(e.length!==3)throw new xi("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!TS.test(e[r]))throw new xi("JWT not in base64url format");return{header:JSON.parse(ch(e[0])),payload:JSON.parse(ch(e[1])),signature:DS(e[2]),raw:{header:e[0],payload:e[1]}}}async function zS(n){return await new Promise(e=>{setTimeout(()=>e(null),n)})}function VS(n,e){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await n(i);if(!e(i,null,o)){r(o);return}}catch(o){if(!e(i,o)){s(o);return}}})()})}function BS(n){return("0"+n.toString(16)).substr(-2)}function qS(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=t.length;let s="";for(let i=0;i<56;i++)s+=t.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(e),Array.from(e,BS).join("")}async function GS(n){const t=new TextEncoder().encode(n),r=await crypto.subtle.digest("SHA-256",t),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function HS(n){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),n;const t=await GS(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ss(n,e,t=!1){const r=qS();let s=r;t&&(s+="/PASSWORD_RECOVERY"),await Cg(n,`${e}-code-verifier`,s);const i=await HS(r);return[i,r===i?"plain":"s256"]}const WS=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function JS(n){const e=n.headers.get(wl);if(!e||!e.match(WS))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function YS(n){if(!n)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(n<=e)throw new Error("JWT has expired")}function KS(n){switch(n){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var QS=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t};const Or=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),XS=[502,503,504];async function lh(n){var e;if(!US(n))throw new xl(Or(n),0);if(XS.includes(n.status))throw new xl(Or(n),n.status);let t;try{t=await n.json()}catch(i){throw new Eg(Or(i),i)}let r;const s=JS(n);if(s&&s.getTime()>=Sg["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?r=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(r=t.error_code),r){if(r==="weak_password")throw new ih(Or(t),n.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new Gn}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new ih(Or(t),n.status,t.weak_password.reasons);throw new CS(Or(t),n.status||500,r)}const ZS=(n,e,t,r)=>{const s={method:n,headers:(e==null?void 0:e.headers)||{}};return n==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),t))};async function Ee(n,e,t,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[wl]||(i[wl]=Sg["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await eE(n,e,t+a,{headers:i,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function eE(n,e,t,r,s,i){const o=ZS(e,r,s,i);let a;try{a=await n(t,Object.assign({},o))}catch(c){throw console.error(c),new xl(Or(c),0)}if(a.ok||await lh(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(c){await lh(c)}}function Hn(n){var e;let t=null;sE(n)&&(t=Object.assign({},n),n.expires_at||(t.expires_at=LS(n.expires_in)));const r=(e=n.user)!==null&&e!==void 0?e:n;return{data:{session:t,user:r},error:null}}function uh(n){const e=Hn(n);return!e.error&&n.weak_password&&typeof n.weak_password=="object"&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.message&&typeof n.weak_password.message=="string"&&n.weak_password.reasons.reduce((t,r)=>t&&typeof r=="string",!0)&&(e.data.weak_password=n.weak_password),e}function tr(n){var e;return{data:{user:(e=n.user)!==null&&e!==void 0?e:n},error:null}}function tE(n){return{data:n,error:null}}function nE(n){const{action_link:e,email_otp:t,hashed_token:r,redirect_to:s,verification_type:i}=n,o=QS(n,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:t,hashed_token:r,redirect_to:s,verification_type:i},c=Object.assign({},o);return{data:{properties:a,user:c},error:null}}function rE(n){return n}function sE(n){return n.access_token&&n.refresh_token&&n.expires_in}var iE=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t};class oE{constructor({url:e="",headers:t={},fetch:r}){this.url=e,this.headers=t,this.fetch=kg(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,t="global"){try{return await Ee(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(we(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,t={}){try{return await Ee(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:tr})}catch(r){if(we(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:t}=e,r=iE(e,["options"]),s=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Ee(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:nE,redirectTo:t==null?void 0:t.redirectTo})}catch(t){if(we(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await Ee(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:tr})}catch(t){if(we(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,r,s,i,o,a,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Ee(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:rE});if(d.error)throw d.error;const f=await d.json(),p=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,v=(c=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return v.length>0&&(v.forEach(b=>{const m=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(b.split(";")[1].split("=")[1]);u[`${g}Page`]=m}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(we(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){try{return await Ee(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:tr})}catch(t){if(we(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){try{return await Ee(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:tr})}catch(r){if(we(r))return{data:{user:null},error:r};throw r}}
8async deleteUser(e,t=!1){try{return await Ee(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:tr})}catch(r){if(we(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){try{const{data:t,error:r}=await Ee(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:t,error:r}}catch(t){if(we(t))return{data:null,error:t};throw t}}async _deleteFactor(e){try{return{data:await Ee(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(we(t))return{data:null,error:t};throw t}}}const aE={getItem:n=>_i()?globalThis.localStorage.getItem(n):null,setItem:(n,e)=>{_i()&&globalThis.localStorage.setItem(n,e)},removeItem:n=>{_i()&&globalThis.localStorage.removeItem(n)}};function dh(n={}){return{getItem:e=>n[e]||null,setItem:(e,t)=>{n[e]=t},removeItem:e=>{delete n[e]}}}function cE(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const is={debug:!!(globalThis&&_i()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Ag extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class lE extends Ag{}async function uE(n,e,t){is.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",n,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),is.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",n)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(n,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){is.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",n,s.name);try{return await t()}finally{is.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",n,s.name)}}else{if(e===0)throw is.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",n),new lE(`Acquiring an exclusive Navigator LockManager lock "${n}" immediately failed`);if(is.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await t()}}))}cE();const dE={url:_S,storageKey:SS,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ES,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function hh(n,e,t){return await t()}class Pi{constructor(e){var t,r;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=Pi.nextInstanceID,Pi.nextInstanceID+=1,this.instanceID>0&&un()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const s=Object.assign(Object.assign({},dE),e);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new oE({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=kg(s.fetch),this.lock=s.lock||hh,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,s.lock?this.lock=s.lock:un()&&(!((t=globalThis==null?void 0:globalThis.navigator)===null||t===void 0)&&t.locks)?this.lock=uE:this.lock=hh,this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?s.storage?this.storage=s.storage:_i()?this.storage=aE:(this.memoryStorage={},this.storage=dh(this.memoryStorage)):(this.memoryStorage={},this.storage=dh(this.memoryStorage)),un()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${_g}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const t=$S(window.location.href);let r="none";if(this._isImplicitGrantCallback(t)?r="implicit":await this._isPKCECallback(t)&&(r="pkce"),un()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(t,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),jS(i)){const c=(e=i.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return we(t)?{error:t}:{error:new Eg("Unexpected error during initialization",t)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,s;try{const i=await Ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:Hn}),{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:u,session:c},error:null}}catch(i){if(we(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(e){var t,r,s;try{let i;if("email"in e){const{email:d,password:f,options:p}=e;let v=null,b=null;this.flowType==="pkce"&&([v,b]=await ss(this.storage,this.storageKey)),i=await Ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:d,password:f,data:(t=p==null?void 0:p.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:v,code_challenge_method:b},xform:Hn})}else if("phone"in e){const{phone:d,password:f,options:p}=e;i=await Ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},channel:(s=p==null?void 0:p.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Hn})}else throw new uo("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:u,session:c},error:null}}catch(i){if(we(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(e){try{let t;if("email"in e){const{email:i,password:o,options:a}=e;t=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:uh})}else if("phone"in e){const{phone:i,password:o,options:a}=e;t=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:uh})}else throw new uo("You must provide either an email or phone number and a password");const{data:r,error:s}=t;return s?{data:{user:null,session:null},error:s}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new Sc}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(t){if(we(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOAuth(e){var t,r,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){const t=await fo(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(t??"").split("/");try{const{data:i,error:o}=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:Hn});if(await po(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new Sc}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(we(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(e){try{const{options:t,provider:r,token:s,access_token:i,nonce:o}=e,a=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:Hn}),{data:c,error:u}=a;return u?{data:{user:null,session:null},error:u}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new Sc}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:u})}catch(t){if(we(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOtp(e){var t,r,s,i,o;try{if("email"in e){const{email:a,options:c}=e;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await ss(this.storage,this.storageKey));const{error:f}=await Ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(t=c==null?void 0:c.data)!==null&&t!==void 0?t:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){const{phone:a,options:c}=e,{data:u,error:d}=await Ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d}}throw new uo("You must provide either an email or phone number.")}catch(a){if(we(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var t,r;try{let s,i;"options"in e&&(s=(t=e.options)===null||t===void 0?void 0:t.redirectTo,i=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await Ee(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:Hn});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:u,session:c},error:null}}catch(s){if(we(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithSSO(e){var t,r,s;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await ss(this.storage,this.storageKey)),await Ee(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:tE})}catch(i){if(we(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new Gn;const{error:s}=await Ee(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:s}})}catch(e){if(we(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:r,type:s,options:i}=e,{error:o}=await Ee(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:r,type:s,options:i}=e,{data:o,error:a}=await Ee(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a}}throw new uo("You must provide either an email or phone number and a type")}catch(t){if(we(t))return{data:{user:null,session:null},error:t};throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async t=>t))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await t()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=t();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[.
8..this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const t=await fo(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<_c:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.storage.isServer){let o=this.suppressGetSessionWarning;e=new Proxy(e,{get:(c,u,d)=>(!o&&u==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,u,d))})}return{data:{session:e},error:null}}const{session:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:s},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await Ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:tr}):await this._useSession(async t=>{var r,s,i;const{data:o,error:a}=t;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Gn}:await Ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:tr})})}catch(t){if(we(t))return PS(t)&&(await this._removeSession(),await po(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:t};throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new Gn;const o=s.session;let a=null,c=null;this.flowType==="pkce"&&e.email!=null&&([a,c]=await ss(this.storage,this.storageKey));const{data:u,error:d}=await Ee(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:c}),jwt:o.access_token,xform:tr});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(r){if(we(r))return{data:{user:null},error:r};throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Gn;const t=Date.now()/1e3;let r=t,s=!0,i=null;const{payload:o}=Tc(e.access_token);if(o.exp&&(r=o.exp,s=r<=t),s){const{session:a,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:c}=await this._getUser(e.access_token);if(c)throw c;i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(t){if(we(t))return{data:{session:null,user:null},error:t};throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){const{data:o,error:a}=t;if(a)throw a;e=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new Gn;const{session:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(t){if(we(t))return{data:{user:null,session:null},error:t};throw t}}async _getSessionFromURL(e,t){try{if(!un())throw new ho("No browser detected.");
8if(e.error||e.error_description||e.error_code)throw new ho(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new sh("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ho("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new sh("No code detected.");const{data:S,error:E}=await this._exchangeCodeForSession(e.code);if(E)throw E;const P=new URL(window.location.href);return P.searchParams.delete("code"),window.history.replaceState(window.history.state,"",P.toString()),{data:{session:S.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:c,token_type:u}=e;if(!i||!a||!o||!u)throw new ho("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(a);let p=d+f;c&&(p=parseInt(c));const v=p-d;v*1e3<=hs&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${v}s, should have been closer to ${f}s`);const b=p-f;d-b>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",b,p,d):d-b<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",b,p,d);const{data:m,error:g}=await this._getUser(i);if(g)throw g;const x={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:f,expires_at:p,refresh_token:o,token_type:u,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:x,redirectType:e.type},error:null}}catch(r){if(we(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const t=await fo(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;const{data:s,error:i}=t;if(i)return{error:i};const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(AS(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await po(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const t=FS(),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,s;try{const{data:{session:i},error:o}=t;if(o)throw o;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,t={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await ss(this.storage,this.storageKey,!0));try{return await Ee(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(i){if(we(i))return{data:null,error:i};throw i}}async getUserIdentities(){var e;try{const{data:t,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(t){if(we(t))return{data:null,error:t};throw t}}async linkIdentity(e){var t;try{const{data:r,error:s}=await this._useSession(async i=>{var o,a,c,u,d;const{data:f,error:p}=i;if(p)throw p;const v=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Ee(this.fetch,"GET",v,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return un()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:e.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(we(r))return{data:{provider:e.provider,url:null},error:r};throw r}}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,s;const{data:i,error:o}=t;if(o)throw o;
8return await Ee(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(t){if(we(t))return{data:null,error:t};throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const r=Date.now();return await VS(async s=>(s>0&&await zS(200*Math.pow(2,s-1)),this._debug(t,"refreshing attempt",s),await Ee(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Hn})),(s,i)=>{const o=200*Math.pow(2,s);return i&&Ec(i)&&Date.now()+o-r<hs})}catch(r){if(this._debug(t,"error",r),we(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(t,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),un()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e;const t="#_recoverAndRefresh()";this._debug(t,"begin");try{const r=await fo(this.storage,this.storageKey);if(this._debug(t,"session from storage",r),!this._isValidSession(r)){this._debug(t,"session is not valid"),r!==null&&await this._removeSession();return}const s=((e=r.expires_at)!==null&&e!==void 0?e:1/0)*1e3-Date.now()<_c;if(this._debug(t,`session has${s?"":" not"} expired with margin of ${_c}s`),s){if(this.autoRefreshToken&&r.refresh_token){const{error:i}=await this._callRefreshToken(r.refresh_token);i&&(console.error(i),Ec(i)||(this._debug(t,"refresh failed with a non-retryable error, removing the session",i),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(r){this._debug(t,"error",r),console.error(r);return}finally{this._debug(t,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new Gn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Ua;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new Gn;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={session:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(s,"error",i),we(i)){const o={session:null,error:i};return Ec(i)||await this._removeSession(),(t=this.refreshingDeferred)===null||t===void 0||t.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,t,r=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,t)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Cg(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await po(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&un()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),hs);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-e)/hs);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${hs}ms, refresh threshold is ${bl} ticks`),s<=bl&&await this._callRefreshToken(r.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Ag)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!un()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(
8await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){const s=[`provider=${encodeURIComponent(t)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await ss(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;const{data:s,error:i}=t;return i?{data:null,error:i}:await Ee(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(t){if(we(t))return{data:null,error:t};throw t}}async _enroll(e){try{return await this._useSession(async t=>{var r,s;const{data:i,error:o}=t;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:c,error:u}=await Ee(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(e.factorType==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(t){if(we(t))return{data:null,error:t};throw t}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r;const{data:s,error:i}=t;if(i)return{data:null,error:i};const{data:o,error:a}=await Ee(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(t){if(we(t))return{data:null,error:t};throw t}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r;const{data:s,error:i}=t;return i?{data:null,error:i}:await Ee(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(t){if(we(t))return{data:null,error:t};throw t}})}async _challengeAndVerify(e){const{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){const{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};const r=(e==null?void 0:e.factors)||[],s=r.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=r.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:r,totp:s,phone:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var t,r;const{data:{session:s},error:i}=e;if(i)return{data:null,error:i};if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=Tc(s.access_token);let a=null;o.aal&&(a=o.aal);let c=a;((r=(t=s.user.factors)===null||t===void 0?void 0:t.filter(f=>f.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(c="aal2");const d=o.amr||[];return{data:{currentLevel:a,nextLevel:c,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(o=>o.kid===e);if(r||(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+kS>Date.now()))return r;const{data:s,error:i}=await Ee(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;if(!s.keys||s.keys.length===0)throw new xi("JWKS is empty");if(this.jwks=s,this.jwks_cached_at=Date.now(),r=s.keys.find(o=>o.kid===e),!r)throw new xi("No matching signing key found in JWKS");return r}async getClaims(e,t={keys:[]}){try{let r=e;if(!r){const{data:v,error:b}
8=await this.getSession();if(b||!v.session)return{data:null,error:b};r=v.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:c}}=Tc(r);if(YS(i.exp),!s.kid||s.alg==="HS256"||!("crypto"in globalThis&&"subtle"in globalThis.crypto)){const{error:v}=await this.getUser(r);if(v)throw v;return{data:{claims:i,header:s,signature:o},error:null}}const u=KS(s.alg),d=await this.fetchJwk(s.kid,t),f=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,f,o,MS(`${a}.${c}`)))throw new xi("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(we(r))return{data:null,error:r};throw r}}}Pi.nextInstanceID=0;const hE=Pi;class fE extends hE{constructor(e){super(e)}}var pE=function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})};class mE{constructor(e,t,r){var s,i,o;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const a=wS(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;const c=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,u={db:hS,realtime:pS,auth:Object.assign(Object.assign({},fS),{storageKey:c}),global:dS},d=xS(r??{},u);this.storageKey=(s=d.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(i=d.global.headers)!==null&&i!==void 0?i:{},d.accessToken?(this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(f,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=d.auth)!==null&&o!==void 0?o:{},this.headers,d.global.fetch),this.fetch=yS(t,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.rest=new I_(`${a}/rest/v1`,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),d.accessToken||this._listenForAuthEvents()}get functions(){return new l_(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new cS(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t;return pE(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(t=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,storageKey:i,flowType:o,lock:a,debug:c},u,d){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new fE({url:this.authUrl,headers:Object.assign(Object.assign({},f),u),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,flowType:o,lock:a,debug:c,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new J_(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,r)=>{this._handleTokenChanged(t,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const gE=(n,e,t)=>new mE(n,e,t),vE="https://fqlgxrmibthatbutedym.supabase.co",yE="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZxbGd4cm1pYnRoYXRidXRlZHltIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDY5NzMyOTgsImV4cCI6MjA2MjU0OTI5OH0.XRNzvfbyvZrrM8vdFe4SE99XBtqCQy-f-pMx8enK0D0",_e=gE(vE,yE),bE="https://fqlgxrmibthatbutedym.supabase.co",wE=3e4,Pg=10;let Ko=[],kc=null,fh=!1;async function jg(){if(Ko.length===0)return;const n=Ko.splice(0,Pg);for(const e of n)try{await _e.functions.invoke("secure-monitoring",{body:{type:"performance_metric",data:{endpoint:e.endpoint,method:e.method,responseTimeMs:e.responseTimeMs,statusCode:e.statusCode,userId:null}}})}catch{}}function xE(){kc||(kc=setTimeout(()=>
8{kc=null,jg()},wE))}function ph(n){Ko.push(n),Ko.length>=Pg?jg():xE()}function _E(){if(fh)return;const n=window.location.hostname;if(n==="localhost"||n==="127.0.0.1")return;fh=!0;const e=window.fetch;window.fetch=async function(r,s){var d;const i=typeof r=="string"?r:r instanceof URL?r.href:r.url,o=i.startsWith(bE),a=i.includes("/secure-monitoring")||i.includes("/collect-system-metrics");if(!o||a)return e.call(this,r,s);const c=((d=s==null?void 0:s.method)==null?void 0:d.toUpperCase())||"GET",u=performance.now();try{const f=await e.call(this,r,s),p=Math.round(performance.now()-u);try{const b=new URL(i).pathname.replace(/^\/rest\/v1\//,"/").split("?")[0];ph({endpoint:b,method:c,responseTimeMs:p,statusCode:f.status})}catch{}return f}catch(f){const p=Math.round(performance.now()-u);try{const b=new URL(i).pathname.replace(/^\/rest\/v1\//,"/").split("?")[0];ph({endpoint:b,method:c,responseTimeMs:p,statusCode:0})}catch{}throw f}}}const SE=()=>(y.useEffect(()=>{const n=window.location.hostname;if(n==="localhost"||n==="127.0.0.1")return;let e=0;const t=5e3,r=(o,a,c)=>{const u=Date.now();u-e<t||(e=u,_e.functions.invoke("secure-monitoring",{body:{type:"error_log",data:{errorType:o,errorMessage:a.slice(0,500),severity:c,url:window.location.pathname,userId:null}}}).catch(()=>{}))},s=o=>{r("JavaScript Error",o.message||"Unknown error","medium")},i=o=>{const a=o.reason instanceof Error?o.reason.message:String(o.reason);r("Unhandled Promise Rejection",a,"high")};return window.addEventListener("error",s),window.addEventListener("unhandledrejection",i),()=>{window.removeEventListener("error",s),window.removeEventListener("unhandledrejection",i)}},[]),null),EE=()=>{const n=wr(),e=y.useRef("");return y.useEffect(()=>{const t=window.location.hostname;if(t==="localhost"||t==="127.0.0.1")return;const r=n.pathname;r!==e.current&&(e.current=r,_e.functions.invoke("secure-monitoring",{body:{type:"application_metric",data:{metricName:"page_view",metricValue:1,metricType:"counter",labels:{path:r}}}}).catch(()=>{}))},[n.pathname]),y.useEffect(()=>{const t=window.location.hostname;if(t==="localhost"||t==="127.0.0.1")return;const s=setTimeout(()=>{try{const i=performance.getEntriesByType("navigation");if(i.length>0){const o=i[0],a=Math.round(o.loadEventEnd-o.startTime);a>0&&_e.functions.invoke("secure-monitoring",{body:{type:"application_metric",data:{metricName:"page_load_time_ms",metricValue:a,metricType:"gauge",labels:{path:window.location.pathname}}}}).catch(()=>{})}}catch{}},3e3);return()=>clearTimeout(s)},[]),null},TE=5,kE=5e3;let Cc=0;function CE(){return Cc=(Cc+1)%Number.MAX_SAFE_INTEGER,Cc.toString()}const Ac=new Map,mh=n=>{if(Ac.has(n))return;const e=setTimeout(()=>{Ac.delete(n),Si({type:"REMOVE_TOAST",toastId:n})},kE);Ac.set(n,e)},AE=(n,e)=>{switch(e.type){case"ADD_TOAST":return{...n,toasts:[e.toast,...n.toasts].slice(0,TE)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=e;return t?mh(t):n.toasts.forEach(r=>{mh(r.id)}),{...n,toasts:n.toasts.map(r=>r.id===t||t===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(t=>t.id!==e.toastId)}}},Lo=[];let Fo={toasts:[]};function Si(n){Fo=AE(Fo,n),Lo.forEach(e=>{e(Fo)})}function Ge({...n}){const e=CE(),t=s=>Si({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Si({type:"DISMISS_TOAST",toastId:e});return Si({type:"ADD_TOAST",toast:{...n,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:t}}Ge.success=n=>Ge({variant:"success",...n});Ge.error=n=>Ge({variant:"destructive",...n});Ge.info=n=>Ge({variant:"info",...n});function Wu(){const[n,e]=y.useState(Fo);return y.useEffect(()=>(Lo.push(e),()=>{const t=Lo.indexOf(e);t>-1&&Lo.splice(t,1)}),[n]),{...n,toast:Ge,dismiss:t=>Si({type:"DISMISS_TOAST",toastId:t})}}var PE="VisuallyHidden",Ki=y.forwardRef((n,e)=>l.jsx(Ce.span,{...n,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...n.style}}));Ki.displayName=PE;var KL=Ki,Ju="ToastProvider",[Yu,jE,OE]=Fu("Toast"),[Og,QL]=Gi("Toast",[OE]),[RE,za]=Og(Ju),Rg=n=>{const{__scopeToast:e,label:t="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=n,[a,c]=y.useState(null),[u,d]=y.useState(0),f=y.useRef(!1),p=y.useRef(!1);return t.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ju}\`. Expected non-empty \`string\`.`),l.jsx(Yu.Provider,{scope:e,children:l.jsx(RE,{scope:e,label:t,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:
8a,onViewportChange:c,onToastAdd:y.useCallback(()=>d(v=>v+1),[]),onToastRemove:y.useCallback(()=>d(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:o})})};Rg.displayName=Ju;var Ig="ToastViewport",IE=["F8"],_l="toast.viewportPause",Sl="toast.viewportResume",Ng=y.forwardRef((n,e)=>{const{__scopeToast:t,hotkey:r=IE,label:s="Notifications ({hotkey})",...i}=n,o=za(Ig,t),a=jE(t),c=y.useRef(null),u=y.useRef(null),d=y.useRef(null),f=y.useRef(null),p=He(e,f,o.onViewportChange),v=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=o.toastCount>0;y.useEffect(()=>{const g=x=>{var E;r.length!==0&&r.every(P=>x[P]||x.code===P)&&((E=f.current)==null||E.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),y.useEffect(()=>{const g=c.current,x=f.current;if(b&&g&&x){const S=()=>{if(!o.isClosePausedRef.current){const O=new CustomEvent(_l);x.dispatchEvent(O),o.isClosePausedRef.current=!0}},E=()=>{if(o.isClosePausedRef.current){const O=new CustomEvent(Sl);x.dispatchEvent(O),o.isClosePausedRef.current=!1}},P=O=>{!g.contains(O.relatedTarget)&&E()},C=()=>{g.contains(document.activeElement)||E()};return g.addEventListener("focusin",S),g.addEventListener("focusout",P),g.addEventListener("pointermove",S),g.addEventListener("pointerleave",C),window.addEventListener("blur",S),window.addEventListener("focus",E),()=>{g.removeEventListener("focusin",S),g.removeEventListener("focusout",P),g.removeEventListener("pointermove",S),g.removeEventListener("pointerleave",C),window.removeEventListener("blur",S),window.removeEventListener("focus",E)}}},[b,o.isClosePausedRef]);const m=y.useCallback(({tabbingDirection:g})=>{const S=a().map(E=>{const P=E.ref.current,C=[P,...HE(P)];return g==="forwards"?C:C.reverse()});return(g==="forwards"?S.reverse():S).flat()},[a]);return y.useEffect(()=>{const g=f.current;if(g){const x=S=>{var C,O,N;const E=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!E){const D=document.activeElement,R=S.shiftKey;if(S.target===g&&R){(C=u.current)==null||C.focus();return}const I=m({tabbingDirection:R?"backwards":"forwards"}),z=I.findIndex($=>$===D);Pc(I.slice(z+1))?S.preventDefault():R?(O=u.current)==null||O.focus():(N=d.current)==null||N.focus()}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[a,m]),l.jsxs(J0,{ref:c,role:"region","aria-label":s.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&l.jsx(El,{ref:u,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});Pc(g)}}),l.jsx(Yu.Slot,{scope:t,children:l.jsx(Ce.ol,{tabIndex:-1,...i,ref:p})}),b&&l.jsx(El,{ref:d,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});Pc(g)}})]})});Ng.displayName=Ig;var Dg="ToastFocusProxy",El=y.forwardRef((n,e)=>{const{__scopeToast:t,onFocusFromOutsideViewport:r,...s}=n,i=za(Dg,t);return l.jsx(Ki,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});El.displayName=Dg;var Va="Toast",NE="toast.swipeStart",DE="toast.swipeMove",ME="toast.swipeCancel",LE="toast.swipeEnd",Mg=y.forwardRef((n,e)=>{const{forceMount:t,open:r,defaultOpen:s,onOpenChange:i,...o}=n,[a=!0,c]=Jo({prop:r,defaultProp:s,onChange:i});return l.jsx(Un,{present:t||a,children:l.jsx(UE,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:mt(n.onPause),onResume:mt(n.onResume),onSwipeStart:ie(n.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ie(n.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:ie(n.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ie(n.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});Mg.displayName=Va;var[FE,$E]=Og(Va,{onClose(){}}),UE=y.forwardRef((n,e)=>{const{__scopeToast:t,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:v,...b}=n,m=za(Va,t),[g,x]=y.useState(null),S=He(e,$=>x($)),E=y.useRef(null),P=y.useRef(null),C=s||m.duration,O=y.useRef(0),N=y.useRef(C),D=y.useRef(0),{onToastAdd:R,onToastRemove:F}=m,A=mt(()=>{var ee;(g==null?void 0:g.contains(document.activeElement))&&((ee=m.viewport)==null||ee.focus()),o()}),I=y.useCallback($=>
8{!$||$===1/0||(window.clearTimeout(D.current),O.current=new Date().getTime(),D.current=window.setTimeout(A,$))},[A]);y.useEffect(()=>{const $=m.viewport;if($){const ee=()=>{I(N.current),u==null||u()},K=()=>{const se=new Date().getTime()-O.current;N.current=N.current-se,window.clearTimeout(D.current),c==null||c()};return $.addEventListener(_l,K),$.addEventListener(Sl,ee),()=>{$.removeEventListener(_l,K),$.removeEventListener(Sl,ee)}}},[m.viewport,C,c,u,I]),y.useEffect(()=>{i&&!m.isClosePausedRef.current&&I(C)},[i,C,m.isClosePausedRef,I]),y.useEffect(()=>(R(),()=>F()),[R,F]);const z=y.useMemo(()=>g?Bg(g):null,[g]);return m.viewport?l.jsxs(l.Fragment,{children:[z&&l.jsx(zE,{__scopeToast:t,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:z}),l.jsx(FE,{scope:t,onClose:A,children:Hi.createPortal(l.jsx(Yu.ItemSlot,{scope:t,children:l.jsx(Y0,{asChild:!0,onEscapeKeyDown:ie(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||A(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(Ce.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...b,ref:S,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:ie(n.onKeyDown,$=>{$.key==="Escape"&&(a==null||a($.nativeEvent),$.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:ie(n.onPointerDown,$=>{$.button===0&&(E.current={x:$.clientX,y:$.clientY})}),onPointerMove:ie(n.onPointerMove,$=>{if(!E.current)return;const ee=$.clientX-E.current.x,K=$.clientY-E.current.y,se=!!P.current,G=["left","right"].includes(m.swipeDirection),q=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,te=G?q(0,ee):0,Q=G?0:q(0,K),oe=$.pointerType==="touch"?10:2,h={x:te,y:Q},_={originalEvent:$,delta:h};se?(P.current=h,mo(DE,f,_,{discrete:!1})):gh(h,m.swipeDirection,oe)?(P.current=h,mo(NE,d,_,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(ee)>oe||Math.abs(K)>oe)&&(E.current=null)}),onPointerUp:ie(n.onPointerUp,$=>{const ee=P.current,K=$.target;if(K.hasPointerCapture($.pointerId)&&K.releasePointerCapture($.pointerId),P.current=null,E.current=null,ee){const se=$.currentTarget,G={originalEvent:$,delta:ee};gh(ee,m.swipeDirection,m.swipeThreshold)?mo(LE,v,G,{discrete:!0}):mo(ME,p,G,{discrete:!0}),se.addEventListener("click",q=>q.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),zE=n=>{const{__scopeToast:e,children:t,...r}=n,s=za(Va,e),[i,o]=y.useState(!1),[a,c]=y.useState(!1);return qE(()=>o(!0)),y.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:l.jsx($u,{asChild:!0,children:l.jsx(Ki,{...r,children:i&&l.jsxs(l.Fragment,{children:[s.label," ",t]})})})},VE="ToastTitle",Lg=y.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return l.jsx(Ce.div,{...r,ref:e})});Lg.displayName=VE;var BE="ToastDescription",Fg=y.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return l.jsx(Ce.div,{...r,ref:e})});Fg.displayName=BE;var $g="ToastAction",Ug=y.forwardRef((n,e)=>{const{altText:t,...r}=n;return t.trim()?l.jsx(Vg,{altText:t,asChild:!0,children:l.jsx(Ku,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${$g}\`. Expected non-empty \`string\`.`),null)});Ug.displayName=$g;var zg="ToastClose",Ku=y.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n,s=$E(zg,t);return l.jsx(Vg,{asChild:!0,children:l.jsx(Ce.button,{type:"button",...r,ref:e,onClick:ie(n.onClick,s.onClose)})})});Ku.displayName=zg;var Vg=y.forwardRef((n,e)=>{const{__scopeToast:t,altText:r,...s}=n;return l.jsx(Ce.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function Bg(n){const e=[];return Array.from(n.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),GE(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...Bg(r))}}),e}function mo(n,e,t,{discrete:r}){const s=t.originalEvent.currentTarget,i=new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:t});e&&s.addEventListener(n,e,{once:!0}),r?Bm(s,i):s.dispatchEvent(i)}var gh=(n,e,t=0)=>{const r=Math.abs(n.x),s=Math.abs(n.y),i=r>s;return e==="left"||e==="right"?i&&r>t:!i&&s>t};function qE(n=()=>{}){const e=mt(n);Nt(()=>{let t=0,r=0;return t=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(r)}},[e])}function GE(n){return n.nodeType===n.ELEMENT_NODE}function HE(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function Pc(n){const e=document.activeElement;return n.some(t=>t===e?!0:(t.focus(),document.activeElement!==e))}var WE=Rg,qg=Ng,Gg=Mg,Hg=Lg,Wg=Fg,Jg=Ug,Yg=Ku;function Kg(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;e<s;e++)n[e]&&(t=Kg(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Qg(){for(var n,e,t=0,r="",s=arguments.length;t<s;t++)(n=arguments[t])&&(e=Kg(n))&&(r&&(r+=" "),r+=e);return r}const vh=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,yh=Qg,Ws=(n,e)=>t=>{var r;if((e==null?void 0:e.variants)==null)return yh(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const d=t==null?void 0:t[u],f=i==null?void 0:i[u];if(d===null)return null;const p=vh(d)||vh(f);return s[u][p]}),a=t&&Object.entries(t).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...v}=d;return Object.entries(v).every(b=>{let[m,g]=b;return Array.isArray(g)?g.includes({...i,...a}[m]):{...i,...a}[m]===g})?[...u,f,p]:u},[]);return yh(n,o,c,t==null?void 0:t.class,t==null?void 0:t.className)};/**
9 * @license lucide-react v0.462.0 - ISC
10 *
11 * This source code is licensed under the ISC license.
12 * See the LICENSE file in the root directory of this source tree.
13 */const JE=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xg=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim();/**
14 * @license lucide-react v0.462.0 - ISC
15 *
16 * This source code is licensed under the ISC license.
17 * See the LICENSE file in the root directory of this source tree.
18 */var YE={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"};/**
19 * @license lucide-react v0.462.0 - ISC
20 *
21 * This source code is licensed under the ISC license.
22 * See the LICENSE file in the root directory of this source tree.
23 */const KE=y.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},c)=>y.createElement("svg",{ref:c,...YE,width:e,height:e,stroke:n,strokeWidth:r?Number(t)*24/Number(e):t,className:Xg("lucide",s),...a},[...o.map(([u,d])=>y.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
24 * @license lucide-react v0.462.0 - ISC
25 *
26 * This source code is licensed under the ISC license.
27 * See the LICENSE file in the root directory of this source tree.
28 */const ne=(n,e)=>{const t=y.forwardRef(({className:r,...s},i)=>y.createElement(KE,{ref:i,iconNode:e,className:Xg(`lucide-${JE(n)}`,r),...s}));return t.displayName=`${n}`,t};/**
29 * @license lucide-react v0.462.0 - ISC
30 *
31 * This source code is licensed under the ISC license.
32 * See the LICENSE file in the root directory of this source tree.
33 */const bh=ne("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
34 * @license lucide-react v0.462.0 - ISC
35 *
36 * This source code is licensed under the ISC license.
37 * See the LICENSE file in the root directory of this source tree.
38 */const go=ne("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
39 * @license lucide-react v0.462.0 - ISC
40 *
41 * This source code is licensed under the ISC license.
42 * See the LICENSE file in the root directory of this source tree.
43 */const Zg=ne("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"}]]);/**
44 * @license lucide-react v0.462.0 - ISC
45 *
46 * This source code is licensed under the ISC license.
47 * See the LICENSE file in the root directory of this source tree.
48 */const Tl=ne("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"}]]);/**
49 * @license lucide-react v0.462.0 - ISC
50 *
51 * This source code is licensed under the ISC license.
52 * See the LICENSE file in the root directory of this source tree.
53 */const wh=ne("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
54 * @license lucide-react v0.462.0 - ISC
55 *
56 * This source code is licensed under the ISC license.
57 * See the LICENSE file in the root directory of this source tree.
58 */const kl=ne("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"}
58],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
59 * @license lucide-react v0.462.0 - ISC
60 *
61 * This source code is licensed under the ISC license.
62 * See the LICENSE file in the root directory of this source tree.
63 */const Qu=ne("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
64 * @license lucide-react v0.462.0 - ISC
65 *
66 * This source code is licensed under the ISC license.
67 * See the LICENSE file in the root directory of this source tree.
68 */const QE=ne("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"}]]);/**
69 * @license lucide-react v0.462.0 - ISC
70 *
71 * This source code is licensed under the ISC license.
72 * See the LICENSE file in the root directory of this source tree.
73 */const Qo=ne("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"}]]);/**
74 * @license lucide-react v0.462.0 - ISC
75 *
76 * This source code is licensed under the ISC license.
77 * See the LICENSE file in the root directory of this source tree.
78 */const XE=ne("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
79 * @license lucide-react v0.462.0 - ISC
80 *
81 * This source code is licensed under the ISC license.
82 * See the LICENSE file in the root directory of this source tree.
83 */const ZE=ne("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/**
84 * @license lucide-react v0.462.0 - ISC
85 *
86 * This source code is licensed under the ISC license.
87 * See the LICENSE file in the root directory of this source tree.
88 */const Xu=ne("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
89 * @license lucide-react v0.462.0 - ISC
90 *
91 * This source code is licensed under the ISC license.
92 * See the LICENSE file in the root directory of this source tree.
93 */const ev=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
94 * @license lucide-react v0.462.0 - ISC
95 *
96 * This source code is licensed under the ISC license.
97 * See the LICENSE file in the root directory of this source tree.
98 */const tv=ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
99 * @license lucide-react v0.462.0 - ISC
100 *
101 * This source code is licensed under the ISC license.
102 * See the LICENSE file in the root directory of this source tree.
103 */const eT=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
104 * @license lucide-react v0.462.0 - ISC
105 *
106 * This source code is licensed under the ISC license.
107 * See the LICENSE file in the root directory of this source tree.
108 */const tT=ne("Church",[["path",{d:"M10 9h4",key:"u4k05v"}],["path",{d:"M12 7v5",key:"ma6bk"}],["path",{d:"M14 22v-4a2 2 0 0 0-4 0v4",key:"1pdhuj"}],["path",{d:"M18 22V5.618a1 1 0 0 0-.553-.894l-4.553-2.277a2 2 0 0 0-1.788 0L6.553 4.724A1 1 0 0 0 6 5.618V22",key:"1rkokr"}],["path",{d:"m18 7 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9.618a1 1 0 0 1 .553-.894L6 7",key:"1w6esw"}]]);/**
109 * @license lucide-react v0.462.0 - ISC
110 *
111 * This source code is licensed under the ISC license.
112 * See the LICENSE file in the root directory of this source tree.
113 */const ji=ne("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"}]]);/**
114 * @license lucide-react v0.462.0 - ISC
115 *
116 * This source code is licensed under the ISC license.
117 * See the LICENSE file in the root directory of this source tree.
118 */const jc=ne("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
119 * @license lucide-react v0.462.0 - ISC
120 *
121 * This source code is licensed under the ISC license.
122 * See the LICENSE file in the root directory of this source tree.
123 */const nv=ne("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
124 * @license lucide-react v0.462.0 - ISC
125 *
126 * This source code is licensed under the ISC license.
127 * See the LICENSE file in the root directory of this source tree.
128 */const nT=ne("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
129 * @license lucide-react v0.462.0 - ISC
130 *
131 * This source code is licensed under the ISC license.
132 * See the LICENSE file in the root directory of this source tree.
133 */const Cl=ne("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
134 * @license lucide-react v0.462.0 - ISC
135 *
136 * This source code is licensed under the ISC license.
137 * See the LICENSE file in the root directory of this source tree.
138 */const rv=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
139 * @license lucide-react v0.462.0 - ISC
140 *
141 * This source code is licensed under the ISC license.
142 * See the LICENSE file in the root directory of this source tree.
143 */const rT=ne("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"}]]);/**
144 * @license lucide-react v0.462.0 - ISC
145 *
146 * This source code is licensed under the ISC license.
147 * See the LICENSE file in the root directory of this source tree.
148 */const xh=ne("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
149 * @license lucide-react v0.462.0 - ISC
150 *
151 * This source code is licensed under the ISC license.
152 * See the LICENSE file in the root directory of this source tree.
153 */const Zu=ne("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"}]]);/**
154 * @license lucide-react v0.462.0 - ISC
155 *
156 * This source code is licensed under the ISC license.
157 * See the LICENSE file in the root directory of this source tree.
158 */const vo=ne("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"}]]);/**
159 * @license lucide-react v0.462.0 - ISC
160 *
161 * This source code is licensed under the ISC license.
162 * See the LICENSE file in the root directory of this source tree.
163 */const sT=ne("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
164 * @license lucide-react v0.462.0 - ISC
165 *
166 * This source code is licensed under the ISC license.
167 * See the LICENSE file in the root directory of this source tree.
168 */const Oi=ne("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"}]]);/**
169 * @license lucide-react v0.462.0 - ISC
170 *
171 * This source code is licensed under the ISC license.
172 * See the LICENSE file in the root directory of this source tree.
173 */const iT=ne("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
174 * @license lucide-react v0.462.0 - ISC
175 *
176 * This source code is licensed under the ISC license.
177 * See the LICENSE file in the root directory of this source tree.
178 */const oT=ne("FolderUp",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/**
179 * @license lucide-react v0.462.0 - ISC
180 *
181 * This source code is licensed under the ISC license.
182 * See the LICENSE file in the root directory of this source tree.
183 */const aT=ne("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"}]]);/**
184 * @license lucide-react v0.462.0 - ISC
185 *
186 * This source code is licensed under the ISC license.
187 * See the LICENSE file in the root directory of this source tree.
188 */const cT=ne("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"}]]);/**
189 * @license lucide-react v0.462.0 - ISC
190 *
191 * This source code is licensed under the ISC license.
192 * See the LICENSE file in the root directory of this source tree.
193 */const Oc=ne("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
194 * @license lucide-react v0.462.0 - ISC
195 *
196 * This source code is licensed under the ISC license.
197 * See the LICENSE file in the root directory of this source tree.
198 */const ed=ne("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"}]]);/**
199 * @license lucide-react v0.462.0 - ISC
200 *
201 * This source code is licensed under the ISC license.
202 * See the LICENSE file in the root directory of this source tree.
203 */const lT=ne("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"}]]);/**
204 * @license lucide-react v0.462.0 - ISC
205 *
206 * This source code is licensed under the ISC license.
207 * See the LICENSE file in the root directory of this source tree.
208 */const nr=ne("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
209 * @license lucide-react v0.462.0 - ISC
210 *
211 * This source code is licensed under the ISC license.
212 * See the LICENSE file in the root directory of this source tree.
213 */const sv=ne("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"}]]);/**
214 * @license lucide-react v0.462.0 - ISC
215 *
216 * This source code is licensed under the ISC license.
217 * See the LICENSE file in the root directory of this source tree.
218 */const fs=ne("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"}]]);/**
219 * @license lucide-react v0.462.0 - ISC
220 *
221 * This source code is licensed under the ISC license.
222 * See the LICENSE file in the root directory of this source tree.
223 */const yo=ne("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"}]]);/**
224 * @license lucide-react v0.462.0 - ISC
225 *
226 * This source code is licensed under the ISC license.
227 * See the LICENSE file in the root directory of this source tree.
228 */const uT=ne("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
229 * @license lucide-react v0.462.0 - ISC
230 *
231 * This source code is licensed under the ISC license.
232 * See the LICENSE file in the root directory of this source tree.
233 */const dT=ne("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"}]]);/**
234 * @license lucide-react v0.462.0 - ISC
235 *
236 * This source code is licensed under the ISC license.
237 * See the LICENSE file in the root directory of this source tree.
238 */const hT=ne("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
239 * @license lucide-react v0.462.0 - ISC
240 *
241 * This source code is licensed under the ISC license.
242 * See the LICENSE file in the root directory of this source tree.
243 */const fT=ne("MessageSquarePlus",[["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:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
244 * @license lucide-react v0.462.0 - ISC
245 *
246 * This source code is licensed under the ISC license.
247 * See the LICENSE file in the root directory of this source tree.
248 */const pT=ne("MessageSquare",[["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"}]]);/**
249 * @license lucide-react v0.462.0 - ISC
250 *
251 * This source code is licensed under the ISC license.
252 * See the LICENSE file in the root directory of this source tree.
253 */const mT=ne("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
254 * @license lucide-react v0.462.0 - ISC
255 *
256 * This source code is licensed under the ISC license.
257 * See the LICENSE file in the root directory of this source tree.
258 */const ps=ne("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
259 * @license lucide-react v0.462.0 - ISC
260 *
261 * This source code is licensed under the ISC license.
262 * See the LICENSE file in the root directory of this source tree.
263 */const td=ne("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/**
264 * @license lucide-react v0.462.0 - ISC
265 *
266 * This source code is licensed under the ISC license.
267 * See the LICENSE file in the root directory of this source tree.
268 */const _h=ne("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
269 * @license lucide-react v0.462.0 - ISC
270 *
271 * This source code is licensed under the ISC license.
272 * See the LICENSE file in the root directory of this source tree.
273 */const iv=ne("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"}]]);/**
274 * @license lucide-react v0.462.0 - ISC
275 *
276 * This source code is licensed under the ISC license.
277 * See the LICENSE file in the root directory of this source tree.
278 */const gT=ne("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
279 * @license lucide-react v0.462.0 - ISC
280 *
281 * This source code is licensed under the ISC license.
282 * See the LICENSE file in the root directory of this source tree.
283 */const vT=ne("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"}]]);/**
284 * @license lucide-react v0.462.0 - ISC
285 *
286 * This source code is licensed under the ISC license.
287 * See the LICENSE file in the root directory of this source tree.
288 */const ov=ne("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"}]]);/**
289 * @license lucide-react v0.462.0 - ISC
290 *
291 * This source code is licensed under the ISC license.
292 * See the LICENSE file in the root directory of this source tree.
293 */const yT=ne("ShieldAlert",[["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
293y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
294 * @license lucide-react v0.462.0 - ISC
295 *
296 * This source code is licensed under the ISC license.
297 * See the LICENSE file in the root directory of this source tree.
298 */const bT=ne("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"}]]);/**
299 * @license lucide-react v0.462.0 - ISC
300 *
301 * This source code is licensed under the ISC license.
302 * See the LICENSE file in the root directory of this source tree.
303 */const wT=ne("ShoppingBasket",[["path",{d:"m15 11-1 9",key:"5wnq3a"}],["path",{d:"m19 11-4-7",key:"cnml18"}],["path",{d:"M2 11h20",key:"3eubbj"}],["path",{d:"m3.5 11 1.6 7.4a2 2 0 0 0 2 1.6h9.8a2 2 0 0 0 2-1.6l1.7-7.4",key:"yiazzp"}],["path",{d:"M4.5 15.5h15",key:"13mye1"}],["path",{d:"m5 11 4-7",key:"116ra9"}],["path",{d:"m9 11 1 9",key:"1ojof7"}]]);/**
304 * @license lucide-react v0.462.0 - ISC
305 *
306 * This source code is licensed under the ISC license.
307 * See the LICENSE file in the root directory of this source tree.
308 */const xT=ne("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"}]]);/**
309 * @license lucide-react v0.462.0 - ISC
310 *
311 * This source code is licensed under the ISC license.
312 * See the LICENSE file in the root directory of this source tree.
313 */const _T=ne("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"}]]);/**
314 * @license lucide-react v0.462.0 - ISC
315 *
316 * This source code is licensed under the ISC license.
317 * See the LICENSE file in the root directory of this source tree.
318 */const ST=ne("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"}]]);/**
319 * @license lucide-react v0.462.0 - ISC
320 *
321 * This source code is licensed under the ISC license.
322 * See the LICENSE file in the root directory of this source tree.
323 */const ET=ne("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]);/**
324 * @license lucide-react v0.462.0 - ISC
325 *
326 * This source code is licensed under the ISC license.
327 * See the LICENSE file in the root directory of this source tree.
328 */const Xo=ne("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"}]]);/**
329 * @license lucide-react v0.462.0 - ISC
330 *
331 * This source code is licensed under the ISC license.
332 * See the LICENSE file in the root directory of this source tree.
333 */const TT=ne("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"}]]);/**
334 * @license lucide-react v0.462.0 - ISC
335 *
336 * This source code is licensed under the ISC license.
337 * See the LICENSE file in the root directory of this source tree.
338 */const Zo=ne("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"}]]);/**
339 * @license lucide-react v0.462.0 - ISC
340 *
341 * This source code is licensed under the ISC license.
342 * See the LICENSE file in the root directory of this source tree.
343 */const Sh=ne("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
344 * @license lucide-react v0.462.0 - ISC
345 *
346 * This source code is licensed under the ISC license.
347 * See the LICENSE file in the root directory of this source tree.
348 */const Ba=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 8,399 bytes, lines 348-353
348],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
349 * @license lucide-react v0.462.0 - ISC
350 *
351 * This source code is licensed under the ISC license.
352 * See the LICENSE file in the root directory of this source tree.
353 */const Eh=ne("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"}]]),nd="-",kT=n=>{const e=AT(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:o=>{const a=o.split(nd);return a[0]===""&&a.length!==1&&a.shift(),av(a,e)||CT(o)},getConflictingClassGroupIds:(o,a)=>{const c=t[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},av=(n,e)=>{var o;if(n.length===0)return e.classGroupId;const t=n[0],r=e.nextPart.get(t),s=r?av(n.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=n.join(nd);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Th=/^\[(.+)\]$/,CT=n=>{if(Th.test(n)){const e=Th.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},AT=n=>{const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return jT(Object.entries(n.classGroups),t).forEach(([i,o])=>{Al(o,r,i,e)}),r},Al=(n,e,t,r)=>{n.forEach(s=>{if(typeof s=="string"){const i=s===""?e:kh(e,s);i.classGroupId=t;return}if(typeof s=="function"){if(PT(s)){Al(s(r),e,t,r);return}e.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([i,o])=>{Al(o,kh(e,i),t,r)})})},kh=(n,e)=>{let t=n;return e.split(nd).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t},PT=n=>n.isThemeGetter,jT=(n,e)=>e?n.map(([t,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[t,s]}):n,OT=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;const s=(i,o)=>{t.set(i,o),e++,e>n&&(e=0,r=t,t=new Map)};return{get(i){let o=t.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){t.has(i)?t.set(i,o):s(i,o)}}},cv="!",RT=n=>{const{separator:e,experimentalParseClassName:t}=n,r=e.length===1,s=e[0],i=e.length,o=a=>{const c=[];let u=0,d=0,f;for(let g=0;g<a.length;g++){let x=a[g];if(u===0){if(x===s&&(r||a.slice(g,g+i)===e)){c.push(a.slice(d,g)),d=g+i;continue}if(x==="/"){f=g;continue}}x==="["?u++:x==="]"&&u--}const p=c.length===0?a:a.substring(d),v=p.startsWith(cv),b=v?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:m}};return t?a=>t({className:a,parseClassName:o}):o},IT=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e},NT=n=>({cache:OT(n.cacheSize),parseClassName:RT(n),...kT(n)}),DT=/\s+/,MT=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=n.trim().split(DT);let a="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:v}=t(u);let b=!!v,m=r(b?p.substring(0,v):p);if(!m){if(!b){a=u+(a.length>0?" "+a:a);continue}if(m=r(p),!m){a=u+(a.length>0?" "+a:a);continue}b=!1}const g=IT(d).join(":"),x=f?g+cv:g,S=x+m;if(i.includes(S))continue;i.push(S);const E=s(m,b);for(let P=0;P<E.length;++P){const C=E[P];i.push(x+C)}a=u+(a.length>0?" "+a:a)}return a};function LT(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=lv(e))&&(r&&(r+=" "),r+=t);return r}const lv=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=lv(n[r]))&&(t&&(t+=" "),t+=e);return t};function FT(n,...e){let t,r,s,i=o;function o(c){const u=e.reduce((d,f)=>f(d),n());return t=NT(u),r=t.cache.get,s=t.cache.set,i=a,a(c)}function a(c){const u=r(c);if(u)return u;const d=MT(c,t);return s(c,d),d}return function(){return i(LT.apply(null,arguments))}}const qe=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},uv=/^\[(?:([a-z-]+):)?(.+)\]$/i,$T=/^\d+\/\d+$/,UT=new Set(["px","full","screen"]),zT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,VT=/\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$/,BT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,qT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,GT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tn=n=>ys(n)||UT.has(n)||$T.test(n),Vn=n=>Js(n,"length",ZT),ys=n=>!!n&&!Number.isNaN(Number(n)),Rc=n=>Js(n,"number",ys),ii=n=>!!n&&Number.isInteger(Number(n)),HT=n=>n.endsWith("%")&&ys(n.slice(0,-1)),be=n=>uv.test(n),Bn=n=>zT.test(n),WT=new Set(["length","size","percentage"]),JT=n=>Js(n,WT,dv),YT=n=>Js(n,"position",dv),KT=new Set(["image","url"]),QT=n=>Js(n,KT,tk),XT=n=>Js(n,"",ek),oi=()=>!0,Js=(n,e,t)=>{const r=uv.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1},ZT=n=>VT.test(n)&&!BT.test(n),dv=()=>!1,ek=n=>qT.test(n),tk=n=>GT.test(n),nk=()=>{const n=qe("colors"),e=qe("spacing"),t=qe("blur"),r=qe("brightness"),s=qe("borderColor"),i=qe("borderRadius"),o=qe("borderSpacing"),a=qe("borderWidth"),c=qe("contrast"),u=qe("grayscale"),d=qe("hueRotate"),f=qe("invert"),p=qe("gap"),v=qe("gradientColorStops"),b=qe("gradientColorStopPositions"),m=qe("inset"),g=qe("margin"),x=qe("opacity"),S=qe("padding"),E=qe("saturate"),P=qe("scale"),C=qe("sepia"),O=qe("skew"),N=qe("space"),D=qe("translate"),R=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",be,e],I=()=>[be,e],z=()=>["",Tn,Vn],$=()=>["auto",ys,be],ee=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["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"],G=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",be],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>[ys,be];return{cacheSize:500,separator:":",theme:{colors:[oi],spacing:[Tn,Vn],blur:["none","",Bn,be],brightness:Q(),borderColor:[n],borderRadius:["none","","full",Bn,be],borderSpacing:I(),borderWidth:z(),contrast:Q(),grayscale:q(),hueRotate:Q(),invert:q(),gap:I(),gradientColorStops:[n],gradientColorStopPositions:[HT,Vn],inset:A(),margin:A(),opacity:Q(),padding:I(),saturate:Q(),scale:Q(),sepia:q(),skew:Q(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",be]}],container:["container"],columns:[{columns:[Bn]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"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:[...ee(),be]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ii,be]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",be]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",ii,be]}],"grid-cols":[{"grid-cols":[oi]}],"col-start-end":[{col:["auto",{span:["full",ii,be]},be]}],"col-start":[{"col-start":$()}
vendor: 9,422 bytes, line 353
353],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[oi]}],"row-start-end":[{row:["auto",{span:[ii,be]},be]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",be]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],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",be,e]}],"min-w":[{"min-w":[be,e,"min","max","fit"]}],"max-w":[{"max-w":[be,e,"none","full","min","max","fit","prose",{screen:[Bn]},Bn]}],h:[{h:[be,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[be,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[be,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[be,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Bn,Vn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Rc]}],"font-family":[{font:[oi]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",be]}],"line-clamp":[{"line-clamp":["none",ys,Rc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Tn,be]}],"list-image":[{"list-image":["none",be]}],"list-style-type":[{list:["none","disc","decimal",be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Tn,Vn]}],"underline-offset":[{"underline-offset":["auto",Tn,be]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be]}],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",be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ee(),YT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",JT]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},QT]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],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:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:K()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[Tn,be]}],"outline-w":[{outline:[Tn,Vn]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Tn,Vn]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Bn,XT]}],"shadow-color":[{shadow:[oi]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Bn,be]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[E]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",be]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",be]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[ii,be]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",be]}],accent:[{accent:["auto",n]}],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",be]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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"]}
353],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",be]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Tn,Vn,Rc]}],stroke:[{stroke:[n,"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"]}}},rk=FT(nk);function re(...n){return rk(Qg(n))}const sk=WE,hv=y.forwardRef(({className:n,...e},t)=>l.jsx(qg,{ref:t,className:re("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]",n),...e}));hv.displayName=qg.displayName;const ik=Ws("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",success:"success group border-green-600 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300",info:"info group border-blue-600 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300"}},defaultVariants:{variant:"default"}}),fv=y.forwardRef(({className:n,variant:e,...t},r)=>l.jsx(Gg,{ref:r,className:re(ik({variant:e}),n),...t}));fv.displayName=Gg.displayName;const ok=y.forwardRef(({className:n,...e},t)=>l.jsx(Jg,{ref:t,className:re("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 hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive group-[.success]:border-green-600/40 group-[.success]:hover:border-green-600/30 group-[.success]:hover:bg-green-600 group-[.success]:hover:text-white group-[.success]:focus:ring-green-600 group-[.info]:border-blue-600/40 group-[.info]:hover:border-blue-600/30 group-[.info]:hover:bg-blue-600 group-[.info]:hover:text-white group-[.info]:focus:ring-blue-600",n),...e}));ok.displayName=Jg.displayName;const pv=y.forwardRef(({className:n,...e},t)=>l.jsx(Yg,{ref:t,className:re("absolute right-2 top-2 rounded-md p-1 text-foreground
353/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 group-[.success]:text-green-700 group-[.success]:hover:text-green-900 group-[.success]:focus:ring-green-700 group-[.info]:text-blue-700 group-[.info]:hover:text-blue-900 group-[.info]:focus:ring-blue-700",n),"toast-close":"",...e,children:l.jsx(Ba,{className:"h-4 w-4"})}));pv.displayName=Yg.displayName;const mv=y.forwardRef(({className:n,...e},t)=>l.jsx(Hg,{ref:t,className:re("text-sm font-semibold",n),...e}));mv.displayName=Hg.displayName;const gv=y.forwardRef(({className:n,...e},t)=>l.jsx(Wg,{ref:t,className:re("text-sm opacity-90",n),...e}));gv.displayName=Wg.displayName;function ak(){const{toasts:n}=Wu();return l.jsxs(sk,{children:[n.map(function({id:e,title:t,description:r,action:s,variant:i,...o}){const a=i==="destructive"?ji:i==="success"?nv:rv;return l.jsxs(fv,{...o,variant:i,children:[l.jsxs("div",{className:"flex gap-3",children:[l.jsx(a,{className:"h-5 w-5 flex-shrink-0 mt-0.5"}),l.jsxs("div",{className:"grid gap-1 flex-1 min-w-0",children:[t&&l.jsx(mv,{className:"break-words",children:t}),r&&l.jsx(gv,{className:"break-words text-sm",children:r})]})]}),s,l.jsx(pv,{})]},e)}),l.jsx(hv,{})]})}var ck=n=>{switch(n){case"success":return dk;case"info":return fk;case"warning":return hk;case"error":return pk;default:return null}},lk=Array(12).fill(0),uk=({visible:n})=>Y.createElement("div",{className:"sonner-loading-wrapper","data-visible":n},Y.createElement("div",{className:"sonner-spinner"},lk.map((e,t)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),dk=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),hk=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Y.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"})),fk=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),pk=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),mk=()=>{let[n,e]=Y.useState(document.hidden);return Y.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),n},Pl=1,gk=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:r,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Pl++,o=this.toasts.find(c=>c.id===i),a=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...e,id:i,title:r}),{...c,...e,id:i,dismissible:a,title:r}):c):this.addToast({title:r,...s,dismissible:a,id:i}),i},this.dismiss=e=>
353(e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({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)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let s=e instanceof Promise?e:e(),i=r!==void 0;return s.then(async o=>{if(yk(o)&&!o.ok){i=!1;let a=typeof t.error=="function"?await t.error(`HTTP error! status: ${o.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${o.status}`):t.description;this.create({id:r,type:"error",message:a,description:c})}else if(t.success!==void 0){i=!1;let a=typeof t.success=="function"?await t.success(o):t.success,c=typeof t.description=="function"?await t.description(o):t.description;this.create({id:r,type:"success",message:a,description:c})}}).catch(async o=>{if(t.error!==void 0){i=!1;let a=typeof t.error=="function"?await t.error(o):t.error,c=typeof t.description=="function"?await t.description(o):t.description;this.create({id:r,type:"error",message:a,description:c})}}).finally(()=>{var o;i&&(this.dismiss(r),r=void 0),(o=t.finally)==null||o.call(t)}),r},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Pl++;return this.create({jsx:e(r),id:r,...t}),r},this.subscribers=[],this.toasts=[]}},Pt=new gk,vk=(n,e)=>{let t=(e==null?void 0:e.id)||Pl++;return Pt.addToast({title:n,...e,id:t}),t},yk=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",bk=vk,wk=()=>Pt.toasts,Ic=Object.assign(bk,{success:Pt.success,info:Pt.info,warning:Pt.warning,error:Pt.error,custom:Pt.custom,message:Pt.message,promise:Pt.promise,dismiss:Pt.dismiss,loading:Pt.loading},{getHistory:wk});function xk(n,{insertAt:e}={}){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}xk(`: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}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-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;
353left: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;background:var(--gray1);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}: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:0;right:0;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}
353: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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);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-border: hsl(0, 0%, 20%);--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%);--error-text: hsl(358, 100%, 81%)}[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%)}
354`);function bo(n){return n.label!==void 0}var _k=3,Sk="32px",Ek=4e3,Tk=356,kk=14,Ck=20,Ak=200;
354function Pk(...n){return n.filter(Boolean).join(" ")}var jk=n=>{var e,t,r,s,i,o,a,c,u,d;let{invert:f,toast:p,unstyled:v,interacting:b,setHeights:m,visibleToasts:g,heights:x,index:S,toasts:E,expanded:P,removeToast:C,defaultRichColors:O,closeButton:N,style:D,cancelButtonStyle:R,actionButtonStyle:F,className:A="",descriptionClassName:I="",duration:z,position:$,gap:ee,loadingIcon:K,expandByDefault:se,classNames:G,icons:q,closeButtonAriaLabel:te="Close toast",pauseWhenPageIsHidden:Q,cn:oe}=n,[h,_]=Y.useState(!1),[w,T]=Y.useState(!1),[k,j]=Y.useState(!1),[M,L]=Y.useState(!1),[B,X]=Y.useState(0),[ue,Le]=Y.useState(0),Ze=Y.useRef(null),Ke=Y.useRef(null),je=S===0,nt=S+1<=g,Fe=p.type,lt=p.dismissible!==!1,Jt=p.className||"",Ft=p.descriptionClassName||"",rt=Y.useMemo(()=>x.findIndex(me=>me.toastId===p.id)||0,[x,p.id]),ut=Y.useMemo(()=>{var me;return(me=p.closeButton)!=null?me:N},[p.closeButton,N]),yt=Y.useMemo(()=>p.duration||z||Ek,[p.duration,z]),zn=Y.useRef(0),bt=Y.useRef(0),ti=Y.useRef(0),Sn=Y.useRef(null),[ni,Er]=$.split("-"),io=Y.useMemo(()=>x.reduce((me,$e,De)=>De>=rt?me:me+$e.height,0),[x,rt]),oo=mk(),yc=p.invert||f,ri=Fe==="loading";bt.current=Y.useMemo(()=>rt*ee+io,[rt,io]),Y.useEffect(()=>{_(!0)},[]),Y.useLayoutEffect(()=>{if(!h)return;let me=Ke.current,$e=me.style.height;me.style.height="auto";let De=me.getBoundingClientRect().height;me.style.height=$e,Le(De),m($t=>$t.find(Ut=>Ut.toastId===p.id)?$t.map(Ut=>Ut.toastId===p.id?{...Ut,height:De}:Ut):[{toastId:p.id,height:De,position:p.position},...$t])},[h,p.title,p.description,m,p.id]);let cn=Y.useCallback(()=>{T(!0),X(bt.current),m(me=>me.filter($e=>$e.toastId!==p.id)),setTimeout(()=>{C(p)},Ak)},[p,C,m,bt]);Y.useEffect(()=>{if(p.promise&&Fe==="loading"||p.duration===1/0||p.type==="loading")return;let me,$e=yt;return P||b||Q&&oo?(()=>{if(ti.current<zn.current){let De=new Date().getTime()-zn.current;$e=$e-De}ti.current=new Date().getTime()})():$e!==1/0&&(zn.current=new Date().getTime(),me=setTimeout(()=>{var De;(De=p.onAutoClose)==null||De.call(p,p),cn()},$e)),()=>clearTimeout(me)},[P,b,se,p,yt,cn,p.promise,Fe,Q,oo]),Y.useEffect(()=>{let me=Ke.current;if(me){let $e=me.getBoundingClientRect().height;return Le($e),m(De=>[{toastId:p.id,height:$e,position:p.position},...De]),()=>m(De=>De.filter($t=>$t.toastId!==p.id))}},[m,p.id]),Y.useEffect(()=>{p.delete&&cn()},[cn,p.delete]);function ao(){return q!=null&&q.loading?Y.createElement("div",{className:"sonner-loader","data-visible":Fe==="loading"},q.loading):K?Y.createElement("div",{className:"sonner-loader","data-visible":Fe==="loading"},K):Y.createElement(uk,{visible:Fe==="loading"})}return Y.createElement("li",{"aria-live":p.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Ke,className:oe(A,Jt,G==null?void 0:G.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[Fe],(t=p==null?void 0:p.classNames)==null?void 0:t[Fe]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:O,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":h,"data-promise":!!p.promise,"data-removed":w,"data-visible":nt,"data-y-position":ni,"data-x-position":Er,"data-index":S,"data-front":je,"data-swiping":k,"data-dismissible":lt,"data-type":Fe,"data-invert":yc,"data-swipe-out":M,"data-expanded":!!(P||se&&h),style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${w?B:bt.current}px`,"--initial-height":se?"auto":`${ue}px`,...D,...p.style},onPointerDown:me=>{ri||!lt||(Ze.current=new Date,X(bt.current),me.target.setPointerCapture(me.pointerId),me.target.tagName!=="BUTTON"&&(j(!0),Sn.current={x:me.clientX,y:me.clientY}))},onPointerUp:()=>{var me,$e,De,$t;if(M||!lt)return;Sn.current=null;let Ut=Number(((me=Ke.current)==null?void 0:me.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Tr=new Date().getTime()-(($e=Ze.current)==null?void 0:$e.getTime()),de=Math.abs(Ut)/Tr;if(Math.abs(Ut)>=Ck||de>.11){X(bt.current),(De=p.onDismiss)==null||De.call(p,p),cn(),L(!0);return}($t=Ke.current)==null||$t.style.setProperty("--swipe-amount","0px"),j(!1)},onPointerMove:me=>{var $e;if(!Sn.current||!lt)return;let De=me.clientY-Sn.current.y,$t=me.clientX-Sn.current.x,Ut=(ni==="top"?Math.min:Math.max)(0,De),Tr=me.pointerType==="touch"?10:2;Math.abs(Ut)>Tr?($e=Ke.current)==null||$e.style.setProperty("--swipe-amount",`${De}px`):Math.abs($t)>Tr&&(Sn.current=null)}},ut&&!p.jsx?Y.createElement("button",{"aria-label":te,"data-disabled":ri,"data-close-button":!0,onClick:ri||!lt?()=>{}:()=>{var me;cn(),(me=p.onDismiss)==null||me.call(p,p)},className:oe(G==null?void 0:G.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},Y.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"},Y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,p.jsx||Y.isValidElement(p.title)?p.jsx||p.title:Y.createElement(Y.Fragment,null,Fe||p.icon||p.promise?Y.createElement("div",{"data-icon":"",className:oe(G==null?void 0:G.icon,(i=p==null?void 0:p.classNames)==null?void 0:i.icon)}
354,p.promise||p.type==="loading"&&!p.icon?p.icon||ao():null,p.type!=="loading"?p.icon||(q==null?void 0:q[Fe])||ck(Fe):null):null,Y.createElement("div",{"data-content":"",className:oe(G==null?void 0:G.content,(o=p==null?void 0:p.classNames)==null?void 0:o.content)},Y.createElement("div",{"data-title":"",className:oe(G==null?void 0:G.title,(a=p==null?void 0:p.classNames)==null?void 0:a.title)},p.title),p.description?Y.createElement("div",{"data-description":"",className:oe(I,Ft,G==null?void 0:G.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},p.description):null),Y.isValidElement(p.cancel)?p.cancel:p.cancel&&bo(p.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:me=>{var $e,De;bo(p.cancel)&&lt&&((De=($e=p.cancel).onClick)==null||De.call($e,me),cn())},className:oe(G==null?void 0:G.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,Y.isValidElement(p.action)?p.action:p.action&&bo(p.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||F,onClick:me=>{var $e,De;bo(p.action)&&(me.defaultPrevented||((De=($e=p.action).onClick)==null||De.call($e,me),cn()))},className:oe(G==null?void 0:G.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function Ch(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}var Ok=n=>{let{invert:e,position:t="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:o,offset:a,theme:c="light",richColors:u,duration:d,style:f,visibleToasts:p=_k,toastOptions:v,dir:b=Ch(),gap:m=kk,loadingIcon:g,icons:x,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:E,cn:P=Pk}=n,[C,O]=Y.useState([]),N=Y.useMemo(()=>Array.from(new Set([t].concat(C.filter(Q=>Q.position).map(Q=>Q.position)))),[C,t]),[D,R]=Y.useState([]),[F,A]=Y.useState(!1),[I,z]=Y.useState(!1),[$,ee]=Y.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=Y.useRef(null),se=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=Y.useRef(null),q=Y.useRef(!1),te=Y.useCallback(Q=>{var oe;(oe=C.find(h=>h.id===Q.id))!=null&&oe.delete||Pt.dismiss(Q.id),O(h=>h.filter(({id:_})=>_!==Q.id))},[C]);return Y.useEffect(()=>Pt.subscribe(Q=>{if(Q.dismiss){O(oe=>oe.map(h=>h.id===Q.id?{...h,delete:!0}:h));return}setTimeout(()=>{Z0.flushSync(()=>{O(oe=>{let h=oe.findIndex(_=>_.id===Q.id);return h!==-1?[...oe.slice(0,h),{...oe[h],...Q},...oe.slice(h+1)]:[Q,...oe]})})})}),[]),Y.useEffect(()=>{if(c!=="system"){ee(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ee("dark"):ee("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:Q})=>{ee(Q?"dark":"light")})},[c]),Y.useEffect(()=>{C.length<=1&&A(!1)},[C]),Y.useEffect(()=>{let Q=oe=>{var h,_;r.every(w=>oe[w]||oe.code===w)&&(A(!0),(h=K.current)==null||h.focus()),oe.code==="Escape"&&(document.activeElement===K.current||(_=K.current)!=null&&_.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[r]),Y.useEffect(()=>{if(K.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,q.current=!1)}},[K.current]),C.length?Y.createElement("section",{"aria-label":`${S} ${se}`,tabIndex:-1},N.map((Q,oe)=>{var h;let[_,w]=Q.split("-");return Y.createElement("ol",{key:Q,dir:b==="auto"?Ch():b,tabIndex:-1,ref:K,className:o,"data-sonner-toaster":!0,"data-theme":$,"data-y-position":_,"data-x-position":w,style:{"--front-toast-height":`${((h=D[0])==null?void 0:h.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||Sk,"--width":`${Tk}px`,"--gap":`${m}px`,...f},onBlur:T=>{q.current&&!T.currentTarget.contains(T.relatedTarget)&&(q.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:T=>{T.target instanceof HTMLElement&&T.target.dataset.dismissible==="false"||q.current||(q.current=!0,G.current=T.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{I||A(!1)},onPointerDown:T=>{T.target instanceof HTMLElement&&T.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},C.filter(T=>!T.position&&oe===0||T.position===Q).map((T,k)=>{var j,M;return Y.createElement(jk,{key:T.id,icons:x,index:k,toast:T,defaultRichColors:u,duration:(j=v==null?void 0:v.duration)!=null?j:d,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:e,visibleToasts:p,closeButton:(M=v==null?void 0:v.closeButton)!=null?M:i,interacting:I,position:Q,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:te,toasts:C.filter(L=>L.position==T.position),heights:D.filter(L=>L.position==T.position),setHeights:R,expandByDefault:s,gap:m,loadingIcon:g,expanded:F,pauseWhenPageIsHidden:E,cn:P})}))})):null};const Rk=()=>{const[n,e]=y.useState(!1),[t,r]=y.useState(null);y.useEffect(()=>{var a;const i=(()=>{try{return window.self!==window.top}catch{return!0}})(),o=window.location.hostname.includes("id-preview--")||window.location.hostname.includes("lovableproject.com");if(i||o){(a=navigator.serviceWorker)==null||a.getRegistrations().then(c=>c.forEach(u=>u.unregister()));return}
354"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(c=>{c.addEventListener("updatefound",()=>{const u=c.installing;u&&u.addEventListener("statechange",()=>{u.state==="installed"&&navigator.serviceWorker.controller&&(r(u),e(!0))})}),c.waiting&&navigator.serviceWorker.controller&&(r(c.waiting),e(!0))})},[]);const s=()=>{t==null||t.postMessage({type:"SKIP_WAITING"}),e(!1),setTimeout(()=>window.location.reload(),100)};return n?l.jsx("div",{className:"fixed bottom-4 left-4 right-4 z-[9999] rounded-lg border bg-background p-4 shadow-lg",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(iv,{className:"h-5 w-5 text-primary shrink-0 mt-0.5"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-semibold",children:"Update available"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"A new version is ready. Please update to get the latest fixes including login and signup improvements."})]}),l.jsx("button",{onClick:s,className:"shrink-0 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:"Update now"})]})}):null};var qa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ga=typeof window>"u"||"Deno"in globalThis;function Xt(){}function Ik(n,e){return typeof n=="function"?n(e):n}function Nk(n){return typeof n=="number"&&n>=0&&n!==1/0}function Dk(n,e){return Math.max(n+(e||0)-Date.now(),0)}function Ah(n,e){return typeof n=="function"?n(e):n}function Mk(n,e){return typeof n=="function"?n(e):n}function Ph(n,e){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=n;if(o){if(r){if(e.queryHash!==rd(o,e.options))return!1}else if(!Ii(e.queryKey,o))return!1}if(t!=="all"){const c=e.isActive();if(t==="active"&&!c||t==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function jh(n,e){const{exact:t,status:r,predicate:s,mutationKey:i}=n;if(i){if(!e.options.mutationKey)return!1;if(t){if(Ri(e.options.mutationKey)!==Ri(i))return!1}else if(!Ii(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function rd(n,e){return((e==null?void 0:e.queryKeyHashFn)||Ri)(n)}function Ri(n){return JSON.stringify(n,(e,t)=>jl(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ii(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?!Object.keys(e).some(t=>!Ii(n[t],e[t])):!1}function vv(n,e){if(n===e)return n;const t=Oh(n)&&Oh(e);if(t||jl(n)&&jl(e)){const r=t?n:Object.keys(n),s=r.length,i=t?e:Object.keys(e),o=i.length,a=t?[]:{};let c=0;for(let u=0;u<o;u++){const d=t?u:i[u];(!t&&r.includes(d)||t)&&n[d]===void 0&&e[d]===void 0?(a[d]=void 0,c++):(a[d]=vv(n[d],e[d]),a[d]===n[d]&&n[d]!==void 0&&c++)}return s===o&&c===s?n:a}return e}function ZL(n,e){if(!e||Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}function Oh(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function jl(n){if(!Rh(n))return!1;const e=n.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!Rh(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function Rh(n){return Object.prototype.toString.call(n)==="[object Object]"}function Lk(n){return new Promise(e=>{setTimeout(e,n)})}function Fk(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?vv(n,e):e}function $k(n,e,t=0){const r=[...n,e];return t&&r.length>t?r.slice(1):r}function Uk(n,e,t=0){const r=[e,...n];return t&&r.length>t?r.slice(0,-1):r}var sd=Symbol();function yv(n,e){return!n.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!n.queryFn||n.queryFn===sd?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}var Mr,sr,Cs,Rm,zk=(Rm=class extends qa{constructor(){super();Ie(this,Mr);Ie(this,sr);Ie(this,Cs);Se(this,Cs,e=>{if(!Ga&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){U(this,sr)||this.setEventListener(U(this,Cs))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,sr))==null||e.call(this),Se(this,sr,void 0))}setEventListener(e){var t;Se(this,Cs,e),(t=U(this,sr))==null||t.call(this),Se(this,sr,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){U(this,Mr)!==e&&(Se(this,Mr,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 20,184 bytes, line 354
354this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof U(this,Mr)=="boolean"?U(this,Mr):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Mr=new WeakMap,sr=new WeakMap,Cs=new WeakMap,Rm),bv=new zk,As,ir,Ps,Im,Vk=(Im=class extends qa{constructor(){super();Ie(this,As,!0);Ie(this,ir);Ie(this,Ps);Se(this,Ps,e=>{if(!Ga&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){U(this,ir)||this.setEventListener(U(this,Ps))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,ir))==null||e.call(this),Se(this,ir,void 0))}setEventListener(e){var t;Se(this,Ps,e),(t=U(this,ir))==null||t.call(this),Se(this,ir,e(this.setOnline.bind(this)))}setOnline(e){U(this,As)!==e&&(Se(this,As,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return U(this,As)}},As=new WeakMap,ir=new WeakMap,Ps=new WeakMap,Im),ea=new Vk;function Bk(){let n,e;const t=new Promise((s,i)=>{n=s,e=i});t.status="pending",t.catch(()=>{});function r(s){Object.assign(t,s),delete t.resolve,delete t.reject}return t.resolve=s=>{r({status:"fulfilled",value:s}),n(s)},t.reject=s=>{r({status:"rejected",reason:s}),e(s)},t}function qk(n){return Math.min(1e3*2**n,3e4)}function wv(n){return(n??"online")==="online"?ea.isOnline():!0}var xv=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function Nc(n){return n instanceof xv}function _v(n){let e=!1,t=0,r=!1,s;const i=Bk(),o=m=>{var g;r||(p(new xv(m)),(g=n.abort)==null||g.call(n))},a=()=>{e=!0},c=()=>{e=!1},u=()=>bv.isFocused()&&(n.networkMode==="always"||ea.isOnline())&&n.canRun(),d=()=>wv(n.networkMode)&&n.canRun(),f=m=>{var g;r||(r=!0,(g=n.onSuccess)==null||g.call(n,m),s==null||s(),i.resolve(m))},p=m=>{var g;r||(r=!0,(g=n.onError)==null||g.call(n,m),s==null||s(),i.reject(m))},v=()=>new Promise(m=>{var g;s=x=>{(r||u())&&m(x)},(g=n.onPause)==null||g.call(n)}).then(()=>{var m;s=void 0,r||(m=n.onContinue)==null||m.call(n)}),b=()=>{if(r)return;let m;const g=t===0?n.initialPromise:void 0;try{m=g??n.fn()}catch(x){m=Promise.reject(x)}Promise.resolve(m).then(f).catch(x=>{var O;if(r)return;const S=n.retry??(Ga?0:3),E=n.retryDelay??qk,P=typeof E=="function"?E(t,x):E,C=S===!0||typeof S=="number"&&t<S||typeof S=="function"&&S(t,x);if(e||!C){p(x);return}t++,(O=n.onFail)==null||O.call(n,t,x),Lk(P).then(()=>u()?void 0:v()).then(()=>{e?p(x):b()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:c,canStart:d,start:()=>(d()?b():v().then(b),i)}}function Gk(){let n=[],e=0,t=a=>{a()},r=a=>{a()},s=a=>setTimeout(a,0);const i=a=>{e?n.push(a):s(()=>{t(a)})},o=()=>{const a=n;n=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{t(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{t=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var pt=Gk(),Lr,Nm,Sv=(Nm=class{constructor(){Ie(this,Lr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nk(this.gcTime)&&Se(this,Lr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Ga?1/0:5*60*1e3))}clearGcTimeout(){U(this,Lr)&&(clearTimeout(U(this,Lr)),Se(this,Lr,void 0))}},Lr=new WeakMap,Nm),js,Os,zt,ot,Bi,Fr,Zt,Cn,Dm,Hk=(Dm=class extends Sv{constructor(e){super();Ie(this,Zt);Ie(this,js);Ie(this,Os);Ie(this,zt);Ie(this,ot);Ie(this,Bi);Ie(this,Fr);Se(this,Fr,!1),Se(this,Bi,e.defaultOptions),this.setOptions(e.options),this.observers=[],Se(this,zt,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Se(this,js,Jk(this.options)),this.state=e.state??U(this,js),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=U(this,ot))==null?void 0:e.promise}setOptions(e){this.options={...U(this,Bi),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,zt).remove(this)}setData(e,t){const r=Fk(this.state.data,e,this.options);return it(this,Zt,Cn).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(e,t){it(this,Zt,Cn).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var r,s;const t=(r=U(this,ot))==null?void 0:r.promise;return(s=U(this,ot))==null||s.cancel(e),t?t.then(Xt).catch(Xt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(U(this,js))}isActive(){return this.observers.some(e=>Mk(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Dk(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=U(this,ot))==null||t.continue()}onOnline(){var t;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=U(this,ot))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),U(this,zt).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(U(this,ot)&&(U(this,Fr)?U(this,ot).cancel({revert:!0}):U(this,ot).cancelRetry()),this.scheduleGc()),U(this,zt).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||it(this,Zt,Cn).call(this,{type:"invalidate"})}fetch(e,t){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(U(this,ot))return U(this,ot).continueRetry(),U(this,ot).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Se(this,Fr,!0),r.signal)})},i=()=>{const f=yv(this.options,t),p={queryKey:this.queryKey,meta:this.meta};return s(p),Se(this,Fr,!1),this.options.persister?this.options.persister(f,p,this):f(p)},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),Se(this,Os,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&it(this,Zt,Cn).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=f=>{var p,v,b,m;Nc(f)&&f.silent||it(this,Zt,Cn).call(this,{type:"error",error:f}),Nc(f)||((v=(p=U(this,zt).config).onError)==null||v.call(p,f,this),(m=(b=U(this,zt).config).onSettled)==null||m.call(b,this.state.data,f,this)),this.scheduleGc()};return Se(this,ot,_v({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,v,b,m;if(f===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(g){a(g);return}(v=(p=U(this,zt).config).onSuccess)==null||v.call(p,f,this),(m=(b=U(this,zt).config).onSettled)==null||m.call(b,f,this.state.error,this),this.scheduleGc()},onError:a,onFail:(f,p)=>{it(this,Zt,Cn).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{it(this,Zt,Cn).call(this,{type:"pause"})},onContinue:()=>{it(this,Zt,Cn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),U(this,ot).start()}},js=new WeakMap,Os=new WeakMap,zt=new WeakMap,ot=new WeakMap,Bi=new WeakMap,Fr=new WeakMap,Zt=new WeakSet,Cn=function(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Wk(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return Nc(s)&&s.revert&&U(this,Os)?{...U(this,Os),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),pt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),U(this,zt).notify({query:this,type:"updated",action:e})})},Dm);function Wk(n,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wv(e.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Jk(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=e!==void 0,r=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var fn,Mm,Yk=(Mm=class extends qa{constructor(e={}){super();Ie(this,fn);this.config=e,Se(this,fn,new Map)}build(e,t,r){const s=t.queryKey,i=t.queryHash??rd(s,t);let o=this.get(i);return o||(o=new Hk({cache:this,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){U(this,fn).has(e.queryHash)||(U(this,fn).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=U(this,fn).get(e.queryHash);t&&(e.destroy(),t===e&&U(this,fn).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){pt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return U(this,fn).get(e)}getAll(){return[...U(this,fn).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Ph(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>Ph(e,r)):t}notify(e){pt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fn=new WeakMap,Mm),pn,ht,$r,mn,Wn,Lm,Kk=(Lm=class extends Sv{constructor(e){super();Ie(this,mn);Ie(this,pn);Ie(this,ht);Ie(this,$r);this.mutationId=e.mutationId,Se(this,ht,e.mutationCache),Se(this,pn,[]),this.state=e.state||Qk(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){U(this,pn).includes(e)||(U(this,pn).push(e),this.clearGcTimeout(),U(this,ht).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Se(this,pn,U(this,pn).filter(t=>t!==e)),this.scheduleGc(),U(this,ht).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){U(this,pn).length||(this.state.status==="pending"?this.scheduleGc():U(this,ht).remove(this))}continue(){var e;return((e=U(this,$r))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,i,o,a,c,u,d,f,p,v,b,m,g,x,S,E,P,C,O,N;Se(this,$r,_v({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(D,R)=>{it(this,mn,Wn).call(this,{type:"failed",failureCount:D,error:R})},onPause:()=>{it(this,mn,Wn).call(this,{type:"pause"})},onContinue:()=>{it(this,mn,Wn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,ht).canRun(this)}));const t=this.state.status==="pending",r=!U(this,$r).canStart();try{if(!t){it(this,mn,Wn).call(this,{type:"pending",variables:e,isPaused:r}),await((i=(s=U(this,ht).config).onMutate)==null?void 0:i.call(s,e,this));const R=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));R!==this.state.context&&it(this,mn,Wn).call(this,{type:"pending",context:R,variables:e,isPaused:r})}const D=await U(this,$r).start();return await((u=(c=U(this,ht).config).onSuccess)==null?void 0:u.call(c,D,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,D,e,this.state.context)),await((v=(p=U(this,ht).config).onSettled)==null?void 0:v.call(p,D,null,this.state.variables,this.state.context,this)),await((m=(b=this.options).onSettled)==null?void 0:m.call(b,D,null,e,this.state.context)),it(this,mn,Wn).call(this,{type:"success",data:D}),D}catch(D){try{throw await((x=(g=U(this,ht).config).onError)==null?void 0:x.call(g,D,e,this.state.context,this)),await((E=(S=this.options).onError)==null?void 0:E.call(S,D,e,this.state.context)),await((C=(P=U(this,ht).config).onSettled)==null?void 0:C.call(P,void 0,D,this.state.variables,this.state.context,this)),await((N=(O=this.options).onSettled)==null?void 0:N.call(O,void 0,D,e,this.state.context)),D}finally{it(this,mn,Wn).call(this,{type:"error",error:D})}}finally{U(this,ht).runNext(this)}}},pn=new WeakMap,ht=new WeakMap,$r=new WeakMap,mn=new WeakSet,Wn=function(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),pt.batch(()=>{U(this,pn).forEach(r=>{r.onMutationUpdate(e)}),U(this,ht).notify({mutation:this,type:"updated",action:e})})},Lm);function Qk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var At,qi,Fm,Xk=(Fm=class extends qa{constructor(e={}){super();Ie(this,At);Ie(this,qi);this.config=e,Se(this,At,new Map),Se(this,qi,Date.now())}build(e,t,r){const s=new Kk({mutationCache:this,mutationId:++lo(this,qi)._,options:e.defaultMutationOptions(t),state:r});return this.add(s),s}add(e){const t=wo(e),r=U(this,At).get(t)??[];r.push(e),U(this,At).set(t,r),this.notify({type:"added",mutation:e})}remove(e){var r;const t=wo(e);if(U(this,At).has(t)){const s=(r=U(this,At).get(t))==null?void 0:r.filter(i=>i!==e);s&&(s.length===0?U(this,At).delete(t):U(this,At).set(t,s))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const t=(r=U(this,At).get(wo(e)))==null?void 0:r.find(s=>s.state.status==="pending");return!t||t===e}runNext(e){var r;const t=(r=U(this,At).get(wo(e)))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(t==null?void 0:t.continue())??Promise.resolve()}clear(){pt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...U(this,At).values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(r=>jh(t,r))}findAll(e={}){return this.getAll().filter(t=>jh(e,t))}notify(e){pt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return pt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Xt))))}},At=new WeakMap,qi=new WeakMap,Fm);function wo(n){var e;return((e=n.options.scope)==null?void 0:e.id)??String(n.mutationId)}function Ih(n){return{onFetch:(e,t)=>{var d,f,p,v,b;const r=e.options,s=(p=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((b=e.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let m=!1;const g=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(e.signal.aborted?m=!0:e.signal.addEventListener("abort",()=>{m=!0}),e.signal)})},x=yv(e.options,e.fetchOptions),S=async(E,P,C)=>{if(m)return Promise.reject();if(P==null&&E.pages.length)return Promise.resolve(E);const O={queryKey:e.queryKey,pageParam:P,direction:C?"backward":"forward",meta:e.options.meta};g(O);const N=await x(O),{maxPages:D}=e.options,R=C?Uk:$k;return{pages:R(E.pages,N,D),pageParams:R(E.pageParams,P,D)}};if(s&&i.length){const E=s==="backward",P=E?Zk:Nh,C={pages:i,pageParams:o},O=P(r,C);a=await S(C,O,E)}else{const E=n??i.length;do{const P=c===0?o[0]??r.initialPageParam:Nh(r,a);if(c>0&&P==null)break;a=await S(a,P),c++}while(c<E)}return a};e.options.persister?e.fetchFn=()=>{var m,g;return(g=(m=e.options).persister)==null?void 0:g.call(m,u,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=u}}}function Nh(n,{pages:e,pageParams:t}){const r=e.length-1;return e.length>0?n.getNextPageParam(e[r],e,t[r],t):void 0}function Zk(n,{pages:e,pageParams:t}){var r;return e.length>0?(r=n.getPreviousPageParam)==null?void 0:r.call(n,e[0],e,t[0],t):void 0}var Ye,or,ar,Rs,Is,cr,Ns,Ds,$m,eC=($m=class{constructor(n={}){Ie(this,Ye);Ie(this,or);Ie(this,ar);Ie(this,Rs);Ie(this,Is);Ie(this,cr);Ie(this,Ns);Ie(this,Ds);Se(this,Ye,n.queryCache||new Yk),Se(this,or,n.mutationCache||new Xk),Se(this,ar,n.defaultOptions||{}),Se(this,Rs,new Map),Se(this,Is,new Map),Se(this,cr,0)}mount(){lo(this,cr)._++,U(this,cr)===1&&(Se(this,Ns,bv.subscribe(async n=>{n&&(await this.resumePausedMutations(),U(this,Ye).onFocus())})),Se(this,Ds,ea.subscribe(async n=>{n&&(await this.resumePausedMutations(),U(this,Ye).onOnline())})))}unmount(){var n,e;lo(this,cr)._--,U(this,cr)===0&&((n=U(this,Ns))==null||n.call(this),Se(this,Ns,void 0),(e=U(this,Ds))==null||e.call(this),Se(this,Ds,void 0))}isFetching(n){return U(this,Ye).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return U(this,or).findAll({...n,status:"pending"}).length}getQueryData(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=U(this,Ye).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(n){const e=this.getQueryData(n.queryKey);if(e===void 0)return this.fetchQuery(n);{const t=this.defaultQueryOptions(n),r=U(this,Ye).build(this,t);return n.revalidateIfStale&&r.isStaleByTime(Ah(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(e)}}getQueriesData(n){return U(this,Ye).findAll(n).map(({queryKey:e,state:t})=>{const r=t.data;return[e,r]})}setQueryData(n,e,t){const r=this.defaultQueryOptions({queryKey:n}),s=U(this,Ye).get(r.queryHash),i=s==null?void 0:s.state.data,o=Ik(e,i);if(o!==void 0)return U(this,Ye).build(this,r).setData(o,{...t,manual:!0})}setQueriesData(n,e,t){return pt.batch(()=>U(this,Ye).findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,e,t)]))}getQueryState(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=U(this,Ye).get(e.queryHash))==null?void 0:t.state}removeQueries(n){const e=U(this,Ye);pt.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=U(this,Ye),r={type:"active",...n};return pt.batch(()=>(t.findAll(n).forEach(s=>{s.reset()}),this.refetchQueries(r,e)))}cancelQueries(n={},e={}){const t={revert:!0,...e},r=pt.batch(()=>U(this,Ye).findAll(n).map(s=>s.cancel(t)));return Promise.all(r).then(Xt).catch(Xt)}invalidateQueries(n={},e={}){return pt.batch(()=>{if(U(this,Ye).findAll(n).forEach(r=>{r.invalidate()}),n.refetchType==="none")return Promise.resolve();const t={...n,type:n.refetchType??n.type??"active"};return this.refetchQueries(t,e)})}refetchQueries(n={},e){const t={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=pt.batch(()=>U(this,Ye).findAll(n).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Xt)),s.state.fetchStatus==="paused"?Promise.resolve():i}
354));return Promise.all(r).then(Xt)}fetchQuery(n){const e=this.defaultQueryOptions(n);e.retry===void 0&&(e.retry=!1);const t=U(this,Ye).build(this,e);return t.isStaleByTime(Ah(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Xt).catch(Xt)}fetchInfiniteQuery(n){return n.behavior=Ih(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Xt).catch(Xt)}ensureInfiniteQueryData(n){return n.behavior=Ih(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return ea.isOnline()?U(this,or).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,Ye)}getMutationCache(){return U(this,or)}getDefaultOptions(){return U(this,ar)}setDefaultOptions(n){Se(this,ar,n)}setQueryDefaults(n,e){U(this,Rs).set(Ri(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...U(this,Rs).values()];let t={};return e.forEach(r=>{Ii(n,r.queryKey)&&(t={...t,...r.defaultOptions})}),t}setMutationDefaults(n,e){U(this,Is).set(Ri(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...U(this,Is).values()];let t={};return e.forEach(r=>{Ii(n,r.mutationKey)&&(t={...t,...r.defaultOptions})}),t}defaultQueryOptions(n){if(n._defaulted)return n;const e={...U(this,ar).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=rd(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===sd&&(e.enabled=!1),e}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...U(this,ar).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){U(this,Ye).clear(),U(this,or).clear()}},Ye=new WeakMap,or=new WeakMap,ar=new WeakMap,Rs=new WeakMap,Is=new WeakMap,cr=new WeakMap,Ns=new WeakMap,Ds=new WeakMap,$m),Ev=y.createContext(void 0),e2=n=>{const e=y.useContext(Ev);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},tC=({client:n,children:e})=>(y.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),l.jsx(Ev.Provider,{value:n,children:e}));const Tv=y.createContext(void 0);function nC({children:n,defaultTheme:e="dark",storageKey:t="gazel-theme"}){const[r,s]=y.useState(()=>localStorage.getItem(t)||e);y.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),r==="system"){const a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";o.classList.add(a);return}o.classList.add(r)},[r]);const i={theme:r,setTheme:o=>{localStorage.setItem(t,o),s(o)}};return l.jsx(Tv.Provider,{value:i,children:n})}const rC=()=>{const n=y.useContext(Tv);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n},kv=y.createContext({session:null,user:null,isLoading:!0,isAdminUser:!1,signOut:async()=>{},isAdmin:()=>!1}),sC=({children:n})=>{const[e,t]=y.useState(null),[r,s]=y.useState(null),[i,o]=y.useState(!0),[a,c]=y.useState(!1),u=async v=>{if(!v){c(!1);return}try{const{data:b,error:m}=await _e.rpc("is_admin_user");if(m){console.error("Error checking admin status:",m),c(!1);return}c(b===!0)}catch(b){console.error("Error in checkAdminStatus:",b),c(!1)}};y.useEffect(()=>{console.log("useAuth: Setting up authentication");const v=async()=>{var g;try{const{data:{session:x},error:S}=await _e.auth.getSession();S&&console.error("Error getting initial session:",S),console.log("Initial session:",((g=x==null?void 0:x.user)==null?void 0:g.id)||"no user"),t(x),s((x==null?void 0:x.user)??null),o(!1)}catch(x){console.error("Error in getInitialSession:",x),o(!1)}},{data:{subscription:b}}=_e.auth.onAuthStateChange((g,x)=>{var S;console.log("Auth state change:",g,((S=x==null?void 0:x.user)==null?void 0:S.id)||"no user"),t(x),s((x==null?void 0:x.user)??null),o(!1),x!=null&&x.user?setTimeout(()=>{u(x.user.id)},0):c(!1)});v();const m=setTimeout(()=>{i&&(console.log("Auth loading timeout, setting isLoading to false"),o(!1))},2e3);return()=>{clearTimeout(m),b.unsubscribe()}},[]);const p={session:e,user:r,isLoading:i,isAdminUser:a,signOut:async()=>{try{console.log("useAuth: Signing out user");const{error:v}=await _e.auth.signOut();if(v)throw console.error("SignOut error:",v),v;console.log("useAuth: Successfully signed out"),t(null),s(null)}catch(v){throw console.error("Error in signOut:",v),v}},isAdmin:()=>a};return l.jsx(kv.Provider,{value:p,children:n})},Dt=()=>y.useContext(kv),iC=(n,e,t,r)=>{var i,o,a,c;const s=[t,{code:e,...r||{}}];if((o=(i=n==null?void 0:n.services)==null?void 0:i.logger)!=null&&o.forward)return n.services.logger.forward(s,"warn","react-i18next::",!0);Ur(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(c=(a=n==null?void 0:n.services)==null?void 0:a.logger)!=null&&c.warn?n.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},Dh={},Ol=(n,e,t,r)=>{Ur(t)&&Dh[t]||(Ur(t)&&(Dh[t]=new Date),iC(n,e,t,r))},Cv=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},Rl=(n,e,t)=>
354{n.loadNamespaces(e,Cv(n,t))},Mh=(n,e,t,r)=>{if(Ur(t)&&(t=[t]),n.options.preload&&n.options.preload.indexOf(e)>-1)return Rl(n,t,r);t.forEach(s=>{n.options.ns.indexOf(s)<0&&n.options.ns.push(s)}),n.loadLanguages(e,Cv(n,r))},oC=(n,e,t={})=>!e.languages||!e.languages.length?(Ol(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(n,{lng:t.lng,precheck:(r,s)=>{var i;if(((i=t.bindI18n)==null?void 0:i.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,n))return!1}}),Ur=n=>typeof n=="string",aC=n=>typeof n=="object"&&n!==null,cC=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,lC={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},uC=n=>lC[n],dC=n=>n.replace(cC,uC);let Il={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:dC};const hC=(n={})=>{Il={...Il,...n}},fC=()=>Il;let Av;const pC=n=>{Av=n},mC=()=>Av,gC={type:"3rdParty",init(n){hC(n.options.react),pC(n)}},vC=y.createContext();class yC{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const bC=(n,e)=>{const t=y.useRef();return y.useEffect(()=>{t.current=n},[n,e]),t.current},Pv=(n,e,t,r)=>n.getFixedT(e,t,r),wC=(n,e,t,r)=>y.useCallback(Pv(n,e,t,r),[n,e,t,r]),Qi=(n,e={})=>{var P,C,O,N;const{i18n:t}=e,{i18n:r,defaultNS:s}=y.useContext(vC)||{},i=t||r||mC();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new yC),!i){Ol(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const D=(F,A)=>Ur(A)?A:aC(A)&&Ur(A.defaultValue)?A.defaultValue:Array.isArray(F)?F[F.length-1]:F,R=[D,{},!1];return R.t=D,R.i18n={},R.ready=!1,R}(P=i.options.react)!=null&&P.wait&&Ol(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...fC(),...i.options.react,...e},{useSuspense:a,keyPrefix:c}=o;let u=s||((C=i.options)==null?void 0:C.defaultNS);u=Ur(u)?[u]:u||["translation"],(N=(O=i.reportNamespaces).addUsedNamespaces)==null||N.call(O,u);const d=(i.isInitialized||i.initializedStoreOnce)&&u.every(D=>oC(D,i,o)),f=wC(i,e.lng||null,o.nsMode==="fallback"?u:u[0],c),p=()=>f,v=()=>Pv(i,e.lng||null,o.nsMode==="fallback"?u:u[0],c),[b,m]=y.useState(p);let g=u.join();e.lng&&(g=`${e.lng}${g}`);const x=bC(g),S=y.useRef(!0);y.useEffect(()=>{const{bindI18n:D,bindI18nStore:R}=o;S.current=!0,!d&&!a&&(e.lng?Mh(i,e.lng,u,()=>{S.current&&m(v)}):Rl(i,u,()=>{S.current&&m(v)})),d&&x&&x!==g&&S.current&&m(v);const F=()=>{S.current&&m(v)};return D&&(i==null||i.on(D,F)),R&&(i==null||i.store.on(R,F)),()=>{S.current=!1,i&&(D==null||D.split(" ").forEach(A=>i.off(A,F))),R&&i&&R.split(" ").forEach(A=>i.store.off(A,F))}},[i,g]),y.useEffect(()=>{S.current&&d&&m(p)},[i,c,d]);const E=[b,i,d];if(E.t=b,E.i18n=i,E.ready=d,d||!d&&!a)return E;throw new Promise(D=>{e.lng?Mh(i,e.lng,u,()=>D()):Rl(i,u,()=>D())})},jv=y.createContext({currentLanguage:"en",currentRegion:"US",changeLanguage:async()=>{},changeRegion:async()=>{},isLoading:!1}),xC=({children:n})=>{const{i18n:e}=Qi(),[t,r]=y.useState("en"),[s,i]=y.useState("US"),[o,a]=y.useState(!1);y.useEffect(()=>{const d=localStorage.getItem("app-language"),f=localStorage.getItem("app-region");d&&["en","es","fr","de"].includes(d)&&(r(d),e.changeLanguage(d)),f&&["US","GB","ES","FR","DE","MX","JP","NG","ZA","GH","KE","EG"].includes(f)&&i(f)},[e]);const c=async d=>{a(!0);try{await e.changeLanguage(d),r(d),localStorage.setItem("app-language",d),console.log("Language changed to:",d)}catch(f){console.error("Error changing language:",f)}finally{a(!1)}},u=async d=>{a(!0);try{i(d),localStorage.setItem("app-region",d),console.log("Region changed to:",d)}catch(f){console.error("Error changing region:",f)}finally{a(!1)}};return l.jsx(jv.Provider,{value:{currentLanguage:t,currentRegion:s,changeLanguage:c,changeRegion:u,isLoading:o},children:n})},Ov=()=>y.useContext(jv),xt={USD:1,EUR:.85,GBP:.73,CAD:1.25,MXN:18.5,ZAR:15.2,GHS:12.8,NGN:460,JPY:110,KES:130,EGP:30.9},_C={US:"USD",GB:"GBP",JP:"JPY",NG:"NGN",MX:"MXN",ES:"EUR",FR:"EUR",DE:"EUR",ZA:"ZAR",GH:"GHS",KE:"KES",EG:"EGP"},Rv=y.createContext({currentCurrency:"USD",exchangeRates:xt,changeCurrency:()=>{},convertAmount:()=>0,formatCurrency:()=>"",isLoading:!1,lastUpdated:null,refreshRates:async()=>{}}),SC=({children:n})=>{const{currentRegion:e}=Ov(),[t,r]=y.useState("USD"),[s,i]=y.useState(xt),[o,a]=y.useState(!1),[c,u]=y.useState(null),d=async()=>{try{console.log("Fetching real exchange rates...");const m=await fetch("https://api.exchangerate-api.com/v4/latest/USD");if(!m.ok)throw new Error(`HTTP error! status: ${m.status}`);const g=await m.json();return console.log("Exchange rates fetched successfully:",g.rates),{USD:1,EUR:g.rates.EUR||xt.EUR,GBP:g.rates.GBP||xt.GBP,CAD:g.rates.CAD||xt.CAD,MXN:g.rates.MXN||xt.MXN,ZAR:g.rates.ZAR||xt.ZAR,GHS:g.rates.GHS||xt.GHS,NGN:g.rates.NGN||xt.NGN,JPY:g.rates.JPY||xt.JPY,KES:g.rates.KES||xt.KES,EGP:g.rates.EGP||xt.EGP}}catch(m){return console.error("Failed to fetch exchange rates, using defaults:",m),xt}},f=async()=>{a(!0);try{const m=await d();i(m),u(new Date),localStorage.setItem("exchangeRates",JSON.stringify({rates:m,timestamp:Date.now()}))}catch(m){console.error("Error refreshing exchange rates:",m)}finally{a(!1)}};y.useEffect(()=>{(async()=>{try{const g=localStorage.getItem("exchangeRates");if(g){const{rates:x,timestamp:S}=JSON.parse(g);if((Date.now()-S)/(1e3*60*60)<1){console.log("Using cached exchange rates"),i(x),u(new Date(S));return}}await f()}catch(g){console.error("Error loading exchange rates:",g),i(xt)}})()},[]),y.useEffect(()=>{const m=_C[e]||"USD";r(m)},[e]);const p=m=>{console.log("Changing currency to:",m),r(m)},v=(m,g="USD",x=t)=>{if(g===x)return m;const E=m/s[g]*s[x];
354return console.log(`Converting ${m} ${g} to ${x}: ${E}`),E},b=(m,g=t)=>{try{return new Intl.NumberFormat("en-US",{style:"currency",currency:g}).format(m)}catch{return`${g} ${m.toFixed(2)}`}};return l.jsx(Rv.Provider,{value:{currentCurrency:t,exchangeRates:s,changeCurrency:p,convertAmount:v,formatCurrency:b,isLoading:o,lastUpdated:c,refreshRates:f},children:n})},t2=()=>y.useContext(Rv),Iv=y.createContext(void 0),Lh="gazel_onboarding_state",EC=({children:n})=>{const[e,t]=y.useState("landing"),[r,s]=y.useState(!0);y.useEffect(()=>{const f=localStorage.getItem(Lh);if(f){const{step:p,onboarding:v}=JSON.parse(f);t(p),s(v)}},[]),y.useEffect(()=>{const f={step:e,onboarding:r};localStorage.setItem(Lh,JSON.stringify(f))},[e,r]);const d={currentStep:e,isOnboarding:r,setCurrentStep:f=>{console.log(`Onboarding: Moving to step ${f}`),t(f)},completeOnboarding:()=>{console.log("Onboarding: Completing onboarding process"),t("completed"),s(!1)},restartOnboarding:()=>{console.log("Onboarding: Restarting onboarding process"),t("landing"),s(!0)},getStepNumber:f=>({landing:1,auth:2,products:3,completed:4})[f],getTotalSteps:()=>3};return l.jsx(Iv.Provider,{value:d,children:n})},Nv=()=>{const n=y.useContext(Iv);if(!n)throw new Error("useOnboarding must be used within an OnboardingProvider");return n},ai="gazelfaith_current_org",Dv=y.createContext(null);function TC({children:n}){const{user:e,isLoading:t}=Dt(),[r,s]=y.useState([]),[i,o]=y.useState(null),[a,c]=y.useState(null),[u,d]=y.useState([]),[f,p]=y.useState(!0),[v,b]=y.useState(null),m=y.useCallback(async()=>{if(!t){if(!e){s([]),o(null),c(null),d([]),p(!1);return}try{p(!0),b(null);const{data:C,error:O}=await _e.from("organization_members").select(`
355          role,
356          organization:organizations(*)
357        `).eq("user_id",e.id);if(O)throw O;const N=(C==null?void 0:C.map(F=>F.organization).filter(Boolean))||[];if(s(N),N.length===0){o(null),c(null),localStorage.removeItem(ai);return}const D=localStorage.getItem(ai),R=N.find(F=>F.id===D);if(R){o(R);const F=C==null?void 0:C.find(A=>{var I;return((I=A.organization)==null?void 0:I.id)===R.id});c((F==null?void 0:F.role)||null)}else if(N.length>0){o(N[0]);const F=C==null?void 0:C.find(A=>{var I;return((I=A.organization)==null?void 0:I.id)===N[0].id});c((F==null?void 0:F.role)||null),localStorage.setItem(ai,N[0].id)}}catch(C){console.error("Error fetching organizations:",C),s([]),o(null),c(null),d([]),b(C instanceof Error?C.message:"Failed to fetch organizations")}finally{p(!1)}}},[t,e]),g=y.useCallback(async()=>{if(!i){d([]);return}try{const{data:C,error:O}=await _e.from("organization_members").select("*").eq("organization_id",i.id);if(O)throw O;d(C||[])}catch(C){console.error("Error fetching members:",C)}},[i]);y.useEffect(()=>{m()},[m]),y.useEffect(()=>{i&&g()},[i,g]);const x=y.useCallback(C=>{o(C),C?localStorage.setItem(ai,C.id):localStorage.removeItem(ai)},[]),S=y.useCallback(async C=>
357{if(!e)throw new Error("Must be logged in to create organization");const{data:O,error:N}=await _e.rpc("create_organization_with_owner",{_name:C.name,_type:C.type,_slug:C.slug,_user_id:e.id});if(N)throw N;if(C.email||C.phone||C.address||C.tax_id){const{error:F}=await _e.from("organizations").update({email:C.email,phone:C.phone,address:C.address,city:C.city,state:C.state,zip:C.zip,tax_id:C.tax_id}).eq("id",O);if(F)throw F}const{data:D,error:R}=await _e.from("organizations").select("*").eq("id",O).single();if(R)throw R;return await m(),x(D),c("owner"),D},[e,m,x]),E=y.useCallback(async(C,O)=>{const{error:N}=await _e.from("organizations").update(O).eq("id",C);if(N)throw N;await m()},[m]),P={organizations:r,currentOrg:i,currentRole:a,members:u,isLoading:f,error:v,setCurrentOrg:x,createOrganization:S,updateOrganization:E,refreshOrganizations:m,refreshMembers:g};return y.createElement(Dv.Provider,{value:P},n)}function n2(){const n=y.useContext(Dv);if(!n)throw new Error("useOrganization must be used within an OrganizationProvider");return n}const Dc=768;function Ha(){const[n,e]=y.useState(void 0);return y.useEffect(()=>{const t=window.matchMedia(`(max-width: ${Dc-1}px)`),r=()=>{e(window.innerWidth<Dc)};return t.addEventListener("change",r),e(window.innerWidth<Dc),()=>t.removeEventListener("change",r)},[]),!!n}function Mv(){const[n,e]=y.useState(null),[t,r]=y.useState(!0),[s,i]=y.useState(null),[o,a]=y.useState(!1),{user:c,session:u}=Dt(),{toast:d}=Wu(),f=y.useCallback(async()=>{if(!c)return!1;try{const g=new Date;g.setDate(g.getDate()-1);const{data:x,error:S}=await _e.from("orders").select("*").eq("user_id",c.id).in("status",["pending","incomplete"]).gt("created_at",g.toISOString()).order("created_at",{ascending:!1});if(S)throw S;const E=x&&x.length>0;return a(E),console.log("Checking for pending subscriptions:",{userId:c.id,recentOrdersCount:(x==null?void 0:x.length)||0,hasPending:E}),E}catch(g){return console.error("Error checking for pending subscriptions:",g),!1}},[c]),p=y.useCallback(async(g=2)=>{if(!c||!u){console.log("No user or session, setting default status"),e({subscribed:!1,status:"trial",trial_active:!0,trial_days_remaining:14}),r(!1),a(!1);return}try{r(!0),i(null),await f();const{data:x,error:S}=await _e.from("subscription_status").select("*").eq("user_id",c.id).maybeSingle();if(S&&console.error("Error fetching local subscription status:",S),x){console.log("Found local subscription status:",x);let N=0;if(x.trial_active&&x.end_date){const R=new Date(x.end_date),F=new Date,A=R.getTime()-F.getTime(),I=Math.ceil(A/(1e3*3600*24));N=Math.max(0,I),N<=0&&x.trial_active&&(console.log("Trial expired, updating status"),await _e.from("subscription_status").update({trial_active:!1,status:x.subscribed?"active":"trial_expired",updated_at:new Date().toISOString()}).eq("user_id",c.id))}const D={subscribed:x.subscribed,status:N<=0&&x.trial_active?x.subscribed?"active":"trial_expired":x.status,trial_active:x.trial_active&&N>0,end_date:x.end_date,plan:x.plan,pending:!1,trial_days_remaining:N};e(D),r(!1);return}const E=new Date;E.setDate(E.getDate()+14);const{data:P,error:C}=await _e.from("subscription_status").insert({user_id:c.id,email:c.email||"",subscribed:!1,status:"trialing",trial_active:!0,plan:"trial",start_date:new Date().toISOString(),end_date:E.toISOString(),updated_at:new Date().toISOString()}).select().single();if(C)throw console.error("Error creating subscription status:",C),C;console.log("Created new subscription status:",P);const O={subscribed:!1,status:"trialing",trial_active:!0,end_date:E.toISOString(),plan:"trial",pending:!1,trial_days_remaining:14};e(O)}catch(x){console.error("Error fetching subscription status:",x),i(x instanceof Error?x.message:"Failed to fetch subscription status"),e({subscribed:!1,status:"trial",trial_active:!0,trial_days_remaining:14}),g>0&&d({title:"Subscription Error",description:"Failed to verify your subscription status",variant:"destructive"})}finally{r(!1)}},[c,u,d,f]);y.useEffect(()=>{p();const g=setInterval(()=>p(0),5*60*1e3);return()=>clearInterval(g)},[p]);const v=y.useCallback(g=>g==="basic"||g==="Basic Analysis"||!n||!n.subscribed?!0:n.status==="active"||n.status==="trialing"?!1:n.status==="canceling"||n.status==="canceled",[n]);return{status:n,isLoading:t,error:s,subscribe:async(g,x="month")=>{if(!c)throw d({title:"Authentication Required",description:"You must be logged in to subscribe",variant:"destructive"}),new Error("User must be logged in to subscribe");
357if(!v(g))throw d({title:"Subscription Error",description:"You already have an active subscription",variant:"destructive"}),new Error("User already has an active subscription");try{console.log("Creating subscription for product:",g,"interval:",x);const{data:S,error:E}=await _e.functions.invoke("create-subscription",{body:{productId:g,billingInterval:x}});if(E)throw console.error("Error from create-subscription function:",E),new Error(E.message);return a(!0),S}catch(S){throw console.error("Error creating subscription:",S),d({title:"Subscription Error",description:"Failed to create your subscription",variant:"destructive"}),S}},cancelSubscription:async()=>{if(!c)throw d({title:"Authentication Required",description:"You must be logged in to cancel a subscription",variant:"destructive"}),new Error("User must be logged in to cancel subscription");try{console.log("Canceling subscription");const{data:g,error:x}=await _e.functions.invoke("cancel-subscription");if(x)throw console.error("Error from cancel-subscription function:",x),new Error(x.message);if(console.log("Cancellation response:",g),g){const S={subscribed:!1,status:"canceled",trial_active:!1,end_date:g.end_date,trial_days_remaining:0};e(S),a(!1)}return d({title:"Subscription Canceled",description:(g==null?void 0:g.message)||"Your subscription has been canceled. You now have access to Basic Analysis features.",variant:"default"}),setTimeout(()=>{p()},1e3),g}catch(g){throw console.error("Error canceling subscription:",g),d({title:"Cancellation Failed",description:g instanceof Error?g.message:"Failed to cancel your subscription",variant:"destructive"}),g}},refetchStatus:p,isSubscribed:(n==null?void 0:n.subscribed)||!1,isTrialActive:(n==null?void 0:n.trial_active)||!1,canSubscribe:v,hasPendingSubscription:o,checkForPendingSubscriptions:f,trialDaysRemaining:(n==null?void 0:n.trial_days_remaining)||0}}function kC(){const{user:n}=Dt(),e=y.useCallback(async c=>{try{const u=navigator.userAgent,d={type:"audit_log",data:{userId:(n==null?void 0:n.id)||null,actionType:c.action,resourceType:c.resourceType,resourceId:c.resourceId,details:{...c.details,timestamp:new Date().toISOString(),url:window.location.href,sessionId:sessionStorage.getItem("session_id")||"unknown"},userAgent:u}},{error:f}=await _e.functions.invoke("secure-monitoring",{body:d});f&&(console.error("Failed to log audit event:",f),console.log("Audit Event:",d)),console.log(`Audit: ${c.action.toUpperCase()} ${c.resourceType} (${c.resourceId})`,c.details)}catch(u){console.error("Error logging audit event:",u)}
357},[n]),t=y.useCallback((c,u)=>e({action:"security_violation",resourceType:"security",resourceId:"security-event",details:{event:c,...u}}),[e]),r=y.useCallback((c,u,d)=>e({action:"read",resourceType:c,resourceId:u,details:d}),[e]),s=y.useCallback((c,u,d,f)=>e({action:c,resourceType:u,resourceId:d,details:f}),[e]),i=y.useCallback((c,u)=>e({action:c,resourceType:"user",resourceId:(n==null?void 0:n.id)||"unknown",details:u}),[e,n]),o=y.useCallback((c,u,d)=>e({action:c,resourceType:"file",resourceId:u,details:d}),[e]),a=y.useCallback((c,u,d)=>e({action:c,resourceType:"message",resourceId:u,details:d}),[e]);return{logAuditEvent:e,logSecurityEvent:t,logDataAccess:r,logDataModification:s,logAuthentication:i,logFileOperation:o,logMessaging:a}}function Lv(){const{user:n,session:e}=Dt(),{logAuthentication:t,logSecurityEvent:r}=kC(),[s,i]=y.useState({isAdmin:!1,isLoading:!0,sessionValid:!1,lastActivity:null}),o=y.useRef(new Set),a=async()=>{if(!n){i(d=>({...d,isAdmin:!1,isLoading:!1}));return}let u=!1;try{const{data:d,error:f}=await _e.from("admin_users").select("role").eq("user_id",n.id).single();if(f&&f.code!=="PGRST116"){console.error("Error checking admin status:",f),r("admin_check_error",{error:f.message}).catch(()=>{}),i(p=>({...p,isLoading:!1,sessionValid:!!e,lastActivity:new Date}));return}u=!!d,i(p=>({...p,isAdmin:u,isLoading:!1,sessionValid:!!e,lastActivity:new Date}))}catch(d){console.error("Security check failed:",d),i(f=>({...f,isLoading:!1})),r("security_check_failed",{error:String(d)}).catch(()=>{});return}if(u&&!o.current.has(n.id)){o.current.add(n.id);try{await t("login",{admin_access:!0})}catch{}}},c=async()=>{if(!(!e||!n))try{const{data:{user:u}}=await _e.auth.getUser();if(!u||u.id!==n.id){r("invalid_session_detected",{session_user:e.user.id,current_user:(u==null?void 0:u.id)||"none"}).catch(()=>{}),i(d=>({...d,sessionValid:!1}));return}try{await _e.from("user_sessions").upsert({user_id:n.id,session_token:e.access_token.substring(0,10)+"...",ip_address:"client-side",user_agent:navigator.userAgent,last_activity:new Date().toISOString(),is_active:!0},{onConflict:"user_id,session_token"})}catch{}i(d=>({...d,sessionValid:!0,lastActivity:new Date}))}catch(u){console.warn("Session validation skipped:",u)}};return y.useEffect(()=>{if(n){a(),c();const u=setInterval(c,5*60*1e3);return()=>clearInterval(u)}else o.current.clear(),i({isAdmin:!1,isLoading:!1,sessionValid:!1,lastActivity:null})},[n==null?void 0:n.id]),y.useEffect(()=>{const u=()=>{i(f=>({...f,lastActivity:new Date}))},d=["mousedown","keydown","scroll","touchstart"];return d.forEach(f=>{window.addEventListener(f,u)}),()=>{d.forEach(f=>{window.removeEventListener(f,u)})}},[]),{...s,user:n,session:e,refreshAdminStatus:a,validateSession:c}}function CC(){const{status:n,isLoading:e,trialDaysRemaining:t}=Mv(),{isAdmin:r}=Dt(),[s,i]=y.useState(!1),[o,a]=y.useState(null),[c,u]=y.useState(null),[d,f]=y.useState(!1),p=y.useCallback(()=>{if(r){i(!1),a(null),u(null),f(!1);return}if(!n){i(!1),a(null),u(null),f(!1);return}if(n.subscribed&&n.status==="active"&&!n.trial_active){i(!1),a(null),u(null),f(!1);return}const v=t||0;if(u(v),n.trial_active&&n.end_date){const b=new Date(n.end_date),m=new Date;a(b);const g=m>b||v<=0;i(g),f(!g&&v<=3&&v>0),console.log("Trial expiration check:",{trialEndDate:b.toISOString(),now:m.toISOString(),trialDays:v,expired:g,shouldShowUpgradePrompt:!g&&v<=3&&v>0})}else n.subscribed===!1&&n.status!=="active"?(i(!0),a(null),u(0),f(!1)):(i(!1),a(null),u(null),f(!1))},[n,t,r]);return y.useEffect(()=>{p()},[p]),y.useEffect(()=>{const v=setInterval(p,6e4);return()=>clearInterval(v)},[p]),{isTrialExpired:s,trialEndsAt:o,daysRemaining:c,shouldShowUpgradePrompt:d,isLoading:e,hasValidAccess:!s&&!e}}const Fh="gazelproject";function AC(){const{user:n}=Dt(),[e,t]=y.useState(null),[r,s]=y.useState(!0),[i,o]=y.useState(null),a=y.useCallback(async()=>{if(!(n!=null&&n.id)){t(null),s(!1);return}try{s(!0),o(null);const{data:u,error:d}=await _e.functions.invoke("verify-module-subscription",{body:{module_name:Fh}});if(d)throw d;t(u)}catch(u){console.error("Error checking projects subscription:",u),o(u instanceof Error?u.message:"Failed to check 
357subscription"),t({has_access:!1,status:"error",is_trialing:!1,trial_days_remaining:0})}finally{s(!1)}},[n==null?void 0:n.id]);y.useEffect(()=>{a()},[a]);const c=y.useCallback(async()=>{if(!(n!=null&&n.id))throw new Error("You must be signed in to start a trial");const{data:u,error:d}=await _e.functions.invoke("create-module-subscription",{body:{module_name:Fh,success_url:`${window.location.origin}/projects?trial=started`,cancel_url:`${window.location.origin}/projects?canceled=true`}});if(d)throw d;return await a(),u},[n==null?void 0:n.id,a]);return{subscription:e,isLoading:r,hasAccess:(e==null?void 0:e.has_access)??!1,isTrialing:(e==null?void 0:e.is_trialing)??!1,trialDaysRemaining:(e==null?void 0:e.trial_days_remaining)??0,error:i,startTrial:c,refreshSubscription:a}}var Ir=(n=>(n.BasicTransactionTracking="basic_transaction_tracking",n.BasicExpenseCategories="basic_expense_categories",n.BasicTaxDeductions="basic_tax_deductions",n.StandardReports="standard_reports",n.BankAccountConnection="bank_account_connection",n.MonthlyReports="monthly_reports",n.EmailSupport="email_support",n.DataExportBasic="data_export_basic",n.AIDeductionSuggestions="ai_deduction_suggestions",n.ReceiptScanning="receipt_scanning",n.AdvancedTaxSavingsAnalysis="advanced_tax_savings_analysis",n.CategoryAutomation="category_automation",n.ForecastingTools="forecasting_tools",n.PriorityEmailSupport="priority_email_support",n.MileageTracking="mileage_tracking",n.TaxStrategyPlanning="tax_strategy_planning",n.UnlimitedConsultations="unlimited_consultations",n.PrioritySupport="priority_support",n.CustomReports="custom_reports",n.DataExport="data_export",n.DedicatedAccountManager="dedicated_account_manager",n))(Ir||{});const lr=["basic_transaction_tracking","basic_expense_categories","basic_tax_deductions","standard_reports"],Nl=[...lr,"bank_account_connection","monthly_reports","email_support","data_export_basic"],Qn=[...Nl,"ai_deduction_suggestions","receipt_scanning","advanced_tax_savings_analysis","category_automation","forecasting_tools","priority_email_support","mileage_tracking"],$h=[...Qn,"tax_strategy_planning","unlimited_consultations","priority_support","custom_reports","data_export","dedicated_account_manager"],ln={free:lr,basic:lr,"basic analysis":lr,trial:Qn,trialing:Qn,starter:Nl,"starter plan":Nl,professional:Qn,premium:Qn,"professional plan":Qn,enterprise:$h,"enterprise plan":$h,pending:Qn,active:[],canceling:[]};function Fv(){const{status:n,isLoading:e,isSubscribed:t,isTrialActive:r,hasPendingSubscription:s,trialDaysRemaining:i}=Mv(),{user:o}=Dt(),{isAdmin:a,isLoading:c}=Lv(),{isTrialExpired:u,hasValidAccess:d}=CC(),{hasAccess:f}=AC(),p=t||r||s||f,v=(n==null?void 0:n.plan)||null,b=a||(o==null?void 0:o.email)==="[email protected]",m=(v==null?void 0:v.toLowerCase().includes("enterprise"))||b;b&&console.log("🔐 Admin bypass active for user:",o==null?void 0:o.email,{isAdminSecure:a,emailMatch:(o==null?void 0:o.email)==="[email protected]"});const g=b||d&&(p||i>0);return{canAccess:y.useCallback(E=>{var P,C;if(console.log("useFeatureAccess.canAccess called for feature:",E,{isAdminSecure:a,isAdminUser:b,user:o==null?void 0:o.email,isLoading:e,isTrialActive:n==null?void 0:n.trial_active,isSubscribed:n==null?void 0:n.subscribed,hasPendingSubscription:s,isTrialExpired:u,hasValidAccess:g,status:n==null?void 0:n.status,plan:n==null?void 0:n.plan,isEnterprise:m,trialDaysRemaining:i}),b)return console.log("✅ ADMIN BYPASS: Granting full access to",o==null?void 0:o.email,"for feature:",E),!0;if(f&&Qn.includes(E))return!0;if(lr.includes(E))return console.log("Feature is a Basic Analysis feature, granting unrestricted access"),!0;if(e)return console.log("Loading status, temporarily granting access to Basic Analysis features"),lr.includes(E);if(u&&!t&&!s)return console.log("Trial expired and no subscription, denying access to premium features"),lr.includes(E);if(s&&!u)return console.log("User has pending subscription, granting access to Professional features",{feature:E,hasAccess:ln.pending.includes(E)}),ln.pending.includes(E);if(n!=null&&n.trial_active&&i>0)return console.log("User is in valid trial, checking trial features",{feature:E,trialDaysRemaining:i,hasAccess:ln.trialing.includes(E)}),ln.trialing.includes(E);if(n!=null&&n.subscribed){let O=(n.plan||"professional").toLowerCase();console.log("User is subscribed with plan:",O),(!ln[O]||ln[O].length===0)&&(O="professional",console.log("No features found for plan, defaulting to professional features"));const N=((P=ln[O])==null?void 0:P.includes(E))||!1;return console.log(`Feature ${E} access check for ${O} plan:`,N),N}if((n==null?void 0:n.status)==="canceling"||(n==null?void 0:n.status)==="past_due"){let O=(n.plan||"professional").toLowerCase();console.log("User has canceling/past_due subscription with plan:",O),(!ln[O]||ln[O].length===0)&&(O="professional");const N=((C=ln[O])==null?void 0:C.includes(E))||!1;return console.log(`Feature ${E} access check for ${O} plan (canceling/past_due):`,N),N}return console.log(`Feature ${E} access check - falling back to Basic Analysis features`),lr.includes(E)},[n,e,a,o==null?void 0:o.email,b,s,u,t,i,f]),isSubscribed:t,isTrialing:r&&!u,hasAnySubscription:p,isLoading:e,subscriptionPlan:v,isPending:s,isTrialExpired:u,hasValidAccess:g,hasFreeAccess:!0,isEnterprise:m,trialDaysRemaining:i||0}}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Ls;
357(function(n){n.Unimplemented="UNIMPLEMENTED",n.Unavailable="UNAVAILABLE"})(Ls||(Ls={}));class Mc extends Error{constructor(e,t,r){super(e),this.message=e,this.code=t,this.data=r}}const PC=n=>{var e,t;return n!=null&&n.androidBridge?"android":!((t=(e=n==null?void 0:n.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||t===void 0)&&t.bridge?"ios":"web"},jC=n=>{const e=n.CapacitorCustomPlatform||null,t=n.Capacitor||{},r=t.Plugins=t.Plugins||{},s=()=>e!==null?e.name:PC(n),i=()=>s()!=="web",o=f=>{const p=u.get(f);return!!(p!=null&&p.platforms.has(s())||a(f))},a=f=>{var p;return(p=t.PluginHeaders)===null||p===void 0?void 0:p.find(v=>v.name===f)},c=f=>n.console.error(f),u=new Map,d=(f,p={})=>{const v=u.get(f);if(v)return console.warn(`Capacitor plugin "${f}" already registered. Cannot register plugins twice.`),v.proxy;const b=s(),m=a(f);let g;const x=async()=>(!g&&b in p?g=typeof p[b]=="function"?g=await p[b]():g=p[b]:e!==null&&!g&&"web"in p&&(g=typeof p.web=="function"?g=await p.web():g=p.web),g),S=(D,R)=>{var F,A;if(m){const I=m==null?void 0:m.methods.find(z=>R===z.name);if(I)return I.rtype==="promise"?z=>t.nativePromise(f,R.toString(),z):(z,$)=>t.nativeCallback(f,R.toString(),z,$);if(D)return(F=D[R])===null||F===void 0?void 0:F.bind(D)}else{if(D)return(A=D[R])===null||A===void 0?void 0:A.bind(D);throw new Mc(`"${f}" plugin is not implemented on ${b}`,Ls.Unimplemented)}},E=D=>{let R;const F=(...A)=>{const I=x().then(z=>{const $=S(z,D);if($){const ee=$(...A);return R=ee==null?void 0:ee.remove,ee}else throw new Mc(`"${f}.${D}()" is not implemented on ${b}`,Ls.Unimplemented)});return D==="addListener"&&(I.remove=async()=>R()),I};return F.toString=()=>`${D.toString()}() { [capacitor code] }`,Object.defineProperty(F,"name",{value:D,writable:!1,configurable:!1}),F},P=E("addListener"),C=E("removeListener"),O=(D,R)=>{const F=P({eventName:D},R),A=async()=>{const z=await F;C({eventName:D,callbackId:z},R)},I=new Promise(z=>F.then(()=>z({remove:A})));return I.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await A()},I},N=new Proxy({},{get(D,R){switch(R){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return m?O:P;case"removeListener":return C;default:return E(R)}}});return r[f]=N,u.set(f,{name:f,proxy:N,platforms:new Set([...Object.keys(p),...m?[b]:[]])}),N};return t.convertFileSrc||(t.convertFileSrc=f=>f),t.getPlatform=s,t.handleError=c,t.isNativePlatform=i,t.isPluginAvailable=o,t.registerPlugin=d,t.Exception=Mc,t.DEBUG=!!t.DEBUG,t.isLoggingEnabled=!!t.isLoggingEnabled,t},OC=n=>n.Capacitor=jC(n),bs=OC(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Ys=bs.registerPlugin;class $v{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,t){let r=!1;this.listeners[e]||(this.listeners[e]=[],r=!0),this.listeners[e].push(t);const i=this.windowListeners[e];i&&!i.registered&&this.addWindowListener(i),r&&this.sendRetainedArgumentsForEvent(e);const o=async()=>this.removeListener(e,t);return Promise.resolve({remove:o})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t,r){const s=this.listeners[e];if(!s){if(r){let i=this.retainedEventArguments[e];i||(i=[]),i.push(t),this.retainedEventArguments[e]=i}return}s.forEach(i=>i(t))}hasListeners(e){var t;return!!(!((t=this.listeners[e])===null||t===void 0)&&t.length)}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:r=>{this.notifyListeners(t,r)}}}unimplemented(e="not implemented"){return new bs.Exception(e,Ls.Unimplemented)}unavailable(e="not available"){return new bs.Exception(e,Ls.Unavailable)}async removeListener(e,t){const r=this.listeners[e];if(!r)return;const s=r.indexOf(t);this.listeners[e].splice(s,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const t=this.retainedEventArguments[e];t&&(delete this.retainedEventArguments[e],t.forEach(r=>{this.notifyListeners(e,r)}))}}const Uh=n=>
357encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),zh=n=>n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class RC extends $v{async getCookies(){const e=document.cookie,t={};return e.split(";").forEach(r=>{if(r.length<=0)return;let[s,i]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");s=zh(s).trim(),i=zh(i).trim(),t[s]=i}),t}async setCookie(e){try{const t=Uh(e.key),r=Uh(e.value),s=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),o=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${r||""}${s}; path=${i}; ${o};`}catch(t){return Promise.reject(t)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}Ys("CapacitorCookies",{web:()=>new RC});const IC=async n=>new Promise((e,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;e(s.indexOf(",")>=0?s.split(",")[1]:s)},r.onerror=s=>t(s),r.readAsDataURL(n)}),NC=(n={})=>{const e=Object.keys(n);return Object.keys(n).map(s=>s.toLocaleLowerCase()).reduce((s,i,o)=>(s[i]=n[e[o]],s),{})},DC=(n,e=!0)=>n?Object.entries(n).reduce((r,s)=>{const[i,o]=s;let a,c;return Array.isArray(o)?(c="",o.forEach(u=>{a=e?encodeURIComponent(u):u,c+=`${i}=${a}&`}),c.slice(0,-1)):(a=e?encodeURIComponent(o):o,c=`${i}=${a}`),`${r}&${c}`},"").substr(1):null,MC=(n,e={})=>{const t=Object.assign({method:n.method||"GET",headers:n.headers},e),s=NC(n.headers)["content-type"]||"";
357if(typeof n.data=="string")t.body=n.data;else if(s.includes("application/x-www-form-urlencoded")){const i=new URLSearchParams;for(const[o,a]of Object.entries(n.data||{}))i.set(o,a);t.body=i.toString()}else if(s.includes("multipart/form-data")||n.data instanceof FormData){const i=new FormData;if(n.data instanceof FormData)n.data.forEach((a,c)=>{i.append(c,a)});else for(const a of Object.keys(n.data))i.append(a,n.data[a]);t.body=i;const o=new Headers(t.headers);o.delete("content-type"),t.headers=o}else(s.includes("application/json")||typeof n.data=="object")&&(t.body=JSON.stringify(n.data));return t};class LC extends $v{async request(e){const t=MC(e,e.webFetchExtra),r=DC(e.params,e.shouldEncodeUrlParams),s=r?`${e.url}?${r}`:e.url,i=await fetch(s,t),o=i.headers.get("content-type")||"";let{responseType:a="text"}=i.ok?e:{};o.includes("application/json")&&(a="json");let c,u;switch(a){case"arraybuffer":case"blob":u=await i.blob(),c=await IC(u);break;case"json":c=await i.json();break;case"document":case"text":default:c=await i.text()}const d={};return i.headers.forEach((f,p)=>{d[p]=f}),{data:c,headers:d,status:i.status,url:i.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}Ys("CapacitorHttp",{web:()=>new LC});const id=()=>{const[n,e]=y.useState({isNative:!1,isIOS:!1,isAndroid:!1,isWeb:!0,platform:"web"});return y.useEffect(()=>{const t=bs.isNativePlatform(),r=bs.getPlatform(),s=(bs.isPluginAvailable("Device"),void 0);e({isNative:t,isIOS:r==="ios",isAndroid:r==="android",isWeb:r==="web",platform:r,version:s}),console.log("Platform detected:",{platform:r,isNative:t,userAgent:navigator.userAgent})},[]),n},Dl=({children:n,className:e="",mobilePadding:t="px-4 py-3",desktopPadding:r="px-6 py-4"})=>{const s=Ha();return l.jsx("div",{className:`w-full max-w-full overflow-hidden ${s?t:r} ${e}`,children:n})},FC=({children:n,title:e,showBackButton:t=!1,onBack:r,className:s,headerContent:i})=>{const o=Ha(),{isNative:a,isIOS:c}=id();return l.jsxs("div",{className:re("min-h-screen bg-background",a&&c&&"safe-area-inset-top",s),children:[o&&e&&l.jsx("div",{className:"sticky top-0 z-40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border-b",children:l.jsxs("div",{className:"flex items-center h-14 px-4",children:[t&&l.jsx("button",{onClick:r,className:"mr-4 p-2 -ml-2 rounded-full hover:bg-muted transition-colors",children:l.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),l.jsx("h1",{className:"text-lg font-semibold flex-1 truncate",children:e}),i&&l.jsx("div",{className:"ml-4",children:i})]})}),l.jsx("div",{className:re(o&&a?"pb-20":"","flex-1"),children:o?l.jsx("div",{className:"px-4 py-4",children:n}):l.jsx(Dl,{children:n})})]})},ws=({className:n,size:e="md",variant:t="default"})=>{const r={sm:"text-xl",md:"text-2xl",lg:"text-3xl"},s={sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12"};return l.jsxs("div",{className:re("flex items-center",n),children:[t==="default"&&l.jsx("div",{className:"mr-2 flex items-center justify-center",children:l.jsx("img",{src:"/lovable-uploads/356ba6e2-76b1-4602-b628-d193db8e9a6a.png",alt:"The Gazel Logo",className:re(s[e],"object-contain")})}),l.jsx("div",{className:"font-extrabold tracking-tight",children:l.jsxs("span",{className:re(r[e]),children:["The ",l.jsx("span",{className:"text-primary italic",children:"Gazel"})]})})]})},$C=["top","right","bottom","left"],pr=Math.min,Ot=Math.max,ta=Math.round,xo=Math.floor,mr=n=>({x:n,y:n}),UC={left:"right",right:"left",bottom:"top",top:"bottom"},zC={start:"end",end:"start"};function Ml(n,e,t){return Ot(n,pr(e,t))}function Fn(n,e){return typeof n=="function"?n(e):n}function $n(n){return n.split("-")[0]}function Ks(n){return n.split("-")[1]}function od(n){return n==="x"?"y":"x"}function ad(n){return n==="y"?"height":"width"}function gr(n){return["top","bottom"].includes($n(n))?"y":"x"}function cd(n){return od(gr(n))}function VC(n,e,t){t===void 0&&(t=!1);const r=Ks(n),s=cd(n),i=ad(s);let o=s==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=na(o)),[o,na(o)]}function BC(n){const e=na(n);return[Ll(n),e,Ll(e)]}function Ll(n){return n.replace(/start|end/g,e=>zC[e])}function qC(n,e,t){const r=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(n){case"top":case"bottom":return t?e?s:r:e?r:s;case"left":case"right":return e?i:o;default:return[]}}function GC(n,e,t,r){const s=Ks(n);let i=qC($n(n),t==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Ll)))),i}function na(n){return n.replace(/left|right|bottom|top/g,e=>UC[e])}function HC(n){return{top:0,right:0,bottom:0,left:0,...n}}function Uv(n){return typeof n!="number"?HC(n):{top:n,right:n,bottom:n,left:n}}function ra(n){const{x:e,y:t,width:r,height:s}=n;return{width:r,height:s,top:t,left:e,right:e+r,bottom:t+s,x:e,y:t}}function Vh(n,e,t){let{reference:r,floating:s}=n;const i=gr(e),o=cd(e),a=ad(o),c=$n(e),u=i==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,p=r[a]/2-s[a]/2;let v;switch(c){case"top":v={x:d,y:r.y-s.height};break;case"bottom":v={x:d,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:f};break;case"left":v={x:r.x-s.width,y:f};break;default:v={x:r.x,y:r.y}}switch(Ks(e)){case"start":v[o]-=p*(t&&u?-1:1);break;case"end":v[o]+=p*(t&&u?-1:1);break}return v}const WC=async(n,e,t)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}
vendor: 6,952 bytes, line 357
357=t,a=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:n,floating:e,strategy:s}),{x:d,y:f}=Vh(u,r,c),p=r,v={},b=0;for(let m=0;m<a.length;m++){const{name:g,fn:x}=a[m],{x:S,y:E,data:P,reset:C}=await x({x:d,y:f,initialPlacement:r,placement:p,strategy:s,middlewareData:v,rects:u,platform:o,elements:{reference:n,floating:e}});d=S??d,f=E??f,v={...v,[g]:{...v[g],...P}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:n,floating:e,strategy:s}):C.rects),{x:d,y:f}=Vh(u,p,c)),m=-1)}return{x:d,y:f,placement:p,strategy:s,middlewareData:v}};async function Ni(n,e){var t;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:c}=n,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:v=0}=Fn(e,n),b=Uv(v),g=a[p?f==="floating"?"reference":"floating":f],x=ra(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(g)))==null||t?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),S=f==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),P=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},C=ra(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:E,strategy:c}):S);return{top:(x.top-C.top+b.top)/P.y,bottom:(C.bottom-x.bottom+b.bottom)/P.y,left:(x.left-C.left+b.left)/P.x,right:(C.right-x.right+b.right)/P.x}}const JC=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:c}=e,{element:u,padding:d=0}=Fn(n,e)||{};if(u==null)return{};const f=Uv(d),p={x:t,y:r},v=cd(s),b=ad(v),m=await o.getDimensions(u),g=v==="y",x=g?"top":"left",S=g?"bottom":"right",E=g?"clientHeight":"clientWidth",P=i.reference[b]+i.reference[v]-p[v]-i.floating[b],C=p[v]-i.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let N=O?O[E]:0;(!N||!await(o.isElement==null?void 0:o.isElement(O)))&&(N=a.floating[E]||i.floating[b]);const D=P/2-C/2,R=N/2-m[b]/2-1,F=pr(f[x],R),A=pr(f[S],R),I=F,z=N-m[b]-A,$=N/2-m[b]/2+D,ee=Ml(I,$,z),K=!c.arrow&&Ks(s)!=null&&$!==ee&&i.reference[b]/2-($<I?F:A)-m[b]/2<0,se=K?$<I?$-I:$-z:0;return{[v]:p[v]+se,data:{[v]:ee,centerOffset:$-ee-se,...K&&{alignmentOffset:se}},reset:K}}}),YC=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...g}=Fn(n,e);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const x=$n(s),S=gr(a),E=$n(a)===a,P=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=p||(E||!m?[na(a)]:BC(a)),O=b!=="none";!p&&O&&C.push(...GC(a,m,b,P));const N=[a,...C],D=await Ni(e,g),R=[];let F=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&R.push(D[x]),f){const $=VC(s,o,P);R.push(D[$[0]],D[$[1]])}if(F=[...F,{placement:s,overflows:R}],!R.every($=>$<=0)){var A,I;const $=(((A=i.flip)==null?void 0:A.index)||0)+1,ee=N[$];if(ee)return{data:{index:$,overflows:F},reset:{placement:ee}};let K=(I=F.filter(se=>se.overflows[0]<=0).sort((se,G)=>se.overflows[1]-G.overflows[1])[0])==null?void 0:I.placement;if(!K)switch(v){case"bestFit":{var z;const se=(z=F.filter(G=>{if(O){const q=gr(G.placement);return q===S||q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(q=>q>0).reduce((q,te)=>q+te,0)]).sort((G,q)=>G[1]-q[1])[0])==null?void 0:z[0];se&&(K=se);break}case"initialPlacement":K=a;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function Bh(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function qh(n){return $C.some(e=>n[e]>=0)}const KC=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...s}=Fn(n,e);switch(r){case"referenceHidden":{const i=await Ni(e,{...s,elementContext:"reference"}),o=Bh(i,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:qh(o)}}}case"escaped":{const i=await Ni(e,{...s,altBoundary:!0}),o=Bh(i,t.floating);return{data:{escapedOffsets:o,escaped:qh(o)}}}default:return{}}}}};async function QC(n,e){const{placement:t,platform:r,elements:s}=n,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=$n(t),a=Ks(t),c=gr(t)==="y",u=["left","top"].includes(o)?-1:1,d=i&&c?-1:1,f=Fn(e,n);let{mainAxis:p,crossAxis:v,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof b=="number"&&(v=a==="end"?b*-1:b),c?{x:v*d,y:p*u}:{x:p*u,y:v*d}}const XC=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:s,y:i,placement:o,middlewareData:a}=e,c=await QC(e,n);return o===((t=a.offset)==null?void 0:t.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},ZC=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x,y:S}=g;return{x,y:S}}},...c}=Fn(n,e),u={x:t,y:r},d=await Ni(e,c),f=gr($n(s)),p=od(f);let v=u[p],b=u[f];if(i){const g=p==="y"?"top":"left",x=p==="y"?"bottom":"right",S=v+d[g],E=v-d[x];v=Ml(S,v,E)}if(o){const g=f==="y"?"top":"left",x=f==="y"?"bottom":"right",S=b+d[g],E=b-d[x];b=Ml(S,b,E)}const m=a.fn({...e,[p]:v,[f]:b});return{...m,data:{x:m.x-t,y:m.y-r,enabled:{[p]:i,[f]:o}}}}}},e1=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:r,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Fn(n,e),d={x:t,y:r},f=gr(s),p=od(f);let v=d[p],b=d[f];const m=Fn(a,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const E=p==="y"?"height":"width",P=i.reference[p]-i.floating[E]+g.mainAxis,C=i.reference[p]+i.reference[E]-g.mainAxis;v<P?v=P:v>C&&(v=C)}if(u){var x,S;const E=p==="y"?"width":"height",P=["top","left"].includes($n(s)),C=i.reference[f]-i.floating[E]+(P&&((x=o.offset)==null?void 0:x[f])||0)+(P?0:g.crossAxis),O=i.reference[f]+i.reference[E]+(P?0:((S=o.offset)==null?void 0:S[f])||0)-(P?g.crossAxis:0);b<C?b=C:b>O&&(b=O)}return{[p]:v,[f]:b}}}},t1=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,r;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:c=()=>{},...u}=Fn(n,e),d=await Ni(e,u),f=$n(s),p=Ks(s),v=gr(s)==="y",{width:b,height:m}=i.floating;let g,x;f==="top"||f==="bottom"?(g=f,x=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,g
vendor: 3,491 bytes, line 357
357=p==="end"?"top":"bottom");const S=m-d.top-d.bottom,E=b-d.left-d.right,P=pr(m-d[g],S),C=pr(b-d[x],E),O=!e.middlewareData.shift;let N=P,D=C;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(D=E),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(N=S),O&&!p){const F=Ot(d.left,0),A=Ot(d.right,0),I=Ot(d.top,0),z=Ot(d.bottom,0);v?D=b-2*(F!==0||A!==0?F+A:Ot(d.left,d.right)):N=m-2*(I!==0||z!==0?I+z:Ot(d.top,d.bottom))}await c({...e,availableWidth:D,availableHeight:N});const R=await o.getDimensions(a.floating);return b!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Wa(){return typeof window<"u"}function Qs(n){return zv(n)?(n.nodeName||"").toLowerCase():"#document"}function It(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function xn(n){var e;return(e=(zv(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function zv(n){return Wa()?n instanceof Node||n instanceof It(n).Node:!1}function sn(n){return Wa()?n instanceof Element||n instanceof It(n).Element:!1}function wn(n){return Wa()?n instanceof HTMLElement||n instanceof It(n).HTMLElement:!1}function Gh(n){return!Wa()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof It(n).ShadowRoot}function Xi(n){const{overflow:e,overflowX:t,overflowY:r,display:s}=on(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(s)}function n1(n){return["table","td","th"].includes(Qs(n))}function Ja(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function ld(n){const e=ud(),t=sn(n)?on(n):n;return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function r1(n){let e=vr(n);for(;wn(e)&&!Fs(e);){if(ld(e))return e;if(Ja(e))return null;e=vr(e)}return null}function ud(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fs(n){return["html","body","#document"].includes(Qs(n))}function on(n){return It(n).getComputedStyle(n)}function Ya(n){return sn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function vr(n){if(Qs(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Gh(n)&&n.host||xn(n);return Gh(e)?e.host:e}function Vv(n){const e=vr(n);return Fs(e)?n.ownerDocument?n.ownerDocument.body:n.body:wn(e)&&Xi(e)?e:Vv(e)}function Di(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const s=Vv(n),i=s===((r=n.ownerDocument)==null?void 0:r.body),o=It(s);if(i){const a=Fl(o);return e.concat(o,o.visualViewport||[],Xi(s)?s:[],a&&t?Di(a):[])}return e.concat(s,Di(s,[],t))}function Fl(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Bv(n){const e=on(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=wn(n),i=s?n.offsetWidth:t,o=s?n.offsetHeight:r,a=ta(t)!==i||ta(r)!==o;return a&&(t=i,r=o),{width:t,height:r,$:a}}function dd(n){return sn(n)?n:n.contextElement}function xs(n){const e=dd(n);if(!wn(e))return mr(1);const t=e.getBoundingClientRect(),{width:r,height:s,$:i}=Bv(e);let o=(i?ta(t.width):t.width)/r,a=(i?ta(t.height):t.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const s1=mr(0);function qv(n){const e=It(n);
vendor: 4,791 bytes, line 357
357return!ud()||!e.visualViewport?s1:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function i1(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==It(n)?!1:e}function Hr(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const s=n.getBoundingClientRect(),i=dd(n);let o=mr(1);e&&(r?sn(r)&&(o=xs(r)):o=xs(n));const a=i1(i,t,r)?qv(i):mr(0);let c=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(i){const p=It(i),v=r&&sn(r)?It(r):r;let b=p,m=Fl(b);for(;m&&r&&v!==b;){const g=xs(m),x=m.getBoundingClientRect(),S=on(m),E=x.left+(m.clientLeft+parseFloat(S.paddingLeft))*g.x,P=x.top+(m.clientTop+parseFloat(S.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,f*=g.y,c+=E,u+=P,b=It(m),m=Fl(b)}}return ra({width:d,height:f,x:c,y:u})}function o1(n){let{elements:e,rect:t,offsetParent:r,strategy:s}=n;const i=s==="fixed",o=xn(r),a=e?Ja(e.floating):!1;if(r===o||a&&i)return t;let c={scrollLeft:0,scrollTop:0},u=mr(1);const d=mr(0),f=wn(r);if((f||!f&&!i)&&((Qs(r)!=="body"||Xi(o))&&(c=Ya(r)),wn(r))){const p=Hr(r);u=xs(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+d.x,y:t.y*u.y-c.scrollTop*u.y+d.y}}function a1(n){return Array.from(n.getClientRects())}function $l(n,e){const t=Ya(n).scrollLeft;return e?e.left+t:Hr(xn(n)).left+t}function c1(n){const e=xn(n),t=Ya(n),r=n.ownerDocument.body,s=Ot(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Ot(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-t.scrollLeft+$l(n);const a=-t.scrollTop;return on(r).direction==="rtl"&&(o+=Ot(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function l1(n,e){const t=It(n),r=xn(n),s=t.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;const u=ud();(!u||u&&e==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a,y:c}}function u1(n,e){const t=Hr(n,!0,e==="fixed"),r=t.top+n.clientTop,s=t.left+n.clientLeft,i=wn(n)?xs(n):mr(1),o=n.clientWidth*i.x,a=n.clientHeight*i.y,c=s*i.x,u=r*i.y;return{width:o,height:a,x:c,y:u}}function Hh(n,e,t){let r;if(e==="viewport")r=l1(n,t);else if(e==="document")r=c1(xn(n));else if(sn(e))r=u1(e,t);else{const s=qv(n);r={...e,x:e.x-s.x,y:e.y-s.y}}return ra(r)}function Gv(n,e){const t=vr(n);return t===e||!sn(t)||Fs(t)?!1:on(t).position==="fixed"||Gv(t,e)}function d1(n,e){const t=e.get(n);if(t)return t;let r=Di(n,[],!1).filter(a=>sn(a)&&Qs(a)!=="body"),s=null;const i=on(n).position==="fixed";let o=i?vr(n):n;for(;sn(o)&&!Fs(o);){const a=on(o),c=ld(o);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Xi(o)&&!c&&Gv(n,o))?r=r.filter(d=>d!==o):s=a,o=vr(o)}return e.set(n,r),r}function h1(n){let{element:e,boundary:t,rootBoundary:r,strategy:s}=n;const o=[...t==="clippingAncestors"?Ja(e)?[]:d1(e,this._c):[].concat(t),r],a=o[0],c=o.reduce((u,d)=>{const f=Hh(e,d,s);return u.top=Ot(f.top,u.top),u.right=pr(f.right,u.right),u.bottom=pr(f.bottom,u.bottom),u.left=Ot(f.left,u.left),u},Hh(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function f1(n){const{width:e,height:t}=Bv(n);return{width:e,height:t}}function p1(n,e,t){const r=wn(e),s=xn(e),i=t==="fixed",o=Hr(n,!0,i,e);let a={scrollLeft:0,scrollTop:0};const c=mr(0);if(r||!r&&!i)if((Qs(e)!=="body"||Xi(s))&&(a=Ya(e)),r){const v=Hr(e,!0,i,e);c.x=v.x+e.clientLeft,c.y=v.y+e.clientTop}else s&&(c.x=$l(s));let u=0,d=0;if(s&&!r&&!i){const v=s.getBoundingClientRect();d=v.top+a.scrollTop,u=v.left+a.scrollLeft-$l(s,v)}const f=o.left+a.scrollLeft-c.x-u,p=o.top+a.scrollTop-c.y-d;return{x:f,y:p,width:o.width,height:o.height}}function Lc(n){return on(n).position==="static"}function Wh(n,e){if(!wn(n)||on(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return xn(n)===t&&(t=t.ownerDocument.body),t}function Hv(n,e){const t=It(n);if(Ja(n))return t;if(!wn(n)){let s=vr(n);for(;s&&!Fs(s);){if(sn(s)&&!Lc(s))return s;s=vr(s)}return t}let r=Wh(n,e);for(;r&&n1(r)&&Lc(r);)r=Wh(r,e);return r&&Fs(r)&&Lc(r)&&!ld(r)?t:r||r1(n)||t}const m1=async function(n){const e=this.getOffsetParent||Hv,t=this.getDimensions,r=await t(n.floating);return{reference:p1(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function g1(n){return on(n).direction==="rtl"}const v1={convertOffsetParentRelativeRectToViewportRelativeRect:o1,getDocumentElement:xn,getClippingRect:h1,getOffsetParent:Hv,getElementRects:m1,getClientRects:a1,getDimensions:f1,getScale:xs,isElement:sn,isRTL:g1};function y1(n,e){let t=null,r;const s=xn(n);function i(){var a;clearTimeout(r),(a=t)==null||a.disconnect(),t=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:f,height:p}=n.getBoundingClientRect();if(a||e(),!f||!p)return;
vendor: 27,412 bytes, line 357
357const v=xo(d),b=xo(s.clientWidth-(u+f)),m=xo(s.clientHeight-(d+p)),g=xo(u),S={rootMargin:-v+"px "+-b+"px "+-m+"px "+-g+"px",threshold:Ot(0,pr(1,c))||1};let E=!0;function P(C){const O=C[0].intersectionRatio;if(O!==c){if(!E)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}E=!1}try{t=new IntersectionObserver(P,{...S,root:s.ownerDocument})}catch{t=new IntersectionObserver(P,S)}t.observe(n)}return o(!0),i}function b1(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=dd(n),d=s||i?[...u?Di(u):[],...Di(e)]:[];d.forEach(x=>{s&&x.addEventListener("scroll",t,{passive:!0}),i&&x.addEventListener("resize",t)});const f=u&&a?y1(u,t):null;let p=-1,v=null;o&&(v=new ResizeObserver(x=>{let[S]=x;S&&S.target===u&&v&&(v.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(e)})),t()}),u&&!c&&v.observe(u),v.observe(e));let b,m=c?Hr(n):null;c&&g();function g(){const x=Hr(n);m&&(x.x!==m.x||x.y!==m.y||x.width!==m.width||x.height!==m.height)&&t(),m=x,b=requestAnimationFrame(g)}return t(),()=>{var x;d.forEach(S=>{s&&S.removeEventListener("scroll",t),i&&S.removeEventListener("resize",t)}),f==null||f(),(x=v)==null||x.disconnect(),v=null,c&&cancelAnimationFrame(b)}}const w1=XC,x1=ZC,_1=YC,S1=t1,E1=KC,Jh=JC,T1=e1,k1=(n,e,t)=>{const r=new Map,s={platform:v1,...t},i={...s.platform,_c:r};return WC(n,e,{...s,platform:i})};var $o=typeof document<"u"?y.useLayoutEffect:y.useEffect;function sa(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,s;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!==0;)if(!sa(n[r],e[r]))return!1;return!0}if(s=Object.keys(n),t=s.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=t;r--!==0;){const i=s[r];if(!(i==="_owner"&&n.$$typeof)&&!sa(n[i],e[i]))return!1}return!0}return n!==n&&e!==e}function Wv(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Yh(n,e){const t=Wv(n);return Math.round(e*t)/t}function Fc(n){const e=y.useRef(n);return $o(()=>{e.current=n}),e}function C1(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:c,open:u}=n,[d,f]=y.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[p,v]=y.useState(r);sa(p,r)||v(r);const[b,m]=y.useState(null),[g,x]=y.useState(null),S=y.useCallback(G=>{G!==O.current&&(O.current=G,m(G))},[]),E=y.useCallback(G=>{G!==N.current&&(N.current=G,x(G))},[]),P=i||b,C=o||g,O=y.useRef(null),N=y.useRef(null),D=y.useRef(d),R=c!=null,F=Fc(c),A=Fc(s),I=Fc(u),z=y.useCallback(()=>{if(!O.current||!N.current)return;const G={placement:e,strategy:t,middleware:p};A.current&&(G.platform=A.current),k1(O.current,N.current,G).then(q=>{const te={...q,isPositioned:I.current!==!1};$.current&&!sa(D.current,te)&&(D.current=te,Hi.flushSync(()=>{f(te)}))})},[p,e,t,A,I]);$o(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[u]);const $=y.useRef(!1);$o(()=>($.current=!0,()=>{$.current=!1}),[]),$o(()=>{if(P&&(O.current=P),C&&(N.current=C),P&&C){if(F.current)return F.current(P,C,z);z()}},[P,C,z,F,R]);const ee=y.useMemo(()=>({reference:O,floating:N,setReference:S,setFloating:E}),[S,E]),K=y.useMemo(()=>({reference:P,floating:C}),[P,C]),se=y.useMemo(()=>{const G={position:t,left:0,top:0};if(!K.floating)return G;const q=Yh(K.floating,d.x),te=Yh(K.floating,d.y);return a?{...G,transform:"translate("+q+"px, "+te+"px)",...Wv(K.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:q,top:te}},[t,a,K.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:z,refs:ee,elements:K,floatingStyles:se}),[d,z,ee,K,se])}const A1=n=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:r,padding:s}=typeof n=="function"?n(t):n;return r&&e(r)?r.current!=null?Jh({element:r.current,padding:s}).fn(t):{}:r?Jh({element:r,padding:s}).fn(t):{}}}},P1=(n,e)=>({...w1(n),options:[n,e]}),j1=(n,e)=>({...x1(n),options:[n,e]}),O1=(n,e)=>({...T1(n),options:[n,e]}),R1=(n,e)=>({..._1(n),options:[n,e]}),I1=(n,e)=>({...S1(n),options:[n,e]}),N1=(n,e)=>({...E1(n),options:[n,e]}),D1=(n,e)=>({...A1(n),options:[n,e]});var M1="Arrow",Jv=y.forwardRef((n,e)=>{const{children:t,width:r=10,height:s=5,...i}=n;return l.jsx(Ce.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?t:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Jv.displayName=M1;var L1=Jv;function F1(n,e=[]){let t=[];function r(i,o){const a=y.createContext(o),c=t.length;t=[...t,o];function u(f){const{scope:p,children:v,...b}=f,m=(p==null?void 0:p[n][c])||a,g=y.useMemo(()=>b,Object.values(b));return l.jsx(m.Provider,{value:g,children:v})}function d(f,p){const v=(p==null?void 0:p[n][c])||a,b=y.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const s=()=>{const i=t.map(o=>y.createContext(o));return function(a){const c=(a==null?void 0:a[n])||i;return y.useMemo(()=>({[`__scope${n}`]:{...a,[n]:c}}),[a,c])}};return s.scopeName=n,[r,$1(s,...e)]}function $1(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...a,...f}},{});return y.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function U1(n){const[e,t]=y.useState(void 0);return Nt(()=>{if(n){t({width:n.offsetWidth,height:n.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,a=u.blockSize}else o=n.offsetWidth,a=n.offsetHeight;t({width:o,height:a})});return r.observe(n,{box:"border-box"}),()=>r.unobserve(n)}else t(void 0)},[n]),e}var hd="Popper",[Yv,Ka]=F1(hd),[z1,Kv]=Yv(hd),Qv=n=>{const{__scopePopper:e,children:t}=n,[r,s]=y.useState(null);return l.jsx(z1,{scope:e,anchor:r,onAnchorChange:s,children:t})};Qv.displayName=hd;var Xv="PopperAnchor",Zv=y.forwardRef((n,e)=>{const{__scopePopper:t,virtualRef:r,...s}=n,i=Kv(Xv,t),o=y.useRef(null),a=He(e,o);return y.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:l.jsx(Ce.div,{...s,ref:a})});Zv.displayName=Xv;var fd="PopperContent",[V1,B1]=Yv(fd),ey=y.forwardRef((n,e)=>{var k,j,M,L,B,X;const{__scopePopper:t,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:v="optimized",onPlaced:b,...m}=n,g=Kv(fd,t),[x,S]=y.useState(null),E=He(e,ue=>S(ue)),[P,C]=y.useState(null),O=U1(P),N=(O==null?void 0:O.width)??0,D=(O==null?void 0:O.height)??0,R=r+(i!=="center"?"-"+i:""),F=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},A=Array.isArray(u)?u:[u],I=A.length>0,z={padding:F,boundary:A.filter(G1),altBoundary:I},{refs:$,floatingStyles:ee,placement:K,isPositioned:se,middlewareData:G}=C1({strategy:"fixed",placement:R,whileElementsMounted:(...ue)=>b1(...ue,{animationFrame:v==="always"}),elements:{reference:g.anchor},middleware:[P1({mainAxis:s+D,alignmentAxis:o}),c&&j1({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?O1():void 0,...z}),c&&R1({...z}),I1({...z,apply:({elements:ue,rects:Le,availableWidth:Ze,availableHeight:Ke})=>{const{width:je,height:nt}=Le.reference,Fe=ue.floating.style;Fe.setProperty("--radix-popper-available-width",`${Ze}px`),Fe.setProperty("--radix-popper-available-height",`${Ke}px`),Fe.setProperty("--radix-popper-anchor-width",`${je}px`),Fe.setProperty("--radix-popper-anchor-height",`${nt}px`)}}),P&&D1({element:P,padding:a}),H1({arrowWidth:N,arrowHeight:D}),p&&N1({strategy:"referenceHidden",...z})]}),[q,te]=ry(K),Q=mt(b);Nt(()=>{se&&(Q==null||Q())},[se,Q]);const oe=(k=G.arrow)==null?void 0:k.x,h=(j=G.arrow)==null?void 0:j.y,_=((M=G.arrow)==null?void 0:M.centerOffset)!==0,[w,T]=y.useState();return Nt(()=>{x&&T(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:se?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:w,"--radix-popper-transform-origin":[(L=G.transformOrigin)==null?void 0:L.x,(B=G.transformOrigin)==null?void 0:B.y].join(" "),...((X=G.hide)==null?void 0:X.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:l.jsx(V1,{scope:t,placedSide:q,onArrowChange:C,arrowX:oe,arrowY:h,shouldHideArrow:_,children:l.jsx(Ce.div,{"data-side":q,"data-align":te,...m,ref:E,style:{...m.style,animation:se?void 0:"none"}})})})});ey.displayName=fd;var ty="PopperArrow",q1={top:"bottom",right:"left",bottom:"top",left:"right"},ny=y.forwardRef(function(e,t){const{__scopePopper:r,...s}=e,i=B1(ty,r),o=q1[i.placedSide];return l.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:l.jsx(L1,{...s,ref:t,style:{...s.style,display:"block"}})})});ny.displayName=ty;function G1(n){return n!==null}var H1=n=>({name:"transformOrigin",options:n,fn(e){var g,x,S;const{placement:t,rects:r,middlewareData:s}=e,o=((g=s.arrow)==null?void 0:g.centerOffset)!==0,a=o?0:n.arrowWidth,c=o?0:n.arrowHeight,[u,d]=ry(t),f={start:"0%",center:"50%",end:"100%"}[d],p=(((x=s.arrow)==null?void 0:x.x)??0)+a/2,v=(((S=s.arrow)==null?void 0:S.y)??0)+c/2;let b="",m="";return u==="bottom"?(b=o?f:`${p}px`,m=`${-c}px`):u==="top"?(b=o?f:`${p}px`,m=`${r.floating.height+c}px`):u==="right"?(b=`${-c}px`,m=o?f:`${v}px`):u==="left"&&(b=`${r.floating.width+c}px`,m=o?f:`${v}px`),{data:{x:b,y:m}}}});function ry(n){const[e,t="center"]=n.split("-");return[e,t]}var sy=Qv,iy=Zv,oy=ey,ay=ny,Ul=["Enter"," "],W1=["ArrowDown","PageUp","Home"],cy=["ArrowUp","PageDown","End"],J1=[...W1,...cy],Y1={ltr:[...Ul,"ArrowRight"],rtl:[...Ul,"ArrowLeft"]},K1={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zi="Menu",[Mi,Q1,X1]=Fu(Zi),[Zr,ly]=Gi(Zi,[X1,Ka,qm]),Qa=Ka(),uy=qm(),[Z1,es]=Zr(Zi),[eA,eo]=Zr(Zi),dy=n=>{const{__scopeMenu:e,open:t=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=n,a=Qa(e),[c,u]=y.useState(null),d=y.useRef(!1),f=mt(i),p=zu(s);return y.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),l.jsx(sy,{...a,children:l.jsx(Z1,{scope:e,open:t,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(eA,{scope:e,onClose:y.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:o,children:r})})})};dy.displayName=Zi;var tA="MenuAnchor",pd=y.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n,s=Qa(t);return l.jsx(iy,{...s,...r,ref:e})});pd.displayName=tA;var md="MenuPortal",[nA,hy]=Zr(md,{forceMount:void 0}),fy=n=>{const{__scopeMenu:e,forceMount:t,children:r,container:s}=n,i=es(md,e);return l.jsx(nA,{scope:e,forceMount:t,children:l.jsx(Un,{present:t||i.open,children:l.jsx($u,{asChild:!0,container:s,children:r})})})};fy.displayName=md;var qt="MenuContent",[rA,gd]=Zr(qt),py=y.forwardRef((n,e)=>{const t=hy(qt,n.__scopeMenu),{forceMount:r=t.forceMount,...s}=n,i=es(qt,n.__scopeMenu),o=eo(qt,n.__scopeMenu);return l.jsx(Mi.Provider,{scope:n.__scopeMenu,children:l.jsx(Un,{present:r||i.open,children:l.jsx(Mi.Slot,{scope:n.__scopeMenu,children:o.modal?l.jsx(sA,{...s,ref:e}):l.jsx(iA,{...s,ref:e})})})})}),sA=y.forwardRef((n,e)=>{const t=es(qt,n.__scopeMenu),r=y.useRef(null),s=He(e,r);return y.useEffect(()=>{const i=r.current;if(i)return Gm(i)},[]),l.jsx(vd,{...n,ref:s,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:ie(n.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),iA=y.forwardRef((n,e)=>{const t=es(qt,n.__scopeMenu);return l.jsx(vd,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),vd=y.forwardRef((n,e)=>{const{__scopeMenu:t,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:v,disableOutsideScroll:b,...m}=n,g=es(qt,t),x=eo(qt,t),S=Qa(t),E=uy(t),P=Q1(t),[C,O]=y.useState(null),N=y.useRef(null),D=He(e,N,g.onContentChange),R=y.useRef(0),F=y.useRef(""),A=y.useRef(0),I=y.useRef(null),z=y.useRef("right"),$=y.useRef(0),ee=b?Km:y.Fragment,K=b?{as:Uu,allowPinchZoom:!0}:void 0,se=q=>{var k,j;const te=F.current+q,Q=P().filter(M=>!M.disabled),oe=document.activeElement,h=(k=Q.find(M=>M.ref.current===oe))==null?void 0:k.textValue,_=Q.map(M=>M.textValue),w=vA(_,te,h),T=(j=Q.find(M=>M.textValue===w))==null?void 0:j.ref.current;(function M(L){F.current=L,window.clearTimeout(R.current),L!==""&&(R.current=window.setTimeout(()=>M(""),1e3))})(te),T&&setTimeout(()=>T.focus())};y.useEffect(()=>()=>window.clearTimeout(R.current),[]),Hm();const G=y.useCallback(q=>{var Q,oe;return z.current===((Q=I.current)==null?void 0:Q.side)&&bA(q,(oe=I.current)==null?void 0:oe.area)},[]);return l.jsx(rA,{scope:t,searchRef:F,onItemEnter:y.useCallback(q=>{G(q)&&q.preventDefault()},[G]),onItemLeave:y.useCallback(q=>{var te;G(q)||((te=N.current)==null||te.focus(),O(null))},[G]),onTriggerLeave:y.useCallback(q=>{G(q)&&q.preventDefault()},[G]),pointerGraceTimerRef:A,onPointerGraceIntentChange:y.useCallback(q=>{I.current=q},[]),children:l.jsx(ee,{...K,children:l.jsx(Wm,{asChild:!0,trapped:s,onMountAutoFocus:ie(i,q=>{var te;q.preventDefault(),(te=N.current)==null||te.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:l.jsx(Jm,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:v,children:l.jsx(K0,{asChild:!0,...E,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:O,onEntryFocus:ie(c,q=>{x.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(oy,{role:"menu","aria-orientation":"vertical","data-state":jy(g.open),"data-radix-menu-content":"",dir:x.dir,...S,...m,ref:D,style:{outline:"none",...m.style},onKeyDown:ie(m.onKeyDown,q=>{const Q=q.target.closest("[data-radix-menu-content]")===q.currentTarget,oe=q.ctrlKey||q.altKey||q.metaKey,h=q.key.length===1;Q&&(q.key==="Tab"&&q.preventDefault(),!oe&&h&&se(q.key));const _=N.current;if(q.target!==_||!J1.includes(q.key))return;q.preventDefault();const T=P().filter(k=>!k.disabled).map(k=>k.ref.current);cy.includes(q.key)&&T.reverse(),mA(T)}),onBlur:ie(n.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(R.current),F.current="")}),onPointerMove:ie(n.onPointerMove,Li(q=>{const te=q.target,Q=$.current!==q.clientX;if(q.currentTarget.contains(te)&&Q){const oe=q.clientX>$.current?"right":"left";z.current=oe,$.current=q.clientX}}))})})})})})})});py.displayName=qt;var oA="MenuGroup",yd=y.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n;return l.jsx(Ce.div,{role:"group",...r,ref:e})});yd.displayName=oA;var aA="MenuLabel",my=y.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n;return l.jsx(Ce.div,{...r,ref:e})});my.displayName=aA;var ia="MenuItem",Kh="menu.itemSelect",Xa=y.forwardRef((n,e)=>{const{disabled:t=!1,onSelect:r,...s}=n,i=y.useRef(null),o=eo(ia,n.__scopeMenu),a=gd(ia,n.__scopeMenu),c=He(e,i),u=y.useRef(!1),d=()=>{const f=i.current;if(!t&&f){const p=new CustomEvent(Kh,{bubbles:!0,cancelable:!0});f.addEventListener(Kh,v=>r==null?void 0:r(v),{once:!0}),Bm(f,p),p.defaultPrevented?u.current=!1:o.onClose()}};return l.jsx(gy,{...s,ref:c,disabled:t,onClick:ie(n.onClick,d),onPointerDown:f=>{var p;(p=n.onPointerDown)==null||p.call(n,f),u.current=!0},onPointerUp:ie(n.onPointerUp,f=>{var p;u.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:ie(n.onKeyDown,f=>{const p=a.searchRef.current!=="";t||p&&f.key===" "||Ul.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Xa.displayName=ia;var gy=y.forwardRef((n,e)=>{const{__scopeMenu:t,disabled:r=!1,textValue:s,...i}=n,o=gd(ia,t),a=uy(t),c=y.useRef(null),u=He(e,c),[d,f]=y.useState(!1),[p,v]=y.useState("");return y.useEffect(()=>{const b=c.current;b&&v((b.textContent??"").trim())},[i.children]),l.jsx(Mi.ItemSlot,{scope:t,disabled:r,textValue:s??p,children:l.jsx(Q0,{asChild:!0,...a,focusable:!r,children:l.jsx(Ce.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:ie(n.onPointerMove,Li(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ie(n.onPointerLeave,Li(b=>o.onItemLeave(b))),onFocus:ie(n.onFocus,()=>f(!0)),onBlur:ie(n.onBlur,()=>f(!1))})})})}),cA="MenuCheckboxItem",vy=y.forwardRef((n,e)=>{const{checked:t=!1,onCheckedChange:r,...s}=n;return l.jsx(_y,{scope:n.__scopeMenu,checked:t,children:l.jsx(Xa,{role:"menuitemcheckbox","aria-checked":oa(t)?"mixed":t,...s,ref:e,"data-state":wd(t),onSelect:ie(s.onSelect,()=>r==null?void 0:r(oa(t)?!0:!t),{checkForDefaultPrevented:!1})})})});vy.displayName=cA;var yy="MenuRadioGroup",[lA,uA]=Zr(yy,{value:void 0,onValueChange:()=>{}}),by=y.forwardRef((n,e)=>{const{value:t,onValueChange:r,...s}=n,i=mt(r);return l.jsx(lA,{scope:n.__scopeMenu,value:t,onValueChange:i,children:l.jsx(yd,{...s,ref:e})})});by.displayName=yy;var wy="MenuRadioItem",xy=y.forwardRef((n,e)=>{const{value:t,...r}=n,s=uA(wy,n.__scopeMenu),i=t===s.value;return l.jsx(_y,{scope:n.__scopeMenu,checked:i,children:l.jsx(Xa,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":wd(i),onSelect:ie(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,t)},{checkForDefaultPrevented:!1})})})});xy.displayName=wy;var bd="MenuItemIndicator",[_y,dA]=Zr(bd,{checked:!1}),Sy=y.forwardRef((n,e)=>{const{__scopeMenu:t,forceMount:r,...s}=n,i=dA(bd,t);return l.jsx(Un,{present:r||oa(i.checked)||i.checked===!0,children:l.jsx(Ce.span,{...s,ref:e,"data-state":wd(i.checked)})})});Sy.displayName=bd;var hA="MenuSeparator",Ey=y.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n;return l.jsx(Ce.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});Ey.displayName=hA;var fA="MenuArrow",Ty=y.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n,s=Qa(t);return l.jsx(ay,{...s,...r,ref:e})});Ty.displayName=fA;var pA="MenuSub",[r2,ky]=Zr(pA),pi="MenuSubTrigger",Cy=y.forwardRef((n,e)=>{const t=es(pi,n.__scopeMenu),r=eo(pi,n.__scopeMenu),s=ky(pi,n.__scopeMenu),i=gd(pi,n.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,u={__scopeMenu:n.__scopeMenu},d=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>d,[d]),y.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),l.jsx(pd,{asChild:!0,...u,children:l.jsx(gy,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":s.contentId,"data-state":jy(t.open),...n,ref:Ym(e,s.onTriggerChange),onClick:f=>{var p;(p=n.onClick)==null||p.call(n,f),!(n.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:ie(n.onPointerMove,Li(f=>{i.onItemEnter(f),!f.defaultPrevented&&!n.disabled&&!t.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{t.onOpenChange(!0),d()},100))})),onPointerLeave:ie(n.onPointerLeave,Li(f=>{var v,b;d();const p=(v=t.content)==null?void 0:v.getBoundingClientRect();if(p){const m=(b=t.content)==null?void 0:b.dataset.side,g=m==="right",x=g?-5:5,S=p[g?"left":"right"],E=p[g?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:S,y:p.top},{x:E,y:p.top},{x:E,y:p.bottom},{x:S,y:p.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ie(n.onKeyDown,f=>{var v;const p=i.searchRef.current!=="";n.disabled||p&&f.key===" "||Y1[r.dir].includes(f.key)&&(t.onOpenChange(!0),(v=t.content)==null||v.focus(),f.preventDefault())})})})});Cy.displayName=pi;var Ay="MenuSubContent",Py=y.forwardRef((n,e)=>{const t=hy(qt,n.__scopeMenu),{forceMount:r=t.forceMount,...s}=n,i=es(qt,n.__scopeMenu),o=eo(qt,n.__scopeMenu),a=ky(Ay,n.__scopeMenu),c=y.useRef(null),u=He(e,c);return l.jsx(Mi.Provider,{scope:n.__scopeMenu,children:l.jsx(Un,{present:r||i.open,children:l.jsx(Mi.Slot,{scope:n.__scopeMenu,children:l.jsx(vd,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ie(n.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ie(n.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:ie(n.onKeyDown,d=>{var v;const f=d.currentTarget.contains(d.target),p=K1[o.dir].includes(d.key);f&&p&&(i.onOpenChange(!1),(v=a.trigger)==null||v.focus(),d.preventDefault())})})})})})});Py.displayName=Ay;function jy(n){return n?"open":"closed"}function oa(n){return n==="indeterminate"}function wd(n){return oa(n)?"indeterminate":n?"checked":"unchecked"}function mA(n){const e=document.activeElement;for(const t of n)if(t===e||(t.focus(),document.activeElement!==e))return}function gA(n,e){return n.map((t,r)=>n[(e+r)%n.length])}function vA(n,e,t){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let o=gA(n,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==t));const c=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==t?c:void 0}function yA(n,e){const{x:t,y:r}=n;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i].x,c=e[i].y,u=e[o].x,d=e[o].y;c>r!=d>r&&t<(u-a)*(r-c)/(d-c)+a&&(s=!s)}return s}function bA(n,e){if(!e)return!1;const t={x:n.clientX,y:n.clientY};return yA(t,e)}function Li(n){return e=>e.pointerType==="mouse"?n(e):void 0}var wA=dy,xA=pd,_A=fy,SA=py,EA=yd,TA=my,kA=Xa,CA=vy,AA=by,PA=xy,jA=Sy,OA=Ey,RA=Ty,IA=Cy,NA=Py,xd="DropdownMenu",[DA,s2]=Gi(xd,[ly]),vt=ly(),[MA,Oy]=DA(xd),Ry=n=>{const{__scopeDropdownMenu:e,children:t,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=n,c=vt(e),u=y.useRef(null),[d=!1,f]=Jo({prop:s,defaultProp:i,onChange:o});return l.jsx(MA,{scope:e,triggerId:Ci(),triggerRef:u,contentId:Ci(),open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(p=>!p),[f]),modal:a,children:l.jsx(wA,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:t})})};Ry.displayName=xd;var Iy="DropdownMenuTrigger",Ny=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,disabled:r=!1,...s}=n,i=Oy(Iy,t),o=vt(t);return l.jsx(xA,{asChild:!0,...o,children:l.jsx(Ce.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Ym(e,i.triggerRef),onPointerDown:ie(n.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ie(n.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Ny.displayName=Iy;var LA="DropdownMenuPortal",Dy=n=>{const{__scopeDropdownMenu:e,...t}=n,r=vt(e);return l.jsx(_A,{...r,...t})};Dy.displayName=LA;var My="DropdownMenuContent",Ly=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=Oy(My,t),i=vt(t),o=y.useRef(!1);return l.jsx(SA,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:e,onCloseAutoFocus:ie(n.onCloseAutoFocus,a=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ie(n.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(o.current=!0)}),style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ly.displayName=My;var FA="DropdownMenuGroup",$A=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(EA,{...s,...r,ref:e})});$A.displayName=FA;var UA="DropdownMenuLabel",Fy=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(TA,{...s,...r,ref:e})});Fy.displayName=UA;var zA="DropdownMenuItem",$y=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(kA,{...s,...r,ref:e})});$y.displayName=zA;var VA="DropdownMenuCheckboxItem",Uy=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(CA,{...s,...r,ref:e})});Uy.displayName=VA;var BA="DropdownMenuRadioGroup",qA=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(AA,{...s,...r,ref:e})});qA.displayName=BA;var GA="DropdownMenuRadioItem",zy=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(PA,{...s,...r,ref:e})});zy.displayName=GA;var HA="DropdownMenuItemIndicator",Vy=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(jA,{...s,...r,ref:e})});Vy.displayName=HA;var WA="DropdownMenuSeparator",By=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(OA,{...s,...r,ref:e})});By.displayName=WA;var JA="DropdownMenuArrow",YA=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(RA,{...s,...r,ref:e})});YA.displayName=JA;var KA="DropdownMenuSubTrigger",qy=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(IA,{...s,...r,ref:e})});qy.displayName=KA;var QA="DropdownMenuSubContent",Gy=y.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,s=vt(t);return l.jsx(NA,{...s,...r,ref:e,style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Gy.displayName=QA;
357var XA=Ry,ZA=Ny,eP=Dy,Hy=Ly,Wy=Fy,Jy=$y,Yy=Uy,Ky=zy,Qy=Vy,Xy=By,Zy=qy,eb=Gy;const tb=XA,nb=ZA,tP=y.forwardRef(({className:n,inset:e,children:t,...r},s)=>l.jsxs(Zy,{ref:s,className:re("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",n),...r,children:[t,l.jsx(tv,{className:"ml-auto h-4 w-4"})]}));tP.displayName=Zy.displayName;const nP=y.forwardRef(({className:n,...e},t)=>l.jsx(eb,{ref:t,className:re("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",n),...e}));nP.displayName=eb.displayName;const _d=y.forwardRef(({className:n,sideOffset:e=4,...t},r)=>l.jsx(eP,{children:l.jsx(Hy,{ref:r,sideOffset:e,className:re("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",n),...t})}));_d.displayName=Hy.displayName;const _s=y.forwardRef(({className:n,inset:e,...t},r)=>l.jsx(Jy,{ref:r,className:re("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",n),...t}));_s.displayName=Jy.displayName;const rP=y.forwardRef(({className:n,children:e,checked:t,...r},s)=>l.jsxs(Yy,{ref:s,className:re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),checked:t,...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(Qy,{children:l.jsx(Xu,{className:"h-4 w-4"})})}),e]}));rP.displayName=Yy.displayName;const sP=y.forwardRef(({className:n,children:e,...t},r)=>l.jsxs(Ky,{ref:r,className:re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...t,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(Qy,{children:l.jsx(nT,{className:"h-2 w-2 fill-current"})})}),e]}));sP.displayName=Ky.displayName;const zl=y.forwardRef(({className:n,inset:e,...t},r)=>l.jsx(Wy,{ref:r,className:re("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",n),...t}));zl.displayName=Wy.displayName;const rb=y.forwardRef(({className:n,...e},t)=>l.jsx(Xy,{ref:t,className:re("-mx-1 my-1 h-px bg-muted",n),...e}));rb.displayName=Xy.displayName;const iP=Ws("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors 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",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),xe=y.forwardRef(({className:n,variant:e,size:t,asChild:r=!1,...s},i)=>{const o=r?Uu:"button";return l.jsx(o,{className:re(iP({variant:e,size:t,className:n})),ref:i,...s})});xe.displayName="Button";const Qh=[{code:"en",name:"English",flag:"🇺🇸"},{code:"es",name:"Español",flag:"🇪🇸"},{code:"fr",name:"Français",flag:"🇫🇷"},{code:"de",name:"Deutsch",flag:"🇩🇪"}
357],Xh=[{code:"US",name:"United States",flag:"🇺🇸",language:"en"},{code:"ES",name:"Spain",flag:"🇪🇸",language:"es"},{code:"FR",name:"France",flag:"🇫🇷",language:"fr"},{code:"DE",name:"Germany",flag:"🇩🇪",language:"de"},{code:"GB",name:"United Kingdom",flag:"🇬🇧",language:"en"},{code:"JP",name:"Japan",flag:"🇯🇵",language:"en"},{code:"NG",name:"Nigeria",flag:"🇳🇬",language:"en"},{code:"MX",name:"Mexico",flag:"🇲🇽",language:"es"},{code:"ZA",name:"South Africa",flag:"🇿🇦",language:"en"},{code:"GH",name:"Ghana",flag:"🇬🇭",language:"en"}],oP=()=>{const{t:n}=Qi(),{currentLanguage:e,currentRegion:t,changeLanguage:r,changeRegion:s,isLoading:i}=Ov(),o=Qh.find(u=>u.code===e);Xh.find(u=>u.code===t);const a=async u=>{console.log("Language selector: changing language to",u),await r(u)},c=async u=>{console.log("Language selector: changing region to",u),await s(u)};return l.jsxs(tb,{children:[l.jsx(nb,{asChild:!0,children:l.jsxs(xe,{variant:"outline",size:"sm",className:"h-9 gap-1",disabled:i,children:[l.jsx(aT,{className:"h-4 w-4"}),l.jsx("span",{className:"mr-1",children:o==null?void 0:o.flag}),l.jsx("span",{className:"hidden sm:inline",children:o==null?void 0:o.name})]})}),l.jsxs(_d,{align:"end",children:[l.jsx(zl,{children:n("common.language")}),Qh.map(u=>l.jsxs(_s,{onClick:()=>a(u.code),className:"cursor-pointer",children:[l.jsx("span",{className:"mr-2",children:u.flag}),l.jsx("span",{children:u.name}),e===u.code&&l.jsx("span",{className:"ml-auto",children:"✓"})]},u.code)),l.jsx(rb,{}),l.jsx(zl,{children:n("common.region")}),Xh.map(u=>l.jsxs(_s,{onClick:()=>c(u.code),className:"cursor-pointer",children:[l.jsx("span",{className:"mr-2",children:u.flag}),l.jsx("span",{children:u.name}),t===u.code&&l.jsx("span",{className:"ml-auto",children:"✓"})]},u.code))]})]})},aP=Zm,cP=eg,lP=Xm,sb=y.forwardRef(({className:n,...e},t)=>l.jsx(Pa,{className:re("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",n),...e,ref:t}));sb.displayName=Pa.displayName;const uP=Ws("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"}}),ib=y.forwardRef(({side:n="right",className:e,children:t,...r},s)=>l.jsxs(lP,{children:[l.jsx(sb,{}),l.jsxs(ja,{ref:s,className:re(uP({side:n}),e),...r,children:[t,l.jsxs(Qm,{className:"absolute right-4 top-4 roun
357ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[l.jsx(Ba,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ib.displayName=ja.displayName;const dP=y.forwardRef(({className:n,...e},t)=>l.jsx(Oa,{ref:t,className:re("text-lg font-semibold text-foreground",n),...e}));dP.displayName=Oa.displayName;const hP=y.forwardRef(({className:n,...e},t)=>l.jsx(Ra,{ref:t,className:re("text-sm text-muted-foreground",n),...e}));hP.displayName=Ra.displayName;const fP=Ws("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"}});function ms({className:n,variant:e,...t}){return l.jsx("div",{className:re(fP({variant:e}),n),...t})}const Zh=({onNavItemClick:n})=>{const e=wr(),{canAccess:t,isEnterprise:r}=Fv(),{t:s}=Qi(),i=[{name:s("navigation.taxDeductions"),path:"/deductions",icon:Qu,premium:!1},{name:s("navigation.taxEstimates"),path:"/tax-estimates",icon:Xo,premium:!1},{name:"Tax Documents",path:"/tax-documents",icon:oT,premium:!1},{name:s("navigation.filingStatus"),path:"/tax-filing-status",icon:Oi,premium:!1},{name:s("navigation.complianceCenter"),path:"/compliance",icon:kl,premium:!1}],o=[{name:s("navigation.taxStrategyPlanning"),path:"/tax-strategy-planning",icon:Xo,feature:Ir.TaxStrategyPlanning},{name:s("navigation.aiConsultations"),path:"/ai-consultations",icon:Tl,feature:Ir.UnlimitedConsultations},{name:s("navigation.customReports"),path:"/custom-reports",icon:Qo,feature:Ir.CustomReports},{name:s("navigation.dataExport"),path:"/data-export",icon:Zu,feature:Ir.DataExport},{name:s("navigation.prioritySupport"),path:"/priority-support",icon:cT,feature:Ir.PrioritySupport}],a=c=>c==="/"?e.pathname==="/":e.pathname.startsWith(c);return l.jsxs("div",{className:"space-y-1",children:[i.map(c=>l.jsxs(jt,{to:c.path,onClick:n,className:`flex items-center px-3 py-2 rounded-md text-sm font-medium ${a(c.path)?"bg-primary/10 dark:bg-primary/20 text-primary":"text-foreground hover:bg-muted/50"}`,children:[l.jsx(c.icon,{className:"h-4 w-4 mr-2"}),c.name]},c.path)),r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pt-4 pb-2",children:l.jsxs("div",{className:"flex items-center gap-2 px-3",children:[l.jsx(xh,{className:"h-4 w-4 text-amber-500"}),l.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:s("enterprise.enterpriseFeatures")}),l.jsx(ms,{variant:"secondary",className:"text-xs bg-amber-100 text-amber-700",children:s("enterprise.premium")})]})}),o.map(c=>{const u=t(c.feature);return l.jsxs(jt,{to:c.path,onClick:n,className:`flex items-center px-3 py-2 rounded-md text-sm font-medium ${a(c.path)?"bg-primary/10 dark:bg-primary/20 text-primary":u?"text-foreground hover:bg-muted/50":"text-muted-foreground/50 cursor-not-allowed"}`,children:[l.jsx(c.icon,{className:"h-4 w-4 mr-2"}),c.name,!u&&l.jsx(ms,{variant:"outline",className:"ml-auto text-xs",children:s("enterprise.upgrade")})]},c.path)})]}),!r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pt-4 pb-2",children:l.jsxs("div",{className:"flex items-center gap-2 px-3",children:[l.jsx(xh,{className:"h-4 w-4 text-amber-500"}),l.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:s("enterprise.enterpriseFeatures")}),l.jsx(ms,{variant:"outline",className:"text-xs",children:s("enterprise.available")})]})}),o.map(c=>l.jsxs(jt,{to:"/products",onClick:n,className:"flex items-center px-3 py-2 rounded-md text-sm font-medium text-muted-foreground hover:bg-muted/50",children:[l.jsx(c.icon,{className:"h-4 w-4 mr-2"}),c.name,l.jsx(ms,{variant:"outline",className:"ml-auto text-xs",children:s("enterprise.upgrade")})]},c.path))]})]})},pP=()=>{const n=typeof window<"u",[e,t]=y.useState(n?!navigator.onLine:!1);return y.useEffect(()=>{if(!n)return;const r=()=>t(!1),s=()=>t(!0);return window.addEventListener("online",r),window.addEventListener("offline",s),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}},[n]),e},mP=({isOffline:n}
357)=>{let e=!1;try{e=pP()}catch(r){console.error("Error using offline status hook:",r)}return(n!==void 0?n:e)?l.jsxs("div",{className:"bg-amber-600 text-white p-2 text-center fixed bottom-0 w-full z-50 flex justify-center items-center",children:[l.jsx(ji,{className:"w-4 h-4 mr-2"}),l.jsx("span",{children:"You're offline. Some features may be unavailable until you reconnect."})]}):null};function Vl(){const{setTheme:n}=rC();return l.jsxs(tb,{children:[l.jsx(nb,{asChild:!0,children:l.jsxs(xe,{variant:"ghost",size:"icon",className:"relative",children:[l.jsx(ST,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),l.jsx(mT,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),l.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),l.jsxs(_d,{align:"end",children:[l.jsx(_s,{onClick:()=>n("light"),children:"Light"}),l.jsx(_s,{onClick:()=>n("dark"),children:"Dark"}),l.jsx(_s,{onClick:()=>n("system"),children:"System"})]})]})}const zr=y.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:re("rounded-lg border bg-card text-card-foreground shadow-sm",n),...e}));zr.displayName="Card";const aa=y.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:re("flex flex-col space-y-1.5 p-6",n),...e}));aa.displayName="CardHeader";const ca=y.forwardRef(({className:n,...e},t)=>l.jsx("h3",{ref:t,className:re("text-2xl font-semibold leading-none tracking-tight",n),...e}));ca.displayName="CardTitle";const Bl=y.forwardRef(({className:n,...e},t)=>l.jsx("p",{ref:t,className:re("text-sm text-muted-foreground",n),...e}));Bl.displayName="CardDescription";const hr=y.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:re("p-6 pt-0",n),...e}));hr.displayName="CardContent";const ob=y.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:re("flex items-center p-6 pt-0",n),...e}));ob.displayName="CardFooter";const ab=X0,Sd=y.forwardRef(({className:n,...e},t)=>l.jsx(tg,{ref:t,className:re("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground overflow-x-auto max-w-full",n),...e}));Sd.displayName=tg.displayName;const Fi=y.forwardRef(({className:n,...e},t)=>l.jsx(ng,{ref:t,className:re("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm flex-shrink-0",n),...e}));Fi.displayName=ng.displayName;const ql=y.forwardRef(({className:n,...e},t)=>l.jsx(rg,{ref:t,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...e}));ql.displayName=rg.displayName;const Xn=y.forwardRef(({className:n,type:e,...t},r)=>l.jsx("input",{type:e,className:re("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
357ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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",n),ref:r,...t}));Xn.displayName="Input";function Gl(n,[e,t]){return Math.min(t,Math.max(e,n))}function gP(n,e){return y.useReducer((t,r)=>e[t][r]??t,n)}var Ed="ScrollArea",[cb,i2]=Gi(Ed),[vP,Wt]=cb(Ed),lb=y.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=n,[a,c]=y.useState(null),[u,d]=y.useState(null),[f,p]=y.useState(null),[v,b]=y.useState(null),[m,g]=y.useState(null),[x,S]=y.useState(0),[E,P]=y.useState(0),[C,O]=y.useState(!1),[N,D]=y.useState(!1),R=He(e,A=>c(A)),F=zu(s);return l.jsx(vP,{scope:t,type:r,dir:F,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:C,onScrollbarXEnabledChange:O,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:N,onScrollbarYEnabledChange:D,onCornerWidthChange:S,onCornerHeightChange:P,children:l.jsx(Ce.div,{dir:F,...o,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":E+"px",...n.style}})})});lb.displayName=Ed;var ub="ScrollAreaViewport",db=y.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,asChild:s,nonce:i,...o}=n,a=Wt(ub,t),c=y.useRef(null),u=He(e,c,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:`
358[data-radix-scroll-area-viewport] {
359  scrollbar-width: none;
360  -ms-overflow-style: none;
361  -webkit-overflow-scrolling: touch;
362}
363[data-radix-scroll-area-viewport]::-webkit-scrollbar {
364  display: none;
365}
366:where([data-radix-scroll-area-viewport]) {
367  display: flex;
368  flex-direction: column;
369  align-items: stretch;
370}
371:where([data-radix-scroll-area-content]) {
372  flex-grow: 1;
373}
374`},nonce:i}),l.jsx(Ce.div,{"data-radix-scroll-area-viewport":"",...o,asChild:s,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...n.style},children:CP({asChild:s,children:r},d=>l.jsx("div",{"data-radix-scroll-area-content":"",ref:a.onContentChange,style:{minWidth:a.scrollbarXEnabled?"fit-content":void 0},children:d}))})]})});db.displayName=ub;var _n="ScrollAreaScrollbar",Td=y.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Wt(_n,n.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,a=n.orientation==="horizontal";return y.useEffect(()=>(a?i(!0):o(!0),()=>{a?i(!1):o(!1)}),[a,i,o]),s.type==="hover"?l.jsx(yP,{...r,ref:e,forceMount:t}):s.type==="scroll"?l.jsx(bP,{...r,ref:e,forceMount:t}):s.type==="auto"?l.jsx(hb,{...r,ref:e,forceMount:t}):s.type==="always"?l.jsx(kd,{...r,ref:e}):null});Td.displayName=_n;var yP=y.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Wt(_n,n.__scopeScrollArea),[i,o]=y.useState(!1);return y.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(Un,{present:t||i,children:l.jsx(hb,{"data-state":i?"visible":"hidden",...r,ref:e})})}),bP=y.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Wt(_n,n.__scopeScrollArea),i=n.orientation==="horizontal",o=ec(()=>c("SCROLL_END"),100),[a,c]=gP("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 y.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,c]),y.useEffect(()=>{const u=s.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const v=u[d];f!==v&&(c("SCROLL"),o()),f=v};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[s.viewport,i,c,o]),l.jsx(Un,{present:t||a!=="hidden",children:l.jsx(kd,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:ie(n.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ie(n.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),hb=y.forwardRef((n,e)=>{const t=Wt(_n,n.__scopeScrollArea),{forceMount:r,...s}=n,[i,o]=y.useState(!1),a=n.orientation==="horizontal",c=ec(()=>{if(t.viewport){const u=t.viewport.offsetWidth<t.viewport.scrollWidth,d=t.viewport.offsetHeight<t.viewport.scrollHeight;o(a?u:d)}},10);return $s(t.viewport,c),$s(t.content,c),l.jsx(Un,{present:r||i,children:l.jsx(kd,{"data-state":i?"visible":"hidden",...s,ref:e})})}),kd=y.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=Wt(_n,n.__scopeScrollArea),i=y.useRef(null),o=y.useRef(0),[a,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=vb(a.viewport,a.content),d={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function f(p,v){return TP(p,o.current,a,v)}return t==="horizontal"?l.jsx(wP,{...d,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const p=s.viewport.scrollLeft,v=ef(p,a,s.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=f(p,s.dir))}}):t==="vertical"?l.jsx(xP,{...d,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const p=s.viewport.scrollTop,v=ef(p,a);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=f(p))}}):null}),wP=y.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,i=Wt(_n,n.__scopeScrollArea),[o,a]=y.useState(),c=y.useRef(null),u=He(e,c,i.onScrollbarXChange);return y.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(pb,{"data-orientation":"horizontal",...s,ref:u,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":Za(t)+"px",...n.style},onThumbPointerDown:d=>n.onThumbPointerDown(d.x),onDragScroll:d=>n.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;n.onWheelScroll(p),bb(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:ua(o.paddingLeft),paddingEnd:ua(o.paddingRight)}})}})}),xP=y.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,i=Wt(_n,n.__scopeScrollArea),[o,a]=y.useState(),c=y.useRef(null),u=He(e,c,i.onScrollbarYChange);return y.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(pb,{"data-orientation":"vertical",...s,ref:u,sizes:t,style:{to
vendor: 4,227 bytes, line 374
374p: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":Za(t)+"px",...n.style},onThumbPointerDown:d=>n.onThumbPointerDown(d.y),onDragScroll:d=>n.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;n.onWheelScroll(p),bb(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:ua(o.paddingTop),paddingEnd:ua(o.paddingBottom)}})}})}),[_P,fb]=cb(_n),pb=y.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=n,v=Wt(_n,t),[b,m]=y.useState(null),g=He(e,R=>m(R)),x=y.useRef(null),S=y.useRef(""),E=v.viewport,P=r.content-r.viewport,C=mt(d),O=mt(c),N=ec(f,10);function D(R){if(x.current){const F=R.clientX-x.current.left,A=R.clientY-x.current.top;u({x:F,y:A})}}return y.useEffect(()=>{const R=F=>{const A=F.target;(b==null?void 0:b.contains(A))&&C(F,P)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[E,b,P,C]),y.useEffect(O,[r,O]),$s(b,N),$s(v.content,N),l.jsx(_P,{scope:t,scrollbar:b,hasThumb:s,onThumbChange:mt(i),onThumbPointerUp:mt(o),onThumbPositionChange:O,onThumbPointerDown:mt(a),children:l.jsx(Ce.div,{...p,ref:g,style:{position:"absolute",...p.style},onPointerDown:ie(n.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),x.current=b.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),D(R))}),onPointerMove:ie(n.onPointerMove,D),onPointerUp:ie(n.onPointerUp,R=>{const F=R.target;F.hasPointerCapture(R.pointerId)&&F.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=S.current,v.viewport&&(v.viewport.style.scrollBehavior=""),x.current=null})})})}),la="ScrollAreaThumb",mb=y.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=fb(la,n.__scopeScrollArea);return l.jsx(Un,{present:t||s.hasThumb,children:l.jsx(SP,{ref:e,...r})})}),SP=y.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,i=Wt(la,t),o=fb(la,t),{onThumbPositionChange:a}=o,c=He(e,f=>o.onThumbChange(f)),u=y.useRef(),d=ec(()=>{u.current&&(u.current(),u.current=void 0)},100);return y.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(d(),!u.current){const v=kP(f,a);u.current=v,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,d,a]),l.jsx(Ce.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ie(n.onPointerDownCapture,f=>{const v=f.target.getBoundingClientRect(),b=f.clientX-v.left,m=f.clientY-v.top;o.onThumbPointerDown({x:b,y:m})}),onPointerUp:ie(n.onPointerUp,o.onThumbPointerUp)})});mb.displayName=la;var Cd="ScrollAreaCorner",gb=y.forwardRef((n,e)=>{const t=Wt(Cd,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?l.jsx(EP,{...n,ref:e}):null});gb.displayName=Cd;var EP=y.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=Wt(Cd,t),[i,o]=y.useState(0),[a,c]=y.useState(0),u=!!(i&&a);return $s(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),$s(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),o(d)}),u?l.jsx(Ce.div,{...r,ref:e,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function ua(n){return n?parseInt(n,10):0}function vb(n,e){const t=n/e;return isNaN(t)?0:t}function Za(n){const e=vb(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function TP(n,e,t,r="ltr"){const s=Za(t),i=s/2,o=e||i,a=s-o,c=t.scrollbar.paddingStart+o,u=t.scrollbar.size-t.scrollbar.paddingEnd-a,d=t.content-t.viewport,f=r==="ltr"?[0,d]:[d*-1,0];
374return yb([c,u],f)(n)}function ef(n,e,t="ltr"){const r=Za(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,o=e.content-e.viewport,a=i-r,c=t==="ltr"?[0,o]:[o*-1,0],u=Gl(n,c);return yb([0,o],[0,a])(u)}function yb(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function bb(n,e){return n>0&&n<e}var kP=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return function s(){const i={left:n.scrollLeft,top:n.scrollTop},o=t.left!==i.left,a=t.top!==i.top;(o||a)&&e(),t=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function ec(n,e){const t=mt(n),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function $s(n,e){const t=mt(e);Nt(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}function CP(n,e){const{asChild:t,children:r}=n;if(!t)return typeof e=="function"?e(r):e;const s=y.Children.only(r);return y.cloneElement(s,{children:typeof e=="function"?e(s.props.children):e})}var wb=lb,AP=db,PP=gb;const Hl=y.forwardRef(({className:n,children:e,...t},r)=>l.jsxs(wb,{ref:r,className:re("relative overflow-hidden",n),...t,children:[l.jsx(AP,{className:"h-full w-full rounded-[inherit]",children:e}),l.jsx(xb,{}),l.jsx(PP,{})]}));Hl.displayName=wb.displayName;const xb=y.forwardRef(({className:n,orientation:e="vertical",...t},r)=>l.jsx(Td,{ref:r,orientation:e,className:re("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...t,children:l.jsx(mb,{className:"relative flex-1 rounded-full bg-border"})}));xb.displayName=Td.displayName;var _b={};function tf(n,e){if(n==null)return{};var t,r,s=function(o,a){if(o==null)return{};var c={};for(var u in o)if({}.hasOwnProperty.call(o,u)){if(a.indexOf(u)!==-1)continue;c[u]=o[u]}return c}(n,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(r=0;r<i.length;r++)t=i[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function Mt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Pe(n){return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pe(n)}function Sb(n){var e=function(t,r){if(Pe(t)!="object"||!t)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var i=s.call(t,r||"default");if(Pe(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}(n,"string");return Pe(e)=="symbol"?e:e+""}function nf(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Sb(r.key),r)}}function Lt(n,e,t){return e&&nf(n.prototype,e),t&&nf(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function tc(n,e){if(e&&(Pe(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)}function an(n){return an=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},an(n)}function $i(n,e){return $i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},$i(n,e)}function nc(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&$i(n,e)}function gn(n,e,t){return(e=Sb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rf(n,e,t,r,s,i,o){try{var a=n[i](o),c=a.value}catch(u){return void t(u)}a.done?e(c):Promise.resolve(c).then(r,s)}function fe(n){return function(){var e=this,t=arguments;return new Promise(function(r,s){var i=n.apply(e,t);function o(c){rf(i,r,s,o,a,"next",c)}function a(c){rf(i,r,s,o,a,"throw",c)}o(void 0)})}}function sf(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function ct(n,e){return function(t){if(Array.isArray(t))return t}(n)||function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,o,a,c,u=[],d=!0,f=!1;try{if(a=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;d=!1}else for(;
374!(d=(i=a.call(s)).done)&&(u.push(i.value),u.length!==r);d=!0);}catch(p){f=!0,o=p}finally{try{if(!d&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(f)throw o}}return u}}(n,e)||function(t,r){if(t){if(typeof t=="string")return sf(t,r);var s={}.toString.call(t).slice(8,-1);return s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set"?Array.from(t):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?sf(t,r):void 0}}(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
375In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function jP(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var of,_o={exports:{}},Wl=function(){if(of)return _o.exports;of=1;var n,e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(m,g,x){return Function.prototype.apply.call(m,g,x)};n=e&&typeof e.ownKeys=="function"?e.ownKeys:Object.getOwnPropertySymbols?function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:function(m){return Object.getOwnPropertyNames(m)};var r=Number.isNaN||function(m){return m!=m};function s(){s.init.call(this)}_o.exports=s,_o.exports.once=function(m,g){return new Promise(function(x,S){function E(C){m.removeListener(g,P),S(C)}function P(){typeof m.removeListener=="function"&&m.removeListener("error",E),x([].slice.call(arguments))}b(m,g,P,{once:!0}),g!=="error"&&function(C,O,N){typeof C.on=="function"&&b(C,"error",O,N)}(m,E,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var i=10;function o(m){if(typeof m!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof m)}function a(m){return m._maxListeners===void 0?s.defaultMaxListeners:m._maxListeners}function c(m,g,x,S){var E,P,C,O;if(o(x),(P=m._events)===void 0?(P=m._events=Object.create(null),m._eventsCount=0):(P.newListener!==void 0&&(m.emit("newListener",g,x.listener?x.listener:x),P=m._events),C=P[g]),C===void 0)C=P[g]=x,++m._eventsCount;else if(typeof C=="function"?C=P[g]=S?[x,C]:[C,x]:S?C.unshift(x):C.push(x),(E=a(m))>0&&C.length>E&&!C.warned){C.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(g)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=m,N.type=g,N.count=C.length,O=N,console&&console.warn&&console.warn(O)}return m}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(m,g,x){var S={fired:!1,wrapFn:void 0,target:m,type:g,listener:x},E=u.bind(S);return E.listener=x,S.wrapFn=E,E}function f(m,g,x){var S=m._events;if(S===void 0)return[];var E=S[g];return E===void 0?[]:typeof E=="function"?x?[E.listener||E]:[E]:x?function(P){for(var C=new Array(P.length),O=0;O<C.length;++O)C[O]=P[O].listener||P[O];return C}(E):v(E,E.length)}function p(m){var g=this._events;if(g!==void 0){var x=g[m];if(typeof x=="function")return 1;if(x!==void 0)return x.length}return 0}function v(m,g){for(var x=new Array(g),S=0;S<g;++S)x[S]=m[S];return x}function b(m,g,x,S){if(typeof m.on=="function")S.once?m.once(g,x):m.on(g,x);else{if(typeof m.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof m);m.addEventListener(g,function E(P){S.once&&m.removeEventListener(g,E),x(P)})}}return Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(m){if(typeof m!="number"||m<0||r(m))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+m+".");i=m}}),s.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||r(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this},s.prototype.getMaxListeners=function(){return a(this)},s.prototype.emit=function(m){for(var g=[],x=1;x<arguments.length;x++)g.push(arguments[x]);var S=m==="error",E=this._events;if(E!==void 0)S=S&&E.error===void 0;else if(!S)return!1;if(S){var P;if(g.length>0&&(P=g[0]),P instanceof Error)throw P;var C=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw C.context=P,C}var O=E[m];if(O===void 0)return!1;if(typeof O=="function")t(O,this,g);else{var N=O.length,D=v(O,N);for(x=0;x<N;++x)t(D[x],this,g)}return!0},s.prototype.addListener=function(m,g){return c(this,m,g,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(m,g){return c(this,m,g,!0)},s.prototype.once=function(m,g){return o(g),this.on(m,d(this,m,g)),this},s.prototype.prependOnceListener=function(m,g){return o(g),this.prependListener(m,d(this,m,g)),this},s.prototype.removeListener=function(m,g){var x,S,E,P,C;if(o(g),(S=this._events)===void 0)return this;if((x=S[m])===void 0)return this;if(x===g||x.listener===g)--this._eventsCount==0?this._events=Object.create(null):(delete S[m],S.removeListener&&this.emit
375("removeListener",m,x.listener||g));else if(typeof x!="function"){for(E=-1,P=x.length-1;P>=0;P--)if(x[P]===g||x[P].listener===g){C=x[P].listener,E=P;break}if(E<0)return this;E===0?x.shift():function(O,N){for(;N+1<O.length;N++)O[N]=O[N+1];O.pop()}(x,E),x.length===1&&(S[m]=x[0]),S.removeListener!==void 0&&this.emit("removeListener",m,C||g)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(m){var g,x,S;if((x=this._events)===void 0)return this;if(x.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):x[m]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete x[m]),this;if(arguments.length===0){var E,P=Object.keys(x);for(S=0;S<P.length;++S)(E=P[S])!=="removeListener"&&this.removeAllListeners(E);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(g=x[m])=="function")this.removeListener(m,g);else if(g!==void 0)for(S=g.length-1;S>=0;S--)this.removeListener(m,g[S]);return this},s.prototype.listeners=function(m){return f(this,m,!0)},s.prototype.rawListeners=function(m){return f(this,m,!1)},s.listenerCount=function(m,g){return typeof m.listenerCount=="function"?m.listenerCount(g):p.call(m,g)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]},_o.exports}(),So=jP(Wl),af=Object.prototype.hasOwnProperty;function cf(n,e,t){for(t of n.keys())if(ft(t,e))return t}function ft(n,e){var t,r,s;if(n===e)return!0;if(n&&e&&(t=n.constructor)===e.constructor){if(t===Date)return n.getTime()===e.getTime();if(t===RegExp)return n.toString()===e.toString();if(t===Array){if((r=n.length)===e.length)for(;r--&&ft(n[r],e[r]););return r===-1}if(t===Set){if(n.size!==e.size)return!1;for(r of n)if((s=r)&&typeof s=="object"&&!(s=cf(e,s))||!e.has(s))return!1;return!0}if(t===Map){if(n.size!==e.size)return!1;for(r of n)if((s=r[0])&&typeof s=="object"&&!(s=cf(e,s))||!ft(r[1],e.get(s)))return!1;return!0}if(t===ArrayBuffer)n=new Uint8Array(n),e=new Uint8Array(e);else if(t===DataView){if((r=n.byteLength)===e.byteLength)for(;r--&&n.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(n)){if((r=n.byteLength)===e.byteLength)for(;r--&&n[r]===e[r];);return r===-1}if(!t||typeof n=="object"){for(t in r=0,n)if(af.call(n,t)&&++r&&!af.call(e,t)||!(t in e)||!ft(n[t],e[t]))return!1;return Object.keys(e).length===r}}return n!=n&&e!=e}const OP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Eb={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},Qe={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},dt={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},Jn={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class V{static getFirstMatch(e,t){const r=t.match(e);return r&&r.length>0&&r[1]||""}static getSecondMatch(e,t){const r=t.match(e);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(e,t,r){if(e.test(t))return r}
375static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(t.push(0),t[0]===10)switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(t.push(0),!(t[0]===1&&t[1]<5))return t[0]===1&&t[1]<6?"Cupcake":t[0]===1&&t[1]>=6?"Donut":t[0]===2&&t[1]<2?"Eclair":t[0]===2&&t[1]===2?"Froyo":t[0]===2&&t[1]>2?"Gingerbread":t[0]===3?"Honeycomb":t[0]===4&&t[1]<1?"Ice Cream Sandwich":t[0]===4&&t[1]<4?"Jelly Bean":t[0]===4&&t[1]>=4?"KitKat":t[0]===5?"Lollipop":t[0]===6?"Marshmallow":t[0]===7?"Nougat":t[0]===8?"Oreo":t[0]===9?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,r=!1){const s=V.getVersionPrecision(e),i=V.getVersionPrecision(t);let o=Math.max(s,i),a=0;const c=V.map([e,t],u=>{const d=o-V.getVersionPrecision(u),f=u+new Array(d+1).join(".0");return V.map(f.split("."),p=>new Array(20-p.length).join("0")+p).reverse()});for(r&&(a=o-Math.min(s,i)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}}static map(e,t){const r=[];let s;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(s=0;s<e.length;s+=1)r.push(t(e[s]));return r}static find(e,t){let r,s;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,s=e.length;r<s;r+=1){const i=e[r];if(t(i,r))return i}}static assign(e,...t){const r=e;let s,i;if(Object.assign)return Object.assign(e,...t);for(s=0,i=t.length;s<i;s+=1){const o=t[s];typeof o=="object"&&o!==null&&Object.keys(o).forEach(a=>{r[a]=o[a]})}return e}static getBrowserAlias(e){return OP[e]}static getBrowserTypeByAlias(e){return Eb[e]||""}}const Ue=/version\/(\d+(\.?_?\d+)+)/i,RP=[{test:[/googlebot/i],describe(n){const e={name:"Googlebot"},t=V.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/opera/i],describe(n){const e={name:"Opera"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/opr\/|opios/i],describe(n){const e={name:"Opera"},t=V.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/SamsungBrowser/i],describe(n){const e={name:"Samsung Internet for Android"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/Whale/i],describe(n){const e={name:"NAVER Whale Browser"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/MZBrowser/i],describe(n){const e={name:"MZ Browser"},t=V.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/focus/i],describe(n){const e={name:"Focus"},t=V.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/swing/i],describe(n){const e={name:"Swing"},t=V.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/coast/i],describe(n){const e={name:"Opera Coast"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(n){const e={name:"Opera Touch"},t=V.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/yabrowser/i],describe(n){const e={name:"Yandex Browser"},t=V.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/ucbrowser/i],describe(n){const e={name:"UC Browser"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/Maxthon|mxios/i],describe(n){const e={name:"Maxthon"}
vendor: 5,293 bytes, line 375
375,t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/epiphany/i],describe(n){const e={name:"Epiphany"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/puffin/i],describe(n){const e={name:"Puffin"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/sleipnir/i],describe(n){const e={name:"Sleipnir"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/k-meleon/i],describe(n){const e={name:"K-Meleon"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/micromessenger/i],describe(n){const e={name:"WeChat"},t=V.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/qqbrowser/i],describe(n){const e={name:/qqbrowserlite/i.test(n)?"QQ Browser Lite":"QQ Browser"},t=V.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/msie|trident/i],describe(n){const e={name:"Internet Explorer"},t=V.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/\sedg\//i],describe(n){const e={name:"Microsoft Edge"},t=V.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/edg([ea]|ios)/i],describe(n){const e={name:"Microsoft Edge"},t=V.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/vivaldi/i],describe(n){const e={name:"Vivaldi"},t=V.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/seamonkey/i],describe(n){const e={name:"SeaMonkey"},t=V.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/sailfish/i],describe(n){const e={name:"Sailfish"},t=V.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,n);return t&&(e.version=t),e}},{test:[/silk/i],describe(n){const e={name:"Amazon Silk"},t=V.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/phantom/i],describe(n){const e={name:"PhantomJS"},t=V.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/slimerjs/i],describe(n){const e={name:"SlimerJS"},t=V.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(n){const e={name:"BlackBerry"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/(web|hpw)[o0]s/i],describe(n){const e={name:"WebOS Browser"},t=V.getFirstMatch(Ue,n)||V.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/bada/i],describe(n){const e={name:"Bada"},t=V.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/tizen/i],describe(n){const e={name:"Tizen"},t=V.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/qupzilla/i],describe(n){const e={name:"QupZilla"},t=V.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/firefox|iceweasel|fxios/i],describe(n){const e={name:"Firefox"},t=V.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/electron/i],describe(n){const e={name:"Electron"},t=V.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/MiuiBrowser/i],describe(n){const e={name:"Miui"},t=V.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/chromium/i],describe(n){const e={name:"Chromium"},t=V.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,n)||V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/chrome|crios|crmo/i],describe(n){const e={name:"Chrome"},t=V.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/GSA/i],describe(n){const e={name:"Google Search"},t=V.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test(n){const e=!n.test(/like android/i),t=n.test(/android/i);return e&&t},describe(n){const e={name:"Android Browser"},t=V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/playstation 4/i],describe(n){const e={name:"PlayStation 4"},t=V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/safari|applewebkit/i],describe(n){const e={name:"Safari"},t=V.getFirstMatch(Ue,n);return t&&(e.version=t),e}},{test:[/.*/i],describe(n){const e=n.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:V.getFirstMatch(e,n),version:V.getSecondMatch(e,n)}}}];var IP=[{test:[/Roku\/DVP/],describe(n){const e=V.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,n);return{name:dt.Roku,version:e}}},{test:[/windows phone/i],describe(n){const e=V.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,n);return{name:dt.WindowsPhone,version:e}}},{test:[/windows /i],describe(n){const e=V.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,n),t=V.getWindowsVersionName(e);return{name:dt.Windows,version:e,versionName:t}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(n){const e={name:dt.iOS}
375,t=V.getSecondMatch(/(Version\/)(\d[\d.]+)/,n);return t&&(e.version=t),e}},{test:[/macintosh/i],describe(n){const e=V.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,n).replace(/[_\s]/g,"."),t=V.getMacOSVersionName(e),r={name:dt.MacOS,version:e};return t&&(r.versionName=t),r}},{test:[/(ipod|iphone|ipad)/i],describe(n){const e=V.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,n).replace(/[_\s]/g,".");return{name:dt.iOS,version:e}}},{test(n){const e=!n.test(/like android/i),t=n.test(/android/i);return e&&t},describe(n){const e=V.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,n),t=V.getAndroidVersionName(e),r={name:dt.Android,version:e};return t&&(r.versionName=t),r}},{test:[/(web|hpw)[o0]s/i],describe(n){const e=V.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,n),t={name:dt.WebOS};return e&&e.length&&(t.version=e),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(n){const e=V.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,n)||V.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,n)||V.getFirstMatch(/\bbb(\d+)/i,n);return{name:dt.BlackBerry,version:e}}},{test:[/bada/i],describe(n){const e=V.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,n);return{name:dt.Bada,version:e}}},{test:[/tizen/i],describe(n){const e=V.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,n);return{name:dt.Tizen,version:e}}},{test:[/linux/i],describe:()=>({name:dt.Linux})},{test:[/CrOS/],describe:()=>({name:dt.ChromeOS})},{test:[/PlayStation 4/],describe(n){const e=V.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,n);return{name:dt.PlayStation4,version:e}}}],NP=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(n){const e=V.getFirstMatch(/(can-l01)/i,n)&&"Nova",t={type:Qe.mobile,vendor:"Huawei"};return e&&(t.model=e),t}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Qe.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Qe.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Qe.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Qe.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Qe.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Qe.tablet})},{test(n){const e=n.test(/ipod|iphone/i),t=n.test(/like (ipod|iphone)/i);return e&&!t},describe(n){const e=V.getFirstMatch(/(ipod|iphone)/i,n);return{type:Qe.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Qe.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:Qe.mobile})},{test:n=>n.getBrowserName(!0)==="blackberry",describe:()=>({type:Qe.mobile,vendor:"BlackBerry"})},{test:n=>n.getBrowserName(!0)==="bada",describe:()=>({type:Qe.mobile})},{test:n=>n.getBrowserName()==="windows phone",describe:()=>({type:Qe.mobile,vendor:"Microsoft"})},{test(n){const e=Number(String(n.getOSVersion()).split(".")[0]);return n.getOSName(!0)==="android"&&e>=3},describe:()=>({type:Qe.tablet})},{test:n=>n.getOSName(!0)==="android",describe:()=>({type:Qe.mobile})},{test:n=>n.getOSName(!0)==="macos",describe:()=>({type:Qe.desktop,vendor:"Apple"})},{test:n=>n.getOSName(!0)==="windows",describe:()=>({type:Qe.desktop})},{test:n=>n.getOSName(!0)==="linux",describe:()=>({type:Qe.desktop})},{test:n=>n.getOSName(!0)==="playstation 4",describe:()=>({type:Qe.tv})},{test:n=>n.getOSName(!0)==="roku",describe:()=>({type:Qe.tv})}],DP=[{test:n=>n.getBrowserName(!0)==="microsoft edge",describe(n){if(/\sedg\//i.test(n))return{name:Jn.Blink};const e=V.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,n);return{name:Jn.EdgeHTML,version:e}}},{test:[/trident/i],describe(n){const e={name:Jn.Trident},t=V.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:n=>n.test(/presto/i),describe(n){const e={name:Jn.Presto},t=V.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test(n){const e=n.test(/gecko/i),t=n.test(/like gecko/i);return e&&!t},describe(n){const e={name:Jn.Gecko},t=V.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Jn.Blink})},{test:[/(apple)?webkit/i],describe(n){const e={name:Jn.WebKit},t=V.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,n);return t&&(e.version=t),e}}];class lf{constructor(e,t=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},t!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=V.find(RP,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(r=>this.test(r));
375throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=V.find(IP,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=V.find(NP,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=V.find(DP,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return V.assign({},this.parsedResult)}satisfies(e){const t={};let r=0;const s={};let i=0;if(Object.keys(e).forEach(o=>{const a=e[o];typeof a=="string"?(s[o]=a,i+=1):typeof a=="object"&&(t[o]=a,r+=1)}),r>0){const o=Object.keys(t),a=V.find(o,u=>this.isOS(u));if(a){const u=this.satisfies(t[a]);if(u!==void 0)return u}const c=V.find(o,u=>this.isPlatform(u));if(c){const u=this.satisfies(t[c]);if(u!==void 0)return u}}if(i>0){const o=Object.keys(s),a=V.find(o,c=>this.isBrowser(c,!0));if(a!==void 0)return this.compareVersion(s[a])}}isBrowser(e,t=!1){const r=this.getBrowserName().toLowerCase();let s=e.toLowerCase();const i=V.getBrowserTypeByAlias(s);return t&&i&&(s=i.toLowerCase()),s===r}compareVersion(e){let t=[0],r=e,s=!1;const i=this.getBrowserVersion();if(typeof i=="string")return e[0]===">"||e[0]==="<"?(r=e.substr(1),e[1]==="="?(s=!0,r=e.substr(2)):t=[],e[0]===">"?t.push(1):t.push(-1)):e[0]==="="?r=e.substr(1):e[0]==="~"&&(s=!0,r=e.substr(1)),t.indexOf(V.compareVersions(i,r,s))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(t=>this.is(t))}}/*!
376 * Bowser - a browser detector
377 * https://github.com/lancedikson/bowser
378 * MIT License | (c) Dustin Diaz 2012-2015
379 * MIT License | (c) Denis Demchenko 2015-2019
380 */class MP{static getParser(e,t=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new lf(e,t)}static parse(e){return new lf(e).getResult()}static get BROWSER_MAP(){return Eb}static get ENGINE_MAP(){return Jn}static get OS_MAP(){return dt}static get PLATFORMS_MAP(){return Qe}}function rc(){return Date.now()+Math.random().toString()}function ci(){throw new Error("Method must be implemented in subclass")}function Tb(n,e){return e!=null&&e.proxyUrl?e.proxyUrl+(e.proxyUrl.slice(-1)==="/"?"":"/")+n.substring(8):n}function da(n){return n!=null&&n.callObjectBundleUrlOverride?n.callObjectBundleUrlOverride:Tb("https://c.daily.co/call-machine/versioned/".concat("0.85.0","/static/call-machine-object-bundle.js"),n)}function ha(n){try{new URL(n)}catch{return!1}return!0}const Be=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Vr="8.55.0",Oe=globalThis;function fa(n,e,t){const r=Oe,s=r.__SENTRY__=r.__SENTRY__||{},i=s[Vr]=s[Vr]||{};return i[n]||(i[n]=e())}const ts=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Jl=["debug","info","warn","error","log","assert","trace"],pa={};function to(n){if(!("console"in Oe))return n();const e=Oe.console,t={},r=Object.keys(pa);r.forEach(s=>{const i=pa[s];t[s]=e[s],e[s]=i});try{return n()}finally{r.forEach(s=>{e[s]=t[s]})}}const ge=fa("logger",function(){let n=!1;const e={enable:()=>{n=!0},disable:()=>{n=!1},isEnabled:()=>n};return ts?Jl.forEach(t=>{e[t]=(...r)=>{n&&to(()=>{Oe.console[t](`Sentry Logger [${t}]:`,...r)})}}):Jl.forEach(t=>{e[t]=()=>{}}),e}),Nr="?",uf=/\(error: (.*)\)/,df=/captureMessage|captureException/;function Eo(n){return n[n.length-1]||{}}const hf="<anonymous>";function yr(n){try{return n&&typeof n=="function"&&n.name||hf}catch{return hf}}function ff(n){const e=n.exception;if(e){const t=[];
380try{return e.values.forEach(r=>{r.stacktrace.frames&&t.push(...r.stacktrace.frames)}),t}catch{return}}}const Uo={},pf={};function Br(n,e){Uo[n]=Uo[n]||[],Uo[n].push(e)}function qr(n,e){if(!pf[n]){pf[n]=!0;try{e()}catch(t){ts&&ge.error(`Error while instrumenting ${n}`,t)}}}function nn(n,e){const t=n&&Uo[n];if(t)for(const r of t)try{r(e)}catch(s){ts&&ge.error(`Error while triggering instrumentation handler.
381Type: ${n}
382Name: ${yr(r)}
383Error:`,s)}}let $c=null;function LP(){$c=Oe.onerror,Oe.onerror=function(n,e,t,r,s){return nn("error",{column:r,error:s,line:t,msg:n,url:e}),!!$c&&$c.apply(this,arguments)},Oe.onerror.__SENTRY_INSTRUMENTED__=!0}let Uc=null;function FP(){Uc=Oe.onunhandledrejection,Oe.onunhandledrejection=function(n){return nn("unhandledrejection",n),!Uc||Uc.apply(this,arguments)},Oe.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function sc(){return Ad(Oe),Oe}function Ad(n){const e=n.__SENTRY__=n.__SENTRY__||{};return e.version=e.version||Vr,e[Vr]=e[Vr]||{}}const kb=Object.prototype.toString;function Pd(n){switch(kb.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Wr(n,Error)}}function Xs(n,e){return kb.call(n)===`[object ${e}]`}function Cb(n){return Xs(n,"ErrorEvent")}function mf(n){return Xs(n,"DOMError")}function Dn(n){return Xs(n,"String")}function jd(n){return typeof n=="object"&&n!==null&&"__sentry_template_string__"in n&&"__sentry_template_values__"in n}function Yl(n){return n===null||jd(n)||typeof n!="object"&&typeof n!="function"}function Us(n){return Xs(n,"Object")}function ic(n){return typeof Event<"u"&&Wr(n,Event)}function oc(n){return!!(n&&n.then&&typeof n.then=="function")}function Wr(n,e){try{return n instanceof e}catch{return!1}}function Ab(n){return!(typeof n!="object"||n===null||!n.__isVue&&!n._isVue)}const Od=Oe;function Pb(n,e={}){if(!n)return"<unknown>";try{let t=n;const r=5,s=[];let i=0,o=0;const a=" > ",c=a.length;let u;const d=Array.isArray(e)?e:e.keyAttrs,f=!Array.isArray(e)&&e.maxStringLength||80;for(;t&&i++<r&&(u=$P(t,d),!(u==="html"||i>1&&o+s.length*c+u.length>=f));)s.push(u),o+=u.length,t=t.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function $P(n,e){const t=n,r=[];if(!t||!t.tagName)return"";if(Od.HTMLElement&&t instanceof HTMLElement&&t.dataset){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}r.push(t.tagName.toLowerCase());const s=e&&e.length?e.filter(o=>t.getAttribute(o)).map(o=>[o,t.getAttribute(o)]):null;if(s&&s.length)s.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{t.id&&r.push(`#${t.id}`);const o=t.className;if(o&&Dn(o)){const a=o.split(/\s+/);for(const c of a)r.push(`.${c}`)}}const i=["aria-label","type","name","title","alt"];for(const o of i){const a=t.getAttribute(o);a&&r.push(`[${o}="${a}"]`)}return r.join("")}function Ss(n,e=0){return typeof n!="string"||e===0||n.length<=e?n:`${n.slice(0,e)}...`}function gf(n,e){if(!Array.isArray(n))return"";const t=[];for(let r=0;r<n.length;r++){const s=n[r];try{Ab(s)?t.push("[VueViewModel]"):t.push(String(s))}catch{t.push("[value cannot be serialized]")}}return t.join(e)}function UP(n,e,t=!1){return!!Dn(n)&&(Xs(e,"RegExp")?e.test(n):!!Dn(e)&&(t?n===e:n.includes(e)))}function To(n,e=[],t=!1){return e.some(r=>UP(n,r,t))}function Rt(n,e,t){if(!(e in n))return;const r=n[e],s=t(r);typeof s=="function"&&jb(s,r);try{n[e]=s}catch{ts&&ge.log(`Failed to replace method "${e}" in object`,n)}}function Jr(n,e,t){try{Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0})}catch{ts&&ge.log(`Failed to add non-enumerable property "${e}" to object`,n)}}function jb(n,e){try{const t=e.prototype||{};n.prototype=e.prototype=t,Jr(n,"__sentry_original__",e)}catch{}}function Rd(n){return n.__sentry_original__}function Ob(n){if(Pd(n))return{message:n.message,name:n.name,stack:n.stack,...yf(n)};if(ic(n)){const e={type:n.type,target:vf(n.target),currentTarget:vf(n.currentTarget),...yf(n)};return typeof CustomEvent<"u"&&Wr(n,CustomEvent)&&(e.detail=n.detail),e}return n}function vf(n){try{return e=n,typeof Element<"u"&&Wr(e,Element)?Pb(n):Object.prototype.toString.call(n)}catch{return"<unknown>"}var e}function yf(n){if(typeof n=="object"&&n!==null){const e={};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e}return{}}function Bt(n){return Kl(n,new Map)}function Kl(n,e){if(function(t){if(!Us(t))return!1;try{const r=Object.getPrototypeOf(t).constructor.name;return!r||r==="Object"}catch{return!0}}(n)){const t=e.get(n);if(t!==void 0)return t;const r={};e.set(n,r);for(const s of Object.getOwnPropertyNames(n))n[s]!==void 0&&(r[s]=Kl(n[s],e));return r}if(Array.isArray(n)){const t=e.get(n);if(t!==void 0)return t;const r=[];
383return e.set(n,r),n.forEach(s=>{r.push(Kl(s,e))}),r}return n}function no(){return Date.now()/1e3}const Ln=function(){const{performance:n}=Oe;if(!n||!n.now)return no;const e=Date.now()-n.now(),t=n.timeOrigin==null?e:n.timeOrigin;return()=>(t+n.now())/1e3}();function Gt(){const n=Oe,e=n.crypto||n.msCrypto;let t=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(t=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(15&t())>>r/4).toString(16))}function Rb(n){return n.exception&&n.exception.values?n.exception.values[0]:void 0}function Zn(n){const{message:e,event_id:t}=n;if(e)return e;const r=Rb(n);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||t||"<unknown>":t||"<unknown>"}function Ql(n,e,t){const r=n.exception=n.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type="Error")}function zs(n,e){const t=Rb(n);if(!t)return;const r=t.mechanism;if(t.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const s={...r&&r.data,...e.data};t.mechanism.data=s}}function bf(n){if(function(e){try{return e.__sentry_captured__}catch{}}(n))return!0;try{Jr(n,"__sentry_captured__",!0)}catch{}return!1}var jn;function Yr(n){return new Vt(e=>{e(n)})}function ma(n){return new Vt((e,t)=>{t(n)})}(()=>{const{performance:n}=Oe;if(!n||!n.now)return;const e=36e5,t=n.now(),r=Date.now(),s=n.timeOrigin?Math.abs(n.timeOrigin+t-r):e,i=s<e,o=n.timing&&n.timing.navigationStart,a=typeof o=="number"?Math.abs(o+t-r):e;(i||a<e)&&s<=a&&n.timeOrigin})(),function(n){n[n.PENDING=0]="PENDING",n[n.RESOLVED=1]="RESOLVED",n[n.REJECTED=2]="REJECTED"}(jn||(jn={}));class Vt{constructor(e){Vt.prototype.__init.call(this),Vt.prototype.__init2.call(this),Vt.prototype.__init3.call(this),Vt.prototype.__init4.call(this),this._state=jn.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new Vt((r,s)=>{this._handlers.push([!1,i=>{if(e)try{r(e(i))}catch(o){s(o)}else r(i)},i=>{if(t)try{r(t(i))}catch(o){s(o)}else s(i)}]),this._executeHandlers()})}catch(e){return this.then(t=>t,e)}finally(e){return new Vt((t,r)=>{let s,i;return this.then(o=>{i=!1,s=o,e&&e()},o=>{i=!0,s=o,e&&e()}).then(()=>{i?r(s):t(s)})})}__init(){this._resolve=e=>{this._setResult(jn.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(jn.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===jn.PENDING&&(oc(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===jn.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(t=>{t[0]||(this._state===jn.RESOLVED&&t[1](this._value),this._state===jn.REJECTED&&t[2](this._value),t[0]=!0)})}}}function zP(n){const e=Ln(),t={sid:Gt(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(r){return Bt({sid:`${r.sid}`,init:r.init,started:new Date(1e3*r.started).toISOString(),timestamp:new Date(1e3*r.timestamp).toISOString(),status:r.status,errors:r.errors,did:typeof r.did=="number"||typeof r.did=="string"?`${r.did}`:void 0,duration:r.duration,abnormal_mechanism:r.abnormal_mechanism,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}(t)};return n&&Vs(t,n),t}function Vs(n,e={}){if(e.user&&(!n.ipAddress&&e.user.ip_address&&(n.ipAddress=e.user.ip_address),n.did||e.did||(n.did=e.user.id||e.user.email||e.user.username)),n.timestamp=e.timestamp||Ln(),e.abnormal_mechanism&&(n.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(n.ignoreDuration=e.ignoreDuration),e.sid&&(n.sid=e.sid.length===32?e.sid:Gt()),e.init!==void 0&&(n.init=e.init),!n.did&&e.did&&(n.did=`${e.did}`),typeof e.started=="number"&&(n.started=e.started),n.ignoreDuration)n.duration=void 0;else if(typeof e.duration=="number")n.duration=e.duration;else{const t=n.timestamp-n.started;n.duration=t>=0?t:0}e.release&&(n.release=e.release),e.environment&&(n.environment=e.environment),!n.ipAddress&&e.ipAddress&&(n.ipAddress=e.ipAddress),!n.userAgent&&e.userAgent&&(n.userAgent=e.userAgent),t
vendor: 5,751 bytes, line 383
383ypeof e.errors=="number"&&(n.errors=e.errors),e.status&&(n.status=e.status)}function wf(){return Gt()}function Xl(){return Gt().substring(16)}function ac(n,e,t=2){if(!e||typeof e!="object"||t<=0)return e;if(n&&e&&Object.keys(e).length===0)return n;const r={...n};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=ac(r[s],e[s],t-1));return r}const Zl="_sentrySpan";function xf(n,e){e?Jr(n,Zl,e):delete n[Zl]}function _f(n){return n[Zl]}class Id{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:wf(),spanId:Xl()}}clone(){const e=new Id;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,xf(e,_f(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Vs(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t=typeof e=="function"?e(this):e,[r,s]=t instanceof br?[t.getScopeData(),t.getRequestSession()]:Us(t)?[e,e.requestSession]:[],{tags:i,extra:o,user:a,contexts:c,level:u,fingerprint:d=[],propagationContext:f}=r||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),d.length&&(this._fingerprint=d),f&&(this._propagationContext=f),s&&(this._requestSession=s),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,xf(this,void 0),this._attachments=[],this.setPropagationContext({traceId:wf()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const r=typeof t=="number"?t:100;if(r<=0)return this;const s={timestamp:no(),...e};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_f(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=ac(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:Xl(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t&&t.event_id?t.event_id:Gt();if(!this._client)return ge.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:s,...t,event_id:r},this),r}captureMessage(e,t,r){const s=r&&r.event_id?r.event_id:Gt();if(!this._client)return ge.warn("No client configured on scope - will not capture message!"),s;const i=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:s},this),s}captureEvent(e,t){const r=t&&t.event_id?t.event_id:Gt();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(ge.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEac
383h(e=>{e(this)}),this._notifyingListeners=!1)}}const br=Id;class VP{constructor(e,t){let r,s;r=e||new br,s=t||new br,this._stack=[{scope:r}],this._isolationScope=s}withScope(e){const t=this._pushScope();let r;try{r=e(t)}catch(s){throw this._popScope(),s}return oc(r)?r.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function Bs(){const n=Ad(sc());return n.stack=n.stack||new VP(fa("defaultCurrentScope",()=>new br),fa("defaultIsolationScope",()=>new br))}function BP(n){return Bs().withScope(n)}function qP(n,e){const t=Bs();return t.withScope(()=>(t.getStackTop().scope=n,e(n)))}function Sf(n){return Bs().withScope(()=>n(Bs().getIsolationScope()))}function Nd(n){const e=Ad(n);return e.acs?e.acs:{withIsolationScope:Sf,withScope:BP,withSetScope:qP,withSetIsolationScope:(t,r)=>Sf(r),getCurrentScope:()=>Bs().getScope(),getIsolationScope:()=>Bs().getIsolationScope()}}function ns(){return Nd(sc()).getCurrentScope()}function ro(){return Nd(sc()).getIsolationScope()}function at(){return ns().getClient()}function GP(n){const e=n.getPropagationContext(),{traceId:t,spanId:r,parentSpanId:s}=e;return Bt({trace_id:t,span_id:r,parent_span_id:s})}function HP(n){const e=n._sentryMetrics;if(!e)return;const t={};for(const[,[r,s]]of e)(t[r]||(t[r]=[])).push(Bt(s));return t}const WP=/^sentry-/;function JP(n){const e=function(r){if(!(!r||!Dn(r)&&!Array.isArray(r)))return Array.isArray(r)?r.reduce((s,i)=>{const o=Ef(i);return Object.entries(o).forEach(([a,c])=>{s[a]=c}),s},{}):Ef(r)}(n);if(!e)return;const t=Object.entries(e).reduce((r,[s,i])=>(s.match(WP)&&(r[s.slice(7)]=i),r),{});return Object.keys(t).length>0?t:void 0}function Ef(n){return n.split(",").map(e=>e.split("=").map(t=>decodeURIComponent(t.trim()))).reduce((e,[t,r])=>(t&&r&&(e[t]=r),e),{})}let Tf=!1;function YP(n){const{spanId:e,traceId:t,isRemote:r}=n.spanContext();return Bt({parent_span_id:r?e:Dd(n).parent_span_id,span_id:r?Xl():e,trace_id:t})}function kf(n){return typeof n=="number"?Cf(n):Array.isArray(n)?n[0]+n[1]/1e9:n instanceof Date?Cf(n.getTime()):Ln()}function Cf(n){return n>9999999999?n/1e3:n}function Dd(n){if(function(e){return typeof e.getSpanJSON=="function"}(n))return n.getSpanJSON();try{const{spanId:e,traceId:t}=n.spanContext();if(function(r){const s=r;return!!(s.attributes&&s.startTime&&s.name&&s.endTime&&s.status)}(n)){const{attributes:r,startTime:s,name:i,endTime:o,parentSpanId:a,status:c}=n;return Bt({span_id:e,trace_id:t,data:r,description:i,parent_span_id:a,start_timestamp:kf(s),timestamp:kf(o)||void 0,status:KP(c),op:r["sentry.op"],origin:r["sentry.origin"],_metrics_summary:HP(n)})}return{span_id:e,trace_id:t}}catch{return{}}}function KP(n){if(n&&n.code!==0)return n.code===1?"ok":n.message||"unknown_error"}function Ib(n){return n._sentryRootSpan||n}function QP(){Tf||(to(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),Tf=!0)}const Md="production";function Nb(n,e){const t=e.getOptions(),{publicKey:r}=e.getDsn()||{},s=Bt({environment:t.environment||Md,release:t.release,public_key:r,trace_id:n});return e.emit("createDsc",s),s}function XP(n){const e=at();if(!e)return{};const t=Ib(n),r=t._frozenDsc;if(r)return r;const s=t.spanContext().traceState,i=s&&s.get("sentry.dsc"),o=i&&JP(i);if(o)return o;const a=Nb(n.spanContext().traceId,e),c=Dd(t),u=c.data||{},d=u["sentry.sample_rate"];d!=null&&(a.sample_rate=`${d}`);const f=u["sentry.source"],p=c.description;return f!=="url"&&p&&(a.transaction=p),function(v){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const b=at(),m=b&&b.getOptions();return!!m&&(m.enableTracing||"tracesSampleRate"in m||"tracesSampler"in m)}()&&(a.sampled=String(function(v){const{traceFlags:b}=v.spanContext();return b===1}(t))),e.emit("createDsc",a,t),a}const ZP=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ga(n,e=!1){const{host:t,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=n;return`${a}://${c}${e&&s?`:${s}`:""}@${t}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function Af(n){return{protocol:n.protocol,publicKey:n.publicKey||"",pass:n.pass||"",host:n.host,port:n.port||"",path:n.path||"",projectId:n.projectId}}function ej(n){const e=typeof n=="string"?function(t){const r=ZP.exec(t);if(!r)return void to(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});const[s,i,o="",a="",c="",u=""]=r.slice(1);let d="",f=u;const p=f.split("/");if(p.length>1&&(d=p.slice(0,-1).join("/"),f=p.pop()),f){const v=f.match(/^\d+/);v&&(f=v[0])}return Af({host:a,pass:o,path:d,projectId:f,port:c,protocol:s,publicKey:i})}(n):Af(n);if(e&&function(t){if(!ts)return!0;const{port:r,projectId:s,protocol:i}=t;return!(["protocol","publicKey","host","projectId"].find(o=>!t[o]&&(ge.error(`Invalid Sentry Dsn: ${o} missing`),!0))||(s.match(/^\d+$/)?function(o){return o==="http"||o==="https"}(i)?r&&isNaN(parseInt(r,10))&&(ge.error(`Invalid Sentry Dsn: Invalid port ${r}`),1):(ge.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),1):(ge.error(`Invalid Sentry Dsn: Invalid projectId ${s}`),1)))}(e))return e}function On(n,e=100,t=1/0){try{return eu("",n,e,t)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Db(n,e=3,t=102400){const r=On(n,e);return s=r,function(i){return~-encodeURI(i).split(/%..|./).length}(JSON.stringify(s))>t?Db(n,e-1,t):r;var s}function eu(n,e,t=1/0,r=1/0,s=function(){const i=typeof WeakSet=="function",o=i?new WeakSet:[];
383return[function(a){if(i)return!!o.has(a)||(o.add(a),!1);for(let c=0;c<o.length;c++)if(o[c]===a)return!0;return o.push(a),!1},function(a){if(i)o.delete(a);else for(let c=0;c<o.length;c++)if(o[c]===a){o.splice(c,1);break}}]}()){const[i,o]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const a=function(v,b){try{if(v==="domain"&&b&&typeof b=="object"&&b._events)return"[Domain]";if(v==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&b===global)return"[Global]";if(typeof window<"u"&&b===window)return"[Window]";if(typeof document<"u"&&b===document)return"[Document]";if(Ab(b))return"[VueViewModel]";if(Us(m=b)&&"nativeEvent"in m&&"preventDefault"in m&&"stopPropagation"in m)return"[SyntheticEvent]";if(typeof b=="number"&&!Number.isFinite(b))return`[${b}]`;if(typeof b=="function")return`[Function: ${yr(b)}]`;if(typeof b=="symbol")return`[${String(b)}]`;if(typeof b=="bigint")return`[BigInt: ${String(b)}]`;const g=function(x){const S=Object.getPrototypeOf(x);return S?S.constructor.name:"null prototype"}(b);return/^HTML(\w*)Element$/.test(g)?`[HTMLElement: ${g}]`:`[object ${g}]`}catch(g){return`**non-serializable** (${g})`}var m}(n,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:t;if(c===0)return a.replace("object ","");if(i(e))return"[Circular ~]";const u=e;if(u&&typeof u.toJSON=="function")try{return eu("",u.toJSON(),c-1,r,s)}catch{}const d=Array.isArray(e)?[]:{};let f=0;const p=Ob(e);for(const v in p){if(!Object.prototype.hasOwnProperty.call(p,v))continue;if(f>=r){d[v]="[MaxProperties ~]";break}const b=p[v];d[v]=eu(v,b,c-1,r,s),f++}return o(e),d}function Ui(n,e=[]){return[n,e]}function tj(n,e){const[t,r]=n;return[t,[...r,e]]}function Pf(n,e){const t=n[1];for(const r of t)if(e(r,r[0].type))return!0;return!1}function tu(n){return Oe.__SENTRY__&&Oe.__SENTRY__.encodePolyfill?Oe.__SENTRY__.encodePolyfill(n):new TextEncoder().encode(n)}function nj(n){const[e,t]=n;let r=JSON.stringify(e);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[tu(r),i]:r.push(typeof i=="string"?tu(i):i)}for(const i of t){const[o,a]=i;if(s(`
384${JSON.stringify(o)}
385`),typeof a=="string"||a instanceof Uint8Array)s(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(On(a))}s(c)}}return typeof r=="string"?r:function(i){const o=i.reduce((u,d)=>u+d.length,0),a=new Uint8Array(o);let c=0;for(const u of i)a.set(u,c),c+=u.length;return a}(r)}
385function rj(n){const e=typeof n.data=="string"?tu(n.data):n.data;return[Bt({type:"attachment",length:e.length,filename:n.filename,content_type:n.contentType,attachment_type:n.attachmentType}),e]}const sj={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function jf(n){return sj[n]}function Mb(n){if(!n||!n.sdk)return;const{name:e,version:t}=n.sdk;return{name:e,version:t}}function ij(n,e,t,r){const s=Mb(t),i=n.type&&n.type!=="replay_event"?n.type:"event";(function(a,c){c&&(a.sdk=a.sdk||{},a.sdk.name=a.sdk.name||c.name,a.sdk.version=a.sdk.version||c.version,a.sdk.integrations=[...a.sdk.integrations||[],...c.integrations||[]],a.sdk.packages=[...a.sdk.packages||[],...c.packages||[]])})(n,t&&t.sdk);const o=function(a,c,u,d){const f=a.sdkProcessingMetadata&&a.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:a.event_id,sent_at:new Date().toISOString(),...c&&{sdk:c},...!!u&&d&&{dsn:ga(d)},...f&&{trace:Bt({...f})}}}(n,s,r,e);return delete n.sdkProcessingMetadata,Ui(o,[[{type:i},n]])}function nu(n,e,t,r=0){return new Vt((s,i)=>{const o=n[r];if(e===null||typeof o!="function")s(e);else{const a=o({...e},t);Be&&o.id&&a===null&&ge.log(`Event processor "${o.id}" dropped event`),oc(a)?a.then(c=>nu(n,c,t,r+1).then(s)).then(null,i):nu(n,a,t,r+1).then(s).then(null,i)}})}let ko,Of,zc;function oj(n,e){const{fingerprint:t,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=e;(function(o,a){const{extra:c,tags:u,user:d,contexts:f,level:p,transactionName:v}=a,b=Bt(c);b&&Object.keys(b).length&&(o.extra={...b,...o.extra});const m=Bt(u);m&&Object.keys(m).length&&(o.tags={...m,...o.tags});const g=Bt(d);g&&Object.keys(g).length&&(o.user={...g,...o.user});const x=Bt(f);x&&Object.keys(x).length&&(o.contexts={...x,...o.contexts}),p&&(o.level=p),v&&o.type!=="transaction"&&(o.transaction=v)})(n,e),r&&function(o,a){o.contexts={trace:YP(a),...o.contexts},o.sdkProcessingMetadata={dynamicSamplingContext:XP(a),...o.sdkProcessingMetadata};const c=Ib(a),u=Dd(c).description;u&&!o.transaction&&o.type==="transaction"&&(o.transaction=u)}(n,r),function(o,a){o.fingerprint=o.fingerprint?Array.isArray(o.fingerprint)?o.fingerprint:[o.fingerprint]:[],a&&(o.fingerprint=o.fingerprint.concat(a)),o.fingerprint&&!o.fingerprint.length&&delete o.fingerprint}(n,t),function(o,a){const c=[...o.breadcrumbs||[],...a];o.breadcrumbs=c.length?c:void 0}(n,s),function(o,a){o.sdkProcessingMetadata={...o.sdkProcessingMetadata,...a}}(n,i)}function Rf(n,e){const{extra:t,tags:r,user:s,contexts:i,level:o,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:v,span:b}=e;Co(n,"extra",t),Co(n,"tags",r),Co(n,"user",s),Co(n,"contexts",i),n.sdkProcessingMetadata=ac(n.sdkProcessingMetadata,a,2),o&&(n.level=o),v&&(n.transactionName=v),b&&(n.span=b),c.length&&(n.breadcrumbs=[...n.breadcrumbs,...c]),u.length&&(n.fingerprint=[...n.fingerprint,...u]),d.length&&(n.eventProcessors=[...n.eventProcessors,...d]),f.length&&(n.attachments=[...n.attachments,...f]),n.propagationContext={...n.propagationContext,...p}}function Co(n,e,t){n[e]=ac(n[e],t,1)}function aj(n,e,t,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=n,c={...e,event_id:e.event_id||t.event_id||Gt(),timestamp:e.timestamp||no()},u=t.integrations||n.integrations.map(b=>b.name);(function(b,m){const{environment:g,release:x,dist:S,maxValueLength:E=250}=m;b.environment=b.environment||g||Md,!b.release&&x&&(b.release=x),!b.dist&&S&&(b.dist=S),b.message&&(b.message=Ss(b.message,E));const P=b.exception&&b.exception.values&&b.exception.values[0];P&&P.value&&(P.value=Ss(P.value,E));const C=b.request;C&&C.url&&(C.url=Ss(C.url,E))})(c,n),function(b,m){m.length>0&&(b.sdk=b.sdk||{},b.sdk.integrations=[...b.sdk.integrations||[],...m])}(c,u),s&&s.emit("applyFrameMetadata",e),e.type===void 0&&function(b,m){const g=function(x){const S=Oe._sentryDebugIds;if(!S)return{};const E=Object.keys(S);return zc&&E.length===Of||(Of=E.length,zc=E.reduce((P,C)=>
385{ko||(ko={});const O=ko[C];if(O)P[O[0]]=O[1];else{const N=x(C);for(let D=N.length-1;D>=0;D--){const R=N[D],F=R&&R.filename,A=S[C];if(F&&A){P[F]=A,ko[C]=[F,A];break}}}return P},{})),zc}(m);try{b.exception.values.forEach(x=>{x.stacktrace.frames.forEach(S=>{g&&S.filename&&(S.debug_id=g[S.filename])})})}catch{}}(c,n.stackParser);const d=function(b,m){if(!m)return b;const g=b?b.clone():new br;return g.update(m),g}(r,t.captureContext);t.mechanism&&zs(c,t.mechanism);const f=s?s.getEventProcessors():[],p=fa("globalScope",()=>new br).getScopeData();i&&Rf(p,i.getScopeData()),d&&Rf(p,d.getScopeData());const v=[...t.attachments||[],...p.attachments];return v.length&&(t.attachments=v),oj(c,p),nu([...f,...p.eventProcessors],c,t).then(b=>(b&&function(m){const g={};try{m.exception.values.forEach(S=>{S.stacktrace.frames.forEach(E=>{E.debug_id&&(E.abs_path?g[E.abs_path]=E.debug_id:E.filename&&(g[E.filename]=E.debug_id),delete E.debug_id)})})}catch{}if(Object.keys(g).length===0)return;m.debug_meta=m.debug_meta||{},m.debug_meta.images=m.debug_meta.images||[];const x=m.debug_meta.images;Object.entries(g).forEach(([S,E])=>{x.push({type:"sourcemap",code_file:S,debug_id:E})})}(b),typeof o=="number"&&o>0?function(m,g,x){if(!m)return null;const S={...m,...m.breadcrumbs&&{breadcrumbs:m.breadcrumbs.map(E=>({...E,...E.data&&{data:On(E.data,g,x)}}))},...m.user&&{user:On(m.user,g,x)},...m.contexts&&{contexts:On(m.contexts,g,x)},...m.extra&&{extra:On(m.extra,g,x)}};return m.contexts&&m.contexts.trace&&S.contexts&&(S.contexts.trace=m.contexts.trace,m.contexts.trace.data&&(S.contexts.trace.data=On(m.contexts.trace.data,g,x))),m.spans&&(S.spans=m.spans.map(E=>({...E,...E.data&&{data:On(E.data,g,x)}}))),m.contexts&&m.contexts.flags&&S.contexts&&(S.contexts.flags=On(m.contexts.flags,3,x)),S}(b,o,a):b))}function If(n,e){return ns().captureEvent(n,e)}function Nf(n){const e=at(),t=ro(),r=ns(),{release:s,environment:i=Md}=e&&e.getOptions()||{},{userAgent:o}=Oe.navigator||{},a=zP({release:s,environment:i,user:r.getUser()||t.getUser(),...o&&{userAgent:o},...n}),c=t.getSession();return c&&c.status==="ok"&&Vs(c,{status:"exited"}),Lb(),t.setSession(a),r.setSession(a),a}function Lb(){const n=ro(),e=ns(),t=e.getSession()||n.getSession();t&&function(r,s){let i={};r.status==="ok"&&(i={status:"exited"}),Vs(r,i)}(t),Fb(),n.setSession(),e.setSession()}function Fb(){const n=ro(),e=ns(),t=at(),r=e.getSession()||n.getSession();r&&t&&t.captureSession(r)}function Df(n=!1){n?Lb():Fb()}function cj(n,e,t){return e||`${function(r){return`${function(s){const i=s.protocol?`${s.protocol}:`:"",o=s.port?`:${s.port}`:"";return`${i}//${s.host}${o}${s.path?`/${s.path}`:""}/api/`}(r)}${r.projectId}/envelope/`}(n)}?${function(r,s){const i={sentry_version:"7"};return r.publicKey&&(i.sentry_key=r.publicKey),s&&(i.sentry_client=`${s.name}/${s.version}`),new URLSearchParams(i).toString()}(n,t)}`}const Mf=[];function Lf(n,e){for(const t of e)t&&t.afterAllSetup&&t.afterAllSetup(n)}function Ff(n,e,t){if(t[e.name])Be&&ge.log(`Integration skipped because it was already installed: ${e.name}`);else{if(t[e.name]=e,Mf.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),Mf.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(n),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);n.on("preprocessEvent",(s,i)=>r(s,i,n))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),s=Object.assign((i,o)=>r(i,o,n),{id:e.name});n.addEventProcessor(s)}Be&&ge.log(`Integration installed: ${e.name}`)}}class Kt extends Error{constructor(e,t="warn"){super(e),this.message=e,this.logLevel=t}}const $f="Not capturing exception because it's already been captured.";class lj{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=ej(e.dsn):Be&&ge.warn("No DSN provided, client will not send events."),this._dsn){const r=cj(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}const t=["enableTracing","tracesSampleRate","tracesSampler"].find(r=>r in e&&e[r]==null);t&&to(()=>{console.warn(`[Sentry] Deprecation warning: \`${t}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,t,r){const s=Gt();if(bf(e))return Be&&ge.log($f),s;const i={event_id:s,...t};return this._process(this.eventFromException(e,i).then(o=>this._captureEvent(o,i,r))),i.event_id}captureMessage(e,t,r,s){const i={event_id:Gt(),...r},o=jd(e)?e:String(e),a=Yl(e)?this.eventFromMessage(o,t,i):this.eventFromException(e,i);return this._process(a.then(c=>this._captureEvent(c,i,s))),i.event_id}captureEvent(e,t,r){const s=Gt();if(t&&t.originalException&&bf(t.originalException))return Be&&ge.log($f),s;const i={event_id:s,...t},o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,i,o||r)),i.event_id}captureSession(e){typeof e.release!="string"?Be&&ge.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Vs(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;
385return t?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>t.flush(e).then(s=>r&&s))):Yr(!0)}close(e){return this.flush(e).then(t=>(this.getOptions().enabled=!1,this.emit("close"),t))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];Ff(this,e,this._integrations),t||Lf(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=ij(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of t.attachments||[])r=tj(r,rj(i));const s=this.sendEnvelope(r);s&&s.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){const t=function(r,s,i,o){const a=Mb(i);return Ui({sent_at:new Date().toISOString(),...a&&{sdk:a},...!!o&&s&&{dsn:ga(s)}},["aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,r){if(this._options.sendClientReports){const s=typeof r=="number"?r:1,i=`${e}:${t}`;Be&&ge.log(`Recording outcome: "${i}"${s>1?` (${s} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+s}}on(e,t){const r=this._hooks[e]=this._hooks[e]||[];return r.push(t),()=>{const s=r.indexOf(t);s>-1&&r.splice(s,1)}}emit(e,...t){const r=this._hooks[e];r&&r.forEach(s=>s(...t))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,t=>(Be&&ge.error("Error while sending envelope:",t),t)):(Be&&ge.error("Transport disabled"),Yr({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(t,r){const s={};return r.forEach(i=>{i&&Ff(t,i,s)}),s}(this,e),Lf(this,e)}_updateSessionFromEvent(e,t){let r=t.level==="fatal",s=!1;const i=t.exception&&t.exception.values;if(i){s=!0;for(const a of i){const c=a.mechanism;if(c&&c.handled===!1){r=!0;break}}}const o=e.status==="ok";(o&&e.errors===0||o&&r)&&(Vs(e,{...r&&{status:"crashed"},errors:e.errors||Number(s||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Vt(t=>{let r=0;const s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),t(!0)):(r+=1,e&&r>=e&&(clearInterval(s),t(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,r=ns(),s=ro()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),e.type||s.setLastEventId(e.event_id||t.event_id),aj(i,e,t,r,this,s).then(a=>{if(a===null)return a;a.contexts={trace:GP(r),...a.contexts};const c=function(u,d){const f=d.getPropagationContext();return f.dsc||Nb(f.traceId,u)}(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then(s=>s.event_id,s=>{Be&&(s instanceof Kt&&s.logLevel==="log"?ge.log(s.message):ge.warn(s))})}_processEvent(e,t,r){const s=this.getOptions(),{sampleRate:i}=s,o=zf(e),a=Uf(e),c=e.type||"error",u=`before send for type \`${c}\``,d=i===void 0?void 0:function(v){if(typeof v=="boolean")return Number(v);const b=typeof v=="string"?parseFloat(v):v;if(!(typeof b!="number"||isNaN(b)||b<0||b>1))return b;Be&&ge.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(v)} of type ${JSON.stringify(typeof v)}.`)}(i);if(a&&typeof d=="number"&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error",e),ma(new Kt(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const f=c==="replay_event"?"replay":c,p=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,r,p).then(v=>{if(v===null)throw this.recordDroppedEvent("event_processor",f,e),new Kt("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return v;const b=function(m,g,x,S){const{beforeSend:E,beforeSendTransaction:P,beforeSendSpan:C}=g;if(Uf(x)&&E)return E(x,S);if(zf(x)){if(x.spans&&C){const O=[];for(const N of x.spans){const D=C(N);D?O.push(D):(QP(),m.recordDroppedEvent("before_send","span"))}x.spans=O}if(P){if(x.spans){const O=x.spans.length;x.sdkProcessingMetadata={...x.sdkProcessingMetadata,spanCountBeforeProcessing:O}}return P(x,S)}}return x}(this,s,v,t);return function(m,g){const x=`${g} must return \`null\` or a valid event.`;if(oc(m))return m.then(S=>{if(!Us(S)&&S!==null)throw new Kt(x);return S},S=>{throw new Kt(`${g} rejected with ${S}`)});if(!Us(m)&&m!==null)throw new Kt(x);return m}(b,u)}).then(v=>{if(v===null){if(this.recordDroppedEvent("before_send",f,e),o){const g=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",g)}throw new Kt(`${u} returned \`null\`, will not send event.`,"log")}const b=r&&r.getSession();if(!o&&b&&this._updateSessionFromEvent(b,v),o){const g=(v.sdkProcessingMetadata&&v.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(v.spans?v.spans.length:0);g>0&&this.recordDroppedEvent("before_send","span",g)}const m=v.transaction_info;if(o&&m&&v.transaction!==e.transaction){const g="custom";v.transaction_info={...m,source:g}}return this.sendEvent(v,t),v}).then(null,v=>{throw v instanceof Kt?v:(this.captureException(v,{data:{__sentry__:!0},originalException:v}),new Kt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
386Reason: ${v}`))})}_process(e){this._numProcessing++,e.then(t=>(this._numProcessing--,t),t=>(this._numProcessing--,t))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([t,r])=>{const[s,i]=t.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){Be&&ge.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0)return void(Be&&ge.log("No outcomes to send"));if(!this._dsn)return void(Be&&ge.log("No dsn provided, will not send outcomes"));Be&&ge.log("Sending outcomes:",e);const t=(r=e,Ui((s=this._options.tunnel&&ga(this._dsn))?{dsn:s}:{},[[{type:"client_report"},{timestamp:i||no(),discarded_events:r}]]));var r,s,i;this.sendEnvelope(t)}}function Uf(n){return n.type===void 0}function zf(n){return n.type==="transaction"}function uj(n){const e=[];function t(r){return e.splice(e.indexOf(r),1)[0]||Promise.resolve(void 0)}return{$:e,add:function(r){if(!(n===void 0||e.length<n))return ma(new Kt("Not adding Promise because buffer limit was reached."));const s=r();return e.indexOf(s)===-1&&e.push(s),s.then(()=>t(s)).then(null,()=>t(s).then(null,()=>{})),s},drain:function(r){return new Vt((s,i)=>{let o=e.length;if(!o)return s(!0);const a=setTimeout(()=>{r&&r>0&&s(!1)},r);e.forEach(c=>{Yr(c).then(()=>{--o||(clearTimeout(a),s(!0))},i)})})}}}function dj(n,{statusCode:e,headers:t},r=Date.now()){const s={...n},i=t&&t["x-sentry-rate-limits"],o=t&&t["retry-after"];if(i)for(const a of i.trim().split(",")){const[c,u,,,d]=a.split(":",5),f=parseInt(c,10),p=1e3*(isNaN(f)?60:f);if(u)for(const v of u.split(";"))v==="metric_bucket"&&d&&!d.split(";").includes("custom")||(s[v]=r+p);else s.all=r+p}else o?s.all=r+function(a,c=Date.now()){const u=parseInt(`${a}`,10);if(!isNaN(u))return 1e3*u;const d=Date.parse(`${a}`);return isNaN(d)?6e4:d-c}(o,r):e===429&&(s.all=r+6e4);return s}function hj(n,e,t=uj(n.bufferSize||64)){let r={};return{send:function(s){const i=[];if(Pf(s,(c,u)=>{const d=jf(u);if(function(f,p,v=Date.now()){return function(b,m){return b[m]||b.all||0}(f,p)>v}(r,d)){const f=Vf(c,u);n.recordDroppedEvent("ratelimit_backoff",d,f)}else i.push(c)}),i.length===0)return Yr({});const o=Ui(s[0],i),a=c=>{Pf(o,(u,d)=>{const f=Vf(u,d);
386n.recordDroppedEvent(c,jf(d),f)})};return t.add(()=>e({body:nj(o)}).then(c=>(c.statusCode!==void 0&&(c.statusCode<200||c.statusCode>=300)&&Be&&ge.warn(`Sentry responded with status code ${c.statusCode} to sent event.`),r=dj(r,c),c),c=>{throw a("network_error"),c})).then(c=>c,c=>{if(c instanceof Kt)return Be&&ge.error("Skipped sending event because buffer is full."),a("queue_overflow"),Yr({});throw c})},flush:s=>t.drain(s)}}function Vf(n,e){if(e==="event"||e==="transaction")return Array.isArray(n)?n[1]:void 0}const fj=100;function Cr(n,e){const t=at(),r=ro();if(!t)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=fj}=t.getOptions();if(i<=0)return;const o={timestamp:no(),...n},a=s?to(()=>s(o,e)):o;a!==null&&(t.emit&&t.emit("beforeAddBreadcrumb",a,e),r.addBreadcrumb(a,i))}let Bf;const qf=new WeakMap,pj=()=>({name:"FunctionToString",setupOnce(){Bf=Function.prototype.toString;try{Function.prototype.toString=function(...n){const e=Rd(this),t=qf.has(at())&&e!==void 0?e:this;return Bf.apply(t,n)}}catch{}},setup(n){qf.set(n,!0)}}),mj=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/],gj=(n={})=>({name:"InboundFilters",processEvent(e,t,r){const s=r.getOptions(),i=function(o={},a={}){return{allowUrls:[...o.allowUrls||[],...a.allowUrls||[]],denyUrls:[...o.denyUrls||[],...a.denyUrls||[]],ignoreErrors:[...o.ignoreErrors||[],...a.ignoreErrors||[],...o.disableErrorDefaults?[]:mj],ignoreTransactions:[...o.ignoreTransactions||[],...a.ignoreTransactions||[]],ignoreInternal:o.ignoreInternal===void 0||o.ignoreInternal}}(n,s);return function(o,a){return a.ignoreInternal&&function(c){try{return c.exception.values[0].type==="SentryError"}catch{}return!1}(o)?(Be&&ge.warn(`Event dropped due to being internal Sentry Error.
387Event: ${Zn(o)}`),!0):function(c,u){return c.type||!u||!u.length?!1:function(d){const f=[];d.message&&f.push(d.message);let p;try{p=d.exception.values[d.exception.values.length-1]}catch{}return p&&p.value&&(f.push(p.value),p.type&&f.push(`${p.type}: ${p.value}`)),f}(c).some(d=>To(d,u))}(o,a.ignoreErrors)?(Be&&ge.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
388Event: ${Zn(o)}`),!0):function(c){return c.type||!c.exception||!c.exception.values||c.exception.values.length===0?!1:!c.message&&!c.exception.values.some(u=>u.stacktrace||u.type&&u.type!=="Error"||u.value)}(o)?(Be&&ge.warn(`Event dropped due to not having an error message, error type or stacktrace.
389Event: ${Zn(o)}`),!0):function(c,u){if(c.type!=="transaction"||!u||!u.length)return!1;const d=c.transaction;return!!d&&To(d,u)}(o,a.ignoreTransactions)?(Be&&ge.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
390Event: ${Zn(o)}`),!0):function(c,u){if(!u||!u.length)return!1;const d=Ao(c);return!!d&&To(d,u)}(o,a.denyUrls)?(Be&&ge.warn(`Event dropped due to being matched by \`denyUrls\` option.
391Event: ${Zn(o)}.
392Url: ${Ao(o)}`),!0):function(c,u){if(!u||!u.length)return!0;const d=Ao(c);return!d||To(d,u)}(o,a.allowUrls)?!1:(Be&&ge.warn(`Event dropped due to not being matched by \`allowUrls\` option.
393Event: ${Zn(o)}.
394Url: ${Ao(o)}`),!0)}(e,i)?null:e}});function Ao(n){try{let e;try{e=n.exception.values[0].stacktrace.frames}catch{}return e?function(t=[]){for(let r=t.length-1;r>=0;r--){const s=t[r];if(s&&s.filename!=="<anonymous>"&&s.filename!=="[native code]")return s.filename||null}return null}(e):null}catch{return Be&&ge.error(`Cannot extract url for event ${Zn(n)}`),null}}function vj(n,e,t=250,r,s,i,o){if(!(i.exception&&i.exception.values&&o&&Wr(o.originalException,Error)))return;const a=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;var c,u;a&&(i.exception.values=(c=ru(n,e,s,o.originalException,r,i.exception.values,a,0),u=t,c.map(d=>(d.value&&(d.value=Ss(d.value,u)),d))))}function ru(n,e,t,r,s,i,o,a){if(i.length>=t+1)return i;let c=[...i];if(Wr(r[s],Error)){Gf(o,a);const u=n(e,r[s]),d=c.length;Hf(u,s,d,a),c=ru(n,e,t,r[s],s,[u,...c],u,d)}
394return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Wr(u,Error)){Gf(o,a);const f=n(e,u),p=c.length;Hf(f,`errors[${d}]`,p,a),c=ru(n,e,t,u,s,[f,...c],f,p)}}),c}function Gf(n,e){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,...n.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function Hf(n,e,t,r){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,type:"chained",source:e,exception_id:t,parent_id:r}}function Vc(n){if(!n)return{};const e=n.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const t=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:t,hash:r,relative:e[5]+t+r}}function yj(){"console"in Oe&&Jl.forEach(function(n){n in Oe.console&&Rt(Oe.console,n,function(e){return pa[n]=e,function(...t){nn("console",{args:t,level:n});const r=pa[n];r&&r.apply(Oe.console,t)}})})}function bj(n){return n==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(n)?n:"log"}const wj=()=>{let n;return{name:"Dedupe",processEvent(e){if(e.type)return e;try{if(function(t,r){return r?!!(function(s,i){const o=s.message,a=i.message;return!(!o&&!a||o&&!a||!o&&a||o!==a||!Jf(s,i)||!Wf(s,i))}(t,r)||function(s,i){const o=Yf(i),a=Yf(s);return!(!o||!a||o.type!==a.type||o.value!==a.value||!Jf(s,i)||!Wf(s,i))}(t,r)):!1}(e,n))return Be&&ge.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return n=e}}};function Wf(n,e){let t=ff(n),r=ff(e);if(!t&&!r)return!0;if(t&&!r||!t&&r||r.length!==t.length)return!1;for(let s=0;s<r.length;s++){const i=r[s],o=t[s];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function Jf(n,e){let t=n.fingerprint,r=e.fingerprint;if(!t&&!r)return!0;if(t&&!r||!t&&r)return!1;try{return t.join("")===r.join("")}catch{return!1}}function Yf(n){return n.exception&&n.exception.values&&n.exception.values[0]}function Kf(n){return n===void 0?void 0:n>=400&&n<500?"warning":n>=500?"error":void 0}const Bc=Oe;function su(n){return n&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(n.toString())}function xj(){if(typeof EdgeRuntime=="string")return!0;if(!function(){if(!("fetch"in Bc))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(su(Bc.fetch))return!0;let n=!1;const e=Bc.document;if(e&&typeof e.createElement=="function")try{const t=e.createElement("iframe");t.hidden=!0,e.head.appendChild(t),t.contentWindow&&t.contentWindow.fetch&&(n=su(t.contentWindow.fetch)),e.head.removeChild(t)}catch(t){ts&&ge.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return n}function _j(n,e){const t="fetch";Br(t,n),qr(t,()=>function(r,s=!1){s&&!xj()||Rt(Oe,"fetch",function(i){return function(...o){const a=new Error,{method:c,url:u}=function(f){if(f.length===0)return{method:"GET",url:""};if(f.length===2){const[v,b]=f;return{url:Qf(v),method:iu(b,"method")?String(b.method).toUpperCase():"GET"}}const p=f[0];return{url:Qf(p),method:iu(p,"method")?String(p.method).toUpperCase():"GET"}}(o),d={args:o,fetchData:{method:c,url:u},startTimestamp:1e3*Ln(),virtualError:a};return r||nn("fetch",{...d}),i.apply(Oe,o).then(async f=>(r?r(f):nn("fetch",{...d,endTimestamp:1e3*Ln(),response:f}),f),f=>{throw nn("fetch",{...d,endTimestamp:1e3*Ln(),error:f}),Pd(f)&&f.stack===void 0&&(f.stack=a.stack,Jr(f,"framesToPop",1)),f})}})}(void 0,e))}function iu(n,e){return!!n&&typeof n=="object"&&!!n[e]}function Qf(n){return typeof n=="string"?n:n?iu(n,"url")?n.url:n.toString?n.toString():"":""}const Po=Oe,tt=Oe;let ou=0;function Xf(){return ou>0}function qs(n,e={}){if(!function(r){return typeof r=="function"}(n))return n;try{const r=n.__sentry_wrapped__;if(r)return typeof r=="function"?r:n;if(Rd(n))return n}catch{return n}const t=function(...r){try{const s=r.map(i=>qs(i,e));return n.apply(this,s)}catch(s){throw ou++,setTimeout(()=>{ou--}),function(...i){const o=Nd(sc());if(i.length===2){const[a,c]=i;return a?o.withSetScope(a,c):o.withScope(c)}o.withScope(i[0])}(i=>{var o;i.addEventProcessor(a=>(e.mechanism&&(Ql(a,void 0),zs(a,e.mechanism)),a.extra={...a.extra,arguments:r},a)),o=s,ns().captureException(o,void 0)}),s}};try{for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}catch{}jb(t,n),Jr(n,"__sentry_wrapped__",t);try{Object.getOwnPropertyDescriptor(t,"name").configurable&&Object.defineProperty(t,"name",{get:()=>n.name})}catch{}return t}const cc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Ld(n,e){const t=Fd(n,e),r={type:Tj(e),value:kj(e)};return t.length&&(r.stacktrace={frames:t}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Sj(n,e,t,r){const s=at(),i=s&&s.getOptions().normalizeDepth,o=function(u){for(const d in u)if(Object.prototype.hasOwnProperty.call(u,d)){const f=u[d];if(f instanceof Error)return f}}(e),a={__serialized__:Db(e,i)};if(o)return{exception:{values:[Ld(n,o)]},extra:a};const c={exception:{values:[{type:ic(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:Cj(e,{isUnhandledRejection:r})}]},extra:a};if(t){const u=Fd(n,t);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function qc(n,e){return{exception:{values:[Ld(n,e)]}}}function Fd(n,e){const t=e.stacktrace||e.stack||"",r=function(i){return i&&Ej.test(i.message)?1:0}(e),s=function(i){return typeof i.framesToPop=="number"?i.framesToPop:0}(e);try{return n(t,r,s)}catch{}return[]}const Ej=/Minified React error #\d+;/i;function $b(n){return typeof WebAssembly<"u"&&WebAssembly.Exception!==void 0&&n instanceof WebAssembly.Exception}function Tj(n){const e=n&&n.name;return!e&&$b(n)?n.message&&Array.isArray(n.message)&&n.message.length==2?n.message[0]:"WebAssembly.Exception":e}function kj(n){const e=n&&n.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:$b(n)&&Array.isArray(n.message)&&n.message.length==2?n.message[1]:e:"No error message"}function au(n,e,t,r,s){let i;if(Cb(e)&&e.error)return qc(n,e.error);if(mf(e)||Xs(e,"DOMException")){const o=e;if("stack"in e)i=qc(n,e);else{const a=o.name||(mf(o)?"DOMError":"DOMException"),c=o.message?`${a}: ${o.message}`:a;i=cu(n,c,t,r),Ql(i,c)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return Pd(e)?qc(n,e):Us(e)||ic(e)?(i=Sj(n,e,t,s),zs(i,{synthetic:!0}),i):(i=cu(n,e,t,r),Ql(i,`${e}`),zs(i,{synthetic:!0}),i)}function cu(n,e,t,r){const s={};if(r&&t){const i=Fd(n,t);i.length&&(s.exception={values:[{value:e,stacktrace:{frames:i}}]}),zs(s,{synthetic:!0})}
394if(jd(e)){const{__sentry_template_string__:i,__sentry_template_values__:o}=e;return s.logentry={message:i,params:o},s}return s.message=e,s}function Cj(n,{isUnhandledRejection:e}){const t=function(s,i=40){const o=Object.keys(Ob(s));o.sort();const a=o[0];if(!a)return"[object has no keys]";if(a.length>=i)return Ss(a,i);for(let c=o.length;c>0;c--){const u=o.slice(0,c).join(", ");if(!(u.length>i))return c===o.length?u:Ss(u,i)}return""}(n),r=e?"promise rejection":"exception";return Cb(n)?`Event \`ErrorEvent\` captured as ${r} with message \`${n.message}\``:ic(n)?`Event \`${function(s){try{const i=Object.getPrototypeOf(s);return i?i.constructor.name:void 0}catch{}}(n)}\` (type=${n.type}) captured as ${r}`:`Object captured as ${r} with keys: ${t}`}class Aj extends lj{constructor(e){const t={parentSpanIsAlwaysRootSpan:!0,...e};(function(r,s,i=[s],o="npm"){const a=r._metadata||{};a.sdk||(a.sdk={name:`sentry.javascript.${s}`,packages:i.map(c=>({name:`${o}:@sentry/${c}`,version:Vr})),version:Vr}),r._metadata=a})(t,"browser",["browser"],tt.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&tt.document&&tt.document.addEventListener("visibilitychange",()=>{tt.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return function(r,s,i,o){const a=au(r,s,i&&i.syntheticException||void 0,o);return zs(a),a.level="error",i&&i.event_id&&(a.event_id=i.event_id),Yr(a)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return function(s,i,o="info",a,c){const u=cu(s,i,a&&a.syntheticException||void 0,c);return u.level=o,a&&a.event_id&&(u.event_id=a.event_id),Yr(u)}(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(cc&&ge.warn("SDK not enabled, will not capture user feedback."));const t=function(r,{metadata:s,tunnel:i,dsn:o}){const a={event_id:r.event_id,sent_at:new Date().toISOString(),...s&&s.sdk&&{sdk:{name:s.sdk.name,version:s.sdk.version}},...!!i&&!!o&&{dsn:ga(o)}};return Ui(a,[function(u){return[{type:"user_report"},u]}(r)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(t)}_prepareEvent(e,t,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r)}}const Pj=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,gt=Oe;let Zf,Gc,Hc,jo;function jj(){if(!gt.document)return;const n=nn.bind(null,"dom"),e=ep(n,!0);gt.document.addEventListener("click",e,!1),gt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(t=>{const r=gt[t],s=r&&r.prototype;s&&s.hasOwnProperty&&s.hasOwnProperty("addEventListener")&&(Rt(s,"addEventListener",function(i){return function(o,a,c){if(o==="click"||o=="keypress")try{const u=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=u[o]=u[o]||{refCount:0};if(!d.handler){const f=ep(n);d.handler=f,i.call(this,o,f,c)}d.refCount++}catch{}return i.call(this,o,a,c)}}),Rt(s,"removeEventListener",function(i){return function(o,a,c){if(o==="click"||o=="keypress")try{const u=this.__sentry_instrumentation_handlers__||{},d=u[o];d&&(d.refCount--,d.refCount<=0&&(i.call(this,o,d.handler,c),d.handler=void 0,delete u[o]),Object.keys(u).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,o,a,c)}}))})}function ep(n,e=!1){return t=>{if(!t||t._sentryCaptured)return;const r=function(i){try{return i.target}catch{return null}}(t);if(function(i,o){return i==="keypress"&&(!o||!o.tagName||o.tagName!=="INPUT"&&o.tagName!=="TEXTAREA"&&!o.isContentEditable)}(t.type,r))return;Jr(t,"_sentryCaptured",!0),r&&!r._sentryId&&Jr(r,"_sentryId",Gt());const s=t.type==="keypress"?"input":t.type;(function(i){if(i.type!==Gc)return!1;try{if(!i.target||i.target._sentryId!==Hc)return!1}catch{}return!0})(t)||(n({event:t,name:s,global:e}),Gc=t.type,Hc=r?r._sentryId:void 0),clearTimeout(Zf),Zf=gt.setTimeout(()=>{Hc=void 0,Gc=void 0},1e3)}}function Ub(n){const e="history";Br(e,n),qr(e,Oj)}function Oj(){if(!function(){const t=Po.chrome,r=t&&t.app&&t.app.runtime,s="history"in Po&&!!Po.history.pushState&&!!Po.history.replaceState;return!r&&s}())return;const n=gt.onpopstate;function e(t){return function(...r){const s=r.length>2?r[2]:void 0;if(s){const i=jo,o=String(s);jo=o,nn("history",{from:i,to:o})}return t.apply(this,r)}}gt.onpopstate=function(...t){const r=gt.location.href,s=jo;if(jo=r,nn("history",{from:s,to:r}),n)try{return n.apply(this,t)}catch{}},Rt(gt.history,"pushState",e),Rt(gt.history,"replaceState",e)}const zo={};function tp(n){zo[n]=void 0}const mi="__sentry_xhr_v3__";function Rj(){if(!gt.XMLHttpRequest)return;const n=XMLHttpRequest.prototype;n.open=new Proxy(n.open,{apply(e,t,r){const s=new Error,i=1e3*Ln(),o=Dn(r[0])?r[0].toUpperCase():void 0,a=function(u){if(Dn(u))return u;try{return u.toString()}catch{}}(r[1]);if(!o||!a)return e.apply(t,r);t[mi]={method:o,url:a,request_headers:{}}
394,o==="POST"&&a.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const c=()=>{const u=t[mi];if(u&&t.readyState===4){try{u.status_code=t.status}catch{}nn("xhr",{endTimestamp:1e3*Ln(),startTimestamp:i,xhr:t,virtualError:s})}};return"onreadystatechange"in t&&typeof t.onreadystatechange=="function"?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(u,d,f)=>(c(),u.apply(d,f))}):t.addEventListener("readystatechange",c),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(u,d,f){const[p,v]=f,b=d[mi];return b&&Dn(p)&&Dn(v)&&(b.request_headers[p.toLowerCase()]=v),u.apply(d,f)}}),e.apply(t,r)}}),n.send=new Proxy(n.send,{apply(e,t,r){const s=t[mi];return s?(r[0]!==void 0&&(s.body=r[0]),nn("xhr",{startTimestamp:1e3*Ln(),xhr:t}),e.apply(t,r)):e.apply(t,r)}})}function Ij(n,e=function(t){const r=zo[t];if(r)return r;let s=gt[t];if(su(s))return zo[t]=s.bind(gt);const i=gt.document;if(i&&typeof i.createElement=="function")try{const o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);const a=o.contentWindow;a&&a[t]&&(s=a[t]),i.head.removeChild(o)}catch(o){Pj&&ge.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return s&&(zo[t]=s.bind(gt))}("fetch")){let t=0,r=0;return hj(n,function(s){const i=s.body.length;t+=i,r++;const o={body:s.body,method:"POST",referrerPolicy:"origin",headers:n.headers,keepalive:t<=6e4&&r<15,...n.fetchOptions};if(!e)return tp("fetch"),ma("No fetch implementation available");try{return e(n.url,o).then(a=>(t-=i,r--,{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}))}catch(a){return tp("fetch"),t-=i,r--,ma(a)}})}function Wc(n,e,t,r){const s={filename:n,function:e==="<anonymous>"?Nr:e,in_app:!0};return t!==void 0&&(s.lineno=t),r!==void 0&&(s.colno=r),s}const Nj=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Dj=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mj=/\((\S*)(?::(\d+))(?::(\d+))\)/,Lj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Fj=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$j=function(...n){const e=n.sort((t,r)=>t[0]-r[0]).map(t=>t[1]);return(t,r=0,s=0)=>{const i=[],o=t.split(`
395`);for(let a=r;a<o.length;a++){const c=o[a];if(c.length>1024)continue;const u=uf.test(c)?c.replace(uf,"$1"):c;if(!u.match(/\S*Error: /)){for(const d of e){const f=d(u);if(f){i.push(f);break}}if(i.length>=50+s)break}}return function(a){if(!a.length)return[];const c=Array.from(a);return/sentryWrapped/.test(Eo(c).function||"")&&c.pop(),c.reverse(),df.test(Eo(c).function||"")&&(c.pop(),df.test(Eo(c).function||"")&&c.pop()),c.slice(0,50).map(u=>({...u,filename:u.filename||Eo(c).filename,function:u.function||Nr}))}(i.slice(s))}}([30,n=>{const e=Nj.exec(n);if(e){const[,r,s,i]=e;return Wc(r,Nr,+s,+i)}const t=Dj.exec(n);if(t){if(t[2]&&t[2].indexOf("eval")===0){const i=Mj.exec(t[2]);i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3])}const[r,s]=np(t[1]||Nr,t[2]);return Wc(s,r,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,n=>{const e=Lj.exec(n);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=Fj.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}let t=e[3],r=e[1]||Nr;return[r,t]=np(r,t),Wc(t,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]),np=(n,e)=>{const t=n.indexOf("safari-extension")!==-1,r=n.indexOf("safari-web-extension")!==-1;return t||r?[n.indexOf("@")!==-1?n.split("@")[0]:Nr,t?`safari-extension:${e}`:`safari-web-extension:${e}`]:[n,e]},rp=1024,Uj=(n={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...n};return{name:"Breadcrumbs",setup(t){var r;e.console&&function(s){const i="console";Br(i,s),qr(i,yj)}(function(s){return function(i){if(at()!==s)return;const o={category:"console",data:{arguments:i.args,logger:"console"},level:bj(i.level),message:gf(i.args," ")};if(i.level==="assert"){if(i.args[0]!==!1)return;o.message=`Assertion failed: ${gf(i.args.slice(1)," ")||"console.assert"}`,o.data.arguments=i.args.slice(1)}Cr(o,{input:i.args,level:i.level})}}
395(t)),e.dom&&(r=function(s,i){return function(o){if(at()!==s)return;let a,c,u=typeof i=="object"?i.serializeAttribute:void 0,d=typeof i=="object"&&typeof i.maxStringLength=="number"?i.maxStringLength:void 0;d&&d>rp&&(cc&&ge.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${d} was configured. Sentry will use 1024 instead.`),d=rp),typeof u=="string"&&(u=[u]);try{const p=o.event,v=function(b){return!!b&&!!b.target}(p)?p.target:p;a=Pb(v,{keyAttrs:u,maxStringLength:d}),c=function(b){if(!Od.HTMLElement)return null;let m=b;for(let g=0;g<5;g++){if(!m)return null;if(m instanceof HTMLElement){if(m.dataset.sentryComponent)return m.dataset.sentryComponent;if(m.dataset.sentryElement)return m.dataset.sentryElement}m=m.parentNode}return null}(v)}catch{a="<unknown>"}if(a.length===0)return;const f={category:`ui.${o.name}`,message:a};c&&(f.data={"ui.component_name":c}),Cr(f,{event:o.event,name:o.name,global:o.global})}}(t,e.dom),Br("dom",r),qr("dom",jj)),e.xhr&&function(s){Br("xhr",s),qr("xhr",Rj)}(function(s){return function(i){if(at()!==s)return;const{startTimestamp:o,endTimestamp:a}=i,c=i.xhr[mi];if(!o||!a||!c)return;const{method:u,url:d,status_code:f,body:p}=c,v={method:u,url:d,status_code:f},b={xhr:i.xhr,input:p,startTimestamp:o,endTimestamp:a};Cr({category:"xhr",data:v,type:"http",level:Kf(f)},b)}}(t)),e.fetch&&_j(function(s){return function(i){if(at()!==s)return;const{startTimestamp:o,endTimestamp:a}=i;if(a&&(!i.fetchData.url.match(/sentry_key/)||i.fetchData.method!=="POST"))if(i.error)Cr({category:"fetch",data:i.fetchData,level:"error",type:"http"},{data:i.error,input:i.args,startTimestamp:o,endTimestamp:a});else{const c=i.response,u={...i.fetchData,status_code:c&&c.status},d={input:i.args,response:c,startTimestamp:o,endTimestamp:a};Cr({category:"fetch",data:u,type:"http",level:Kf(u.status_code)},d)}}}(t)),e.history&&Ub(function(s){return function(i){if(at()!==s)return;let o=i.from,a=i.to;const c=Vc(tt.location.href);let u=o?Vc(o):void 0;const d=Vc(a);u&&u.path||(u=c),c.protocol===d.protocol&&c.host===d.host&&(a=d.relative),c.protocol===u.protocol&&c.host===u.host&&(o=u.relative),Cr({category:"navigation",data:{from:o,to:a}})}}(t)),e.sentry&&t.on("beforeSendEvent",function(s){return function(i){at()===s&&Cr({category:"sentry."+(i.type==="transaction"?"transaction":"event"),event_id:i.event_id,level:i.level,message:Zn(i)},{event:i})}}(t))}}},zj=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Vj=(n={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...n};return{name:"BrowserApiErrors",setupOnce(){e.setTimeout&&Rt(tt,"setTimeout",sp),e.setInterval&&Rt(tt,"setInterval",sp),e.requestAnimationFrame&&Rt(tt,"requestAnimationFrame",Bj),e.XMLHttpRequest&&"XMLHttpRequest"in tt&&Rt(XMLHttpRequest.prototype,"send",qj);const t=e.eventTarget;t&&(Array.isArray(t)?t:zj).forEach(Gj)}}};function sp(n){return function(...e){const t=e[0];return e[0]=qs(t,{mechanism:{data:{function:yr(n)},handled:!1,type:"instrument"}}),n.apply(this,e)}}function Bj(n){return function(e){return n.apply(this,[qs(e,{mechanism:{data:{function:"requestAnimationFrame",handler:yr(n)},handled:!1,type:"instrument"}})])}}function qj(n){return function(...e){const t=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in t&&typeof t[r]=="function"&&Rt(t,r,function(s){const i={mechanism:{data:{function:r,handler:yr(s)},handled:!1,type:"instrument"}},o=Rd(s);return o&&(i.mechanism.data.handler=yr(o)),qs(s,i)})}),n.apply(this,e)}}function Gj(n){const e=tt[n],t=e&&e.prototype;t&&t.hasOwnProperty&&t.hasOwnProperty("addEventListener")&&(Rt(t,"addEventListener",function(r){return function(s,i,o){try{typeof i.handleEvent=="function"&&(i.handleEvent=qs(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:yr(i),target:n},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[s,qs(i,{mechanism:{data:{function:"addEventListener",handler:yr(i),target:n},handled:!1,type:"instrument"}}),o])}}),Rt(t,"removeEventListener",function(r){return function(s,i,o){try{const a=i.__sentry_wrapped__;a&&r.call(this,s,a,o)}catch{}return r.call(this,s,i,o)}}))}const Hj=()=>({name:"BrowserSession",setupOnce(){tt.document!==void 0?(Nf({ignoreDuration:!0}),Df(),Ub(({from:n,to:e})=>{n!==void 0&&n!==e&&(Nf({ignoreDuration:!0}),Df())})):cc&&ge.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),Wj=(n={})=>{const e={onerror:!0,onunhandledrejection:!0,...n};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(t){e.onerror&&(function(r){(function(s){const i="error";Br(i,s),qr(i,LP)})(s=>{const{stackParser:i,attachStacktrace:o}=op();if(at()!==r||Xf())return;const{msg:a,url:c,line:u,column:d,error:f}=s,p=function(v,b,m,g){const x=v.exception=v.exception||{},S=x.values=x.values||[],E=S[0]=S[0]||{},P=E.stacktrace=E.stacktrace||{},C=P.frames=P.frames||[],O=g,N=m,D=Dn(b)&&b.length>0?b:function(){try{return Od.document.location.href}catch{return""}}();return C.length===0&&C.push({colno:O,filename:D,function:Nr,in_app:!0,lineno:N}),v}(au(i,f||a,void 0,o,!1),c,u,d);p.level="error",If(p,{originalException:f,mechanism:{handled:!1,type:"onerror"}})})}(t),ip("onerror")),e.onunhandledrejection&&(function(r){(function(s){const i="unhandledrejection";Br(i,s),qr(i,FP)})(s=>{const{stackParser:i,attachStacktrace:o}=op();if(at()!==r||Xf())return;const a=function(u){if(Yl(u))return u;try{if("reason"in u)return u.reason;if("detail"in u&&"reason"in u.detail)return u.detail.reason}catch{}return u}(s),c=Yl(a)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(a)}`}]}}:au(i,a,void 0,o,!0);c.level="error",If(c,{originalException:a,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(t),ip("onunhandledrejection"))}}};function ip(n){cc&&ge.log(`Global Handler attached: ${n}`)}function op(){const n=at();return n&&n.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const Jj=()=>({name:"HttpContext",preprocessEvent(n){if(!tt.navigator&&!tt.location&&!tt.document)return;const e=n.request&&n.request.url||tt.location&&tt.location.href,{referrer:t}=tt.document||{},{userAgent:r}=tt.navigator||{},s={...n.request&&n.request.headers,...t&&{Referer:t},...r&&{"User-Agent":r}},i={...n.request,...e&&{url:e},headers:s};n.request=i}}),Yj=(n={})=>{const e=n.limit||5,t=n.key||"cause";return{name:"LinkedErrors",preprocessEvent(r,s,i){const o=i.getOptions();vj(Ld,o.stackParser,o.maxValueLength,t,e,r,s)}}};var lu="new",ap="loading",cp="loaded",va="joining-meeting",rr="joined-meeting",Yn="left-meeting",An="error",Kj="blocked",Qj="off",Xj="sendable",Zj="loading",eO="interrupted",zb="playable",Vo="unknown",Vb="full",tO="lobby",nO="none",Bb="base",rO="*",sO="ejected",iO="nbf-room",oO="nbf-token",aO="exp-room",cO="exp-token",uu="no-room",lO="meeting-full",qb="end-of-life",uO="not-allowed",Gb="connection-error",dO="cam-in-use",hO="mic-in-use",fO="cam-mic-in-use",pO="permissions",mO="undefined-mediadevices",gO="not-found",vO="constraints",yO="unknown",Hb="iframe-ready-for-launch-config",Wb="iframe-launch-config",Jb="theme-updated",Yb="loading",Kb="load-attempt-failed",du="loaded",Qb="started-camera",Xb="camera-error",Zb="joining-meeting",ew="joined-meeting",tw="left-meeting",nw="participant-joined",rw="participant-updated",sw="participant-left",iw="participant-counts-updated",ow="access-state-updated",aw="meeting-session-summary-updated",cw="meeting-session-state-updated",bO="meeting-session-data-error",lw="waiting-participant-added",uw="waiting-participant-updated",dw="waiting-participant-removed",hw="track-started",fw="track-stopped",pw="transcription-started",mw="transcription-stopped",gw="transcription-error",hu="recording-started",fu="recording-stopped",vw="recording-stats",yw="recording-error",bw="recording-upload-completed",ww="recording-data",xw="app-message",_w="transcription-message",Sw="remote-media-player-started",Ew="remote-media-player-updated",Tw="remote-media-player-stopped",kw="local-screen-share-started",Cw="local-screen-share-stopped",Aw="local-screen-share-canceled",Pw="active-speaker-change",jw="active-speaker-mode-change",Ow="network-quality-change",Rw="network-connection",Iw="cpu-load-change",Nw="face-counts-updated",gi="fullscreen",vi="exited-fullscreen",Dw="live-streaming-started",Mw="live-streaming-updated",Lw="live-streaming-stopped",Fw="live-streaming-error",$w="lang-updated",Uw="receive-settings-updated",pu="input-sett
395ings-updated",mu="nonfatal-error",gu="error",Jc=4096,lp=102400,Yc="iframe-call-message",up="local-screen-start",dp="daily-method-update-live-streaming-endpoints",Oo="transmit-log",Mn="daily-custom-track",Bo={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},zw={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},vu={PLAY:"play",PAUSE:"pause"},Kc=["jpg","png","jpeg"],wO="add-endpoints",xO="remove-endpoints",hp="sip-call-transfer";function Ht(){return!ke()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function ke(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function Vw(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function _O(){return!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)&&(function(n,e){if(!n||!e)return!0;switch(n){case"Chrome":return e.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(e.major===13&&e.minor===0&&e.point===0);case"Firefox":return e.major>=67}return!0}(Kr(),ya())||ke())}function fp(){if(ke()||!document)return!1;var n=document.createElement("iframe");return!!n.requestFullscreen||!!n.webkitRequestFullscreen}var yu="none",SO="software",EO="hardware",TO=function(){try{var n,e=document.createElement("canvas"),t=!1;(n=e.getContext("webgl2",{failIfMajorPerformanceCaveat:!0}))||(t=!0,n=e.getContext("webgl2"));var r=n!=null;return e.remove(),r?t?SO:EO:yu}catch{return yu}}();function Bw(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!ke()&&TO!==yu&&(n?function(){return pp()?!1:["Chrome","Firefox"].includes(Kr())}():function(){if(pp())return!1;var e=Kr();if(e==="Safari"){var t=Ud();if(t.major<15||t.major===15&&t.minor<4)return!1}return e==="Chrome"?$d().major>=77:e==="Firefox"?zd().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}function qw(){if(ke()||Gw()||typeof AudioWorkletNode>"u")return!1;switch(Kr()){case"Chrome":case"Firefox":return!0;case"Safari":var n=ya();return n.major>17||n.major===17&&n.minor>=4}return!1}function Qc(){return Vw()&&typeof MediaStreamTrack<"u"&&!function(){var n,e=Kr();if(!Ht())return!0;switch(e){case"Chrome":return(n=$d()).major&&n.major>0&&n.major<75;case"Firefox":return(n=zd()).major<91;case"Safari":return(n=Ud()).major<13||n.major===13&&n.minor<1;default:return!0}}()}function Gw(){return Ht().match(/Linux; Android/)}function pp(){var n,e=Ht(),t=e.match(/Mac/)&&(!ke()&&typeof window<"u"&&(n=window)!==null&&n!==void 0&&(n=n.navigator)!==null&&n!==void 0&&n.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(e.match(/Mobi/)||e.match(/Android/)||t)||!!Ht().match(/DailyAnd\//)||void 0}function Kr(){if(typeof window<"u"){var n=Ht();return Hw()?"Safari":n.indexOf("Edge")>-1?"Edge":n.match(/Chrome\//)?"Chrome":n.indexOf("Safari")>-1||Ww()?"Safari":n.indexOf("Firefox")>-1?"Firefox":n.indexOf("MSIE")>-1||n.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function ya(){switch(Kr()){case"Chrome":return $d();case"Safari":return Ud();case"Firefox":return zd();case"Edge":return function(){var n=0,e=0;if(typeof window<"u"){var t=Ht().match(/Edge\/(\d+).(\d+)/);if(t)try{n=parseInt(t[1]),e=parseInt(t[2])}catch{}}return{major:n,minor:e}}()}}function $d(){var n=0,e=0,t=0,r=0,s=!1;if(typeof window<"u"){var i=Ht(),o=i.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(o)try{n=parseInt(o[1]),e=parseInt(o[2]),t=parseInt(o[3]),r=parseInt(o[4]),s=i.indexOf("OPR/")>-1}catch{}}return{major:n,minor:e,build:t,patch:r,opera:s}}function Hw(){return!!Ht().match(/iPad|iPhone|iPod/i)&&Vw()}function Ww(){return Ht().indexOf("AppleWebKit/605.1.15")>-1}function Ud(){var n=0,e=0,t=0;if(typeof window<"u"){var r=Ht().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{n=parseInt(r[1]),e=parseInt(r[2]),t=parseInt(r[4])}catch{}else(Hw()||Ww())&&(n=14,e=0,t=3)}return{major:n,minor:e,point:t}}function zd(){var n=0,e=0;if(typeof window<"u"){var t=Ht().match(/Firefox\/(\d+).(\d+)/);if(t)try{n=parseInt(t[1]),e=parseInt(t[2])}catch{}}return{major:n,minor:e}}var Jw=function(){return Lt(function n(){Mt(this,n)},[{key:"addListenerForMessagesFromCallMachine",value:function(n,e,t){ci()}},{key:"addListenerForMessagesFromDailyJs",value:function(n,e,t){ci()}},{key:"sendMessageToCallMachine",value:function(n,e,t,r){ci()}},{key:"sendMessageToDailyJs",value:function(n,e){ci()}},{key:"removeListener",value:function(n){ci()}}])}();function mp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Xc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
395e%2?mp(Object(t),!0).forEach(function(r){gn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Yw(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yw=function(){return!!n})()}var kO=function(){function n(){var e,t,r,s;return Mt(this,n),t=this,r=an(r=n),(e=tc(t,Yw()?Reflect.construct(r,[],an(t).constructor):r.apply(t,s)))._wrappedListeners={},e._messageCallbacks={},e}return nc(n,Jw),Lt(n,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,r){var s=this,i=function(o){if(o.data&&o.data.what==="iframe-call-message"&&(!o.data.callClientId||o.data.callClientId===t)&&(!o.data.from||o.data.from!=="module")){var a=Xc({},o.data);if(delete a.from,a.callbackStamp&&s._messageCallbacks[a.callbackStamp]){var c=a.callbackStamp;s._messageCallbacks[c].call(r,a),delete s._messageCallbacks[c]}delete a.what,delete a.callbackStamp,e.call(r,a)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,r){var s=function(i){var o;if(!(!i.data||i.data.what!==Yc||!i.data.action||i.data.from&&i.data.from!=="module"||i.data.callClientId&&t&&i.data.callClientId!==t||i!=null&&(o=i.data)!==null&&o!==void 0&&o.callFrameId)){var a=i.data;e.call(r,a)}};this._wrappedListeners[e]=s,window.addEventListener("message",s)}},{key:"sendMessageToCallMachine",value:function(e,t,r,s){if(!r)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var i=Xc({},e);if(i.what=Yc,i.from="module",i.callClientId=r,t){var o=rc();this._messageCallbacks[o]=t,i.callbackStamp=o}var a=s?s.contentWindow:window,c=this._callMachineTargetOrigin(s);c&&a.postMessage(i,c)}},{key:"sendMessageToDailyJs",value:function(e,t){e.what=Yc,e.callClientId=t,e.from="embedded",window.postMessage(e,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,t,r){var s=Xc({},e);s.callClientId=r;var i=t?t.contentWindow:window,o=this._callMachineTargetOrigin(t);o&&i.postMessage(s,o)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,t){var r=function(s){if(s.data&&s.data.what==="iframe-call-message"&&(!s.data.callClientId||s.data.callClientId===t)&&(!s.data.from||s.data.from!=="module")){var i=s.data;e(i)}};return this._wrappedListeners[e]=r,window.addEventListener("message",r),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"_callMachineTargetOrigin",value:function(e){return e?e.src?new URL(e.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}])}();function gp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Kw(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kw=function(){return!!n})()}var CO=function(){function n(){var e,t,r,s;return Mt(this,n),t=this,r=an(r=n),e=tc(t,Kw()?Reflect.construct(r,[],an(t).constructor):r.apply(t,s)),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new Wl.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new Wl.EventEmitter,e._wrappedListeners={},e._messageCallbacks={},e}return nc(n,Jw),Lt(n,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,r){this._addListener(e,global.callMachineToDailyJsEmitter,t,r,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,r){this._addListener(e,global.dailyJsToCallMachineEmitter,t,r,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,t,r){this._sendMessage(e,global.dailyJsToCallMachineEmitter,r,t,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(e,t){this._sendMessage(e,global.callMachineToDailyJsEmitter,t,null,"sending message to daily-js")}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(global.callMachineToDailyJsEmitter.removeListener("message",t),global.dailyJsToCallMachineEmitter.removeListener("message",t),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,t,r,s,i){var o=this,a=function(c){if(c.callClientId===r){if(c.callbackStamp&&o._messageCallbacks[c.callbackStamp]){var u=c.
395callbackStamp;o._messageCallbacks[u].call(s,c),delete o._messageCallbacks[u]}e.call(s,c)}};this._wrappedListeners[e]=a,t.addListener("message",a)}},{key:"_sendMessage",value:function(e,t,r,s,i){var o=function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?gp(Object(d),!0).forEach(function(f){gn(c,f,d[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):gp(Object(d)).forEach(function(f){Object.defineProperty(c,f,Object.getOwnPropertyDescriptor(d,f))})}return c}({},e);if(o.callClientId=r,s){var a=rc();this._messageCallbacks[a]=s,o.callbackStamp=a}t.emit("message",o)}}])}(),bu="replace",wu="shallow-merge",vp=[bu,wu],AO=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.data,r=e.mergeStrategy,s=r===void 0?bu:r;Mt(this,n),n._validateMergeStrategy(s),n._validateData(t,s),this.mergeStrategy=s,this.data=t}return Lt(n,[{key:"isNoOp",value:function(){return n.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,t){return Object.keys(e).length===0&&t===wu}},{key:"_validateMergeStrategy",value:function(e){if(!vp.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(vp,"]"))}},{key:"_validateData",value:function(e,t){if(!function(a){if(a==null||Pe(a)!=="object")return!1;var c=Object.getPrototypeOf(a);return c==null||c===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var r;try{if(r=JSON.stringify(e),t===bu){var s=JSON.parse(r);ft(s,e)||console.warn("The meeting session data provided will be modified when serialized.",s,e)}else if(t===wu){for(var i in e)if(Object.hasOwnProperty.call(e,i)&&e[i]!==void 0){var o=JSON.parse(JSON.stringify(e[i]));ft(e[i],o)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",o,e[i])}}}catch(a){throw Error("Meeting session data must be serializable to JSON: ".concat(a))}if(r.length>lp)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(lp,"."))}}])}();function Qw(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qw=function(){return!!n})()}function xu(n){var e=typeof Map=="function"?new Map:void 0;return xu=function(t){if(t===null||!function(s){try{return Function.toString.call(s).indexOf("[native code]")!==-1}catch{return typeof s=="function"}}(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(s,i,o){if(Qw())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,i);var c=new(s.bind.apply(s,a));return o&&$i(c,o.prototype),c}(t,arguments,an(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),$i(r,t)},xu(n)}function Xw(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xw=function(){return!!n})()}function yp(n){var e,t=(e=window._daily)===null||e===void 0?void 0:e.pendings;if(t){var r=t.indexOf(n);r!==-1&&t.splice(r,1)}}var PO=function(){return Lt(function n(e){Mt(this,n),this._currentLoad=null,this._callClientId=e},[{key:"load",value:function(){var n,e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void r(!0);n=this._callClientId,window._daily.pendings.push(n),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new jO(t,function(){r(!1)},function(i,o){o||yp(e._callClientId),s(i,o)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),yp(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}])}(),jO=function(){return Lt(function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;Mt(this,n),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=e,this._successCallback=t,this._failureCallback=r},[{key:"start",value:function(){var n=this;if(!this._currentAttempt){var e=function(t){n._currentAttempt.cancelled||(n._attemptsRemaining--,n._failureCallback(t,n._attemptsRemaining>0),n._attemptsRemaining<=0||setTimeout(function(){n._currentAttempt.cancelled||(n._currentAttempt=new bp(n._dailyConfig,n._successCallback,e),n._currentAttempt.start())},3e3))};this._currentAttempt=new bp(this._dailyConfig,this._successCallback,e),this._currentAttempt.start()}}},{key:"cancel",value:function(){this._currentAttempt&&this._currentAttempt.cancel()}},{key:"cancelled",get:function(){return this._currentAttempt&&this._currentAttempt.cancelled}},{key:"succeeded",get:function(){return this._currentAttempt&&this._currentAttempt.succeeded}}])}(),Zc=function(){function n(){return Mt(this,n),e=this,r=arguments,t=an(t=n),tc(e,Xw()?Reflect.construct(t,r||[],an(e).constructor):t.apply(e,r));var e,t,r}return nc(n,xu(Error)),Lt(n)}(),ba=2e4,bp=function(){return Lt(function e(t,r,s){Mt(this,e),this._loadAttemptImpl=ke()||!t.avoidEval?new OO(t,r,s):new RO(t,r,s)},[{key:"start",value:(n=fe(function*(){return this._loadAttemptImpl.start()}),function(){return n.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]);var n}(),OO=function(){return Lt(function s(i,o,a){Mt(this,s),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=i,this._successCallback=o,this._failureCallback=a},[{key:"start",value:(r=fe(function*(){var s=da(this._dailyConfig);!(yield this._tryLoadFromIOSCache(s))&&this._loadFromNetwork(s)}),function(){return r.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(t=fe(function*(s){if(!this._iosCache)return!1;try{var i=yield this._iosCache.get(s);return!!this.cancelled||!!i&&(i.code?(Function('"use strict";'+i.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=i.refetchHeaders,!1))}catch{return!1}}),function(s){return t.apply(this,arguments)})},{key:"_loadFromNetwork",value:(e=fe(function*(s){var i=this;this._networkTimeout=setTimeout(function(){i._networkTimedOut=!0,i._failureCallback({msg:"Timed out (>
395".concat(ba," ms) when loading call object bundle ").concat(s),type:"timeout"})},ba);try{var o=this._refetchHeaders?{headers:this._refetchHeaders}:{},a=yield fetch(s,o);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Zc;var c=yield this._getBundleCodeFromResponse(s,a);if(this.cancelled)throw new Zc;Function('"use strict";'+c)(),this._iosCache&&this._iosCache.set(s,c,a.headers),this.succeeded=!0,this._successCallback()}catch(u){if(clearTimeout(this._networkTimeout),u instanceof Zc||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(s,": ").concat(u),type:u.message})}}),function(s){return e.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(n=fe(function*(s,i){if(i.ok)return yield i.text();if(this._iosCache&&i.status===304)return(yield this._iosCache.renew(s,i.headers)).code;throw new Error("Received ".concat(i.status," response"))}),function(s,i){return n.apply(this,arguments)})}]);var n,e,t,r}(),RO=function(){return Lt(function n(e,t,r){Mt(this,n),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=e,this._successCallback=t,this._failureCallback=r,this._attemptId=rc(),this._networkTimeout=null,this._scriptElement=null},[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var n=da(this._dailyConfig);(typeof document>"u"?"undefined":Pe(document))==="object"?this._startLoading(n):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(n){var e=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){e._stopLoading(),e._failureCallback({msg:"Timed out (>".concat(ba," ms) when loading call object bundle ").concat(n),type:"timeout"})},ba);var t=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=function(){e._stopLoading(),e.succeeded=!0,e._successCallback()},r.onerror=function(s){e._stopLoading(),e._failureCallback({msg:"Failed to load call object bundle ".concat(s.target.src),type:s.message})},r.src=n,t.appendChild(r)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}])}(),Ro=function(n,e,t){return NO(n.local,e,t)===!0},IO=function(n,e,t){return n.local.streams&&n.local.streams[e]&&n.local.streams[e].stream&&n.local.streams[e].stream["get".concat(t==="video"?"Video":"Audio","Tracks")]()[0]},gs=function(n,e,t,r){var s=DO(n,e,t,r);return s&&s.pendingTrack},NO=function(n,e,t){if(!n)return!1;var r=function(i){switch(i){case"avatar":return!0;case"staged":return i;default:return!!i}},s=n.public.subscribedTracks;return s&&s[e]?["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(t)===-1&&s[e].custom?[!0,"staged"].includes(s[e].custom)?r(s[e].custom):r(s[e].custom[t]):r(s[e][t]):!s||r(s.ALL)},DO=function(n,e,t,r){var s=Object.values(n.streams||{}).filter(function(i){return i.participantId===e&&i.type===t&&i.pendingTrack&&i.pendingTrack.kind===r}).sort(function(i,o){return new Date(o.starttime)-new Date(i.starttime)});return s&&s[0]},MO=function(n,e){var t=n.local.public.customTracks;if(t&&t[e])return t[e].track};function wp(n,e){for(var t=e.getState(),r=0,s=["cam","screen"];r<s.length;r++)for(var i=s[r],o=0,a=["video","audio"];o<a.length;o++){var c=a[o],u=i==="cam"?c:"screen".concat(c.charAt(0).toUpperCase()+c.slice(1)),d=n.tracks[u];if(d){var f=n.local?IO(t,i,c):gs(t,n.session_id,i,c);d.state==="playable"&&(d.track=f),d.persistentTrack=f}}}function xp(n,e){try{var t=e.getState();for(var r in n.tracks)if(!LO(r)){var s=n.tracks[r].kind;if(s){var i=n.tracks[r];if(i){var o=n.local?MO(t,r):gs(t,n.session_id,r,s);i.state==="playable"&&(n.tracks[r].track=o),i.persistentTrack=o}}else console.error("unknown type for custom track")}}catch(a){console.error(a)}}function LO(n){return["video","audio","screenVideo","screenAudio"].includes(n)}function _p(n,e,t){var r=t.getState();if(n.local){if(n.audio)try{n.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],n.audioTrack||(n.audio=!1)}catch{}if(n.video)try{n.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],n.videoTrack||(n.video=!1)}catch{}if(n.screen)try{n.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],n.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],n.screenVideoTrack||n.screenAudioTrack||(n.screen=!1)}catch{}}else{var s=!0;try{var i=r.participants[n.session_id];i&&i.public&&i.public.rtcType&&i.public.rtcType.impl==="peer-to-peer"&&i.private&&!["connected","completed"].includes(i.private.peeringState)&&(s=!1)}catch(d){console.error(d)}if(!s)return n.audio=!1,n.audioTrack=!1,n.video=!1,n.videoTrack=!1,n.screen=!1,void(n.screenTrack=!1);try{if(r.streams,n.audio&&Ro(r,n.session_id,"cam-audio")){var o=gs(r,n.session_id,"cam","audio");o&&(e&&e.audioTrack&&e.audioTrack.id===o.id?n.audioTrack=o:o.muted||(n.audioTrack=o)),n.audioTrack||(n.audio=!1)}if(n.video&&Ro(r,n.session_id,"cam-video")){var a=gs(r,n.session_id,"cam","video");a&&(e&&e.videoTrack&&e.videoTrack.id===a.id?n.videoTrack=a:a.muted||(n.videoTrack=a)),n.videoTrack||(n.video=!1)}if(n.screen&&Ro(r,n.session_id,"screen-audio")){var c=gs(r,n.session_id,"screen","audio");c&&(e&&e.screenAudioTrack&&e.screenAudioTrack.id===c.id?n.screenAudioTrack=c:c.muted||(n.screenAudioTrack=c))}if(n.screen&&Ro(r,n.session_id,"screen-video")){var u=gs(r,n.session_id,"screen","video");u&&(e&&e.screenVideoTrack&&e.screenVideoTrack.id===u.id?n.screenVideoTrack=u:u.muted||(n.screenVideoTrack=u))}n.screenVideoTrack||n.screenAudioTrack||(n.screen=!1)}catch(d){console.error("unexpected error matching up tracks",d)}}}function FO(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(c,u){if(c){if(typeof c=="string")return Sp(c,u);var d={}.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?Sp(c,u):void 0}}(n))||e){t&&(n=t);var r=0,s=function(){};return{s,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
396In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var c=t.next();return o=c.done,c},e:function(c){a=!0,i=c},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw i}}}}function Sp(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}var dn=new Map,Es=null;function $O(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(c,u){if(c){if(typeof c=="string")return Ep(c,u);var d={}.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?Ep(c,u):void 0}}(n))||e){t&&(n=t);var r=0,s=function(){};return{s,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
397In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var c=t.next();return o=c.done,c},e:function(c){a=!0,i=c},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw i}}}}function Ep(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}var hn=new Map,Ei=null;function UO(n){Zw()?function(e){dn.has(e)||(dn.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(t){dn.has(e)&&(dn.get(e).lastDevicesString=JSON.stringify(t),Es||(Es=function(){var r=fe(function*(){var s,i=yield navigator.mediaDevices.enumerateDevices(),o=FO(dn.keys());try{for(o.s();!(s=o.n()).done;){var a=s.value,c=JSON.stringify(i);c!==dn.get(a).lastDevicesString&&(dn.get(a).lastDevicesString=c,a(i))}}catch(u){o.e(u)}finally{o.f()}});return function(){return r.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",Es)))}).catch(function(){}))}(n):function(e){hn.has(e)||(hn.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(t){hn.has(e)&&(hn.get(e).lastDevicesString=JSON.stringify(t),Ei||(Ei=setInterval(fe(function*(){var r,s=yield navigator.mediaDevices.enumerateDevices(),i=$O(hn.keys());try{for(i.s();!(r=i.n()).done;){var o=r.value,a=JSON.stringify(s);a!==hn.get(o).lastDevicesString&&(hn.get(o).lastDevicesString=a,o(s))}}catch(c){i.e(c)}finally{i.f()}}),3e3)))}))}(n)}function zO(n){Zw()?function(e){dn.has(e)&&(dn.delete(e),dn.size===0&&Es&&(navigator.mediaDevices.removeEventListener("devicechange",Es),Es=null))}(n):function(e){hn.has(e)&&(hn.delete(e),hn.size===0&&Ei&&(clearInterval(Ei),Ei=null))}(n)}function Zw(){var n;
397return ke()||((n=navigator.mediaDevices)===null||n===void 0?void 0:n.ondevicechange)!==void 0}var VO=new Set;function BO(n,e){return n&&n.readyState==="live"&&!function(t,r){return t.muted&&!VO.has(t.id)}(n)}function Tp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function qn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tp(Object(t),!0).forEach(function(r){gn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}var yi=Object.freeze({VIDEO:"video",AUDIO:"audio",SCREEN_VIDEO:"screenVideo",SCREEN_AUDIO:"screenAudio",CUSTOM_VIDEO:"customVideo",CUSTOM_AUDIO:"customAudio"}),qO=Object.freeze({PARTICIPANTS:"participants",STREAMING:"streaming",TRANSCRIPTION:"transcription"}),Ti=Object.values(yi),kp=["v","a","sv","sa","cv","ca"];Object.freeze(Ti.reduce(function(n,e,t){return n[e]=kp[t],n},{})),Object.freeze(kp.reduce(function(n,e,t){return n[e]=Ti[t],n},{}));var GO=[yi.VIDEO,yi.AUDIO,yi.SCREEN_VIDEO,yi.SCREEN_AUDIO],Cp=Object.values(qO),Ap=["p","s","t"];Object.freeze(Cp.reduce(function(n,e,t){return n[e]=Ap[t],n},{})),Object.freeze(Ap.reduce(function(n,e,t){return n[e]=Cp[t],n},{}));var ex=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.base,r=e.byUserId,s=e.byParticipantId;Mt(this,n),this.base=t,this.byUserId=r,this.byParticipantId=s}return Lt(n,[{key:"clone",value:function(){var e=new n;if(this.base instanceof st?e.base=this.base.clone():e.base=this.base,this.byUserId!==void 0)for(var t in e.byUserId={},this.byUserId){var r=this.byUserId[t];e.byUserId[t]=r instanceof st?r.clone():r}if(this.byParticipantId!==void 0)for(var s in e.byParticipantId={},this.byParticipantId){var i=this.byParticipantId[s];e.byParticipantId[s]=i instanceof st?i.clone():i}return e}},{key:"toJSONObject",value:function(){var e={};if(typeof this.base=="boolean"?e.base=this.base:this.base instanceof st&&(e.base=this.base.toJSONObject()),this.byUserId!==void 0)for(var t in e.byUserId={},this.byUserId){var r=this.byUserId[t];e.byUserId[t]=r instanceof st?r.toJSONObject():r}if(this.byParticipantId!==void 0)for(var s in e.byParticipantId={},this.byParticipantId){var i=this.byParticipantId[s];e.byParticipantId[s]=i instanceof st?i.toJSONObject():i}return e}},{key:"toMinifiedJSONObject",value:function(){var e={};if(this.base!==void 0&&(typeof this.base=="boolean"?e.b=this.base:e.b=this.base.toMinifiedJSONObject()),this.byUserId!==void 0)for(var t in e.u={},this.byUserId){var r=this.byUserId[t];e.u[t]=typeof r=="boolean"?r:r.toMinifiedJSONObject()}if(this.byParticipantId!==void 0)for(var s in e.p={},this.byParticipantId){var i=this.byParticipantId[s];e.p[s]=typeof i=="boolean"?i:i.toMinifiedJSONObject()}return e}},{key:"normalize",value:function(){return this.base instanceof st&&(this.base=this.base.normalize()),this.byUserId&&(this.byUserId=Object.fromEntries(Object.entries(this.byUserId).map(function(e){var t=ct(e,2),r=t[0],s=t[1];return[r,s instanceof st?s.normalize():s]}))),this.byParticipantId&&(this.byParticipantId=Object.fromEntries(Object.entries(this.byParticipantId).map(function(e){var t=ct(e,2),r=t[0],s=t[1];return[r,s instanceof st?s.normalize():s]}))),this}}],[{key:"fromJSONObject",value:function(e){var t,r,s;if(e.base!==void 0&&(t=typeof e.base=="boolean"?e.base:st.fromJSONObject(e.base)),e.byUserId!==void 0)for(var i in r={},e.byUserId){var o=e.byUserId[i];r[i]=typeof o=="boolean"?o:st.fromJSONObject(o)}if(e.byParticipantId!==void 0)for(var a in s={},e.byParticipantId){var c=e.byParticipantId[a];s[a]=typeof c=="boolean"?c:st.fromJSONObject(c)}return new n({base:t,byUserId:r,byParticipantId:s})}},{key:"fromMinifiedJSONObject",value:function(e){var t,r,s;if(e.b!==void 0&&(t=typeof e.b=="boolean"?e.b:st.fromMinifiedJSONObject(e.b)),e.u!==void 0)for(var i in r={},e.u){var o=e.u[i];r[i]=typeof o=="boolean"?o:st.fromMinifiedJSONObject(o)}if(e.p!==void 0)for(var a in s={},e.p){var c=e.p[a];s[a]=typeof c=="boolean"?c:st.fromMinifiedJSONObject(c)}return new n({base:t,byUserId:r,byParticipantId:s}
397)}},{key:"validateJSONObject",value:function(e){if(Pe(e)!=="object")return[!1,"canReceive must be an object"];for(var t=["base","byUserId","byParticipantId"],r=0,s=Object.keys(e);r<s.length;r++){var i=s[r];if(!t.includes(i))return[!1,"canReceive can only contain keys (".concat(t.join(", "),")")];if(i==="base"){var o=ct(st.validateJSONObject(e.base,!0),2),a=o[0],c=o[1];if(!a)return[!1,c]}else{if(Pe(e[i])!=="object")return[!1,"invalid (non-object) value for field '".concat(i,"' in canReceive")];for(var u=0,d=Object.values(e[i]);u<d.length;u++){var f=d[u],p=ct(st.validateJSONObject(f),2),v=p[0],b=p[1];if(!v)return[!1,b]}}}return[!0]}}])}(),st=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.video,r=e.audio,s=e.screenVideo,i=e.screenAudio,o=e.customVideo,a=e.customAudio;Mt(this,n),this.video=t,this.audio=r,this.screenVideo=s,this.screenAudio=i,this.customVideo=o,this.customAudio=a}return Lt(n,[{key:"clone",value:function(){var e=new n;return this.video!==void 0&&(e.video=this.video),this.audio!==void 0&&(e.audio=this.audio),this.screenVideo!==void 0&&(e.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(e.screenAudio=this.screenAudio),this.customVideo!==void 0&&(e.customVideo=qn({},this.customVideo)),this.customAudio!==void 0&&(e.customAudio=qn({},this.customAudio)),e}},{key:"toJSONObject",value:function(){var e={};return this.video!==void 0&&(e.video=this.video),this.audio!==void 0&&(e.audio=this.audio),this.screenVideo!==void 0&&(e.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(e.screenAudio=this.screenAudio),this.customVideo!==void 0&&(e.customVideo=qn({},this.customVideo)),this.customAudio!==void 0&&(e.customAudio=qn({},this.customAudio)),e}},{key:"toMinifiedJSONObject",value:function(){var e={};return this.video!==void 0&&(e.v=this.video),this.audio!==void 0&&(e.a=this.audio),this.screenVideo!==void 0&&(e.sv=this.screenVideo),this.screenAudio!==void 0&&(e.sa=this.screenAudio),this.customVideo!==void 0&&(e.cv=qn({},this.customVideo)),this.customAudio!==void 0&&(e.ca=qn({},this.customAudio)),e}},{key:"normalize",value:function(){function e(t,r){return t&&Object.keys(t).length===1&&t["*"]===r}return!(this.video!==!0||this.audio!==!0||this.screenVideo!==!0||this.screenAudio!==!0||!e(this.customVideo,!0)||!e(this.customAudio,!0))||(this.video!==!1||this.audio!==!1||this.screenVideo!==!1||this.screenAudio!==!1||!e(this.customVideo,!1)||!e(this.customAudio,!1))&&this}}],[{key:"fromBoolean",value:function(e){return new n({video:e,audio:e,screenVideo:e,screenAudio:e,customVideo:{"*":e},customAudio:{"*":e}})}},{key:"fromJSONObject",value:function(e){return new n({video:e.video,audio:e.audio,screenVideo:e.screenVideo,screenAudio:e.screenAudio,customVideo:e.customVideo!==void 0?qn({},e.customVideo):void 0,customAudio:e.customAudio!==void 0?qn({},e.customAudio):void 0})}},{key:"fromMinifiedJSONObject",value:function(e){return new n({video:e.v,audio:e.a,screenVideo:e.sv,screenAudio:e.sa,customVideo:e.cv,customAudio:e.ca})}},{key:"validateJSONObject",value:function(e,t){if(typeof e=="boolean")return[!0];if(Pe(e)!=="object")return[!1,"invalid (non-object, non-boolean) value in canReceive"];for(var r=Object.keys(e),s=0,i=r;s<i.length;s++){var o=i[s];if(!Ti.includes(o))return[!1,"invalid media type '".concat(o,"' in canReceive")];if(GO.includes(o)){if(typeof e[o]!="boolean")return[!1,"invalid (non-boolean) value for media type '".concat(o,"' in canReceive")]}else{if(Pe(e[o])!=="object")return[!1,"invalid (non-object) value for media type '".concat(o,"' in canReceive")];for(var a=0,c=Object.values(e[o]);a<c.length;a++)if(typeof c[a]!="boolean")return[!1,"invalid (non-boolean) value for entry within '".concat(o,"' in canReceive")];if(t&&e[o]["*"]===void 0)return[!1,`canReceive "base" permission must specify "*" as an entry within '`.concat(o,"'")]}}return t&&r.length!==Ti.length?[!1,'canReceive "base" permission must specify all media types: '.concat(Ti.join(", ")," (or be set to a boolean shorthand)")]:[!0]}}])}(),HO=["result"],WO=["preserveIframe"];function Pp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function ae(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
397e%2?Pp(Object(t),!0).forEach(function(r){gn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function tx(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tx=function(){return!!n})()}function jp(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(c,u){if(c){if(typeof c=="string")return Op(c,u);var d={}.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?Op(c,u):void 0}}(n))||e){t&&(n=t);var r=0,s=function(){};return{s,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
398In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var c=t.next();return o=c.done,c},e:function(c){a=!0,i=c},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw i}}}}function Op(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}var Ar={},Rp="video",JO="voice",Ip=ke()?{data:{}}:{data:{},topology:"none"},Np={present:0,hidden:0},nx={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},el=Object.keys(nx),Dp=["state","volume","simulcastEncodings"],Mp={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},wa={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string",visualState:"'default' | 'sidebar-open' | 'active'"}},_u={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},Pr={customIntegrations:{validate:ux,help:cx()},customTrayButtons:{validate:lx,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(wa))},url:{validate:function(n){return typeof n=="string"},help:"url should be a string"},baseUrl:{validate:function(n){return typeof n=="string"},help:"baseUrl should be a string"},token:{validate:function(n){return typeof n=="string"},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(n,e){try{return e.validateDailyConfig(n),!0}catch(t){console.error("Failed to validate dailyConfig",t)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(n){return dx(n,Mp)},help:"reactNativeConfig should look like ".concat(JSON.stringify(Mp),", all fields optional")},lang:{validate:function(n){return["da","de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(n)},help:"language not supported. Options are: da, de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(n){try{return rx(n),!0}catch(e){return console.error(e),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,allowLocalVideo:!0,allowLocalAudio:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(n,e){if(typeof n=="boolean")return e._preloadCache.allowLocalVideo=n,!0;var t;if(n instanceof MediaStreamTrack)e._sharedTracks.videoTrack=n,t={customTrack:Mn};else{if(delete e._sharedTracks.videoTrack,typeof n!="string")return console.error("videoSource must be a MediaStreamTrack, boolean, or a string"),!1;t={deviceId:n}}return e._updatePreloadCacheInputSettings({video:{settings:t}},!1),!0}},audioSource:{validate:function(n,e){if(typeof n=="boolean")return e._preloadCache.allowLocalAudio=n,!0;var t;if(n instanceof MediaStreamTrack)e._sharedTracks.audioTrack=n,t={customTrack:Mn};
398else{if(delete e._sharedTracks.audioTrack,typeof n!="string")return console.error("audioSource must be a MediaStreamTrack, boolean, or a string"),!1;t={deviceId:n}}return e._updatePreloadCacheInputSettings({audio:{settings:t}},!1),!0}},subscribeToTracksAutomatically:{validate:function(n,e){return e._preloadCache.subscribeToTracksAutomatically=n,!0}},theme:{validate:function(n){var e=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],t=function(r){for(var s=0,i=Object.keys(r);s<i.length;s++){var o=i[s];if(!e.includes(o))return console.error('unsupported color "'.concat(o,'". Valid colors: ').concat(e.join(", "))),!1;if(!r[o].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(o,' theme color should be provided in valid hex color format. Received: "').concat(r[o],'"')),!1}return!0};return Pe(n)==="object"&&("light"in n&&"dark"in n||"colors"in n)?"light"in n&&"dark"in n?"colors"in n.light?"colors"in n.dark?t(n.light.colors)&&t(n.dark.colors):(console.error('Dark theme is missing "colors" property.',n),!1):(console.error('Light theme is missing "colors" property.',n),!1):t(n.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',n),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(n){if("grid"in n){var e=n.grid;if("maxTilesPerPage"in e){if(!Number.isInteger(e.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(e.maxTilesPerPage,".")),!1;if(e.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in e){if(!Number.isInteger(e.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(e.minTilesPerPage,".")),!1;if(e.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in e&&e.minTilesPerPage>e.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(n){return sx(n,{allowAllParticipantsKey:!1})},help:ax({allowAllParticipantsKey:!1})},sendSettings:{validate:function(n,e){return!!function(t,r){try{return r.validateUpdateSendSettings(t),!0}catch(s){return console.error("Failed to validate send settings",s),!1}}(n,e)&&(e._preloadCache.sendSettings=n,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(n,e){var t;return!!ix(n)&&(e._inputSettings||(e._inputSettings={}),ox(n,(t=e.properties)===null||t===void 0?void 0:t.dailyConfig,e._sharedTracks),e._updatePreloadCacheInputSettings(n,!0),!0)},help:Su()},layout:{validate:function(n){return n==="custom-v1"||n==="browser"||n==="none"},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0,allowMultipleCallInstances:!0},Io={styles:{validate:function(n){for(var e in n)if(e!=="cam"&&e!=="screen")return!1;if(n.cam){for(var t in n.cam)if(t!=="div"&&t!=="video")return!1}if(n.screen){for(var r in n.screen)if(r!=="div"&&r!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(n,e){if(e._preloadCache.subscribeToTracksAutomatically)return!1;var t=[!0,!1,"staged"];if(t.includes(n)||!ke()&&n==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"],s=function(i){var o=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var a in i)if(a==="custom"){if(!t.includes(i[a])&&!s(i[a],!0))return!1}else{var c=!o&&!r.includes(a),u=!t.includes(i[a]);if(c||u)return!1}return!0};return s(n)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(ke()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,setScreenShare:{validate:function(n){return n===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(n){for(var e=0,t=Object.entries(n);e<t.length;e++){var r=ct(t[e],2),s=r[0],i=r[1];switch(s){case"hasPresence":if(typeof i!="boolean")return!1;break;case"canSend":if(i instanceof Set||i instanceof Array||Array.isArray(i)){var o,a=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],c=jp(i);try{for(c.s();!(o=c.n()).done;){var u=o.value;if(!a.includes(u))return!1}}catch(x){c.e(x)}finally{c.f()}}else if(typeof i!="boolean")return!1;(i instanceof Array||Array.isArray(i))&&(n.canSend=new Set(i));break;case"canReceive":var d=ct(ex.validateJSONObject(i),2),f=d[0],p=d[1];if(!f)return console.error(p),!1;break;case"canAdmin":if(i instanceof Set||i instanceof Array||Array.isArray(i)){var v,b=["participants","streaming","transcription"],m=jp(i);try{for(m.s();!(v=m.n()).done;){var g=v.value;if(!b.includes(g))return!1}}catch(x){m.e(x)}finally{m.f()}}else if(typeof i!="boolean")return!1;(i instanceof Array||Array.isArray(i))&&(n.canAdmin=new Set(i));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, canReceive, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canReceive must be an object specifying base, byUserId, and/or byParticipantId fields (see documentation for more details). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var n=fe(function*(e){return new Promise(function(t,r){var s=[];e.forEach(function(i){return Promise.resolve(i).then(function(o){t(o)}).catch(function(o){s.push(o),s.length===e.length&&r(s)})})})});return function(e){return n.apply(this,arguments)}}());var YO=function(){function n(h){var _,w,T,k,j,M,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Mt(this,n),T=this,k=an(k=n),gn(w=tc(T,tx()?Reflect.construct(k,[],an(T).constructor):k.apply(T,j)),"startListeningForDeviceChanges",function(){UO(w.handleDeviceChange)}),gn(w,"stopListeningForDeviceChanges",function(){zO(w.handleDeviceChange)}),gn(w,"handleDeviceChange",function(X){X=X.map(function(ue){return JSON.parse(JSON.stringify(ue))}),w.emitDailyJSEvent({action:"available-devices-updated",availableDevices:X})}),gn(w,"handleNativeAppStateChange",function(){var X=fe(function*(ue){if(ue==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield w.destroy());var Le=ue==="active";w.disableReactNativeAutoDeviceManagement("video")||(Le?w.camUnmutedBeforeLosingNativeActiveState&&w.setLocalVideo(!0):(w.camUnmutedBeforeLosingNativeActiveState=w.localVideo(),w.camUnmutedBeforeLosingNativeActiveState&&w.setLocalVideo(!1)))});return function(ue){return X.apply(this,arguments)}}()),gn(w,"handleNativeAudioFocusChange",function(X){w.disableReactNativeAutoDeviceManagement("audio")||(w._hasNativeAudioFocus=X,w.toggleParticipantAudioBasedOnNativeAudioFocus(),w._hasNativeAudioFocus?w.micUnmutedBeforeLosingNativeAudioFocus&&w.setLocalAudio(!0):(w.micUnmutedBeforeLosingNativeAudioFocus=w.localAudio(),w.setLocalAudio(!1)))}),gn(w,"handleNativeSystemScreenCaptureStop",function(){w.stopScreenShare()}),!Qc()&&!ke())throw new Error("WebRTC not supported or suppressed");if(w.strictMode=L.strictMode===void 0||L.strictMode,w.allowMultipleCallInstances=(_=L.allowMultipleCallInstances)!==null&&_!==void 0&&_,Object.keys(Ar).length&&(w._logDuplicateInstanceAttempt(),!w.allowMultipleCallInstances)){if(w.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed");
398console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`")}if(window._daily||(window._daily={pendings:[],instances:{}}),w.callClientId=rc(),Ar[(M=w).callClientId]=M,window._daily.instances[w.callClientId]={},w._sharedTracks={},window._daily.instances[w.callClientId].tracks=w._sharedTracks,L.dailyJsVersion=n.version(),w._iframe=h,w._callObjectMode=L.layout==="none"&&!w._iframe,w._preloadCache={subscribeToTracksAutomatically:!0,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},L.showLocalVideo!==void 0?w._callObjectMode?console.error("showLocalVideo is not available in call object mode"):w._showLocalVideo=!!L.showLocalVideo:w._showLocalVideo=!0,L.showParticipantsBar!==void 0?w._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):w._showParticipantsBar=!!L.showParticipantsBar:w._showParticipantsBar=!0,L.customIntegrations!==void 0?w._callObjectMode?console.error("customIntegrations is not available in call object mode"):w._customIntegrations=L.customIntegrations:w._customIntegrations={},L.customTrayButtons!==void 0?w._callObjectMode?console.error("customTrayButtons is not available in call object mode"):w._customTrayButtons=L.customTrayButtons:w._customTrayButtons={},L.activeSpeakerMode!==void 0?w._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):w._activeSpeakerMode=!!L.activeSpeakerMode:w._activeSpeakerMode=!1,L.receiveSettings?w._callObjectMode?w._receiveSettings=L.receiveSettings:console.error("receiveSettings is only available in call object mode"):w._receiveSettings={},w.validateProperties(L),w.properties=ae({},L),w._inputSettings||(w._inputSettings={}),w._callObjectLoader=w._callObjectMode?new PO(w.callClientId):null,w._callState=lu,w._isPreparingToJoin=!1,w._accessState={access:Vo},w._meetingSessionSummary={},w._finalSummaryOfPrevSession={},w._meetingSessionState=rl(Ip,w._callObjectMode),w._nativeInCallAudioMode=Rp,w._participants={},w._isScreenSharing=!1,w._participantCounts=Np,w._rmpPlayerState={},w._waitingParticipants={},w._network={threshold:"good",quality:100,networkState:"unknown",stats:{}},w._activeSpeaker={},w._localAudioLevel=0,w._isLocalAudioLevelObserverRunning=!1,w._remoteParticipantsAudioLevel={},w._isRemoteParticipantsAudioLevelObserverRunning=!1,w._maxAppMessageSize=Jc,w._messageChannel=ke()?new CO:new kO,w._iframe&&(w._iframe.requestFullscreen?w._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===w._iframe?(w.emitDailyJSEvent({action:gi}),w.sendMessageToCallMachine({action:gi})):(w.emitDailyJSEvent({action:vi}),w.sendMessageToCallMachine({action:vi}))}):w._iframe.webkitRequestFullscreen&&w._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===w._iframe?(w.emitDailyJSEvent({action:gi}),w.sendMessageToCallMachine({action:gi})):(w.emitDailyJSEvent({action:vi}),w.sendMessageToCallMachine({action:vi}))})),ke()){var B=w.nativeUtils();B.addAudioFocusChangeListener&&B.removeAudioFocusChangeListener&&B.addAppStateChangeListener&&B.removeAppStateChangeListener&&B.addSystemScreenCaptureStopListener&&B.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),w._hasNativeAudioFocus=!0,B.addAudioFocusChangeListener(w.handleNativeAudioFocusChange),B.addAppStateChangeListener(w.handleNativeAppStateChange),B.addSystemScreenCaptureStopListener(w.handleNativeSystemScreenCaptureStop)}return w._callObjectMode&&w.startListeningForDeviceChanges(),w._messageChannel.addListenerForMessagesFromCallMachine(w.handleMessageFromCallMachine,w.callClientId,w),w}return nc(n,So),Lt(n,[{key:"destroy",value:(oe=fe(function*(){var h;try{yield this.leave()}catch{}var _=this._iframe;if(_){var w=_.parentElement;w&&w.removeChild(_)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),ke()){var T=this.nativeUtils();T.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),T.removeAppStateChangeListener(this.handleNativeAppStateChange),T.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Ar[this.callClientId],!((h=window)===null||h===void 0||(h=h._daily)===null||h===void 0)&&h.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return oe.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(h){var _=h.bodyClass,w=h.cssFile,T=h.cssText;return Te(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(w),bodyClass:_,cssText:T}),this}},{key:"iframe",value:function(){return Te(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return Yt(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return Yt(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(h,_){for(var w in _){if(!Io[w])throw new Error("unrecognized updateParticipant property ".concat(w));if(Io[w].validate&&!Io[w].validate(_[w],this,this._participants[h]))throw new Error(Io[w].help)}}},{key:"updateParticipant",value:function(h,_){return this._participants.local&&this._participants.local.session_id===h&&(h="local"),h&&_&&(this.validateParticipantProperties(h,_),this.sendMessageToCallMachine({action:"update-participant",id:h,properties:_})),this}},{key:"updateParticipants",value:function(h){var _=this._participants.local&&this._participants.local.session_id;for(var w in h)w===_&&(w="local"),w&&h[w]&&this.validateParticipantProperties(w,h[w]);return this.sendMessageToCallMachine({action:"update-participants",participants:h}),this}},{key:"updateWaitingParticipant",value:(Q=fe(function*(){var h=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Yt(this._callObjectMode,"updateWaitingParticipant()"),ze(this._callState,"updateWaitingParticipant()"),typeof _!="string"||Pe(w)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(T,k){h.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:_,updates:w},function(j){j.error&&k(j.error),j.id||k(new Error("unknown error in updateWaitingParticipant()")),T({id:j.id})})})}),function(){return Q.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(te=fe(function*(){var h=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Yt(this._callObjectMode,"updateWaitingParticipants()"),ze(this._callState,"updateWaitingParticipants()"),Pe(_)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(w,T){h.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updates
398ById:_},function(k){k.error&&T(k.error),k.ids||T(new Error("unknown error in updateWaitingParticipants()")),w({ids:k.ids})})})}),function(){return te.apply(this,arguments)})},{key:"requestAccess",value:(q=fe(function*(){var h=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},w=_.access,T=w===void 0?{level:Vb}:w,k=_.name,j=k===void 0?"":k;return Yt(this._callObjectMode,"requestAccess()"),ze(this._callState,"requestAccess()"),new Promise(function(M,L){h.sendMessageToCallMachine({action:"daily-method-request-access",access:T,name:j},function(B){B.error&&L(B.error),B.access||L(new Error("unknown error in requestAccess()")),M({access:B.access,granted:B.granted})})})}),function(){return q.apply(this,arguments)})},{key:"localAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.audio.state):null}},{key:"localVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.video.state):null}},{key:"setLocalAudio",value:function(h){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in _&&(ke()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),_={}):h&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),_={})),this.sendMessageToCallMachine({action:"local-audio",state:h,options:_}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(h){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:h}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(h){return this.sendMessageToCallMachine({action:"local-video",state:h}),this}},{key:"_setAllowLocalAudio",value:function(h){if(this._preloadCache.allowLocalAudio=h,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-audio",state:h}),this}},{key:"_setAllowLocalVideo",value:function(h){if(this._preloadCache.allowLocalVideo=h,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-video",state:h}),this}},{key:"getReceiveSettings",value:(G=fe(function*(h){var _=this,w=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,T=w!==void 0&&w;if(Yt(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(Pe(h)){case"string":return new Promise(function(k){_.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:h,showInheritedValues:T},function(j){k(j.receiveSettings)})});case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}}),function(h){return G.apply(this,arguments)})},{key:"updateReceiveSettings",value:(se=fe(function*(h){var _=this;if(Yt(this._callObjectMode,"updateReceiveSettings()"),!sx(h,{allowAllParticipantsKey:!0}))throw new Error(ax({allowAllParticipantsKey:!0}));return ze(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(w){_.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:h},function(T){w({receiveSettings:T.receiveSettings})})})}),function(h){return se.apply(this,arguments)})},{key:"_prepInputSettingsForSharing",value:function(h,_){if(h){var w={};if(h.audio){var T,k,j;h.audio.settings&&(!Object.keys(h.audio.settings).length&&_||(w.audio={settings:ae({},h.audio.settings)})),_&&(T=w.audio)!==null&&T!==void 0&&(T=T.settings)!==null&&T!==void 0&&T.customTrack&&(w.audio.settings={customTrack:this._sharedTracks.audioTrack});var M=((k=h.audio.processor)===null||k===void 0?void 0:k.type)==="none"&&((j=h.audio.processor)===null||j===void 0?void 0:j._isDefaultWhenNone);if(h.audio.processor&&!M){var L=ae({},h.audio.processor);delete L._isDefaultWhenNone,w.audio=ae(ae({},w.audio),{},{processor:L})}}if(h.video){var B,X,ue;h.video.settings&&(!Object.keys(h.video.settings).length&&_||(w.video={settings:ae({},h.video.settings)})),_&&(B=w.video)!==null&&B!==void 0&&(B=B.settings)!==null&&B!==void 0&&B.customTrack&&(w.video.settings={customTrack:this._sharedTracks.videoTrack});var Le=((X=h.video.processor)===null||X===void 0?void 0:X.type)==="none"&&((ue=h.video.processor)===null||ue===void 0?void 0:ue._isDefaultWhenNone);if(h.video.processor&&!Le){var Ze=ae({},h.video.processor);delete Ze._isDefaultWhenNone,w.video=ae(ae({},w.video),{},{processor:Ze})}}return w}}},{key:"getInputSettings",value:function(){var h=this;return Te(),new Promise(function(_){_(h._getInputSettings())})}},{key:"_getInputSettings",value:function(){var h,_,w,T,k,j,M={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(h=((w=this._inputSettings)===null||w===void 0?void 0:w.video)||M,_=((T=this._inputSettings)===null||T===void 0?void 0:T.audio)||M):(h=((k=this._preloadCache)===null||k===void 0||(k=k.inputSettings)===null||k===void 0?void 0:k.video)||M,_=((j=this._preloadCache)===null||j===void 0||(j=j.inputSettings)===null||j===void 0?void 0:j.audio)||M);var L={audio:_,video:h};return this._prepInputSettingsForSharing(L,!0)}},{key:"_updatePreloadCacheInputSettings",value:function(h,_){var w=this._inputSettings||{},T={};if(h.video){var k,j,M;T.video={},h.video.settings?(T.video.settings={},_||h.video.settings.customTrack||(M=w.video)===null||M===void 0||!M.settings?T.video.settings=h.video.settings:T.video.settings=ae(ae({},w.video.settings),h.video.settings),Object.keys(T.video.settings).length||delete T.video.settings):(k=w.video)!==null&&k!==void 0&&k.settings&&(T.video.settings=w.video.settings),h.video.processor?T.video.processor=h.video.processor:(j=w.video)!==null&&j!==void 0&&j.processor&&(T.video.processor=w.video.processor)}else w.video&&(T.video=w.video);if(h.audio){var L,B,X;T.audio={},h.audio.settings?(T.audio.settings={},_||h.audio.settings.customTrack||(X=w.audio)===null||X===void 0||!X.settings?T.audio.settings=h.audio.settings:T.audio.settings=ae(ae({},w.audio.settings),h.audio.settings),Object.keys(T.audio.settings).length||delete T.audio.settings):(L=w.audio)!==null&&L!==void 0&&L.settings&&(T.audio.settings=w.audio.settings),h.audio.processor?T.audio.processor=h.audio.processor:(B=w.audio)!==null&&B!==void 0&&B.processor&&(T.audio.processor=w.audio.processor)}else w.audio&&(T.audio=w.audio);this._maybeUpdateInputSettings(T)}},{key:"_devicesFromInputSettings",value:function(h){var _,w,T=(h==null||(_=h.video)===null||_===void 0||(_=_.settings)===null||_===void 0?void 0:_.deviceId)||null,k=(h==null||(w=h.audio)===null||w===void 0||(w=w.settings)===null||w===void 0?void 0:w.deviceId)||null,j=this._preloadCache.outputDeviceId||null;return{camera:T?{deviceId:T}:{},mic:k?{deviceId:k}:{},speaker:j?{deviceId:j}:{}}}},{key:"updateInputSettings",value:(K=fe(function*(h){var _=this;
vendor: 5,646 bytes, line 398
398return Te(),ix(h)?h.video||h.audio?(ox(h,this.properties.dailyConfig,this._sharedTracks),this._callObjectMode&&!this._callMachineInitialized?(this._updatePreloadCacheInputSettings(h,!0),this._getInputSettings()):new Promise(function(w,T){_.sendMessageToCallMachine({action:"update-input-settings",inputSettings:h},function(k){if(k.error)T(k.error);else{if(k.returnPreloadCache)return _._updatePreloadCacheInputSettings(h,!0),void w(_._getInputSettings());_._maybeUpdateInputSettings(k.inputSettings),w(_._prepInputSettingsForSharing(k.inputSettings,!0))}})})):this._getInputSettings():(console.error(Su()),Promise.reject(Su()))}),function(h){return K.apply(this,arguments)})},{key:"setBandwidth",value:function(h){var _=h.kbs,w=h.trackConstraints;if(Te(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:_,trackConstraints:w}),this}},{key:"getDailyLang",value:function(){var h=this;if(Te(),this._callMachineInitialized)return new Promise(function(_){h.sendMessageToCallMachine({action:"get-daily-lang"},function(w){delete w.action,delete w.callbackStamp,_(w)})})}},{key:"setDailyLang",value:function(h){return Te(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:h}),this}},{key:"setProxyUrl",value:function(h){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:h}),this}},{key:"setIceConfig",value:function(h){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:h}),this}},{key:"meetingSessionSummary",value:function(){return[Yn,An].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(ee=fe(function*(){var h=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),ze(this._callState,"getMeetingSession()"),new Promise(function(_){h.sendMessageToCallMachine({action:"get-meeting-session"},function(w){delete w.action,delete w.callbackStamp,_(w)})})}),function(){return ee.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return ze(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(h){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";Yt(this._callObjectMode,"setMeetingSessionData()"),ze(this._callState,"setMeetingSessionData");try{(function(w,T){new AO({data:w,mergeStrategy:T})})(h,_)}catch(w){throw console.error(w),w}try{this.sendMessageToCallMachine({action:"set-session-data",data:h,mergeStrategy:_})}catch(w){throw new Error("Error setting meeting session data: ".concat(w))}}},{key:"setUserName",value:function(h,_){var w=this;return this.properties.userName=h,new Promise(function(T){w.sendMessageToCallMachine({action:"set-user-name",name:h??"",thisMeetingOnly:ke()||!!_&&!!_.thisMeetingOnly},function(k){delete k.action,delete k.callbackStamp,T(k)})})}},{key:"setUserData",value:($=fe(function*(h){var _=this;try{rx(h)}catch(w){throw console.error(w),w}if(this.properties.userData=h,this._callMachineInitialized)return new Promise(function(w){try{_.sendMessageToCallMachine({action:"set-user-data",userData:h},function(T){delete T.action,delete T.callbackStamp,w(T)})}catch(T){throw new Error("Error setting user data: ".concat(T))}})}),function(h){return $.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(h){if(h&&(h<100||typeof h!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(h){var _=this;if(typeof AudioWorkletNode>"u"&&!ke())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(h),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(w,T){_.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:h},function(k){_._isLocalAudioLevelObserverRunning=!k.error,k.error?T({error:k.error}):w()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:h}}},{key:"isLocalAudioLevelObserverRunning",value:function(){return this._isLocalAudioLevelObserverRunning}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(h){var _=this;if(this.validateAudioLevelInterval(h),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(w,T){_.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:h},function(k){_._isRemoteParticipantsAudioLevelObserverRunning=!k.error,k.error?T({error:k.error}):w()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:h}}},{key:"isRemoteParticipantsAudioLevelObserverRunning",value:function(){return this._isRemoteParticipantsAudioLevelObserverRunning}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(z=fe(function*(){var h=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Yt(this._callObjectMode,"startCamera()"),tl(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or set
398LocalVideo() instead?"),this.needsLoad())try{yield this.load(_)}catch(w){return Promise.reject(w)}else{if(this._didPreAuth){if(_.url&&_.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(_.token&&_.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(_),this.properties=ae(ae({},this.properties),_)}return new Promise(function(w){h._preloadCache.inputSettings=h._prepInputSettingsForSharing(h._inputSettings,!1),h.sendMessageToCallMachine({action:"start-camera",properties:os(h.properties,h.callClientId),preloadCache:os(h._preloadCache,h.callClientId)},function(T){w({camera:T.camera,mic:T.mic,speaker:T.speaker})})})}),function(){return z.apply(this,arguments)})},{key:"validateCustomTrack",value:function(h,_,w){if(w&&w.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(_&&_!=="music"&&_!=="speech"&&!(_ instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(w&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(w))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(h instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var h=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName,ignoreAudioLevel};return Te(),ze(this._callState,"startCustomTrack()"),this.validateCustomTrack(_.track,_.mode,_.trackName),new Promise(function(w,T){h._sharedTracks.customTrack=_.track,_.track=Mn,h.sendMessageToCallMachine({action:"start-custom-track",properties:_},function(k){k.error?T({error:k.error}):w(k.mediaTag)})})}},{key:"stopCustomTrack",value:function(h){var _=this;return Te(),ze(this._callState,"stopCustomTrack()"),new Promise(function(w){_.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:h},function(T){w(T.mediaTag)})})}},{key:"setCamera",value:function(h){var _=this;return li(),No(this._callMachineInitialized,"setCamera()"),new Promise(function(w){_.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:h},function(T){w({device:T.device})})})}},{key:"setAudioDevice",value:(I=fe(function*(h){return li(),this.nativeUtils().setAudioDevice(h),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(h){return I.apply(this,arguments)})},{key:"cycleCamera",value:function(){var h=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(w){h.sendMessageToCallMachine({action:"cycle-camera",properties:_},function(T){w({device:T.device})})})}},{key:"cycleMic",value:function(){var h=this;return Te(),new Promise(function(_){h.sendMessageToCallMachine({action:"cycle-mic"},function(w){_({device:w.device})})})}},{key:"getCameraFacingMode",value:function(){var h=this;return li(),new Promise(function(_){h.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(w){_(w.facingMode)})})}},{key:"setInputDevicesAsync",value:(A=fe(function*(h){var _=this,w=h.audioDeviceId,T=h.videoDeviceId,k=h.audioSource,j=h.videoSource;if(Te(),k!==void 0&&(w=k),j!==void 0&&(T=j),typeof w=="boolean"&&(this._setAllowLocalAudio(w),w=void 0),typeof T=="boolean"&&(this._setAllowLocalVideo(T),T=void 0),!w&&!T)return yield this.getInputDevices();var M={};return w&&(w instanceof MediaStreamTrack?(this._sharedTracks.audioTrack=w,w=Mn,M.audio={settings:{customTrack:w}}):(delete this._sharedTracks.audioTrack,M.audio={settings:{deviceId:w}})),T&&(T instanceof MediaStreamTrack?(this._sharedTracks.videoTrack=T,T=Mn,M.video={settings:{customTrack:T}}):(delete this._sharedTracks.videoTrack,M.video={settings:{deviceId:T}})),this._callObjectMode&&this.needsLoad()?(this._updatePreloadCacheInputSettings(M,!1),this._devicesFromInputSettings(this._inputSettings)):new Promise(function(L){_.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:w,videoDeviceId:T},function(B){if(delete B.action,delete B.callbackStamp,B.returnPreloadCache)return _._updatePreloadCacheInputSettings(M,!1),void L(_._devicesFromInputSettings(_._inputSettings));L(B)})})}),function(h){return A.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(F=fe(function*(h){var _=this,w=h.outputDeviceId;
vendor: 3,374 bytes, line 398
398if(Te(),!w||typeof w!="string")throw new Error("outputDeviceId must be provided and must be a valid device id");return this._preloadCache.outputDeviceId=w,this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(T,k){_.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:w},function(j){if(delete j.action,delete j.callbackStamp,j.error){var M=new Error(j.error.message);return M.type=j.error.type,void k(M)}j.returnPreloadCache?T(_._devicesFromInputSettings(_._inputSettings)):T(j)})})}),function(h){return F.apply(this,arguments)})},{key:"getInputDevices",value:(R=fe(function*(){var h=this;return this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(_){h.sendMessageToCallMachine({action:"get-input-devices"},function(w){w.returnPreloadCache?_(h._devicesFromInputSettings(h._inputSettings)):_({camera:w.camera,mic:w.mic,speaker:w.speaker})})})}),function(){return R.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return li(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(h){if(li(),[Rp,JO].includes(h)){if(h!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=h,!this.disableReactNativeAutoDeviceManagement("audio")&&qo(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",h)}},{key:"preAuth",value:(D=fe(function*(){var h=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Yt(this._callObjectMode,"preAuth()"),tl(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(_)),!_.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(_),this.properties=ae(ae({},this.properties),_),new Promise(function(w,T){h._preloadCache.inputSettings=h._prepInputSettingsForSharing(h._inputSettings,!1),h.sendMessageToCallMachine({action:"daily-method-preauth",properties:os(h.properties,h.callClientId),preloadCache:os(h._preloadCache,h.callClientId)},function(k){return k.error?T(k.error):k.access?(h._didPreAuth=!0,void w({access:k.access})):T(new Error("unknown error in preAuth()"))})})}),function(){return D.apply(this,arguments)})},{key:"load",value:(N=fe(function*(h){var _=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(h&&(this.validateProperties(h),this.properties=ae(ae({},this.properties),h)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(ap),this.emitDailyJSEvent({action:Yb}),this._callObjectMode?new Promise(function(w,T){_._callObjectLoader.cancel();var k=Date.now();_._callObjectLoader.load(_.properties.dailyConfig,function(j){_._bundleLoadTime=j?"no-op":Date.now()-k,_._updateCallState(cp),j&&_.emitDailyJSEvent({action:du}),w()},function(j,M){if(_.emitDailyJSEvent({action:Kb}),!M){_._updateCallState(An),_.resetMeetingDependentVars();var L={action:gu,errorMsg:j.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:j,bundleUrl:da(_.properties.dailyConfig)}}};_._maybeSendToSentry(L),_.emitDailyJSEvent(L),T(j.msg)}
398})}):(this._iframe.src=Tb(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(w,T){_._loadedCallback=function(k){_._callState!==An?(_._updateCallState(cp),(_.properties.cssFile||_.properties.cssText)&&_.loadCss(_.properties),w()):T(k)}}))}}),function(h){return N.apply(this,arguments)})},{key:"join",value:(O=fe(function*(){var h=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var w=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(_)}catch(T){return this.updateIsPreparingToJoin(!1),Promise.reject(T)}}else{if(w=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(_.url&&_.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(_.token&&_.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(_.url&&!this._callObjectMode&&_.url&&_.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(_.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(_),this.properties=ae(ae({},this.properties),_)}return _.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!_.showLocalVideo),_.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!_.showParticipantsBar),this._callState===rr||this._callState===va?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(va,!1),this.emitDailyJSEvent({action:Zb}),this._preloadCache.inputSettings=this._prepInputSettingsForSharing(this._inputSettings||{},!1),this.sendMessageToCallMachine({action:"join-meeting",properties:os(this.properties,this.callClientId),preloadCache:os(this._preloadCache,this.callClientId)}),new Promise(function(T,k){h._joinedCallback=function(j,M){if(h._callState!==An){if(h._updateCallState(rr),j)for(var L in j){if(h._callObjectMode){var B=h._callMachine().store;wp(j[L],B),xp(j[L],B),_p(j[L],h._participants[L],B)}h._participants[L]=ae({},j[L]),h.toggleParticipantAudioBasedOnNativeAudioFocus()}w&&h.loadCss(h.properties),T(j)}else k(M)}}))}),function(){return O.apply(this,arguments)})},{key:"leave",value:(C=fe(function*(){var h=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(_){h._callState===Yn||h._callState===An?_():h._callObjectLoader&&!h._callObjectLoader.loaded?(h._callObjectLoader.cancel(),h._updateCallState(Yn),h.resetMeetingDependentVars(),h.emitDailyJSEvent({action:Yn}),_()):(h._resolveLeave=_,h.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return C.apply(this,arguments)})},{key:"startScreenShare",value:(P=fe(function*(){var h=this,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(No(this._callMachineInitialized,"startScreenShare()"),_.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",_.screenVideoSendSettings),_.mediaStream&&(this._sharedTracks.screenMediaStream=_.mediaStream,_.mediaStream=Mn),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var w=this.nativeUtils();if(yield w.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:mu,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});w.setSystemScreenCaptureStartCallback(function(){w.setSystemScreenCaptureStartCallback(null),h.sendMessageToCallMachine({action:up,captureOptions:_})}),w.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:up,captureOptions:_})}),function(){return P.apply(this,arguments)})},{key:"stopScreenShare",value:function(){No(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_=h.type;if(_&&_!=="cloud"&&_!=="raw-tracks"&&_!=="local")throw new Error("invalid type: ".concat(_,", allowed values 'cloud', 'raw-tracks', or 'local'"));this.sendMessageToCallMachine(ae({action:"local-recording-start"},h))}},{key:"updateRecording",value:function(h){var _=h.layout,w=_===void 0?{preset:"default"}:_,T=h.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:w,instanceId:T})}},{key:"stopRecording",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(ae({action:"local-recording-stop"},h))}},{key:"startLiveStreaming",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(ae({action:"daily-method-start-live-streaming"},h))}},{key:"updateLiveStreaming",value:function(h){var _=h.layout,w=_===void 0?{preset:"default"}:_,T=h.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:w,instanceId:T})}},{key:"addLiveStreamingEndpoints",value:function(h){var _=h.endpoints,w=h.instanceId;this.sendMessageToCallMachine({action:dp,endpointsOp:wO,endpoints:_,instanceId:w})}},{key:"removeLiveStreamingEndpoints",value:function(h){var _=h.endpoints,w=h.instanceId;this.sendMessageToCallMachine({action:dp,endpointsOp:xO,endpoints:_,instanceId:w})}},{key:"stopLiveStreaming",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};
398this.sendMessageToCallMachine(ae({action:"daily-method-stop-live-streaming"},h))}},{key:"validateDailyConfig",value:function(h){h.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(h.camSimulcastEncodings)),h.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),Gw()&&h.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(h){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,w=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(h){if(!(h instanceof Array||Array.isArray(h)))throw new Error("encodings must be an Array");if(!zp(h.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var T=0;T<h.length;T++){var k=h[T];for(var j in this._validateEncodingLayerHasValidProperties(k),k)if(el.includes(j)){if(typeof k[j]!="number")throw new Error("".concat(j," must be a number"));if(_){var M=_[j],L=M.min,B=M.max;if(!zp(k[j],L,B))throw new Error("".concat(j," value not in range. valid range: ").concat(L," to ").concat(B))}}else if(!["active","scalabilityMode"].includes(j))throw new Error("Invalid key ".concat(j,", valid keys are:")+Object.values(el));if(w&&!k.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(E=fe(function*(h){var _=this,w=h.url,T=h.settings,k=T===void 0?{state:vu.PLAY}:T;try{(function(j){if(typeof j!="string")throw new Error('url parameter must be "string" type')})(w),Up(k),function(j){for(var M in j)if(!Dp.includes(M))throw new Error("Invalid key ".concat(M,", valid keys are: ").concat(Dp));j.simulcastEncodings&&this.validateSimulcastEncodings(j.simulcastEncodings,nx,!0)}(k)}catch(j){throw console.error("invalid argument Error: ".concat(j)),console.error(`startRemoteMediaPlayer arguments must be of the form:
399  { url: "playback url",
400  settings?:
401  {state: "play"|"pause", simulcastEncodings?: [{}] } }`),j}return new Promise(function(j,M){_.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:w,settings:k},function(L){L.error?M({error:L.error,errorMsg:L.errorMsg}):j({session_id:L.session_id,remoteMediaPlayerState:{state:L.state,settings:L.settings}})})})}),function(h){return E.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(S=fe(function*(h){var _=this;if(typeof h!="string")throw new Error(" remotePlayerID must be of type string");return new Promise(function(w,T){_.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:h},function(k){k.error?T({error:k.error,errorMsg:k.errorMsg}):w()})})}),function(h){return S.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(x=fe(function*(h){var _=this,w=h.session_id,T=h.settings;try{Up(T)}catch(k){throw console.error("invalid argument Error: ".concat(k)),console.error(`updateRemoteMediaPlayer arguments must be of the form:
402  session_id: "participant session",
403  { settings?: {state: "play"|"pause"} }`),k}return new Promise(function(k,j){_.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:w,settings:T},function(M){M.error?j({error:M.error,errorMsg:M.errorMsg}):k({session_id:M.session_id,remoteMediaPlayerState:{state:M.state,settings:M.settings}})})})}),function(h){return x.apply(this,arguments)})},{key:"startTranscription",value:function(h){ze(this._callState,"startTranscription()"),this.sendMessageToCallMachine(ae({action:"daily-method-start-transcription"},h))}},{key:"updateTranscription",value:function(h){if(ze(this._callState,"updateTranscription()"),!h)throw new Error("updateTranscription Error: options is mandatory");if(Pe(h)!=="object")throw new Error("updateTranscription Error: options must be object type");if(h.participants&&!Array.isArray(h.participants))throw new Error("updateTranscription 
403Error: participants must be an array");this.sendMessageToCallMachine(ae({action:"daily-method-update-transcription"},h))}},{key:"stopTranscription",value:function(h){if(ze(this._callState,"stopTranscription()"),h&&Pe(h)!=="object")throw new Error("stopTranscription Error: options must be object type");if(h&&!h.instanceId)throw new Error('"instanceId" not provided');this.sendMessageToCallMachine(ae({action:"daily-method-stop-transcription"},h))}},{key:"startDialOut",value:(g=fe(function*(h){var _=this;ze(this._callState,"startDialOut()");var w=function(M){if(M){if(!Array.isArray(M))throw new Error("Error starting dial out: audio codec must be an array");if(M.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");M.forEach(function(L){if(typeof L!="string")throw new Error("Error starting dial out: audio codec must be a string");if(L!=="OPUS"&&L!=="PCMU"&&L!=="PCMA"&&L!=="G722")throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!h.sipUri&&!h.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(h.sipUri&&h.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");
403if(h.sipUri){if(typeof h.sipUri!="string")throw new Error("Error starting dial out: sipUri must be a string");if(!h.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(h.video&&typeof h.video!="boolean")throw new Error("Error starting dial out: video must be a boolean value");(function(M){if(M&&(w(M.audio),M.video)){if(!Array.isArray(M.video))throw new Error("Error starting dial out: video codec must be an array");if(M.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");M.video.forEach(function(L){if(typeof L!="string")throw new Error("Error starting dial out: video codec must be a string");if(L!=="H264"&&L!=="VP8")throw new Error("Error starting dial out: video codec must be H264 or VP8")})}})(h.codecs)}if(h.phoneNumber){if(typeof h.phoneNumber!="string")throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(h.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");h.codecs&&w(h.codecs.audio)}if(h.callerId){if(typeof h.callerId!="string")throw new Error("Error starting dial out: callerId must be a string");if(h.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(h.displayName){if(typeof h.displayName!="string")throw new Error("Error starting dial out: displayName must be a string");if(h.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}if(h.userId){if(typeof h.userId!="string")throw new Error("Error starting dial out: userId must be a string");if(h.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}if(Lp(h),h.permissions&&h.permissions.canReceive){var T=ct(ex.validateJSONObject(h.permissions.canReceive),2),k=T[0],j=T[1];if(!k)throw new Error(j)}if(h.provider){if(h.provider!=="daily")throw new Error("Error: provider can be set only to 'daily', got: ".concat(h.provider));if(h.phoneNumber)throw new Error("Error starting dial out: provider valid only for sipUri, not phoneNumber");console.warn("(pre-beta) provider=daily is currently in pre-beta, things might break!")}return new Promise(function(M,L){_.sendMessageToCallMachine(ae({action:"dialout-start"},h),function(B){B.error?L(B.error):M(B)})})}),function(h){return g.apply(this,arguments)})},{key:"stopDialOut",value:function(h){var _=this;return ze(this._callState,"stopDialOut()"),new Promise(function(w,T){_.sendMessageToCallMachine(ae({action:"dialout-stop"},h),function(k){k.error?T(k.error):w(k)})})}},{key:"sipCallTransfer",value:(m=fe(function*(h){var _=this;if(ze(this._callState,"sipCallTransfer()"),!h)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return h.useSipRefer=!1,$p(h,"sipCallTransfer"),Lp(h),new Promise(function(w,T){_.sendMessageToCallMachine(ae({action:hp},h),function(k){k.error?T(k.error):w(k)})})}),function(h){return m.apply(this,arguments)})},{key:"sipRefer",value:(b=fe(function*(h){var _=this;if(ze(this._callState,"sipRefer()"),!h)throw new Error("sessionId and toEndPoint are mandatory parameter");return h.useSipRefer=!0,$p(h,"sipRefer"),new Promise(function(w,T){_.sendMessageToCallMachine(ae({action:hp},h),function(k){k.error?T(k.error):w(k)})})}),function(h){return b.apply(this,arguments)})},{key:"sendDTMF",value:(v=fe(function*(h){var _=this;return ze(this._callState,"sendDTMF()"),function(w){var T=w.sessionId,k=w.tones;if(!T||!k)throw new Error("sessionId and tones are mandatory parameter");if(typeof T!="string"||typeof k!="string")throw new Error("sessionId and tones should be of string type");if(k.length>20)throw new Error("tones string must be upto 20 characters");var j=/[^0-9A-D*#]/g,M=k.match(j);if(M&&M[0])throw new Error("".concat(M[0]," is not valid DTMF tone"))}(h),new Promise(function(w,T){_.sendMessageToCallMachine(ae({action:"send-dtmf"},h),function(k){k.error?T(k.error):w(k)})})}),function(h){return v.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var h=this;return this._callState!==rr?Promise.resolve(ae({stats:{latest:{}}},this._network)):new Promise(function(_){h.sendMessageToCallMachine({action:"get-calc-stats"},function(w){_(ae(ae({},h._network),{},{stats:w.stats}))})})}},{key:"testWebsocketConnectivity",value:(p=fe(function*(){var h=this;if(nl(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(_){return Promise.reject(_)}return new Promise(function(_,w){h.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(T){T.error?w(T.error):_(T.results)})})}),function(){return p.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(h){return h?h instanceof MediaStreamTrack?!!BO(h)||
403(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(f=fe(function*(){var h=this;Te(),Yt(this._callObjectMode,"testCallQuality()"),No(this._callMachineInitialized,"testCallQuality()",null,!0),tl(this._callState,this._isPreparingToJoin,"testCallQuality()");var _=this._testCallAlreadyInProgress,w=function(k){_||(h._testCallInProgress=k)};if(w(!0),this.needsLoad())try{var T=this._callState;yield this.load(),this._callState=T}catch(k){return w(!1),Promise.reject(k)}return new Promise(function(k){h.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:h.properties.dailyJsVersion},function(j){var M=j.results,L=M.result,B=tf(M,HO);if(L==="failed"){var X,ue=ae({},B);(X=B.error)!==null&&X!==void 0&&X.details?(B.error.details=JSON.parse(B.error.details),ue.error=ae(ae({},ue.error),{},{details:ae({},ue.error.details)}),ue.error.details.duringTest="testCallQuality"):(ue.error=ue.error?ae({},ue.error):{},ue.error.details={duringTest:"testCallQuality"}),h._maybeSendToSentry(ue)}w(!1),k(ae({result:L},B))})})}),function(){return f.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(d=fe(function*(h){var _;ke()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),_=yield this.testPeerToPeerCallQuality(h)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),_=yield this.testCallQuality());var w={result:_.result,secondsElapsed:_.secondsElapsed};return _.data&&(w.data={maxRTT:_.data.maxRoundTripTime,packetLoss:_.data.avgRecvPacketLoss}),w}),function(h){return d.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(u=fe(function*(h){var _=this;if(nl(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(k){return Promise.reject(k)}var w=h.videoTrack,T=h.duration;if(!this._validateVideoTrackForNetworkTests(w))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=w,new Promise(function(k,j){_.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:T},function(M){M.error?j(M.error):k(M.results)})})}),function(h){return u.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){ke()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(c=fe(function*(h){var _=this;if(nl(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(w){return Promise.reject(w)}if(!this._validateVideoTrackForNetworkTests(h))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=h,new Promise(function(w,T){_.sendMessageToCallMachine({action:"test-network-connectivity"},function(k){k.error?T(k.error):w(k.results)})})}),function(h){return c.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var h=this;return new Promise(function(_){h._callState===rr?h.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(w){_(w.cpuStats)}):_({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(h){var _;if(!(((_=Object.keys(h))===null||_===void 0?void 0:_.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(el))}},{key:"_validateVideoSendSettings",value:function(h,_){var w=h==="screenVideo"?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],T="Video send settings should be either an object or one of the supported presets: ".concat(w.join());if(typeof _=="string"){if(!w.includes(_))throw new Error(T)}else{if(Pe(_)!=="object")throw new Error(T);if(!_.maxQuality&&!_.encodings&&_.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(_.maxQuality&&["low","medium","high"].indexOf(_.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(_.encodings){var k=!1;switch(Object.keys(_.encodings).length){case 1:k=!_.encodings.low;break;case 2:k=!_.encodings.low||!_.encodings.medium;break;case 3:k=!_.encodings.low||!_.encodings.medium||!_.encodings.high;break;default:k=!0}if(k)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");
403_.encodings.low&&this._validateEncodingLayerHasValidProperties(_.encodings.low),_.encodings.medium&&this._validateEncodingLayerHasValidProperties(_.encodings.medium),_.encodings.high&&this._validateEncodingLayerHasValidProperties(_.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(h){var _=this;if(!h||Object.keys(h).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(h).forEach(function(w){var T=ct(w,2),k=T[0],j=T[1];_._validateVideoSendSettings(k,j)})}},{key:"updateSendSettings",value:function(h){var _=this;return this.validateUpdateSendSettings(h),this.needsLoad()?(this._preloadCache.sendSettings=h,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(w,T){_.sendMessageToCallMachine({action:"update-send-settings",sendSettings:h},function(k){k.error?T(k.error):w(k.sendSettings)})})}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return Te(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(h){return Te(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:h}),this}},{key:"activeSpeakerMode",value:function(){return Te(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(h){return ze(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=h,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:h}),this}},{key:"enumerateDevices",value:(a=fe(function*(){var h=this;if(this._callObjectMode){var _=yield navigator.mediaDevices.enumerateDevices();return Kr()==="Firefox"&&ya().major>115&&ya().major<123&&(_=_.filter(function(w){return w.kind!=="audiooutput"})),{devices:_.map(function(w){var T=JSON.parse(JSON.stringify(w));if(!ke()&&w.kind==="videoinput"&&w.getCapabilities){var k,j=w.getCapabilities();T.facing=(j==null||(k=j.facingMode)===null||k===void 0?void 0:k.length)>=1?j.facingMode[0]:void 0}return T})}}return new Promise(function(w){h.sendMessageToCallMachine({action:"enumerate-devices"},function(T){w({devices:T.devices})})})}),function(){return a.apply(this,arguments)})},{key:"sendAppMessage",value:function(h){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(ze(this._callState,"sendAppMessage()"),JSON.stringify(h).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:h,to:_}),this}},{key:"addFakeParticipant",value:function(h){return Te(),ze(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(ae({action:"add-fake-participant"},h)),this}},{key:"setShowNamesMode",value:function(h){return Tt(this._callObjectMode,"setShowNamesMode()"),Te(),h&&h!=="always"&&h!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:h}),this)}},{key:"setShowLocalVideo",value:function(){var h=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return Tt(this._callObjectMode,"setShowLocalVideo()"),Te(),ze(this._callState,"setShowLocalVideo()"),typeof h!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:h}),this._showLocalVideo=h,this)}},{key:"showLocalVideo",value:function(){return Tt(this._callObjectMode,"showLocalVideo()"),Te(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var h=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return Tt(this._callObjectMode,"setShowParticipantsBar()"),Te(),ze(this._callState,"setShowParticipantsBar()"),typeof h!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:h}),this._showParticipantsBar=h,this)}},{key:"showParticipantsBar",value:function(){return Tt(this._callObjectMode,"showParticipantsBar()"),Te(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return Te(),Tt(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(h){return Te(),Tt(this._callObjectMode,"setCustomIntegrations()"),ze(this._callState,"setCustomIntegrations()"),ux(h)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:h}),this._customIntegrations=h,this):this}},{key:"startCustomIntegrations",value:function(h){var _=this;if(Te(),Tt(this._callObjectMode,"startCustomIntegrations()"),ze(this._callState,"startCustomIntegrations()"),Array.isArray(h)&&h.some(function(k){return typeof k!="string"})||!Array.isArray(h)&&typeof h!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var w=typeof h=="string"?[h]:h,T=w.filter(function(k){return!(k in _._customIntegrations)});return T.length?(console.error(`Can't find custom integration(s): "`.concat(T.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:w}),this)}},{key:"stopCustomIntegrations",value:function(h){var _=this;if(Te(),Tt(this._callObjectMode,"stopCustomIntegrations()"),ze(this._callState,"stopCustomIntegrations()"),Array.isArray(h)&&h.some(function(k){return typeof k!="string"})||!Array.isArray(h)&&typeof h!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var w=typeof h=="string"?[h]:h,T=w.filter(function(k){return!(k in _._customIntegrations)});return T.length?(console.error(`Can't find custom integration(s): "`.concat(T.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:w}),this)}},{key:"customTrayButtons",value:function(){return Tt(this._callObjectMode,"customTrayButtons()"),Te(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(h){return Tt(this._callObjectMode,"updateCustomTrayButtons()"),Te(),ze(this._callState,"updateCustomTrayButtons()"),lx(h)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:h}),this._customTrayButtons=h,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(wa))),this)}},{key:"theme",value:function(){return Tt(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(h){var _=this;return Tt(this._callObjectMode,"setTheme()"),new Promise(function(w,T){try{_.validateProperties({theme:h}),_.properties.theme=ae({},h),_.sendMessageToCallMachine({action:"set-theme",theme:_.properties.theme});try{_.emitDailyJSEvent({action:Jb,theme:_.properties.theme})}catch(k){console.log("could not emit 'theme-updated'",k)}w(_.properties.theme)}catch(k){T(k)}})}},{key:"requestFullscreen",value:(o=fe(function*(){if(Te(),this._iframe&&!document.fullscreenElement&&fp())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(h){console.log("could not make video call fullscreen",h)}}),function(){return o.apply(this,arguments)})},{key:"exitFullscreen",value:function(){Te(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(i=fe(function*(){var h=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(_){h.sendMessageToCallMachine({action:"get-sidebar-view"},function(w){_(w.view)})})}),function(){return i.apply(this,arguments)})},{key:"setSidebarView",value:function(h){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:h}),this)}},{key:"room",value:(s=fe(function*(){var h=this,_=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,w=_===void 0||_;return this._accessState.access===Vo||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(T){h.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:w},function(k){delete k.action,delete k.callbackStamp,T(k)})})}),function(){return s.apply(this,arguments)})},{key:"geo",value:(r=fe(function*(){try{var h=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield h.json()).geo}}catch(_){return console.error("geo lookup failed",_),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(t=fe(function*(h){var _=this;return Te(),ze(this._callState,"setNetworkTopology()"),new Promise(function(w,T){_.sendMessageToCallMachine({action:"set-network-topology",opts:h},function(k){k.error?T({error:k.error}):w({workerId:k.workerId})})})}),function(h){return t.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=fe(function*(){var h=this;return new Promise(function(_,w){h.needsLoad()&&_({topology:"none"}),h.sendMessageToCallMachine({action:"get-network-topology"},function(T){T.error?w({error:T.error}):_({topology:T.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(h){if(Te(),typeof h!="number"&&h!==!0&&h!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(h));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:h})}},{key:"on",value:function(h,_){return So.prototype.on.call(this,h,_)}},{key:"once",value:function(h,_){return So.prototype.once.call(this,h,_)}},{key:"off",value:function(h,_){return So.prototype.off.call(this,h,_)}},{key:"validateProperties",value:function(h){var _,w;if(h!=null&&(_=h.dailyConfig)!==null&&_!==void 0&&_.userMediaAudioConstraints){var T,k;ke()||console.warn("userMediaAudioConstraints is deprecated. You can override constraints with inputSettings.audio.settings, found in DailyCallOptions.");var j=h.inputSettings||{};j.audio=((T=h.inputSettings)===null||T===void 0?void 0:T.audio)||{},j.audio.settings=((k=h.inputSettings)===null||k===void 0||(k=k.audio)===null||k===void 0?void 0:k.settings)||{},j.audio.settings=ae(ae({},j.audio.settings),h.dailyConfig.userMediaAudioConstraints),h.inputSettings=j,delete h.dailyConfig.userMediaAudioConstraints}if(h!=null&&(w=h.dailyConfig)!==null&&w!==void 0&&w.userMediaVideoConstraints){var M,L;ke()||console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");var B=h.inputSettings||{};B.video=((M=h.inputSettings)===null||M===void 0?void 0:M.video)||{},B.video.settings=((L=h.inputSettings)===null||L===void 0||(L=L.video)===null||L===void 0?void 0:L.settings)||{},B.video.settings=ae(ae({},B.video.settings),h.dailyConfig.userMediaVideoConstraints),h.inputSettings=B,delete h.dailyConfig.userMediaVideoConstraints}
vendor: 8,490 bytes, line 403
403for(var X in h)if(Pr[X]){if(Pr[X].validate&&!Pr[X].validate(h[X],this))throw new Error("property '".concat(X,"': ").concat(Pr[X].help))}else console.warn("Ignoring unrecognized property '".concat(X,"'")),delete h[X]}},{key:"assembleMeetingUrl",value:function(){var h,_,w=ae(ae({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(h=this.properties.dailyConfig)!==null&&h!==void 0&&h.proxyUrl?encodeURIComponent((_=this.properties.dailyConfig)===null||_===void 0?void 0:_.proxyUrl):void 0}),T=w.url.match(/\?/)?"&":"?";return w.url+T+Object.keys(Pr).filter(function(k){return Pr[k].queryString&&w[k]!==void 0}).map(function(k){return"".concat(Pr[k].queryString,"=").concat(w[k])}).join("&")}},{key:"needsLoad",value:function(){return[lu,ap,Yn,An].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(h,_){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(h,_,this.callClientId,this._iframe)}},{key:"forwardPackagedMessageToCallMachine",value:function(h){this._messageChannel.forwardPackagedMessageToCallMachine(h,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(h){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(h,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(h){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(h)}},{key:"handleMessageFromCallMachine",value:function(h){switch(h.action){case Hb:this.sendMessageToCallMachine(ae({action:Wb},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var _={action:Oo,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:da(this.properties.dailyConfig)}};this.sendMessageToCallMachine(_),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case du:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(h);break;case ew:var w,T=ae({},h);delete T.internal,this._maxAppMessageSize=((w=h.internal)===null||w===void 0?void 0:w._maxAppMessageSize)||Jc,this._joinedCallback&&(this._joinedCallback(h.participants),this._joinedCallback=null),this.emitDailyJSEvent(T);break;case nw:case rw:if(this._callState===Yn)return;if(h.participant&&h.participant.session_id){var k=h.participant.local?"local":h.participant.session_id;if(this._callObjectMode){var j=this._callMachine().store;wp(h.participant,j),xp(h.participant,j),_p(h.participant,this._participants[k],j)}try{this.maybeParticipantTracksStopped(this._participants[k],h.participant),this.maybeParticipantTracksStarted(this._participants[k],h.participant),this.maybeEventRecordingStopped(this._participants[k],h.participant),this.maybeEventRecordingStarted(this._participants[k],h.participant)}catch(zn){console.error("track events error",zn)}this.compareEqualForParticipantUpdateEvent(h.participant,this._participants[k])||(this._participants[k]=ae({},h.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(h))}break;case sw:if(h.participant&&h.participant.session_id){var M=this._participants[h.participant.session_id];M&&this.maybeParticipantTracksStopped(M,null),delete this._participants[h.participant.session_id],this.emitDailyJSEvent(h)}break;case iw:ft(this._participantCounts,h.participantCounts)||(this._participantCounts=h.participantCounts,this.emitDailyJSEvent(h));break;case ow:var L={access:h.access};h.awaitingAccess&&(L.awaitingAccess=h.awaitingAccess),ft(this._accessState,L)||(this._accessState=L,this.emitDailyJSEvent(h));break;case aw:if(h.meetingSession){this._meetingSessionSummary=h.meetingSession,this.emitDailyJSEvent(h);var B=ae(ae({},h),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(B)}break;case gu:var X;this._iframe&&!h.preserveIframe&&(this._iframe.src=""),this._updateCallState(An),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(h.errorMsg),this._loadedCallback=null),h.preserveIframe;var ue=tf(h,WO);ue!=null&&(X=ue.error)!==null&&X!==void 0&&X.details&&(ue.error.details=JSON.parse(ue.error.details)),this._maybeSendToSentry(h),this._joinedCallback&&(this._joinedCallback(null,ue),this._joinedCallback=null),this.emitDailyJSEvent(ue);break;case tw:this._callState!==An&&this._updateCallState(Yn),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(h);break;case"selected-devices-updated":h.devices&&this.emitDailyJSEvent(h);break;case Ow:var Le=h.state,Ze=h.threshold,Ke=h.quality,je=Le.state,nt=Le.reasons;je===this._network.networkState&&ft(nt,this._network.networkStateReasons)&&Ze===this._network.threshold&&Ke===this._network.quality||(this._network.networkState=je,this._network.networkStateReasons=nt,this._network.quality=Ke,this._network.threshold=Ze,h.networkState=je,nt.length&&(h.networkStateReasons=nt),delete h.state,this.emitDailyJSEvent(h));break;case Iw:h&&h.cpuLoadState&&this.emitDailyJSEvent(h);break;case Nw:h&&h.faceCounts!==void 0&&this.emitDailyJSEvent(h);break;case Pw:var Fe=h.activeSpeaker;this._activeSpeaker.peerId!==Fe.peerId&&(this._activeSpeaker.peerId=Fe.peerId,this.emitDailyJSEvent({action:h.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var lt=h.show;this._showLocalVideo=lt,this.emitDailyJSEvent({action:h.action,show:lt});break;case jw:var Jt=h.enabled;this._activeSpeakerMode!==Jt&&(this._activeSpeakerMode=Jt,this.emitDailyJSEvent({action:h.action,enabled:this._activeSpeakerMode}));break;case lw:case uw:case dw:this._waitingParticipants=h.allWaitingParticipants,this.emitDailyJSEvent({action:h.action,participant:h.participant});break;case Uw:ft(this._receiveSettings,h.receiveSettings)||(this._receiveSettings=h.receiveSettings,this.emitDailyJSEvent({action:h.action,receiveSettings:h.receiveSettings}));break;case pu:this._maybeUpdateInputSettings(h.inputSettings);break;case"send-settings-updated":ft(this._sendSettings,h.sendSettings)||(this._sendSettings=h.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:h.action,sendSettings:h.sendSettings}));break;case"local-audio-level":this._localAudioLevel=h.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(h);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=h.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(h);break;case Sw:var Ft=h.session_id;this._rmpPlayerState[Ft]=h.playerState,this.emitDailyJSEvent(h);break;case Tw:delete this._rmpPlayerState[h.session_id],this.emitDailyJSEvent(h);break;case Ew:var rt=h.session_id,ut=this._rmpPlayerState[rt];ut&&this.compareEqualForRMPUpdateEvent(ut,h.remoteMediaPlayerState)||(this._rmpPlayerState[rt]=h.remoteMediaPlayerState,this.emitDailyJSEvent(h));break;case"custom-button-click":case"sidebar-view-changed":case"pip-started":case"pip-stopped":this.emitDailyJSEvent(h);break;case cw:var yt=this._meetingSessionState.topology!==(h.meetingSessionState&&h.meetingSessionState.topology);this._meetingSessionState=rl(h.meetingSessionState,this._callObjectMode),(this._callObjectMode||yt)&&this.emitDailyJSEvent(h);break;case kw:this._isScreenSharing=!0,this.emitDailyJSEvent(h);break;case Cw:case Aw:this._isScreenSharing=!1,this.emitDailyJSEvent(h);break;case hu:case fu:case vw:case yw:case bw:case pw:case mw:case gw:case Qb:case Xb:case xw:case _w:case"test-completed":case Rw:case ww:case Dw:case Mw:case Lw:case Fw:case mu:case $w:case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-answered":case"dialout-error":case"dialout-stopped":case"dialout-warning":this.emitDailyJSEvent(h);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(h,_){var w="record";h&&(_.local||_[w]!==!1||h[w]===_[w]||this.emitDailyJSEvent({action:fu}))}},{key:"maybeEventRecordingStarted",value:function(h,_){var w="record";h&&(_.local||_[w]!==!0||h[w]===_[w]||this.emitDailyJSEvent({action:hu}))}},{key:"_trackStatePlayable",value:function(h){return!(!h||h.state!==zb)}}
403,{key:"_trackChanged",value:function(h,_){return(h==null?void 0:h.id)!==(_==null?void 0:_.id)}},{key:"maybeEventTrackStopped",value:function(h,_,w){var T,k,j=(T=_==null?void 0:_.tracks[h])!==null&&T!==void 0?T:null,M=(k=w==null?void 0:w.tracks[h])!==null&&k!==void 0?k:null,L=j==null?void 0:j.track;if(L){var B=this._trackStatePlayable(j),X=this._trackStatePlayable(M),ue=this._trackChanged(L,M==null?void 0:M.track);B&&(X&&!ue||this.emitDailyJSEvent({action:fw,track:L,participant:w??_,type:h}))}}},{key:"maybeEventTrackStarted",value:function(h,_,w){var T,k,j=(T=_==null?void 0:_.tracks[h])!==null&&T!==void 0?T:null,M=(k=w==null?void 0:w.tracks[h])!==null&&k!==void 0?k:null,L=M==null?void 0:M.track;if(L){var B=this._trackStatePlayable(j),X=this._trackStatePlayable(M),ue=this._trackChanged(j==null?void 0:j.track,L);X&&(B&&!ue||this.emitDailyJSEvent({action:hw,track:L,participant:w,type:h}))}}},{key:"maybeParticipantTracksStopped",value:function(h,_){if(h)for(var w in h.tracks)this.maybeEventTrackStopped(w,h,_)}},{key:"maybeParticipantTracksStarted",value:function(h,_){if(_)for(var w in _.tracks)this.maybeEventTrackStarted(w,h,_)}},{key:"compareEqualForRMPUpdateEvent",value:function(h,_){var w,T;return h.state===_.state&&((w=h.settings)===null||w===void 0?void 0:w.volume)===((T=_.settings)===null||T===void 0?void 0:T.volume)}},{key:"emitDailyJSEvent",value:function(h){try{h.callClientId=this.callClientId,this.emit(h.action,h)}catch(_){console.log("could not emit",h,_)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(h,_){return!!ft(h,_)&&(!h.videoTrack||!_.videoTrack||h.videoTrack.id===_.videoTrack.id&&h.videoTrack.muted===_.videoTrack.muted&&h.videoTrack.enabled===_.videoTrack.enabled)&&(!h.audioTrack||!_.audioTrack||h.audioTrack.id===_.audioTrack.id&&h.audioTrack.muted===_.audioTrack.muted&&h.audioTrack.enabled===_.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return ke()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(h){this._updateCallState(this._callState,h)}},{key:"_updateCallState",value:function(h){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(h!==this._callState||_!==this._isPreparingToJoin){var w=this._callState,T=this._isPreparingToJoin;this._callState=h,this._isPreparingToJoin=_;var k=this._callState===rr;this.updateShowAndroidOngoingMeetingNotification(k);var j=qo(w,T),M=qo(this._callState,this._isPreparingToJoin);j!==M&&(this.updateKeepDeviceAwake(M),this.updateDeviceAudioMode(M),this.updateNoOpRecordingEnsuringBackgroun
vendor: 1,530 bytes, line 403
403dContinuity(M))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=Np,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Vo},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=rl(Ip,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._maxAppMessageSize=Jc,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(h){ke()&&this.nativeUtils().setKeepDeviceAwake(h,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(h){if(ke()&&!this.disableReactNativeAutoDeviceManagement("audio")){var _=h?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(_)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(h){if(ke()&&this.nativeUtils().setShowOngoingMeetingNotification){var _,w,T,k;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var j=this.properties.reactNativeConfig.androidInCallNotification;_=j.title,w=j.subtitle,T=j.iconName,k=j.disableForCustomOverride}k&&(h=!1),this.nativeUtils().setShowOngoingMeetingNotification(h,_,w,T,this.callClientId)}}}
403,{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(h){ke()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(h)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var h;if(ke()){var _=(h=this._callMachine())===null||h===void 0||(h=h.store)===null||h===void 0?void 0:h.getState();for(var w in _==null?void 0:_.streams){var T=_.streams[w];T&&T.pendingTrack&&T.pendingTrack.kind==="audio"&&(T.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(h){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[h]}},{key:"absoluteUrl",value:function(h){if(h!==void 0){var _=document.createElement("a");return _.href=h,_.href}}},{key:"sayHello",value:function(){var h="hello, world.";return console.log(h),h}},{key:"_logUseAfterDestroy",value:function(){var h=Object.values(Ar)[0];if(this.needsLoad())if(h&&!h.needsLoad()){var _={action:Oo,level:"error",code:this.strictMode?9995:9997};h.sendMessageToCallMachine(_)}else this.strictMode||console.error("You are are attempting to use a call instance that was previously destroyed, which is unsupported. Please remove `strictMode: false` from your constructor properties to enable strict mode to track down and fix this unsupported usage.");else{var w={action:Oo,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(w,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var h=0,_=Object.values(Ar);h<_.length;h++){var w=_[h];w._callMachineInitialized?(w.sendMessageToCallMachine({action:Oo,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),w._delayDuplicateInstanceLog=!1):w._delayDuplicateInstanceLog=!0}}},{key:"_maybeSendToSentry",value:function(h){var _,w,T,k;if(!((_=h.error)!==null&&_!==void 0&&_.type&&(![Gb,qb,uu].includes(h.error.type)||h.error.type===uu&&h.error.msg.includes("deleted")))){var j=(w=this.properties)!==null&&w!==void 0&&w.url?new URL(this.properties.url):void 0,M="production";j&&j.host.includes(".staging.daily")&&(M="staging");var L,B,X,ue,Le,Ze=function(Ft){const rt=[gj(),pj(),Vj(),Uj(),Wj(),Yj(),wj(),Jj()];return Ft.autoSessionTracking!==!1&&rt.push(Hj()),rt}({}).filter(function(Ft){return!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(Ft.name)}),Ke=new Aj({dsn:"https://[email protected]/168844",transport:Ij,stackParser:$j,integrations:Ze,environment:M}),je=new br;if(je.setClient(Ke),Ke.init(),this.session_id&&je.setExtra("sessionId",this.session_id),this.properties){var nt=ae({},this.properties);nt.userName=nt.userName?"[Filtered]":void 0,nt.userData=nt.userData?"[Filtered]":void 0,nt.token=nt.token?"[Filtered]":void 0,je.setExtra("properties",nt)}if(j){var Fe=j.searchParams.get("domain");if(!Fe){var lt=j.host.match(/(.*?)\./);Fe=lt&&lt[1]||""}Fe&&je.setTag("domain",Fe)}h.error&&(je.setTag("fatalErrorType",h.error.type),je.setExtra("errorDetails",h.error.details),!((L=h.error.details)===null||L===void 0)&&L.uri&&je.setTag("serverAddress",h.error.details.uri),!((B=h.error.details)===null||B===void 0)&&B.workerGroup&&je.setTag("workerGroup",h.error.details.workerGroup),!((X=h.error.details)===null||X===void 0)&&X.geoGroup&&je.setTag("geoGroup",h.error.details.geoGroup),!((ue=h.error.details)===null||ue===void 0)&&ue.on&&je.setTag("connectionAttempt",h.error.details.on),(Le=h.error.details)!==null&&Le!==void 0&&Le.bundleUrl&&(je.setTag("bundleUrl",h.error.details.bundleUrl),je.setTag("bundleError",h.error.details.sourceError.type))),je.setTags({callMode:this._callObjectMode?ke()?"reactNative":(T=this.properties)!==null&&T!==void 0&&(T=T.dailyConfig)!==null&&T!==void 0&&(T=T.callMode)!==null&&T!==void 0&&T.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:n.version()});var Jt=((k=h.error)===null||k===void 0?void 0:k.msg)||h.errorMsg;je.captureException(new Error(Jt))}}},{key:"_callMachine",value:function(){var h;
403return(h=window._daily)===null||h===void 0||(h=h.instances)===null||h===void 0||(h=h[this.callClientId])===null||h===void 0?void 0:h.callMachine}},{key:"_maybeUpdateInputSettings",value:function(h){if(!ft(this._inputSettings,h)){var _=this._getInputSettings();this._inputSettings=h;var w=this._getInputSettings();ft(_,w)||this.emitDailyJSEvent({action:pu,inputSettings:w})}}}],[{key:"supportedBrowser",value:function(){if(ke())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var h=MP.getParser(Ht());return{supported:!!Qc(),mobile:h.getPlatformType()==="mobile",name:h.getBrowserName(),version:h.getBrowserVersion(),supportsFullscreen:!!fp(),supportsScreenShare:!!_O(),supportsSfu:!!Qc(),supportsVideoProcessing:Bw(),supportsAudioProcessing:qw()}}},{key:"version",value:function(){return"0.85.0"}},{key:"createCallObject",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return h.layout="none",new n(null,h)}},{key:"wrap",value:function(h){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Te(),!h||!h.contentWindow||typeof h.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return _.layout||(_.customLayout?_.layout="custom-v1":_.layout="browser"),new n(h,_)}},{key:"createFrame",value:function(h,_){var w,T;Te(),h&&_?(w=h,T=_):h&&h.append?(w=h,T={}):(w=document.body,T=h||{});var k=T.iframeStyle;k||(k=w===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var j=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?j.allow="microphone, camera":j.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",j.style.visibility="hidden",w.appendChild(j),j.style.visibility=null,Object.keys(k).forEach(function(M){return j.style[M]=k[M]}),T.layout||(T.customLayout?T.layout="custom-v1":T.layout="browser");try{return new n(j,T)}catch(M){throw w.removeChild(j),M}}},{key:"createTransparentFrame",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Te();var _=document.createElement("iframe");return _.allow="microphone; camera; autoplay",_.style.cssText=`
404      position: fixed;
405      top: 0;
406      left: 0;
407      width: 100%;
408      height: 100%;
409      border: 0;
410      pointer-events: none;
411    `,document.body.appendChild(_),h.layout||(h.layout="custom-v1"),n.wrap(_,h)}},{key:"getCallInstance",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return h?Ar[h]:Object.values(Ar)[0]}}]);var e,t,r,s,i,o,a,c,u,d,f,p,v,b,m,g,x,S,E,P,C,O,N,D,R,F,A,I,z,$,ee,K,se,G,q,te,Q,oe}();function Lp(n){if(n.extension){if(typeof n.extension!="string")throw new Error("Error starting dial out: extension must be a string");if(n.extension.length>20)throw new Error("Error starting dial out: extension length must be less than or equal to 20")}if(n.waitBeforeExtensionDialSec){if(typeof n.waitBeforeExtensionDialSec!="number")throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be a number");if(n.waitBeforeExtensionDialSec>60)throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be less than or equal to 60");if(!n.extension)throw new Error("Error starting dial out: waitBeforeExtensionDialSec requires a phoneNumber and extension")}}function os(n,e){var t={};for(var r in n)if(n[r]instanceof MediaStreamTrack)console.warn("MediaStreamTrack found in props or cache.",r),t[r]=Mn;else if(r==="dailyConfig"){if(n[r].modifyLocalSdpHook){var s=window._daily.instances[e].customCallbacks||{};s.modifyLocalSdpHook=n[r].modifyLocalSdpHook,window._daily.instances[e].customCallbacks=s,delete n[r].modifyLocalSdpHook}if(n[r].modifyRemoteSdpHook){var i=window._daily.instances[e].customCallbacks||{};i.modifyRemoteSdpHook=n[r].modifyRemoteSdpHook,window._daily.instances[e].customCallbacks=i,delete n[r].modifyRemoteSdpHook}t[r]=n[r]}else t[r]=n[r];return t}function ze(n){var e=arguments.length>2?arguments[2]:void 0;if(n!==rr){var t="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw e&&(t+=" ".concat(e)),console.error(t),new Error(t)}}function qo(n,e){return[va,rr].includes(n)||e}function tl(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(qo(n,e)){var s="".concat(t," not supported after joining a meeting.");throw r&&(s+=" ".concat(r)),console.error(s),new Error(s)}}function No(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",t=arguments.length>2?arguments[2]:void 0;if(!n){var r="".concat(e,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw t&&(r+=" ".concat(t)),console.error(r),new Error(r)}}function nl(n){if(n){var e="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(e),new Error(e)}}function Yt(n){if(!n){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(e),new Error(e)}}function Tt(n){if(n){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(e),new Error(e)}}function Te(){if(ke())throw new Error("This daily-js method is not currently supported in React Native")}function li(){if(!ke())throw new Error("This daily-js method is only supported in React Native")}function rx(n){if(n===void 0)return!0;var e;if(typeof n=="string")e=n;else try{e=JSON.stringify(n),ft(JSON.parse(e),n)||console.warn("The userData provided will be modified when serialized.")}catch(t){throw Error("userData must be serializable to JSON: ".concat(t))}if(e.length>4096)throw Error("userData is too large (".concat(e.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}
411function sx(n,e){for(var t=e.allowAllParticipantsKey,r=function(f){var p=["local"];return t||p.push("*"),f&&!p.includes(f)},s=function(f){return!!(f.layer===void 0||Number.isInteger(f.layer)&&f.layer>=0||f.layer==="inherit")},i=function(f){return!!f&&!(f.video&&!s(f.video))&&!(f.screenVideo&&!s(f.screenVideo))},o=0,a=Object.entries(n);o<a.length;o++){var c=ct(a[o],2),u=c[0],d=c[1];if(!r(u)||!i(d))return!1}return!0}function ix(n){if(Pe(n)!=="object")return!1;for(var e=0,t=Object.entries(n);e<t.length;e++){var r=ct(t[e],2),s=r[0],i=r[1];switch(s){case"video":if(Pe(i)!=="object")return!1;for(var o=0,a=Object.entries(i);o<a.length;o++){var c=ct(a[o],2),u=c[0],d=c[1];switch(u){case"processor":if(!QO(d))return!1;break;case"settings":if(!Fp(d))return!1;break;default:return!1}}break;case"audio":if(Pe(i)!=="object")return!1;for(var f=0,p=Object.entries(i);f<p.length;f++){var v=ct(p[f],2),b=v[0],m=v[1];switch(b){case"processor":if(!KO(m))return!1;break;case"settings":if(!Fp(m))return!1;break;default:return!1}}break;default:return!1}}return!0}function ox(n,e,t){var r,s=[];n.video&&n.video.processor&&(Bw((r=e==null?void 0:e.useLegacyVideoProcessor)!==null&&r!==void 0&&r)||(n.video.settings?delete n.video.processor:delete n.video,s.push("video"))),n.audio&&n.audio.processor&&(qw()||(n.audio.settings?delete n.audio.processor:delete n.audio,s.push("audio"))),s.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(s.join(", "))),n.audio&&n.audio.settings&&(n.audio.settings.customTrack?(t.audioTrack=n.audio.settings.customTrack,n.audio.settings={customTrack:Mn}):delete t.audioTrack),n.video&&n.video.settings&&(n.video.settings.customTrack?(t.videoTrack=n.video.settings.customTrack,n.video.settings={customTrack:Mn}):delete t.videoTrack)}function KO(n){if(ke())return console.warn("Video processing is not yet supported in React Native"),!1;var e=["type"];return!!n&&Pe(n)==="object"&&(Object.keys(n).filter(function(t){return!e.includes(t)}).forEach(function(t){console.warn("invalid key inputSettings -> audio -> processor : ".concat(t)),delete n[t]}),!!function(t){return typeof t!="string"?!1:Object.values(zw).includes(t)?!0:(console.error("inputSettings audio processor type invalid"),!1)}(n.type))}function QO(n){if(ke())return console.warn("Video processing is not yet supported in React Native"),!1;var e=["type","config"];return!n||Pe(n)!=="object"||!function(t){return typeof t!="string"?!1:Object.values(Bo).includes(t)?!0:(console.error("inputSettings video processor type invalid"),!1)}(n.type)||n.config&&(Pe(n.config)!=="object"||!function(t,r){var s=Object.keys(r);if(s.length===0)return!0;var i="invalid object in inputSettings -> video -> processor -> config";switch(t){case Bo.BGBLUR:return s.length>1||s[0]!=="strength"?(console.error(i),!1):!(typeof r.strength!="number"||r.strength<=0||r.strength>1||isNaN(r.strength))||(console.error("".concat(i,"; expected: {0 < strength <= 1}, got: ").concat(r.strength)),!1);case Bo.BGIMAGE:return!(r.source!==void 0&&!function(o){if(o.source==="default")return o.type="default",!0;if(o.source instanceof ArrayBuffer)return!0;if(ha(o.source))return o.type="url",!!function(u){var d=new URL(u),f=d.pathname;if(d.protocol==="data:")try{var p=f.substring(f.indexOf(":")+1,f.indexOf(";")).split("/")[1];return Kc.includes(p)}catch(b){return console.error("failed to deduce blob content type",b),!1}var v=f.split(".").at(-1).toLowerCase().trim();return Kc.includes(v)}(o.source)||(console.error("invalid image type; supported types: [".concat(Kc.join(", "),"]")),!1);return a=o.source,c=Number(a),isNaN(c)||!Number.isInteger(c)||c<=0||c>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),!1):(o.type="daily-preselect",!0);var a,c}(r));default:return!0}}(n.type,n.config))?!1:(Object.keys(n).filter(function(t){return!e.includes(t)}).forEach(function(t){console.warn("invalid key inputSettings -> video -> processor : ".concat(t)),delete n[t]}),!0)}function Fp(n){return Pe(n)==="object"&&(!n.customTrack||n.customTrack instanceof MediaStreamTrack)}function Su(){var n=Object.values(Bo).join(" | "),e=Object.values(zw).join(" | ");return"inputSettings must be of the form: { video?: { processor?: { type: [ ".concat(n," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function ax(n){var e=n.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(Bb).concat(e?' | "'.concat("*",'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function cx(){return"customIntegrations should be an object of type ".concat(JSON.stringify(_u),".")}function lx(n){if(n&&Pe(n)!=="object"||Array.isArray(n))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(wa),".")),!1;if(n)for(var e=0,t=Object.entries(n);e<t.length;e++)for(var r=ct(t[e],1)[0],s=0,i=Object.entries(n[r]);s<i.length;s++){var o=ct(i[s],2),a=o[0],c=o[1],u=wa.id[a];if(!u)return console.error("customTrayButton does not support key ".concat(a)),!1;switch(a){case"iconPath":case"iconPathDarkMode":if(!ha(c))return console.error("customTrayButton ".concat(a," should be a url.")),!1;break;case"visualState":if(!["default","sidebar-open","active"].includes(c))return console.error("customTrayButton ".concat(a," should be ").concat(u,". Got: ").concat(c)),!1;break;default:if(Pe(c)!==u)return console.error("customTrayButton ".concat(a," should be a ").concat(u,".")),!1}}return!0}function ux(n){if(!n||n&&Pe(n)!=="object"||Array.isArray(n))return console.error(cx()),!1;for(var e=function(f){return"".concat(f," should be ").concat(_u.id[f])},t=function(f,p){return console.error("customIntegration ".concat(f,": ").concat(p))},r=0,s=Object.entries(n);r<s.length;r++){var i=ct(s[r],1)[0];if(!("label"in n[i]))return t(i,"label is required"),!1;if(!("location"in n[i]))return t(i,"location is required"),!1;if(!("src"in n[i])&&!("srcdoc"in n[i]))return t(i,"src or srcdoc is required"),!1;for(var o=0,a=Object.entries(n[i]);o<a.length;o++){var c=ct(a[o],2),u=c[0],d=c[1];switch(u){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof d!="string")return t(i,e(u)),!1;break;case"iconURL":if(!ha(d))return t(i,"".concat(u," should be a url")),!1;break;case"src":if("srcdoc"in n[i])return t(i,"cannot have both src and srcdoc"),!1;if(!ha(d))return t(i,'src "'.concat(d,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in n[i])return t(i,"cannot have both src and srcdoc"),!1;if(typeof d!="string")return t(i,e(u)),!1;break;case"location":if(!["main","sidebar"].includes(d))return t(i,e(u)),!1;break;case"controlledBy":if(d!=="*"&&d!=="owners"&&(!Array.isArray(d)||d.some(function(f){return typeof f!="string"})))return t(i,e(u)),!1;break;case"shared":if((!Array.isArray(d)||d.some(function(f){return typeof f!="string"}))&&d!=="owners"&&typeof d!="boolean")return t(i,e(u)),!1;break;default:if(!_u.id[u])return console.error("customIntegration does not support key ".concat(u)),!1}}}return!0}function dx(n,e){if(e===void 0)return!1;switch(Pe(e)){case"string":return Pe(n)===e;case"object":if(Pe(n)!=="object")return!1;for(var t in n)if(!dx(n[t],e[t]))return!1;return!0;default:return!1}}function $p(n,e){var t=n.sessionId,r=n.toEndPoint,s=n.callerId,i=n.useSipRefer;if(!t||!r)throw new Error("".concat(e,"() requires a sessionId and toEndPoint"));if(typeof t!="string"||typeof r!="string")throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(i&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');
411if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'));if(s&&typeof s!="string")throw new Error("callerId must be of type string");if(s&&!r.startsWith("+"))throw new Error("callerId is only valid when transferring to a PSTN number")}function Up(n){if(Pe(n)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(n.state&&!Object.values(vu).includes(n.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(vu));if(n.volume){if(typeof n.volume!="number")throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(n.volume<0||n.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function zp(n,e,t){return!(typeof n!="number"||n<e||n>t)}function rl(n,e){return n&&!e&&delete n.data,n}const XO=Object.freeze(Object.defineProperty({__proto__:null,DAILY_ACCESS_LEVEL_FULL:Vb,DAILY_ACCESS_LEVEL_LOBBY:tO,DAILY_ACCESS_LEVEL_NONE:nO,DAILY_ACCESS_UNKNOWN:Vo,DAILY_CAMERA_ERROR_CAM_AND_MIC_IN_USE:fO,DAILY_CAMERA_ERROR_CAM_IN_USE:dO,DAILY_CAMERA_ERROR_CONSTRAINTS:vO,DAILY_CAMERA_ERROR_MIC_IN_USE:hO,DAILY_CAMERA_ERROR_NOT_FOUND:gO,DAILY_CAMERA_ERROR_PERMISSIONS:pO,DAILY_CAMERA_ERROR_UNDEF_MEDIADEVICES:mO,DAILY_CAMERA_ERROR_UNKNOWN:yO,DAILY_EVENT_ACCESS_STATE_UPDATED:ow,DAILY_EVENT_ACTIVE_SPEAKER_CHANGE:Pw,DAILY_EVENT_ACTIVE_SPEAKER_MODE_CHANGE:jw,DAILY_EVENT_APP_MSG:xw,DAILY_EVENT_CAMERA_ERROR:Xb,DAILY_EVENT_CPU_LOAD_CHANGE:Iw,DAILY_EVENT_ERROR:gu,DAILY_EVENT_EXIT_FULLSCREEN:vi,DAILY_EVENT_FACE_COUNTS_UPDATED:Nw,DAILY_EVENT_FULLSCREEN:gi,DAILY_EVENT_IFRAME_LAUNCH_CONFIG:Wb,DAILY_EVENT_IFRAME_READY_FOR_LAUNCH_CONFIG:Hb,DAILY_EVENT_INPUT_SETTINGS_UPDATED:pu,DAILY_EVENT_JOINED_MEETING:ew,DAILY_EVENT_JOINING_MEETING:Zb,DAILY_EVENT_LANG_UPDATED:$w,DAILY_EVENT_LEFT_MEETING:tw,DAILY_EVENT_LIVE_STREAMING_ERROR:Fw,DAILY_EVENT_LIVE_STREAMING_STARTED:Dw,DAILY_EVENT_LIVE_STREAMING_STOPPED:Lw,DAILY_EVENT_LIVE_STREAMING_UPDATED:Mw,DAILY_EVENT_LOADED:du,DAILY_EVENT_LOADING:Yb,DAILY_EVENT_LOAD_ATTEMPT_FAILED:Kb,DAILY_EVENT_LOCAL_SCREEN_SHARE_CANCELED:Aw,DAILY_EVENT_LOCAL_SCREEN_SHARE_STARTED:kw,DAILY_EVENT_LOCAL_SCREEN_SHARE_STOPPED:Cw,DAILY_EVENT_MEETING_SESSION_DATA_ERROR:bO,DAILY_EVENT_MEETING_SESSION_STATE_UPDATED:cw,DAILY_EVENT_MEETING_SESSION_SUMMARY_UPDATED:aw,DAILY_EVENT_NETWORK_CONNECTION:Rw,DAILY_EVENT_NETWORK_QUALITY_CHANGE:Ow,DAILY_EVENT_NONFATAL_ERROR:mu,DAILY_EVENT_PARTICIPANT_COUNTS_UPDATED:iw,DAILY_EVENT_PARTICIPANT_JOINED:nw,DAILY_EVENT_PARTICIPANT_LEFT:sw,DAILY_EVENT_PARTICIPANT_UPDATED:rw,DAILY_EVENT_RECEIVE_SETTINGS_UPDATED:Uw,DAILY_EVENT_RECORDING_DATA:ww,DAILY_EVENT_RECORDING_ERROR:yw,DAILY_EVENT_RECORDING_STARTED:hu,DAILY_EVENT_RECORDING_STATS:vw,DAILY_EVENT_RECORDING_STOPPED:fu,DAILY_EVENT_RECORDING_UPLOAD_COMPLETED:bw,DAILY_EVENT_REMOTE_MEDIA_PLAYER_STARTED:Sw,DAILY_EVENT_REMOTE_MEDIA_PLAYER_STOPPED:Tw,DAILY_EVENT_REMOTE_MEDIA_PLAYER_UPDATED:Ew,DAILY_EVENT_STARTED_CAMERA:Qb,DAILY_EVENT_THEME_UPDATED:Jb,DAILY_EVENT_TRACK_STARTED:hw,DAILY_EVENT_TRACK_STOPPED:fw,DAILY_EVENT_TRANSCRIPTION_ERROR:gw,DAILY_EVENT_TRANSCRIPTION_MSG:_w,DAILY_EVENT_TRANSCRIPTION_STARTED:pw,DAILY_EVENT_TRANSCRIPTION_STOPPED:mw,DAILY_EVENT_WAITING_PARTICIPANT_ADDED:lw,DAILY_EVENT_WAITING_PARTICIPANT_REMOVED:dw,DAILY_EVENT_WAITING_PARTICIPANT_UPDATED:uw,DAILY_FATAL_ERROR_CONNECTION:Gb,DAILY_FATAL_ERROR_EJECTED:sO,DAILY_FATAL_ERROR_EOL:qb,DAILY_FATAL_ERROR_EXP_ROOM:aO,DAILY_FATAL_ERROR_EXP_TOKEN:cO,DAILY_FATAL_ERROR_MEETING_FULL:lO,DAILY_FATAL_ERROR_NBF_ROOM:iO,DAILY_FATAL_ERROR_NBF_TOKEN:oO,DAILY_FATAL_ERROR_NOT_ALLOWED:uO,DAILY_FATAL_ERROR_NO_ROOM:uu,DAILY_RECEIVE_SETTINGS_ALL_PARTICIPANTS_KEY:rO,DAILY_RECEIVE_SETTINGS_BASE_KEY:Bb,DAILY_STATE_ERROR:An,DAILY_STATE_JOINED:rr,DAILY_STATE_JOINING:va,DAILY_STATE_LEFT:Yn,DAILY_STATE_NEW:lu,DAILY_TRACK_STATE_BLOCKED:Kj,DAILY_TRACK_STATE_INTERRUPTED:eO,DAILY_TRACK_STATE_LOADING:Zj,DAILY_TRACK_STATE_OFF:Qj,DAILY_TRACK_STATE_PLAYABLE:zb,DAILY_TRACK_STATE_SENDABLE:Xj,default:YO},Symbol.toStringTag,{value:"Module"})),ZO=sg(XO);var Vd={exports:{}},Ts=typeof Reflect=="object"?Reflect:null,Vp=Ts&&typeof Ts.apply=="function"?Ts.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},Go;Ts&&typeof Ts.ownKeys=="function"?Go=Ts.ownKeys:Object.getOwnPropertySymbols?Go=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Go=function(e){return Object.getOwnPropertyNames(e)};function eR(n){console&&console.warn&&console.warn(n)}var hx=Number.isNaN||function(e){return e!==e};function Me(){Me.init.call(this)}Vd.exports=Me;Vd.exports.once=sR;Me.EventEmitter=Me;Me.prototype._events=void 0;Me.prototype._eventsCount=0;Me.prototype._maxListeners=void 0;var Bp=10;
vendor: 4,360 bytes, line 411
411function lc(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(Me,"defaultMaxListeners",{enumerable:!0,get:function(){return Bp},set:function(n){if(typeof n!="number"||n<0||hx(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");Bp=n}});Me.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Me.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||hx(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function fx(n){return n._maxListeners===void 0?Me.defaultMaxListeners:n._maxListeners}Me.prototype.getMaxListeners=function(){return fx(this)};Me.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var s=e==="error",i=this._events;if(i!==void 0)s=s&&i.error===void 0;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[e];if(c===void 0)return!1;if(typeof c=="function")Vp(c,this,t);else for(var u=c.length,d=yx(c,u),r=0;r<u;++r)Vp(d[r],this,t);return!0};function px(n,e,t,r){var s,i,o;if(lc(t),i=n._events,i===void 0?(i=n._events=Object.create(null),n._eventsCount=0):(i.newListener!==void 0&&(n.emit("newListener",e,t.listener?t.listener:t),i=n._events),o=i[e]),o===void 0)o=i[e]=t,++n._eventsCount;else if(typeof o=="function"?o=i[e]=r?[t,o]:[o,t]:r?o.unshift(t):o.push(t),s=fx(n),s>0&&o.length>s&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=n,a.type=e,a.count=o.length,eR(a)}return n}Me.prototype.addListener=function(e,t){return px(this,e,t,!1)};Me.prototype.on=Me.prototype.addListener;Me.prototype.prependListener=function(e,t){return px(this,e,t,!0)};function tR(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function mx(n,e,t){var r={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},s=tR.bind(r);return s.listener=t,r.wrapFn=s,s}Me.prototype.once=function(e,t){return lc(t),this.on(e,mx(this,e,t)),this};Me.prototype.prependOnceListener=function(e,t){return lc(t),this.prependListener(e,mx(this,e,t)),this};Me.prototype.removeListener=function(e,t){var r,s,i,o,a;if(lc(t),s=this._events,s===void 0)return this;if(r=s[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;i===0?r.shift():nR(r,i),r.length===1&&(s[e]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",e,a||t)}return this};Me.prototype.off=Me.prototype.removeListener;Me.prototype.removeAllListeners=function(e){var t,r,s;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var i=Object.keys(r),o;for(s=0;s<i.length;++s)o=i[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this};function gx(n,e,t){var r=n._events;if(r===void 0)return[];var s=r[e];return s===void 0?[]:typeof s=="function"?t?[s.listener||s]:[s]:t?rR(s):yx(s,s.length)}Me.prototype.listeners=function(e){return gx(this,e,!0)};Me.prototype.rawListeners=function(e){return gx(this,e,!1)};Me.listenerCount=function(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):vx.
411call(n,e)};Me.prototype.listenerCount=vx;function vx(n){var e=this._events;if(e!==void 0){var t=e[n];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Me.prototype.eventNames=function(){return this._eventsCount>0?Go(this._events):[]};function yx(n,e){for(var t=new Array(e),r=0;r<e;++r)t[r]=n[r];return t}function nR(n,e){for(;e+1<n.length;e++)n[e]=n[e+1];n.pop()}function rR(n){for(var e=new Array(n.length),t=0;t<e.length;++t)e[t]=n[t].listener||n[t];return e}function sR(n,e){return new Promise(function(t,r){function s(o){n.removeListener(e,i),r(o)}function i(){typeof n.removeListener=="function"&&n.removeListener("error",s),t([].slice.call(arguments))}bx(n,e,i,{once:!0}),e!=="error"&&iR(n,s,{once:!0})})}function iR(n,e,t){typeof n.on=="function"&&bx(n,"error",e,t)}function bx(n,e,t,r){if(typeof n.on=="function")r.once?n.once(e,t):n.on(e,t);else if(typeof n.addEventListener=="function")n.addEventListener(e,function s(i){r.once&&n.removeEventListener(e,s),t(i)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}var oR=Vd.exports,uc={},fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.Api=fr.HttpClient=fr.ContentType=void 0;var Z;(function(n){n.Json="application/json",n.JsonApi="application/vnd.api+json",n.FormData="multipart/form-data",n.UrlEncoded="application/x-www-form-urlencoded",n.Text="text/plain"})(Z||(fr.ContentType=Z={}));class wx{constructor(e={}){he(this,"baseUrl","https://api.vapi.ai");he(this,"securityData",null);he(this,"securityWorker");he(this,"abortControllers",new Map);he(this,"customFetch",(...e)=>fetch(...e));he(this,"baseApiParams",{credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"});he(this,"setSecurityData",e=>{this.securityData=e});he(this,"contentFormatters",{[Z.Json]:e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,[Z.JsonApi]:e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,[Z.Text]:e=>e!==null&&typeof e!="string"?JSON.stringify(e):e,[Z.FormData]:e=>Object.keys(e||{}).reduce((t,r)=>{const s=e[r];return t.append(r,s instanceof Blob?s:typeof s=="object"&&s!==null?JSON.stringify(s):`${s}`),t},new FormData),[Z.UrlEncoded]:e=>this.toQueryString(e)});he(this,"createAbortSignal",e=>{if(this.abortControllers.has(e)){const r=this.abortControllers.get(e);return r?r.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal});he(this,"abortRequest",e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))});he(this,"request",async({body:e,secure:t,path:r,type:s,query:i,format:o,baseUrl:a,cancelToken:c,...u})=>{const d=(typeof t=="boolean"?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{}
411,f=this.mergeRequestParams(u,d),p=i&&this.toQueryString(i),v=this.contentFormatters[s||Z.Json],b=o||f.format;return this.customFetch(`${a||this.baseUrl||""}${r}${p?`?${p}`:""}`,{...f,headers:{...f.headers||{},...s&&s!==Z.FormData?{"Content-Type":s}:{}},signal:(c?this.createAbortSignal(c):f.signal)||null,body:typeof e>"u"||e===null?null:v(e)}).then(async m=>{const g=m.clone();g.data=null,g.error=null;const x=b?await m[b]().then(S=>(g.ok?g.data=S:g.error=S,g)).catch(S=>(g.error=S,g)):g;if(c&&this.abortControllers.delete(c),!m.ok)throw x;return x})});Object.assign(this,e)}encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent(typeof t=="number"?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(s=>this.encodeQueryParam(t,s)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(s=>typeof t[s]<"u").map(s=>Array.isArray(t[s])?this.addArrayQueryParam(t,s):this.addQueryParam(t,s)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}
411mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}}fr.HttpClient=wx;class aR extends wx{constructor(){super(...arguments);he(this,"assistant",{assistantControllerCreate:(t,r={})=>this.request({path:"/assistant",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),assistantControllerFindAll:(t,r={})=>this.request({path:"/assistant",method:"GET",query:t,secure:!0,format:"json",...r}),assistantControllerFindOne:(t,r={})=>this.request({path:`/assistant/${t}`,method:"GET",secure:!0,format:"json",...r}),assistantControllerUpdate:(t,r,s={})=>this.request({path:`/assistant/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),assistantControllerReplace:(t,r,s={})=>this.request({path:`/assistant/${t}`,method:"PUT",body:r,secure:!0,type:Z.Json,format:"json",...s}),assistantControllerRemove:(t,r={})=>this.request({path:`/assistant/${t}`,method:"DELETE",secure:!0,format:"json",...r}),assistantControllerFindVersions:(t,r,s={})=>this.request({path:`/assistant/${t}/version`,method:"GET",query:r,secure:!0,format:"json",...s})});he(this,"v2",{assistantControllerFindAllPaginated:(t,r={})=>this.request({path:"/v2/assistant",method:"GET",query:t,secure:!0,format:"json",...r}),callControllerCallsExport:(t,r={})=>this.request({path:"/v2/call/export",method:"GET",query:t,secure:!0,...r}),callControllerFindAllPaginated:(t,r={})=>this.request({path:"/v2/call",method:"GET",query:t,secure:!0,format:"json",...r}),callControllerFindAllMetadataPaginated:(t,r={})=>this.request({path:"/v2/call/metadata",method:"GET",query:t,secure:!0,format:"json",...r}),phoneNumberControllerFindAllPaginated:(t,r={})=>this.request({path:"/v2/phone-number",method:"GET",query:t,secure:!0,format:"json",...r})});he(this,"squad",{squadControllerCreate:(t,r={})=>this.request({path:"/squad",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),squadControllerFindAll:(t,r={})=>this.request({path:"/squad",method:"GET",query:t,secure:!0,format:"json",...r}),squadControllerFindOne:(t,r={})=>this.request({path:`/squad/${t}`,method:"GET",secure:!0,format:"json",...r}),squadControllerUpdate:(t,r,s={})=>this.request({path:`/squad/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),squadControllerRemove:(t,r={})=>this.request({path:`/squad/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"workflow",{workflowControllerFindAll:(t={})=>this.request({path:"/workflow",method:"GET",secure:!0,format:"json",...t}),workflowControllerCreate:(t,r={})=>this.request({path:"/workflow",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),workflowControllerFindOne:(t,r={})=>this.request({path:`/workflow/${t}`,method:"GET",secure:!0,format:"json",...r}),workflowControllerDelete:(t,r={})=>this.request({path:`/workflow/${t}`,method:"DELETE",secure:!0,format:"json",...r}),workflowControllerUpdate:(t,r,s={})=>this.request({path:`/workflow/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s})});he(this,"call",{callControllerCreate:(t,r={})=>this.request({path:"/call",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),callControllerFindAll:(t,r={})=>this.request({path:"/call",method:"GET",query:t,secure:!0,format:"json",...r}),callControllerFindOne:(t,r={})=>this.request({path:`/call/${t}`,method:"GET",secure:!0,format:"json",...r}),callControllerUpdate:(t,r,s={})=>this.request({path:`/call/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),callControllerDeleteCallData:(t,r,s={})=>this.request({path:`/call/${t}`,method:"DELETE",body:r,secure:!0,type:Z.Json,format:"json",...s}),callControllerCreatePhoneCall:(t,r={})=>this.request({path:"/call/phone",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),callControllerCreateWebCall:(t,r={})=>this.request({path:"/call/web",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r})});he(this,"chat",{chatControllerListChats:(t,r={})=>this.request({path:"/chat",method:"GET",query:t,secure:!0,format:"json",...r}),chatControllerCreateChat:(t,r={})=>this.request({path:"/chat",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),chatControllerGetChat:(t,r={})=>this.request({path:`/chat/${t}`,method:"GET",secure:!0,format:"json",...r}),chatControllerDeleteChat:(t,r={})=>this.request({path:`/chat/${t}`,method:"DELETE",secure:!0,format:"json",...r}),chatControllerCreateOpenAiChat:(t,r={})=>this.request({path:"/chat/responses",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),chatControllerCreateWebChat:(t,r={})=>this.request({path:"/chat/web",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),chatControllerCreateOpenAiWebChat:(t,r={})=>this.request({path:"/chat/web/responses",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r})});he(this,"campaign",{campaignControllerCreate:(t,r={})=>this.request({path:"/campaign",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),campaignControllerFindAll:(t,r={})=>this.request({path:"/campaign",method:"GET",query:t,secure:!0,format:"json",...r}),campaignControllerFindOne:(t,r={})=>this.request({path:`/campaign/${t}`,method:"GET",secure:!0,format:"json",...r}),campaignControllerUpdate:(t,r,s={})=>this.request({path:`/campaign/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),campaignControllerRemove:(t,r={})=>this.request({path:`/campaign/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"session",{sessionControllerCreate:(t,r={})=>this.request({path:"/session",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),sessionControllerFindAllPaginated:(t,r={})=>this.request({path:"/session",method:"GET",query:t,secure:!0,format:"json",...r}),sessionControllerFindOne:(t,r={})=>this.request({path:`/session/${t}`,method:"GET",secure:!0,format:"json",...r}),sessionControllerUpdate:(t,r,s={})=>this.request({path:`/session/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),sessionControllerRemove:(t,r={})=>this.request({path:`/session/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"phoneNumber",{phoneNumberControllerImportTwilio:(t,r={})=>this.request({path:"/phone-number/import/twilio",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),phoneNumberControllerImportVonage:(t,r={})=>this.request({path:"/phone-number/import/vonage",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),phoneNumberControllerCreate:(t,r={})=>this.request({path:"/phone-number",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),phoneNumberControllerFindAll:(t,r={})=>this.request({path:"/phone-number",method:"GET",query:t,secure:!0,format:"json",...r}),phoneNumberControllerFindOne:(t,r={})=>this.request({path:`/phone-number/${t}`,method:"GET",secure:!0,format:"json",...r}),phoneNumberControllerUpdate:(t,r,s={})=>this.request({path:`/phone-number/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),phoneNumberControllerRemove:(t,r={})=>this.request({path:`/phone-number/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"tool",{toolControllerCreate:(t,r={})=>this.request({path:"/tool",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),toolControllerFindAll:(t,r={})=>this.request({path:"/tool",method:"GET",query:t,secure:!0,format:"json",...r}),toolControllerFindOne:(t,r={})=>this.request({path:`/tool/${t}`,method:"GET",secure:!0,format:"json",...r}),toolControllerUpdate:(t,r,s={})=>this.request({path:`/tool/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),toolControllerRemove:(t,r={})=>this.request({path:`/tool/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"file",{fileControllerCreateDeprecated:(t,r={})=>this.request({path:"/file/upload",method:"POST",body:t,secure:!0,type:Z.FormData,format:"json",...r}),fileControllerCreate:(t,r={})=>this.request({path:"/file",method:"POST",body:t,secure:!0,type:Z.FormData,format:"json",...r}),fileControllerFindAll:(t={})=>this.request({path:"/file",method:"GET",secure:!0,format:"json",...t}),fileControllerFindOne:(t,r={})=>this.request({path:`/file/${t}`,method:"GET",secure:!0,format:"json",...r}),fileControllerUpdate:(t,r,s={})=>this.request({path:`/file/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),fileControllerRemove:(t,r={})=>this.request({path:`/file/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"knowledgeBase",{knowledgeBaseControllerCreate:(t,r={})=>this.request({path:"/knowledge-base",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),knowledgeBaseControllerFindAll:(t,r={})=>this.request({path:"/knowledge-base",method:"GET",query:t,secure:!0,format:"json",...r}),knowledgeBaseControllerFindOne:(t,r={})=>this.request({path:`/knowledge-base/${t}`,method:"GET",secure:!0,format:"json",...r}),knowledgeBaseControllerUpdate:(t,r,s={})=>this.request({path:`/knowledge-base/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),knowledgeBaseControllerRemove:(t,r={})=>this.request({path:`/knowledge-base/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"structuredOutput",{structuredOutputControllerFindAll:(t,r={})=>this.request({path:"/structured-output",method:"GET",query:t,secure:!0,format:"json",...r}),structuredOutputControllerCreate:(t,r={})=>this.request({path:"/structured-output",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),structuredOutputControllerFindOne:(t,r={})=>this.request({path:`/structured-output/${t}`,method:"GET",secure:!0,format:"json",...r}),structuredOutputControllerUpdate:(t,r,s,i={})=>this.request({path:`/structured-output/${t}`,method:"PATCH",query:r,body:s,secure:!0,type:Z.Json,format:"json",...i}),structuredOutputControllerRemove:(t,r={})=>this.request({path:`/structured-output/${t}`,method:"DELETE",secure:!0,format:"json",...r}),structuredOutputControllerRun:(t,r={})=>this.request({path:"/structured-output/run",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),structuredOutputControllerSuggest:(t,r={})=>this.request({path:"/structured-output/suggest",method:"POST",body:t,secure:!0,type:Z.Json,...r})});he(this,"testSuite",{testSuiteControllerFindAllPaginated:(t,r={})=>this.request({path:"/test-suite",method:"GET",query:t,secure:!0,format:"json",...r}),testSuiteControllerCreate:(t,r={})=>this.request({path:"/test-suite",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),testSuiteControllerFindOne:(t,r={})=>this.request({path:`/test-suite/${t}`,method:"GET",secure:!0,format:"json",...r}),testSuiteControllerUpdate:(t,r,s={})=>this.request({path:`/test-suite/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),testSuiteControllerRemove:(t,r={})=>this.request({path:`/test-suite/${t}`,method:"DELETE",secure:!0,format:"json",...r}),testSuiteTestControllerFindAllPaginated:(t,r,s={})=>this.request({path:`/test-suite/${t}/test`,method:"GET",query:r,secure:!0,format:"json",...s}),testSuiteTestControllerCreate:(t,r,s={})=>this.request({path:`/test-suite/${t}/test`,method:"POST",body:r,secure:!0,type:Z.Json,format:"json",...s}),testSuiteTestControllerFindOne:(t,r,s={})=>this.request({path:`/test-suite/${t}/test/${r}`,method:"GET",secure:!0,format:"json",...s}),testSuiteTestControllerUpdate:(t,r,s,i={})=>this.request({path:`/test-suite/${t}/test/${r}`,method:"PATCH",body:s,secure:!0,type:Z.Json,format:"json",...i}),testSuiteTestControllerRemove:(t,r,s={})=>this.request({path:`/test-suite/${t}/test/${r}`,method:"DELETE",secure:!0,format:"json",...s}),testSuiteRunControllerFindAllPaginated:(t,r,s={})=>this.request({path:`/test-suite/${t}/run`,method:"GET",query:r,secure:!0,format:"json",...s}),testSuiteRunControllerCreate:(t,r,s={})=>this.request({path:`/test-suite/${t}/run`,method:"POST",body:r,secure:!0,type:Z.Json,format:"json",...s}),testSuiteRunControllerFindOne:(t,r,s={})=>this.request({path:`/test-suite/${t}/run/${r}`,method:"GET",secure:!0,format:"json",...s}),testSuiteRunControllerUpdate:(t,r,s,i={})=>this.request({path:`/test-suite/${t}/run/${r}`,method:"PATCH",body:s,secure:!0,type:Z.Json,format:"json",...i}),testSuiteRunControllerRemove:(t,r,s={})=>this.request({path:`/test-suite/${t}/run/${r}`,method:"DELETE",secure:!0,format:"json",...s})});he(this,"reporting",{insightControllerCreate:(t,r={})=>this.request({path:"/reporting/insight",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),insightControllerFindAll:(t,r={})=>this.request({path:"/reporting/insight",method:"GET",query:t,secure:!0,format:"json",...r}),insightControllerUpdate:(t,r,s={})=>this.request({path:`/reporting/insight/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),insightControllerFindOne:(t,r={})=>this.request({path:`/reporting/insight/${t}`,method:"GET",secure:!0,format:"json",...r}),insightControllerRemove:(t,r={})=>this.request({path:`/reporting/insight/${t}`,method:"DELETE",secure:!0,format:"json",...r}),insightControllerRun:(t,r,s={})=>this.request({path:`/reporting/insight/${t}/run`,method:"POST",body:r,secure:!0,type:Z.Json,format:"json",...s}),insightControllerPreview:(t,r={})=>this.request({path:"/reporting/insight/preview",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r})});he(this,"eval",{evalControllerCreate:(t,r={})=>this.request({path:"/eval",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),evalControllerGetPaginated:(t,r={})=>this.request({path:"/eval",method:"GET",query:t,secure:!0,format:"json",...r}),evalControllerUpdate:(t,r,s={})=>this.request({path:`/eval/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),evalControllerRemove:(t,r={})=>this.request({path:`/eval/${t}`,method:"DELETE",secure:!0,format:"json",...r}),evalControllerGet:(t,r={})=>this.request({path:`/eval/${t}`,method:"GET",secure:!0,format:"json",...r}),evalControllerRemoveRun:(t,r={})=>this.request({path:`/eval/run/${t}`,method:"DELETE",secure:!0,format:"json",...r}),evalControllerGetRun:(t,r={})=>this.request({path:`/eval/run/${t}`,method:"GET",secure:!0,format:"json",...r}),evalControllerRun:(t,r={})=>this.request({path:"/eval/run",method:"POST",body:t,secure:!0,type:Z.Json,...r}),evalControllerGetRunsPaginated:(t,r={})=>this.request({path:"/eval/run",method:"GET",query:t,secure:!0,format:"json",...r})});he(this,"observability",{scorecardControllerGet:(t,r={})=>this.request({path:`/observability/scorecard/${t}`,method:"GET",secure:!0,format:"json",...r}),scorecardControllerUpdate:(t,r,s={})=>this.request({path:`/observability/scorecard/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),scorecardControllerRemove:(t,r={})=>this.request({path:`/observability/scorecard/${t}`,method:"DELETE",secure:!0,format:"json",...r}),scorecardControllerGetPaginated:(t,r={})=>this.request({path:"/observability/scorecard",method:"GET",query:t,secure:!0,format:"json",...r}),scorecardControllerCreate:(t,r={})=>this.request({path:"/observability/scorecard",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r})});he(this,"org",{orgControllerCreate:(t,r={})=>this.request({path:"/org",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),orgControllerFindAll:(t={})=>this.request({path:"/org",method:"GET",secure:!0,format:"json",...t}),orgControllerFeatureFlagEnabled:(t,r={})=>this.request({path:"/org/feature-flag",method:"GET",query:t,secure:!0,format:"json",...r}),orgControllerFindOne:(t,r={})=>this.request({path:`/org/${t}`,method:"GET",secure:!0,format:"json",...r}),orgControllerUpdate:(t,r,s={})=>this.request({path:`/org/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),orgControllerDeleteOrg:(t,r={})=>this.request({path:`/org/${t}`,method:"DELETE",secure:!0,...r}),orgControllerFindAllUsers:(t,r={})=>this.request({path:`/org/${t}/user`,method:"GET",secure:!0,format:"json",...r}),orgControllerOrgLeave:(t,r={})=>this.request({path:`/org/${t}/leave`,method:"DELETE",secure:!0,...r}),orgControllerOrgRemoveUser:(t,r,s={})=>this.request({path:`/org/${t}/member/${r}/leave`,method:"DELETE",secure:!0,...s}),orgControllerUsersInvite:(t,r,s={})=>this.request({path:`/org/${t}/invite`,method:"POST",body:r,secure:!0,type:Z.Json,...s}),orgControllerUserUpdate:(t,r,s={})=>this.request({path:`/org/${t}/role`,method:"PATCH",body:r,secure:!0,type:Z.Json,...s}),orgControll
411erOrgToken:(t,r={})=>this.request({path:`/org/${t}/auth`,method:"GET",secure:!0,format:"json",...r})});he(this,"token",{tokenControllerCreate:(t,r={})=>this.request({path:"/token",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),tokenControllerFindAll:(t,r={})=>this.request({path:"/token",method:"GET",query:t,secure:!0,format:"json",...r}),tokenControllerFindOne:(t,r={})=>this.request({path:`/token/${t}`,method:"GET",secure:!0,format:"json",...r}),tokenControllerUpdate:(t,r,s={})=>this.request({path:`/token/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),tokenControllerRemove:(t,r={})=>this.request({path:`/token/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"credential",{credentialControllerCreate:(t,r={})=>this.request({path:"/credential",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),credentialControllerFindAll:(t,r={})=>this.request({path:"/credential",method:"GET",query:t,secure:!0,format:"json",...r}),credentialControllerFindOne:(t,r={})=>this.request({path:`/credential/${t}`,method:"GET",secure:!0,format:"json",...r}),credentialControllerUpdate:(t,r,s={})=>this.request({path:`/credential/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),credentialControllerRemove:(t,r={})=>this.request({path:`/credential/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"template",{templateControllerCreate:(t,r={})=>this.request({path:"/template",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),templateControllerFindAll:(t,r={})=>this.request({path:"/template",method:"GET",query:t,secure:!0,format:"json",...r}),templateControllerFindAllPinned:(t={})=>this.request({path:"/template/pinned",method:"GET",secure:!0,format:"json",...t}),templateControllerFindOne:(t,r={})=>this.request({path:`/template/${t}`,method:"GET",secure:!0,format:"json",...r}),templateControllerUpdate:(t,r,s={})=>this.request({path:`/template/${t}`,method:"PATCH",body:r,secure:!0,type:Z.Json,format:"json",...s}),templateControllerRemove:(t,r={})=>this.request({path:`/template/${t}`,method:"DELETE",secure:!0,format:"json",...r})});he(this,"voiceLibrary",{voiceLibraryControllerVoiceGetByProvider:(t,r,s={})=>this.request({path:`/voice-library/${t}`,method:"GET",query:r,secure:!0,format:"json",...s}),voiceLibraryControllerVoiceGetAccentsByProvider:(t,r={})=>this.request({path:`/voice-library/${t}/accents`,method:"GET",secure:!0,format:"json",...r}),voiceLibraryControllerVoiceLibrarySyncByProvider:(t,r={})=>this.request({path:`/voice-library/sync/${t}`,method:"POST",secure:!0,format:"json",...r}),voiceLibraryControllerVoiceLibrarySyncDefaultVoices:(t,r={})=>this.request({path:"/voice-library/sync",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r}),voiceLibraryControllerVoiceLibraryCreateSesameVoice:(t,r={})=>this.request({path:"/voice-library/create-sesame-voice",method:"POST",body:t,secure:!0,type:Z.Json,...r})});he(this,"provider",{providerResourceControllerCreateProviderResource:(t,r,s={})=>this.request({path:`/provider/${t}/${r}`,method:"POST",secure:!0,format:"json",...s}),providerResourceControllerGetProviderResourcesPaginated:(t,r,s,i={})=>this.request({path:`/provider/${t}/${r}`,method:"GET",query:s,secure:!0,format:"json",...i}),providerResourceControllerGetProviderResource:(t,r,s,i={})=>this.request({path:`/provider/${t}/${r}/${s}`,method:"GET",secure:!0,format:"json",...i}),providerResourceControllerDeleteProviderResource:(t,r,s,i={})=>this.request({path:`/provider/${t}/${r}/${s}`,method:"DELETE",secure:!0,format:"json",...i}),providerResourceControllerUpdateProviderResource:(t,r,s,i={})=>this.request({path:`/provider/${t}/${r}/${s}`,method:"PATCH",secure:!0,format:"json",...i}),providerControllerGetWorkflows:(t,r,s={})=>this.request({path:`/${t}/workflows`,method:"GET",query:r,secure:!0,format:"json",...s}),providerControllerGetWorkflowTriggerHook:(t,r,s={})=>this.request({path:`/${t}/workflows/${r}/hooks`,method:"GET",secure:!0,format:"json",...s}),providerControllerGetLocations:(t,r={})=>this.request({path:`/${t}/locations`,method:"GET",secure:!0,format:"json",...r}),voiceProviderControllerSearchVoices:(t,r,s={})=>this.request({path:`/${t}/voices/search`,method:"GET",query:r,secure:!0,format:"json",...s}),voiceProviderControllerSearchVoice:(t,r,s={})=>this.request({path:`/${t}/voice/search`,method:"GET",query:r,secure:!0,format:"json",...s}),voiceProviderControllerAddVoices:(t,r,s={})=>this.request({path:`/${t}/voices/add`,method:"POST",body:r,secure:!0,type:Z.Json,format:"json",...s}),voiceProviderControllerAddVoice:(t,r,s={})=>this.request({path:`/${t}/voice/add`,method:"POST",body:r,secure:!0,type:Z.Json,format:"json",...s})});he(this,"v11Labs",{voiceProviderControllerCloneVoices:(t,r={})=>this.request({path:"/11labs/voice/clone",method:"POST",body:t,secure:!0,type:Z.FormData,...r})});he(this,"analytics",{analyticsControllerQuery:(t,r={})=>this.request({path:"/analytics",method:"POST",body:t,secure:!0,type:Z.Json,format:"json",...r})})}}fr.Api=aR;Object.defineProperty(uc,"__esModule",{value:!0});uc.client=void 0;const cR=fr,lR=new cR.Api({baseUrl:"https://api.vapi.ai",baseApiParams:{secure:!0},securityWorker:async n=>{if(n)return{headers:{Authorization:`Bearer ${n}`}}}});uc.client=lR;var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.createSafeDailyConfig=uR;Zs.safeSetLocalAudio=dR;Zs.safeSetInputDevicesAsync=hR;Zs.createSafeDailyFactoryOptions=fR;function uR(n){if(!n)return{};const{alwaysIncludeMicInPermissionPrompt:e,...t}=n;return e===!1?(console.warn("[Vapi] alwaysIncludeMicInPermissionPrompt:false detected. This can cause Chrome 140+ issues. Removing the property."),t):n}function dR(n,e){if(!n)throw new Error("Call object is not available.");n.setLocalAudio(e)}async function hR(n,e){if(!n)throw new Error("Call object is not available.");if("audioSource"in e&&e.audioSource===!1){console.warn("[Vapi] setInputDevicesAsync with audioSource:false detected. This can cause Chrome 140+ issues. Using default device instead.");const{audioSource:t,...r}=e;await n.setInputDevicesAsync(r);return}await n.setInputDevicesAsync(e)}function fR(n){return n?n.audioSource===!1?(console.warn("[Vapi] audioSource:false detected in factory options. This can cause Chrome 140+ issues. Defaulting to true."),{...n,audioSource:!0}):n:{}}var xx=Et&&Et.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};
411Object.defineProperty(_b,"__esModule",{value:!0});const sl=xx(ZO),pR=xx(oR),il=uc,jr=Zs;async function mR(n,e){n.muted=!1,n.autoplay=!0,e!=null&&(n.srcObject=new MediaStream([e]),await n.play())}async function qp(n,e){const t=document.createElement("audio");return t.dataset.participantId=e,document.body.appendChild(t),await mR(t,n),t}function Gp(n){const e=document.querySelector(`audio[data-participant-id="${n}"]`);e==null||e.remove()}function Hp(n,e,t,r){n.participant.local||e.updateParticipant(n.participant.session_id,{setSubscribedTracks:{audio:!0,video:t||r}})}class gR extends pR.default{on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}emit(e,...t){return super.emit(e,...t)}removeListener(e,t){return super.removeListener(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}}class vR extends gR{constructor(t,r,s,i){super();he(this,"started",!1);he(this,"call",null);he(this,"speakingTimeout",null);he(this,"dailyCallConfig",{});he(this,"dailyCallObject",{});he(this,"hasEmittedCallEndedStatus",!1);il.client.baseUrl=r??"https://api.vapi.ai",il.client.setSecurityData(t),this.dailyCallConfig=(0,jr.createSafeDailyConfig)(s),this.dailyCallObject=(0,jr.createSafeDailyFactoryOptions)(i)}async cleanup(){this.started=!1,this.hasEmittedCallEndedStatus=!1,this.call&&(await this.call.destroy(),this.call=null),this.speakingTimeout=null}isMobileDevice(){if(typeof navigator>"u")return!1;const t=navigator.userAgent;return/android|iphone|ipad|ipod|iemobile|blackberry|bada/i.test(t.toLowerCase())}async sleep(t){return new Promise(r=>setTimeout(r,t))}async start(t,r,s,i,o,a){var u,d,f,p,v,b,m;const c=Date.now();if(!t&&!s&&!i){const g=new Error("Assistant or Squad or Workflow must be provided.");throw this.emit("error",{type:"validation-error",stage:"input-validation",message:g.message,timestamp:new Date().toISOString()}),g}if(this.started)return this.emit("call-start-progress",{stage:"validation",status:"failed",timestamp:new Date().toISOString(),metadata:{reason:"already-started"}}),null;this.emit("call-start-progress",{stage:"initialization",status:"started",timestamp:new Date().toISOString(),metadata:{hasAssistant:!!t,hasSquad:!!s,hasWorkflow:!!i}}),this.started=!0;try{this.emit("call-start-progress",{stage:"web-call-creation",status:"started",timestamp:new Date().toISOString()});const g=Date.now(),x=(await il.client.call.callControllerCreateWebCall({assistant:typeof t=="string"?void 0:t,assistantId:typeof t=="string"?t:void 0,assistantOverrides:r,squad:typeof s=="string"?void 0:s,squadId:typeof s=="string"?s:void 0,workflow:typeof i=="string"?void 0:i,workflowId:typeof i=="string"?i:void 0,workflowOverrides:o,roomDeleteOnUserLeaveEnabled:a==null?void 0:a.roomDeleteOnUserLeaveEnabled})).data,S=Date.now()-g;this.emit("call-start-progress",{stage:"web-call-creation",status:"completed",duration:S,timestamp:new Date().toISOString(),metadata:{callId:(x==null?void 0:x.id)||"unknown",videoRecordingEnabled:((u=x==null?void 0:x.artifactPlan)==null?void 0:u.videoRecordingEnabled)??!1,voiceProvider:((f=(d=x==null?void 0:x.assistant)==null?void 0:d.voice)==null?void 0:f.provider)||"unknown"}}
411),this.call&&(this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"started",timestamp:new Date().toISOString(),metadata:{action:"cleanup-existing"}}),await this.cleanup());const E=((p=x==null?void 0:x.artifactPlan)==null?void 0:p.videoRecordingEnabled)??!1,P=((b=(v=x==null?void 0:x.assistant)==null?void 0:v.voice)==null?void 0:b.provider)==="tavus";this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"started",timestamp:new Date().toISOString(),metadata:{audioSource:this.dailyCallObject.audioSource??!0,videoSource:this.dailyCallObject.videoSource??E,isVideoRecordingEnabled:E,isVideoEnabled:P}});const C=Date.now();try{this.call=sl.default.createCallObject({audioSource:this.dailyCallObject.audioSource??!0,videoSource:this.dailyCallObject.videoSource??E,dailyConfig:this.dailyCallConfig});const A=Date.now()-C;this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"completed",duration:A,timestamp:new Date().toISOString()})}catch(A){const I=Date.now()-C;throw this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"failed",duration:I,timestamp:new Date().toISOString(),metadata:{error:A==null?void 0:A.toString()}}),this.emit("error",{type:"daily-call-object-creation-error",stage:"daily-call-object-creation",error:A,timestamp:new Date().toISOString()}),A}(m=this.call.iframe())==null||m.style.setProperty("display","none"),this.call.on("left-meeting",()=>{var A;this.emit("call-end"),this.hasEmittedCallEndedStatus||(this.emit("message",{type:"status-update",status:"ended",endedReason:"customer-ended-call"}),this.hasEmittedCallEndedStatus=!0),E&&((A=this.call)==null||A.stopRecording()),this.cleanup().catch(console.error)}),this.call.on("error",A=>{var I;this.emit("error",A),E&&((I=this.call)==null||I.stopRecording())}),this.call.on("camera-error",A=>{this.emit("camera-error",A)}),this.call.on("network-quality-change",A=>{this.emit("network-quality-change",A)}),this.call.on("network-connection",A=>{this.emit("network-connection",A)}),this.call.on("track-started",async A=>{var I,z,$;!A||!A.participant||(I=A.participant)!=null&&I.local||((z=A.participant)==null?void 0:z.user_name)==="Vapi Speaker"&&(A.track.kind==="video"&&this.emit("video",A.track),A.track.kind==="audio"&&await qp(A.track,A.participant.session_id),($=this.call)==null||$.sendAppMessage("playable"))}),this.call.on("participant-joined",A=>{!A||!this.call||Hp(A,this.call,E,P)}),this.call.on("participant-updated",A=>{A&&this.emit("daily-participant-updated",A.participant)}),this.call.on("participant-left",A=>{A&&Gp(A.participant.session_id)});const O=this.isMobileDevice();if(this.emit("call-start-progress",{stage:"mobile-permissions",status:"started",timestamp:new Date().toISOString(),metadata:{isMobile:O}}),O){const A=Date.now();await this.sleep(1e3);const I=Date.now()-A;this.emit("call-start-progress",{stage:"mobile-permissions",status:"completed",duration:I,timestamp:new Date().toISOString(),metadata:{action:"permissions-wait"}})}else this.emit("call-start-progress",{stage:"mobile-permissions",status:"completed",timestamp:new Date().toISOString(),metadata:{action:"skipped-not-mobile"}});this.emit("call-start-progress",{stage:"daily-call-join",status:"started",timestamp:new Date().toISOString()});const N=Date.now();try{await this.call.join({url:x.webCallUrl,subscribeToTracksAutomatically:!1});const A=Date.now()-N;this.emit("call-start-progress",{stage:"daily-call-join",status:"completed",duration:A,timestamp:new Date().toISOString()})}catch(A){const I=Date.now()-N;throw this.emit("call-start-progress",{stage:"daily-call-join",status:"failed",duration:I,timestamp:new Date().toISOString(),metadata:{error:A==null?void 0:A.toString()}}),this.emit("error",{type:"daily-call-join-error",stage:"daily-call-join",error:A,duration:I,timestamp:new Date().toISOString()}),A}if(E){this.emit("call-start-progress",{stage:"video-recording-setup",status:"started",timestamp:new Date().toISOString()});const A=new Date().getTime(),I=Date.now();try{this.call.startRecording({width:1280,height:720,backgroundColor:"#FF1F2D3D",layout:{preset:"default"}});const z=Date.now()-I;
411this.emit("call-start-progress",{stage:"video-recording-setup",status:"completed",duration:z,timestamp:new Date().toISOString()}),this.call.on("recording-started",()=>{const $=(new Date().getTime()-A)/1e3;this.emit("call-start-progress",{stage:"video-recording-started",status:"completed",timestamp:new Date().toISOString(),metadata:{delaySeconds:$}}),this.send({type:"control",control:"say-first-message",videoRecordingStartDelaySeconds:$})})}catch(z){const $=Date.now()-I;this.emit("call-start-progress",{stage:"video-recording-setup",status:"failed",duration:$,timestamp:new Date().toISOString(),metadata:{error:z==null?void 0:z.toString()}}),this.emit("error",{type:"video-recording-setup-error",stage:"video-recording-setup",error:z,timestamp:new Date().toISOString()})}}else this.emit("call-start-progress",{stage:"video-recording-setup",status:"completed",timestamp:new Date().toISOString(),metadata:{action:"skipped-not-enabled"}});this.emit("call-start-progress",{stage:"audio-observer-setup",status:"started",timestamp:new Date().toISOString()});const D=Date.now();try{this.call.startRemoteParticipantsAudioLevelObserver(100);const A=Date.now()-D;this.emit("call-start-progress",{stage:"audio-observer-setup",status:"completed",duration:A,timestamp:new Date().toISOString()})}catch(A){const I=Date.now()-D;this.emit("call-start-progress",{stage:"audio-observer-setup",status:"failed",duration:I,timestamp:new Date().toISOString(),metadata:{error:A==null?void 0:A.toString()}}),this.emit("error",{type:"audio-observer-setup-error",stage:"audio-observer-setup",error:A,timestamp:new Date().toISOString()})}this.call.on("remote-participants-audio-level",A=>{A&&this.handleRemoteParticipantsAudioLevel(A)}),this.call.on("app-message",A=>this.onAppMessage(A)),this.call.on("nonfatal-error",A=>{var I;(A==null?void 0:A.type)==="audio-processor-error"&&((I=this.call)==null||I.updateInputSettings({audio:{processor:{type:"none"}}}).then(()=>{(0,jr.safeSetLocalAudio)(this.call,!0)}))}),this.emit("call-start-progress",{stage:"audio-processing-setup",status:"started",timestamp:new Date().toISOString()});const R=Date.now();try{this.call.updateInputSettings({audio:{processor:{type:"noise-cancellation"}}});const A=Date.now()-R;this.emit("call-start-progress",{stage:"audio-processing-setup",status:"completed",duration:A,timestamp:new Date().toISOString()})}catch(A){const I=Date.now()-R;this.emit("call-start-progress",{stage:"audio-processing-setup",status:"failed",duration:I,timestamp:new Date().toISOString(),metadata:{error:A==null?void 0:A.toString()}}),this.emit("error",{type:"audio-processing-setup-error",stage:"audio-processing-setup",error:A,timestamp:new Date().toISOString()})}const F=Date.now()-c;return this.emit("call-start-success",{totalDuration:F,callId:(x==null?void 0:x.id)||"unknown",timestamp:new Date().toISOString()}),x}catch(g){const x=Date.now()-c;return this.emit("call-start-failed",{stage:"unknown",totalDuration:x,error:(g==null?void 0:g.toString())||"Unknown error occurred",errorStack:g instanceof Error?g.stack:"No stack trace available",timestamp:new Date().toISOString(),context:{hasAssistant:!!t,hasSquad:!!s,hasWorkflow:!!i,isMobile:this.isMobileDevice()}}),this.emit("error",{type:"start-method-error",stage:"unknown",error:g,totalDuration:x,timestamp:new Date().toISOString(),context:{hasAssistant:!!t,hasSquad:!!s,hasWorkflow:!!i,isMobile:this.isMobileDevice()}}),await this.cleanup(),null}}onAppMessage(t){if(t)try{if(t.data==="listening")return this.emit("call-start");try{const r=JSON.parse(t.data);this.emit("message",r),r&&"type"in r&&"status"in r&&r.type==="status-update"&&r.status==="ended"&&(this.hasEmittedCallEndedStatus=!0)}catch(r){console.log("Error parsing message data: ",r)}}catch(r){console.error(r)}}handleRemoteParticipantsAudioLevel(t){const r=Object.values(t.participantsAudioLevel).reduce((i,o)=>i+o,0);this.emit("volume-level",Math.min(1,r/.15)),r>.01&&(this.speakingTimeout?(clearTimeout(this.speakingTimeout),this.speakingTimeout=null):this.emit("speech-start"),this.speakingTimeout=setTimeout(()=>{this.emit("speech-end"),this.speakingTimeout=null},1e3))}async stop(){this.started=!1,this.call&&(await this.call.destroy(),this.call=null),this.speakingTimeout=null}send(t){var r;(r=this.call)==null||r.sendAppMessage(JSON.stringify(t))}setMuted(t){(0,jr.safeSetLocalAudio)(this.call,!t)}isMuted(){return this.call?this.call.localAudio()===!1:!1}say(t,r,s,i){this.send({type:"say",message:t,endCallAfterSpoken:r,interruptionsEnabled:s??!1,interruptAssistantEnabled:i??!1})}end(){this.send({type:"end-call"}),this.stop()}setInputDevicesAsync(t){return(0,jr.safeSetInputDevicesAsync)(this.call,t)}async increaseMicLevel(t){if(!this.call)throw new Error("Call object is not available.");try{const r=await navigator.mediaDevices.getUserMedia({audio:!0}),s=new AudioContext,i=s.createMediaStreamSource(r),o=s.createGain();o.gain.value=t,i.connect(o);const a=s.createMediaStreamDestination();o.connect(a);const[c]=a.stream.getAudioTracks();await(0,jr.safeSetInputDevicesAsync)(this.call,{audioSource:c})}
411catch(r){console.error("Error adjusting microphone level:",r)}}setOutputDeviceAsync(t){var r;(r=this.call)==null||r.setOutputDeviceAsync(t)}getDailyCallObject(){return this.call}startScreenSharing(t,r){var s;(s=this.call)==null||s.startScreenShare({displayMediaOptions:t,screenVideoSendSettings:r})}stopScreenSharing(){var t;(t=this.call)==null||t.stopScreenShare()}async reconnect(t){var s,i,o,a,c,u,d,f,p,v,b,m,g;const r=Date.now();if(this.started)throw new Error("Cannot reconnect while a call is already in progress. Call stop() first.");if(!t.webCallUrl)throw new Error("webCallUrl is required for reconnection.");this.emit("call-start-progress",{stage:"reconnect-initialization",status:"started",timestamp:new Date().toISOString(),metadata:{callId:t.id||"unknown",hasVideoRecording:!!((s=t==null?void 0:t.artifactPlan)!=null&&s.videoRecordingEnabled),voiceProvider:((o=(i=t==null?void 0:t.assistant)==null?void 0:i.voice)==null?void 0:o.provider)||"unknown"}}),this.started=!0;try{this.call&&(this.emit("call-start-progress",{stage:"cleanup-existing-call",status:"started",timestamp:new Date().toISOString()}),await this.cleanup(),this.emit("call-start-progress",{stage:"cleanup-existing-call",status:"completed",timestamp:new Date().toISOString()}));const x=((a=t==null?void 0:t.artifactPlan)==null?void 0:a.videoRecordingEnabled)??!1,S=((u=(c=t==null?void 0:t.assistant)==null?void 0:c.voice)==null?void 0:u.provider)==="tavus";this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"started",timestamp:new Date().toISOString(),metadata:{audioSource:this.dailyCallObject.audioSource??!0,videoSource:this.dailyCallObject.videoSource??x,isVideoRecordingEnabled:x,isVideoEnabled:S}});const E=Date.now();this.call=sl.default.createCallObject({audioSource:this.dailyCallObject.audioSource??!0,videoSource:this.dailyCallObject.videoSource??x,dailyConfig:this.dailyCallConfig});const P=Date.now()-E;this.emit("call-start-progress",{stage:"daily-call-object-creation",status:"completed",duration:P,timestamp:new Date().toISOString()}),(d=this.call.iframe())==null||d.style.setProperty("display","none"),this.call.on("left-meeting",()=>{var A;this.emit("call-end"),this.hasEmittedCallEndedStatus||(this.emit("message",{type:"status-update",status:"ended",endedReason:"customer-ended-call"}),this.hasEmittedCallEndedStatus=!0),x&&((A=this.call)==null||A.stopRecording()),this.cleanup().catch(console.error)}),this.call.on("error",A=>{var I;this.emit("error",A),x&&((I=this.call)==null||I.stopRecording())}),this.call.on("camera-error",A=>{this.emit("camera-error",A)}),this.call.on("network-quality-change",A=>{this.emit("network-quality-change",A)}),this.call.on("network-connection",A=>{this.emit("network-connection",A)}),this.call.on("track-started",async A=>{var I,z,$;!A||!A.participant||(I=A.participant)!=null&&I.local||((z=A.participant)==null?void 0:z.user_name)==="Vapi Speaker"&&(A.track.kind==="video"&&this.emit("video",A.track),A.track.kind==="audio"&&await qp(A.track,A.participant.session_id),($=this.call)==null||$.sendAppMessage("playable"))}),this.call.on("participant-joined",A=>{!A||!this.call||Hp(A,this.call,x,S)}),this.call.on("participant-updated",A=>{A&&this.emit("daily-participant-updated",A.participant)}),this.call.on("participant-left",A=>{A&&Gp(A.participant.session_id)}),this.call.on("remote-participants-audio-level",A=>{A&&this.handleRemoteParticipantsAudioLevel(A)}),this.call.on("app-message",A=>this.onAppMessage(A)),this.call.on("nonfatal-error",A=>{var I;(A==null?void 0:A.type)==="audio-processor-error"&&((I=this.call)==null||I.updateInputSettings({audio:{processor:{type:"none"}}}).then(()=>{(0,jr.safeSetLocalAudio)(this.call,!0)}))});const C=this.isMobileDevice();if(this.emit("call-start-progress",{stage:"mobile-permissions",status:"started",timestamp:new Date().toISOString(),metadata:{isMobile:C}}),C){const A=Date.now();await this.sleep(1e3);const I=Date.now()-A;this.emit("call-start-progress",{stage:"mobile-permissions",status:"completed",duration:I,timestamp:new Date().toISOString(),metadata:{action:"permissions-wait"}})}
411else this.emit("call-start-progress",{stage:"mobile-permissions",status:"completed",timestamp:new Date().toISOString(),metadata:{action:"skipped-not-mobile"}});this.emit("call-start-progress",{stage:"daily-call-join",status:"started",timestamp:new Date().toISOString()});const O=Date.now();await this.call.join({url:t.webCallUrl,subscribeToTracksAutomatically:!1});const N=Date.now()-O;if(this.emit("call-start-progress",{stage:"daily-call-join",status:"completed",duration:N,timestamp:new Date().toISOString()}),x){this.emit("call-start-progress",{stage:"video-recording-setup",status:"started",timestamp:new Date().toISOString()});const A=Date.now(),I=new Date().getTime();try{this.call.startRecording({width:1280,height:720,backgroundColor:"#FF1F2D3D",layout:{preset:"default"}});const z=Date.now()-A;this.emit("call-start-progress",{stage:"video-recording-setup",status:"completed",duration:z,timestamp:new Date().toISOString()}),this.call.on("recording-started",()=>{const $=(new Date().getTime()-I)/1e3;this.emit("call-start-progress",{stage:"video-recording-started",status:"completed",timestamp:new Date().toISOString(),metadata:{delaySeconds:$}}),this.send({type:"control",control:"say-first-message",videoRecordingStartDelaySeconds:$})})}catch(z){const $=Date.now()-A;this.emit("call-start-progress",{stage:"video-recording-setup",status:"failed",duration:$,timestamp:new Date().toISOString(),metadata:{error:z==null?void 0:z.toString()}})}}else this.emit("call-start-progress",{stage:"video-recording-setup",status:"completed",timestamp:new Date().toISOString(),metadata:{action:"skipped-not-enabled"}});this.emit("call-start-progress",{stage:"audio-observer-setup",status:"started",timestamp:new Date().toISOString()});const D=Date.now();try{this.call.startRemoteParticipantsAudioLevelObserver(100);const A=Date.now()-D;this.emit("call-start-progress",{stage:"audio-observer-setup",status:"completed",duration:A,timestamp:new Date().toISOString()})}catch(A){const I=Date.now()-D;this.emit("call-start-progress",{stage:"audio-observer-setup",status:"failed",duration:I,timestamp:new Date().toISOString(),metadata:{error:A==null?void 0:A.toString()}})}this.emit("call-start-progress",{stage:"audio-processing-setup",status:"started",timestamp:new Date().toISOString()});const R=Date.now();try{this.call.updateInputSettings({audio:{processor:{type:"noise-cancellation"}}});const A=Date.now()-R;this.emit("call-start-progress",{stage:"audio-processing-setup",status:"completed",duration:A,timestamp:new Date().toISOString()})}catch(A){const I=Date.now()-R;this.emit("call-start-progress",{stage:"audio-processing-setup",status:"failed",duration:I,timestamp:new Date().toISOString(),metadata:{error:A==null?void 0:A.toString()}})}const F=Date.now()-r;this.emit("call-start-success",{totalDuration:F,callId:(t==null?void 0:t.id)||"unknown",timestamp:new Date().toISOString()}),this.emit("call-start")}catch(x){const S=Date.now()-r;throw this.emit("call-start-failed",{stage:"reconnect",totalDuration:S,error:(x==null?void 0:x.toString())||"Unknown error occurred",errorStack:x instanceof Error?x.stack:"No stack trace available",timestamp:new Date().toISOString(),context:{isReconnect:!0,callId:(t==null?void 0:t.id)||"unknown",hasVideoRecording:!!((f=t==null?void 0:t.artifactPlan)!=null&&f.videoRecordingEnabled),voiceProvider:((v=(p=t==null?void 0:t.assistant)==null?void 0:p.voice)==null?void 0:v.provider)||"unknown",isMobile:this.isMobileDevice()}}),this.emit("error",{type:"reconnect-error",error:x,totalDuration:S,timestamp:new Date().toISOString(),context:{isReconnect:!0,callId:(t==null?void 0:t.id)||"unknown",hasVideoRecording:!!((b=t==null?void 0:t.artifactPlan)!=null&&b.videoRecordingEnabled),voiceProvider:((g=(m=t==null?void 0:t.assistant)==null?void 0:m.voice)==null?void 0:g.provider)||"unknown",isMobile:this.isMobileDevice()}}),await this.cleanup(),x}}static async runNetworkTestsStandalone(){console.log("Starting standalone network connectivity tests...");const t={};let r=null;try{console.log("Creating temporary call object for testing..."),r=sl.default.createCallObject({audioSource:!0,videoSource:!0}),console.log(`
4121. Testing network connectivity (TURN server)...`);let s=null;try{s=(await navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0];const o=await r.testNetworkConnectivity(s);t.networkConnectivity=o,console.log("Network connectivity test result:",o)}catch(i){t.networkConnectivity={result:"error",error:i==null?void 0:i.toString()},console.error("Network connectivity test error:",i)}finally{s&&s.stop()}console.log(`
4132. Testing websocket connectivity...`);try{const i=await r.testWebsocketConnectivity();t.websocketConnectivity=i,console.log("Websocket connectivity test result:",i)}catch(i){t.websocketConnectivity={result:"error",error:i==null?void 0:i.toString()},console.error("Websocket connectivity test error:",i)}console.log(`
4143. Testing call quality...`);try{if(typeof r.testCallQuality=="function")try{console.log("Initializing call state with startCamera..."),await r.startCamera();const i=await r.testCallQuality();t.callQuality=i,console.log("Call quality test result:",i)}catch(i){console.error("Failed to start camera for call quality test:",i),t.callQuality={result:"error",error:i==null?void 0:i.toString(),message:"Failed to initialize camera for call quality test. Check camera permissions."}}else t.callQuality={result:"not-available",message:"testCallQuality method not available"},console.log("Call quality test not available in current Daily.co version")}catch(i){t.callQuality={result:"error",error:i==null?void 0:i.toString()},console.error("Call quality test error:",i)}}catch(s){console.error("Failed to create temporary call object:",s),t.error=s==null?void 0:s.toString()}finally{if(r)try{console.log("Cleaning up temporary call object..."),await r.destroy()}catch(s){console.error("Error destroying temporary call object:",s)}}return console.log(`
415=== Network Test Summary ===`),console.log("Results:",JSON.stringify(t,null,2)),t}}var yR=_b.default=vR;function bR(){const[n,e]=y.useState({isConnected:!1,isConnecting:!1,isSpeaking:!1,error:null,volumeLevel:0,messages:[],callDuration:0}),[t,r]=y.useState(!1),s=y.useRef(null),i=y.useRef(null);y.useEffect(()=>{const c="8ea3ae14-b6d3-4e6e-90ed-a106ae8fe5fc";
415try{s.current=new yR(c),r(!0),console.log("VAPI client initialized successfully with public key")}catch(u){console.error("Failed to initialize VAPI client:",u),e(d=>({...d,error:"Failed to initialize voice client"}))}return()=>{s.current&&s.current.stop(),i.current&&clearInterval(i.current),r(!1)}},[]);const o=y.useCallback(async()=>{if(!s.current){Ge({title:"Error",description:"Voice client not initialized",variant:"destructive"});return}e(c=>({...c,isConnecting:!0,error:null}));try{await navigator.mediaDevices.getUserMedia({audio:!0}),console.log("Starting VAPI call with assistant...");const c="595d76fe-063c-4c75-9b26-f9168358024e";console.log("Using assistant ID:",c),await s.current.start(c),e(u=>({...u,isConnecting:!1,messages:[]})),console.log("VAPI start() resolved, waiting for call-start event...")}catch(c){console.error("Error starting call:",c);const u=c instanceof Error?c.message:"Failed to start voice call";e(d=>({...d,isConnecting:!1,error:u})),Ge({title:"Connection Failed",description:u,variant:"destructive"})}},[]),a=y.useCallback(()=>{s.current&&(s.current.stop(),e(c=>({...c,isConnected:!1,isSpeaking:!1,callDuration:0})),i.current&&(clearInterval(i.current),i.current=null),Ge({title:"Call Ended",description:"Thank you for using The Gazel voice support"}))},[]);return y.useEffect(()=>{if(!t||!s.current)return;const c=s.current;console.log("VAPI event listeners registered");const u=()=>{console.log("call-start event received - VAPI connection confirmed"),e(g=>({...g,isConnected:!0,isConnecting:!1})),i.current=window.setInterval(()=>{e(g=>({...g,callDuration:g.callDuration+1}))},1e3),Ge({title:"Connected",description:"Voice assistant is ready to help you"})},d=()=>{console.log("Call ended"),e(g=>({...g,isConnected:!1,isSpeaking:!1,callDuration:0})),i.current&&(clearInterval(i.current),i.current=null)},f=()=>{e(g=>({...g,isSpeaking:!0}))},p=()=>{e(g=>({...g,isSpeaking:!1}))},v=g=>{e(x=>({...x,volumeLevel:g}))},b=g=>{console.log("VAPI message:",g);const x={type:g.type,role:g.role,transcript:g.transcript,transcriptType:g.transcriptType,timestamp:Date.now()};e(S=>({...S,messages:[...S.messages,x]}))},m=g=>{console.error("VAPI error details:",{message:g.message,type:g.type,code:g.code,fullError:g}),e(x=>({...x,error:g.message||"An error occurred",isConnecting:!1,isConnected:!1,isSpeaking:!1,callDuration:0})),i.current&&(clearInterval(i.current),i.current=null)};return c.on("call-start",u),c.on("call-end",d),c.on("speech-start",f),c.on("speech-end",p),c.on("volume-level",v),c.on("message",b),c.on("error",m),()=>{c.off("call-start",u),c.off("call-end",d),c.off("speech-start",f),c.off("speech-end",p),c.off("volume-level",v),c.off("message",b),c.off("error",m)}},[t]),{...n,startCall:o,endCall:a}}class wR{constructor(){he(this,"systemPrompt",`You are a helpful financial and tax preparation assistant. 
416  Answer user questions about finances, tax preparation, and financial planning.
417  Be concise, accurate, and helpful. If you're not sure about something, be honest about it.
418  Focus on providing actionable information for tax document preparation and financial organization.
419  Always emphasize that you assist with tax preparation and document organization, not tax filing or submission.
420  Remind users to consult with qualified tax professionals for final review and submission of tax documents.
421  If the user asks about specific tax rates or information, use the 2023/2024 tax brackets.`);he(this,"messages",[]);he(this,"taxInformation",{brackets2023:{single:[{min:0,max:11e3,rate:.1},{min:11e3,max:44725,rate:.12},{min:44725,max:95375,rate:.22},{min:95375,max:182100,rate:.24},{min:182100,max:231250,rate:.32},{min:231250,max:578125,rate:.35},{min:578125,max:null,rate:.37}]},deductionInfo:{standardDeduction2023:13850,standardDeduction2024:14600,selfEmploymentTaxRate:.153,commonDeductions:["Home Office (if self-employed)","Business Travel","Health Insurance Premiums (if self-employed)","Retirement Plan Contributions","Student Loan Interest","Educational Expenses","Medical Expenses (exceeding 7.5% of AGI)","Charitable Donations","State and Local Taxes (up to $10,000)"]}});he(this,"version","1.2.0");he(this,"releaseDate","2026-01-28");this.resetConversation()}resetConversation(){this.messages=[{role:"system",content:this.systemPrompt}]}getVersion(){return this.version}async sendMessage(e){try{this.messages.push({role:"user",content:e});const t=await this.generateMockResponse(e);return this.messages.push({role:"assistant",content:t.message}),t}catch(t){return console.error("Error in AI service:",t),{message:"I'm sorry, I encountered an error while processing your request. Please try again later."}}}async generateMockResponse(e){const t=e.toLowerCase();if(t.includes("version")&&!t.includes("home office")||t.includes("about")&&(t.includes("you")||t.includes("yourself")))return{message:`I'm the AI Tax Preparation Assistant, version ${this.version}, released on ${this.releaseDate}. I help with tax document preparation, financial organization, and planning. Remember, I assist with preparation only - consult a qualified tax professional for final review and submission.`};if(t.includes("home office")){const r=t.match(/\$?(\d{1,3}(?:,\d{3})*(?:\.\d{2})?)/),s=r?parseFloat(r[1].replace(/,/g,"")):null;let i="";
421return s?i=`Based on your $${s.toLocaleString()} mortgage, here are your home office deduction options:
422
423**Simplified Method:**
424- $5 per square foot (maximum 300 sq ft = $1,500 max deduction)
425- For a 200 sq ft office: $1,000 deduction
426- For a 300 sq ft office: $1,500 deduction
427
428**Actual Expense Method:**
429- If your home office is 10% of your home's total area
430- You could deduct 10% of qualifying home expenses
431- Example calculation: ${s*.1/12*12} annually (10% of mortgage interest + utilities + repairs)
432- This method often yields higher deductions for larger home offices
433
434**Additional Deductible Items:**
435- Office furniture and equipment
436- Business phone line
437- Office supplies and software
438- Repairs and maintenance specific to the office area
439
440Choose the method that gives you the larger deduction. `:i=`For home office deductions, you have two calculation methods:
441
442**Simplified Method:**
443- $5 per square foot of your home office
444- Maximum 300 square feet ($1,500 max deduction)
445- Easier to calculate and document
446
447**Actual Expense Method:**
448- Deduct the percentage of home expenses equal to your office percentage
449- Include mortgage interest, property taxes, utilities, repairs, insurance
450- Requires more detailed record-keeping but often yields higher deductions
451
452**To Calculate:**
4531. Measure your home office square footage
4542. Divide by your home's total square footage for percentage
4553. Apply that percentage to qualifying home expenses
456
457`,{message:`${i}
458
459**Requirements:**
460- Office must be used regularly and exclusively for business
461- Must be your principal place of business OR used regularly for business meetings
462- Keep detailed records of expenses and measurements
463
464**Pro Tip:** Calculate both methods each year and use whichever gives you the larger deduction.
465
466Remember to consult with a qualified tax professional for final review and proper documentation of your home office deduction.`,sources:[{title:"IRS Home Office Deduction Guide",content:"Home office deduction calculation methods and requirements"}]}}return t.includes("tax bracket")||t.includes("income tax")?{message:`For 2023 tax preparation, federal income tax brackets for single filers are:
467
468- 10%: $0 to $11,000
469- 12%: $11,001 to $44,725
470- 22%: $44,726 to $95,375
471- 24%: $95,376 to $182,100
472- 32%: $182,101 to $231,250
473- 35%: $231,251 to $578,125
474- 37%: $578,126 or more
475
476These rates apply to taxable income for document preparation purposes. Always have a qualified tax professional review your prepared documents before submission.`,sources:[{title:"IRS Tax Brackets",content:"Federal tax brackets for single filers for the 2023 tax year preparation"}]}:t.includes("deduction")||t.includes("write off")?{message:`Common tax deductions for document preparation include:
477
4781. Standard deduction: $13,850 (single filers, 2023)
4792. Home office deduction (if self-employed)
4803. Business travel and expenses
4814. Health insurance premiums (if self-employed)
4825. Retirement plan contributions
4836. Student loan interest
4847. Educational expenses
4858. Medical expenses (exceeding 7.5% of AGI)
4869. Charitable donations
48710. State and local taxes (up to $10,000)
488
489Remember to maintain proper documentation for all deductions when preparing your tax documents. Have a tax professional review before submission.`,sources:[{title:"Deduction Guidelines",content:"Common tax deductions for individual taxpayer document preparation"}]}:t.includes("self-employ")||t.includes("freelance tax")?{message:`For self-employment tax preparation, note that self-employment tax consists of Social Security (12.4%) and Medicare (2.9%) taxes, totaling 15.3% on your net earnings. Unlike traditional employees, self-employed individuals pay both portions.
490
491Good news for preparation: You can deduct half of your self-employment tax when calculating your adjusted gross income.
492
493For quarterly preparation, estimated taxes should be calculated if you expect to owe $1,000 or more. The due dates are typically April 15, June 15, September 15, and January 15 of the following year.
494
495Always consult with a tax professional to ensure proper preparation and submission of self
495-employment tax documents.`,sources:[{title:"Self-Employment Tax Preparation Guide",content:"Overview of self-employment tax document preparation"}]}:t.includes("invest")||t.includes("stock")||t.includes("capital gain")?{message:`For investment tax document preparation, here are key considerations:
496
4971. Long-term capital gains (assets held >1 year) are taxed at 0%, 15%, or 20% depending on your income.
498
4992. Short-term capital gains (assets held ≤1 year) are taxed as ordinary income.
500
5013. Qualified dividends receive the same favorable tax rates as long-term capital gains.
502
5034. Consider tax-advantaged accounts like 401(k)s and IRAs to defer or potentially eliminate taxes on investment growth.
504
505When preparing investment-related tax documents, ensure you have all necessary forms (1099-B, 1099-DIV, etc.) and work with a qualified tax professional for proper preparation and submission.`,sources:[{title:"Investment Tax Preparation Guide",content:"Tax document preparation for different investment types and strategies"}]}:t.includes("retire")||t.includes("401k")||t.includes("ira")?{message:`For retirement account tax preparation in 2023:
506
5071. 401(k) contribution limit: $22,500 ($30,000 if age 50+)
5082. Traditional/Roth IRA contribution limit: $6,500 ($7,500 if age 50+)
5093. SEP IRA for self-employed: Up to 25% of compensation or $66,000
510
511Traditional 401(k)s and IRAs offer tax deductions now but are taxed on withdrawal. Roth accounts are funded with after-tax dollars but grow tax-free and qualified withdrawals are tax-free.
512
513Remember that early withdrawals (before age 59½) typically incur a 10% penalty plus income tax.
514
515When preparing tax documents involving retirement accounts, work with a qualified professional to ensure proper reporting and compliance.`,sources:[{title:"Retirement Account Tax Preparation",content:"Contribution limits and tax implications for retirement account document preparation"}]}:t.includes("budget")||t.includes("save money")||t.includes("financial plan")?{message:`Here are some financial planning basics for better tax preparation:
516
5171. Create a budget following the 50/30/20 rule:
518   - 50% for needs (housing, food, utilities)
519   - 30% for wants (entertainment, dining out)
520   - 20% for savings and debt repayment
521
5222. Build an emergency fund covering 3-6 months of expenses.
523
5243. Pay off high-interest debt first (like credit cards).
525
5264. Save for retirement through tax-advantaged accounts.
527
5285. Keep organized records throughout the year for easier tax preparation.
529
5306. Consider speaking with a financial advisor for personalized advice and tax preparation strategies.`,sources:[{title:"Financial Planning for Tax Preparation",content:"Fundamental principles for personal financial management and tax document organization"}]}:{message:`Welcome to The Gazel Tax Preparation Assistant v${this.version}. I help organize your financial data and prepare tax documents for professional review. I can assist with questions about tax preparation, deductions, investment strategies, retirement planning, budgeting, and financial organization. 
531
532Remember: I help with tax preparation and document organization only. Always consult with a qualified tax professional for final review and submission of your tax documents.
533
534What specific tax preparation topic would you like help with today?`}}}const Wp=new wR,xR=({message:n,isUser:e,sources:t,timestamp:r=new Date})=>l.jsx("div",{className:re("flex w-full mb-4",e?"justify-end":"justify-start"),children:l.jsxs("div",{className:re("rounded-lg px-4 py-2 max-w-[85%] shadow-sm",e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:[l.jsx("p",{className:"whitespace-pre-line",children:n}),t&&t.length>0&&l.jsxs("div",{className:"mt-2 pt-2 border-t border-t-gray-300 dark:border-t-gray-600 text-xs",children:[l.jsx("p",{className:"font-medium mb-1",children:"Sources:"}),l.jsx("ul",{className:"list-disc pl-4",children:t.map((s,i)=>l.jsx("li",{children:s.title},i))})]}),l.jsx("div",{className:"text-xs opacity-70 mt-1 text-right",children:r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})}),_R=({onSuggestionClick:n})=>{const e=["What tax deductions am I eligible for?","How can I reduce my taxable income legally?","What are tax benefits of retirement contributions?","What deductions can I claim as self-employed?","How should I categorize business expenses?","How should I budget my monthly income?","What's the standard deduction for 2023?","What's the best way to pay off my debt?"];return l.jsxs("div",{className:"mt-4 space-y-2",children:[l.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Try asking:"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((t,r)=>l.jsx(xe,{variant:"outline",size:"sm",onClick:()=>n(t),className:"text-xs",children:t},r))})]})};function SR(){const[n,e]=y.useState(!1),[t,r]=y.useState("chat"),[s,i]=y.useState([]),[o,a]=y.useState(""),[c,u]=y.useState(!1),d=y.useRef(null),{isConnected:f,isConnecting:p,isSpeaking:v,error:b,volumeLevel:m,messages:g,callDuration:x,startCall:S,endCall:E}=bR(),{toast:P}=Wu();y.useEffect(()=>{s.length===0&&i([{content:"Hello! Welcome to The Gazel. I'm your AI assistant available 24/7 to help with tax management, deductions, transactions, and more. How can I assist you today?",isUser:!1,timestamp:new Date}])},[]),y.useEffect(()=>{var R;(R=d.current)==null||R.scrollIntoView({behavior:"smooth"})},[s]);const C=async(R,F)=>{R&&R.preventDefault();const A=F||o.trim();if(!(!A||c)){F||a(""),i(I=>[...I,{content:A,isUser:!0,timestamp:new Date}]),u(!0);try{const I=await Wp.sendMessage(A);i(z=>[...z,{content:I.message,isUser:!1,timestamp:new Date,sources:I.sources}])}catch(I){console.error("Error getting response:",I),P({variant:"destructive",title:"Error",description:"Failed to get a response. Please try again."})}finally{u(!1)}}},O=R=>{C(void 0,R)},N=()=>{Wp.resetConversation(),i([{content:"Hello! Welcome to The Gazel. I'm your AI assistant available 24/7 to help with tax management, deductions, transactions, and more. How can I assist you today?",isUser:!1,timestamp:new Date}])},D=R=>{const F=Math.floor(R/60),A=R%60;return`${F}:${A.toString().padStart(2,"0")}`};return n?l.jsx("div",{className:"fixed bottom-6 right-6 z-50 w-[380px] md:w-[420px]",children:l.jsxs(zr,{className:"shadow-xl border-border overflow-hidden",children:[l.jsx(aa,{className:"py-4 border-b",children:l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs(ca,{className:"text-lg flex items-center gap-2",children:[l.jsx(Tl,{className:"h-5 w-5 text-primary"}),"The Gazel AI Assistant"]}),l.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>e(!1),children:l.jsx(Ba,{className:"h-4 w-4"})})]})}),l.jsxs(ab,{value:t,onValueChange:r,className:"w-full",children:[l.jsx("div",{className:"px-4 pt-3",children:l.jsxs(Sd,{className:"grid w-full grid-cols-2",children:[l.jsxs(Fi,{value:"chat",className:"flex items-center gap-2",children:[l.jsx(hT,{className:"h-4 w-4"}),"Chat"]}),l.jsxs(Fi,{value:"voice",className:"flex items-center gap-2",children:[l.jsx(ps,{className:"h-4 w-4"}),"Voice"]})]})}),l.jsx(ql,{value:"chat",className:"mt-0",children:l.jsxs(hr,{className:"p-0",children:[l.jsxs(Hl,{className:"h-[350px] p-4",children:[s.map((R,F)=>l.jsx(xR,{message:R.content,isUser:R.isUser,sources:R.sources,timestamp:R.timestamp},F)),c&&l.jsx("div",{className:"flex w-full justify-start mb-4",children:l.jsx("div",{className:"bg-muted text-muted-foreground rounded-lg px-4 py-3 max-w-[85%]",children:l.jsx(nr,{className:"h-4 w-4 animate-spin"})})}),l.jsx("div",{ref:d})]}),l.jsxs("div",{className:"p-3 border-t",children:[s.length<=2&&l.jsx("div",{className:"mb-3",children:l.jsx(_R,{onSuggestionClick:O})}),l.jsx("div",{className:"flex items-center gap-2",children:l.jsxs("form",{onSubmit:C,className:"flex w-full gap-2",children:[l.jsx(Xn,{value:o,onChange:R=>
534a(R.target.value),placeholder:"Ask about taxes, deductions, features...",disabled:c,className:"flex-1"}),l.jsx(xe,{type:"button",size:"icon",variant:"ghost",onClick:N,disabled:c,children:l.jsx(_h,{className:"h-4 w-4"})}),l.jsx(xe,{type:"submit",size:"icon",disabled:!o.trim()||c,children:l.jsx(gT,{className:"h-4 w-4"})})]})})]})]})}),l.jsx(ql,{value:"voice",className:"mt-0",children:l.jsx(hr,{className:"p-4",children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ms,{variant:b?"destructive":f?"default":"secondary",children:p?"Connecting...":b?"Error":f?"Connected":"Disconnected"}),v&&l.jsx(ms,{variant:"outline",children:"Speaking"})]}),f&&!b&&l.jsx("div",{className:"text-sm text-muted-foreground",children:D(x)})]}),f&&v&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"text-sm text-muted-foreground",children:"Volume:"}),l.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-primary transition-all duration-100",style:{width:`${m*100}%`}})})]}),b&&l.jsxs("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded-lg space-y-2",children:[l.jsx("p",{className:"text-sm text-destructive font-medium",children:"Voice Connection Error"}),l.jsx("p",{className:"text-sm text-destructive",children:b}),b.includes("not configured")&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"Contact support if this issue persists."}),l.jsxs(xe,{onClick:S,size:"sm",variant:"outline",className:"w-full mt-2",children:[l.jsx(_h,{className:"mr-2 h-3 w-3"}),"Retry Connection"]})]}),l.jsx(Hl,{className:"h-[220px] rounded-lg border p-3 bg-muted/30",children:g.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center text-muted-foreground",children:[l.jsx(ps,{className:"h-8 w-8 mb-2 opacity-50"}),l.jsx("p",{className:"text-sm",children:"Start a voice call to begin conversation"})]}):l.jsx("div",{className:"space-y-3",children:g.map((R,F)=>l.jsxs("div",{className:`text-sm ${R.role==="user"?"text-foreground font-medium":"text-muted-foreground"}`,children:[l.jsx("span",{className:"font-semibold",children:R.role==="user"?"You: ":"AI: "}),R.transcript]},F))})}),l.jsx(xe,{onClick:f?E:S,disabled:p,className:"w-full",variant:f?"destructive":"default",children:p?l.jsxs(l.Fragment,{children:[l.jsx(nr,{className:"mr-2 h-4 w-4 animate-spin"}),"Connecting..."]}):f?l.jsxs(l.Fragment,{children:[l.jsx(ps,{className:"mr-2 h-4 w-4"}),"End Call"]}):l.jsxs(l.Fragment,{children:[l.jsx(ps,{className:"mr-2 h-4 w-4"}),"Start Voice Call"]})}),l.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Talk naturally about tax management, deductions, transactions, and more. Our AI is here to help 24/7."})]})})})]})]})}):l.jsx("div",{className:"fixed bottom-6 right-6 z-50",children:l.jsx(xe,{onClick:()=>e(!0),size:"icon",className:"h-14 w-14 rounded-full shadow-lg bg-primary hover:bg-primary/90",children:l.jsx(Tl,{className:"h-6 w-6"})})})}const ER=Zm,TR=eg,kR=Xm,_x=y.forwardRef(({className:n,...e},t)=>l.jsx(Pa,{ref:t,className:re("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",n),...e}));_x.displayName=Pa.displayName;const Sx=y.forwardRef(({className:n,children:e,...t},r)=>l.jsxs(kR,{children:[l.jsx(_x,{}),l.jsxs(ja,{ref:r,className:re("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",n),...t,children:[e,l.jsxs(Qm,{className:"absolute right-4 top-4 roun
534ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l.jsx(Ba,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Sx.displayName=ja.displayName;const Ex=({className:n,...e})=>l.jsx("div",{className:re("flex flex-col space-y-1.5 text-center sm:text-left",n),...e});Ex.displayName="DialogHeader";const CR=({className:n,...e})=>l.jsx("div",{className:re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...e});CR.displayName="DialogFooter";const Tx=y.forwardRef(({className:n,...e},t)=>l.jsx(Oa,{ref:t,className:re("text-lg font-semibold leading-none tracking-tight",n),...e}));Tx.displayName=Oa.displayName;const AR=y.forwardRef(({className:n,...e},t)=>l.jsx(Ra,{ref:t,className:re("text-sm text-muted-foreground",n),...e}));AR.displayName=Ra.displayName;function PR(n){const e=y.useRef({value:n,previous:n});return y.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}var jR=[" ","Enter","ArrowUp","ArrowDown"],OR=[" ","Enter"],so="Select",[dc,hc,RR]=Fu(so),[ei,o2]=Gi(so,[RR,Ka]),fc=Ka(),[IR,_r]=ei(so),[NR,DR]=ei(so),kx=n=>{const{__scopeSelect:e,children:t,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:v,form:b}=n,m=fc(e),[g,x]=y.useState(null),[S,E]=y.useState(null),[P,C]=y.useState(!1),O=zu(u),[N=!1,D]=Jo({prop:r,defaultProp:s,onChange:i}),[R,F]=Jo({prop:o,defaultProp:a,onChange:c}),A=y.useRef(null),I=g?b||!!g.closest("form"):!0,[z,$]=y.useState(new Set),ee=Array.from(z).map(K=>K.props.value).join(";");return l.jsx(sy,{...m,children:l.jsxs(IR,{required:v,scope:e,trigger:g,onTriggerChange:x,valueNode:S,onValueNodeChange:E,valueNodeHasChildren:P,onValueNodeHasChildrenChange:C,contentId:Ci(),value:R,onValueChange:F,open:N,onOpenChange:D,dir:O,triggerPointerDownPosRef:A,disabled:p,children:[l.jsx(dc.Provider,{scope:e,children:l.jsx(NR,{scope:n.__scopeSelect,onNativeOptionAdd:y.useCallback(K=>{$(se=>new Set(se).add(K))},[]),onNativeOptionRemove:y.useCallback(K=>{$(se=>{const G=new Set(se);return G.delete(K),G})},[]),children:t})}),I?l.jsxs(Qx,{"aria-hidden":!0,required:v,tabIndex:-1,name:d,autoComplete:f,value:R,onChange:K=>F(K.target.value),disabled:p,form:b,children:[R===void 0?l.jsx("option",{value:""}):null,Array.from(z)]},ee):null]})})};kx.displayName=so;var Cx="SelectTrigger",Ax=y.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:r=!1,...s}=n,i=fc(t),o=_r(Cx,t),a=o.disabled||r,c=He(e,o.onTriggerChange),u=hc(t),d=y.useRef("touch"),[f,p,v]=Xx(m=>{const g=u().filter(E=>!E.disabled),x=g.find(E=>E.value===o.value),S=Zx(g,m,x);S!==void 0&&o.onValueChange(S.value)}),b=m=>{a||(o.onOpenChange(!0),v()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return l.jsx(iy,{asChild:!0,...i,children:l.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Kx(o.value)?"":void 0,...s,ref:c,onClick:ie(s.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&b(m)}),onPointerDown:ie(s.onPointerDown,m=>{d.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(b(m),m.preventDefault())}),onKeyDown:ie(s.onKeyDown,m=>{const g=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(g&&m.key===" ")&&jR.includes(m.key)&&(b(),m.preventDefault())})})})});Ax.displayName=Cx;var Px="SelectValue",jx=y.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:s,children:i,placeholder:o="",...a}=n,c=_r(Px,t),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,f=He(e,c.onValueNodeChange);return Nt(()=>{u(d)},[u,d]),l.jsx(Ce.span,{...a,ref:f,style:{pointerEvents:"none"},children:Kx(c.value)?l.jsx(l.Fragment,{children:o}):i})});jx.displayName=Px;var MR="SelectIcon",Ox=y.forwardRef((n,e)=>{const{__scopeSelect:t,children:r,...s}=n;return l.jsx(Ce.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});Ox.displayName=MR;var LR="SelectPortal",Rx=n=>l.jsx($u,{asChild:!0,...n});Rx.displayName=LR;var Qr="SelectContent",Ix=y.forwardRef((n,e)=>{const t=_r(Qr,n.__scopeSelect),[r,s]=y.useState();if(Nt(()=>{s(new DocumentFragment)},[]),!t.open){const i=r;return i?Hi.createPortal(l.jsx(Nx,{scope:n.__scopeSelect,children:l.jsx(dc.Slot,{scope:n.__scopeSelect,children:l.jsx("div",{children:n.children})})}),i):null}return l.jsx(Dx,{...n,ref:e})});Ix.displayName=Qr;var Qt=10,[Nx,Sr]=ei(Qr),FR="SelectContentImpl",Dx=y.forwardRef((n,e)=>{const{__scopeSelect:t,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:m,avoidCollisions:g,...x}=n,S=_r(Qr,t),[E,P]=y.useState(null),[C,O]=y.useState(null),N=He(e,k=>P(k)),[D,R]=y.useState(null),[F,A]=y.useState(null),I=hc(t),[z,$]=y.useState(!1),ee=y.useRef(!1);y.useEffect(()=>{if(E)return Gm(E)},[E]),Hm();const K=y.useCallback(k=>{const[j,...M]=I().map(X=>X.ref.current),[L]=M.slice(-1),B=document.activeElement;for(const X of k)if(X===B||(X==null||X.scrollIntoView({block:"nearest"}),X===j&&C&&(C.scrollTop=0),X===L&&C&&(C.scrollTop=C.scrollHeight),X==null||X.focus(),document.activeElement!==B))return},[I,C]),se=y.useCallback(()=>K([D,E]),[K,D,E]);y.useEffect(()=>{z&&se()},[z,se]);const{onOpenChange:G,triggerPointerDownPosRef:q}=S;y.useEffect(()=>{if(E){let k={x:0,y:0};const j=L=>{var B,X;k={x:Math.abs(Math.round(L.pageX)-(((B=q.current)==null?void 0:B.x)??0)),y:Math.abs(Math.round(L.pageY)-(((X=q.current)==null?void 0:X.y)??0))}},M=L=>
vendor: 13,251 bytes, line 534
534{k.x<=10&&k.y<=10?L.preventDefault():E.contains(L.target)||G(!1),document.removeEventListener("pointermove",j),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",j),document.addEventListener("pointerup",M,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",M,{capture:!0})}}},[E,G,q]),y.useEffect(()=>{const k=()=>G(!1);return window.addEventListener("blur",k),window.addEventListener("resize",k),()=>{window.removeEventListener("blur",k),window.removeEventListener("resize",k)}},[G]);const[te,Q]=Xx(k=>{const j=I().filter(B=>!B.disabled),M=j.find(B=>B.ref.current===document.activeElement),L=Zx(j,k,M);L&&setTimeout(()=>L.ref.current.focus())}),oe=y.useCallback((k,j,M)=>{const L=!ee.current&&!M;(S.value!==void 0&&S.value===j||L)&&(R(k),L&&(ee.current=!0))},[S.value]),h=y.useCallback(()=>E==null?void 0:E.focus(),[E]),_=y.useCallback((k,j,M)=>{const L=!ee.current&&!M;(S.value!==void 0&&S.value===j||L)&&A(k)},[S.value]),w=r==="popper"?Eu:Mx,T=w===Eu?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:m,avoidCollisions:g}:{};return l.jsx(Nx,{scope:t,content:E,viewport:C,onViewportChange:O,itemRefCallback:oe,selectedItem:D,onItemLeave:h,itemTextRefCallback:_,focusSelectedItem:se,selectedItemText:F,position:r,isPositioned:z,searchRef:te,children:l.jsx(Km,{as:Uu,allowPinchZoom:!0,children:l.jsx(Wm,{asChild:!0,trapped:S.open,onMountAutoFocus:k=>{k.preventDefault()},onUnmountAutoFocus:ie(s,k=>{var j;(j=S.trigger)==null||j.focus({preventScroll:!0}),k.preventDefault()}),children:l.jsx(Jm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:k=>k.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:l.jsx(w,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:k=>k.preventDefault(),...x,...T,onPlaced:()=>$(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ie(x.onKeyDown,k=>{const j=k.ctrlKey||k.altKey||k.metaKey;if(k.key==="Tab"&&k.preventDefault(),!j&&k.key.length===1&&Q(k.key),["ArrowUp","ArrowDown","Home","End"].includes(k.key)){let L=I().filter(B=>!B.disabled).map(B=>B.ref.current);if(["ArrowUp","End"].includes(k.key)&&(L=L.slice().reverse()),["ArrowUp","ArrowDown"].includes(k.key)){const B=k.target,X=L.indexOf(B);L=L.slice(X+1)}setTimeout(()=>K(L)),k.preventDefault()}})})})})})})});Dx.displayName=FR;var $R="SelectItemAlignedPosition",Mx=y.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:r,...s}=n,i=_r(Qr,t),o=Sr(Qr,t),[a,c]=y.useState(null),[u,d]=y.useState(null),f=He(e,N=>d(N)),p=hc(t),v=y.useRef(!1),b=y.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:x,focusSelectedItem:S}=o,E=y.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&m&&g&&x){const N=i.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),F=x.getBoundingClientRect();if(i.dir!=="rtl"){const B=F.left-D.left,X=R.left-B,ue=N.left-X,Le=N.width+ue,Ze=Math.max(Le,D.width),Ke=window.innerWidth-Qt,je=Gl(X,[Qt,Math.max(Qt,Ke-Ze)]);a.style.minWidth=Le+"px",a.style.left=je+"px"}else{const B=D.right-F.right,X=window.innerWidth-R.right-B,ue=window.innerWidth-N.right-X,Le=N.width+ue,Ze=Math.max(Le,D.width),Ke=window.innerWidth-Qt,je=Gl(X,[Qt,Math.max(Qt,Ke-Ze)]);a.style.minWidth=Le+"px",a.style.right=je+"px"}const A=p(),I=window.innerHeight-Qt*2,z=m.scrollHeight,$=window.getComputedStyle(u),ee=parseInt($.borderTopWidth,10),K=parseInt($.paddingTop,10),se=parseInt($.borderBottomWidth,10),G=parseInt($.paddingBottom,10),q=ee+K+z+G+se,te=Math.min(g.offsetHeight*5,q),Q=window.getComputedStyle(m),oe=parseInt(Q.paddingTop,10),h=parseInt(Q.paddingBottom,10),_=N.top+N.height/2-Qt,w=I-_,T=g.offsetHeight/2,k=g.offsetTop+T,j=ee+K+k,M=q-j;if(j<=_){const B=A.length>0&&g===A[A.length-1].ref.current;a.style.bottom="0px";const X=u.clientHeight-m.offsetTop-m.offsetHeight,ue=Math.max(w,T+(B?h:0)+X+se),Le=j+ue;a.style.height=Le+"px"}else{const B=A.length>0&&g===A[0].ref.current;a.style.top="0px";const ue=Math.max(_,ee+m.offsetTop+(B?oe:0)+T)+M;a.style.height=ue+"px",m.scrollTop=j-_+m.offsetTop}a.style.margin=`${Qt}px 0`,a.style.minHeight=te+"px",a.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[p,i.trigger,i.valueNode,a,u,m,g,x,i.dir,r]);Nt(()=>E(),[E]);const[P,C]=y.useState();Nt(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const O=y.useCallback(N=>{N&&b.current===!0&&(E(),S==null||S(),b.current=!1)},[E,S]);return l.jsx(zR,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:v,onScrollButtonChange:O,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:l.jsx(Ce.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Mx.displayName=$R;var UR="SelectPopperPosition",Eu=y.forwardRef((n,e)=>{const{__scopeSelect:t,align:r="start",collisionPadding:s=Qt,...i}=n,o=fc(t);return l.jsx(oy,{...o,...i,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Eu.displayName=UR;var[zR,Bd]=ei(Qr,{}),Tu="SelectViewport",Lx=y.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:r,...s}=n,i=Sr(Tu,t),o=Bd(Tu,t),a=He(e,i.onViewportChange),c=y.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(dc.Slot,{scope:t,children:l.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ie(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&f){const v=Math.abs(c.current-d.scrollTop);if(v>0){const b=window.innerHeight-Qt*2,m=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),x=Math.max(m,g);if(x<b){const S=x+v,E=Math.min(b,S),P=S-E;f.style.height=E+"px",f.style.bottom==="0px"&&(d.scrollTop=P>0?P:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Lx.displayName=Tu;var Fx="SelectGroup",[VR,BR]=ei(Fx),qR=y.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,s=Ci();return l.jsx(VR,{scope:t,id:s,children:l.jsx(Ce.div,{role:"group","aria-labelledby":s,...r,ref:e})})});qR.displayName=Fx;var $x="SelectLabel",Ux=y.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,s=BR($x,t);return l.jsx(Ce.div,{id:s.id,...r,ref:e})});Ux.displayName=$x;var xa="SelectItem",[GR,zx]=ei(xa),Vx=y.forwardRef((n,e)=>{const{__scopeSelect:t,value:r,disabled:s=!1,textValue:i,...o}=n,a=_r(xa,t),c=Sr(xa,t),u=a.value===r,[d,f]=y.useState(i??""),[p,v]=y.useState(!1),b=He(e,S=>{var E;return(E=c.itemRefCallback)==null?void 0:E.call(c,S,r,s)}),m=Ci(),g=y.useRef("touch"),x=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(GR,{scope:t,value:r,disabled:s,textId:m,isSelected:u,onItemTextChange:y.useCallback(S=>{f(E=>E||((S==null?void 0:S.textContent)??"").trim())},[]),children:l.jsx(dc.ItemSlot,{scope:t,value:r,disabled:s,textValue:d,children:l.jsx(Ce.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:b,onFocus:ie(o.onFocus,()=>v(!0)),onBlur:ie(o.onBlur,()=>v(!1)),onClick:ie(o.onClick,()=>{g.current!=="mouse"&&x()}),onPointerUp:ie(o.onPointerUp,()=>{g.current==="mouse"&&x()}),onPointerDown:ie(o.onPointerDown,S=>{g.current=S.pointerType}),onPointerMove:ie(o.onPointerMove,S=>{var E;g.current=S.pointerType,s?(E=c.onItemLeave)==null||E.call(c):g.current==="mouse"&&S.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ie(o.onPointerLeave,S=>{var E;S.currentTarget===document.activeElement&&((E=c.onItemLeave)==null||E.call(c))}),onKeyDown:ie(o.onKeyDown,S=>{var P;((P=c.searchRef)==null?void 0:P.current)!==""&&S.key===" "||(OR.includes(S.key)&&x(),S.key===" "&&S.preventDefault())})})})})});Vx.displayName=xa;var bi="SelectItemText",Bx=y.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:s,...i}=n,o=_r(bi,t),a=Sr(bi,t),c=zx(bi,t),u=DR(bi,t),[d,f]=y.useState(null),p=He(e,x=>f(x),c.onItemTextChange,x=>{var S;return(S=a.itemTextRefCallback)==null?void 0:S.call(a,x,c.value,c.disabled)}),v=d==null?void 0:d.textContent,b=y.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return Nt(()=>(m(b),()=>g(b)),[m,g,b]),l.jsxs(l.Fragment,{children:[l.jsx(Ce.span,{id:c.textId,...i,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Hi.createPortal(i.children,o.valueNode):null]})});Bx.displayName=bi;var qx="SelectItemIndicator",Gx=y.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return zx(qx,t).isSelected?l.jsx(Ce.span,{"aria-hidden":!0,...r,ref:e}):null});Gx.displayName=qx;var ku="SelectScrollUpButton",Hx=y.forwardRef((n,e)=>{const t=Sr(ku,n.__scopeSelect),r=Bd(ku,n.__scopeSelect),[s,i]=y.useState(!1),o=He(e,r.onScrollButtonChange);return Nt(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=c.scrollTop>0;i(u)};const c=t.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),s?l.jsx(Jx,{...n,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=t;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Hx.displayName=ku;var Cu="SelectScrollDownButton",Wx=y.forwardRef((n,e)=>{const t=Sr(Cu,n.__scopeSelect),r=Bd(Cu,n.__scopeSelect),[s,i]=y.useState(!1),o=He(e,r.onScrollButtonChange);return Nt(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;i(d)};const c=t.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),s?l.jsx(Jx,{...n,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=t;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Wx.displayName=Cu;var Jx=y.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:r,...s}=n,i=Sr("SelectScrollButton",t),o=y.useRef(null),a=hc(t),c=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),Nt(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),l.jsx(Ce.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:ie(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ie(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ie(s.onPointerLeave,()=>{c()})})}),HR="SelectSeparator",Yx=y.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return l.jsx(Ce.div,{"aria-hidden":!0,...r,ref:e})});Yx.displayName=HR;var Au="SelectArrow",WR=y.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,s=fc(t),i=_r(Au,t),o=Sr(Au,t);return i.open&&o.position==="popper"?l.jsx(ay,{...s,...r,ref:e}):null});WR.displayName=Au;function Kx(n){return n===""||n===void 0}var Qx=y.forwardRef((n,e)=>{const{value:t,...r}=n,s=y.useRef(null),i=He(e,s),o=PR(t);return y.useEffect(()=>{const a=s.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[o,t]),l.jsx(Ki,{asChild:!0,children:l.jsx("select",{...r,ref:i,defaultValue:t})})});Qx.displayName="BubbleSelect";function Xx(n){const e=mt(n),t=y.useRef(""),r=y.useRef(0),s=y.useCallback(o=>{const a=t.current+o;e(a),function c(u){t.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),i=y.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,s,i]}function Zx(n,e,t){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let o=JR(n,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==t));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==t?c:void 0}function JR(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var YR=kx,e0=Ax,KR=jx,QR=Ox,XR=Rx,t0=Ix,ZR=Lx,n0=Ux,r0=Vx,eI=Bx,tI=Gx,s0=Hx,i0=Wx,o0=Yx;const nI=YR,rI=KR,a0=y.forwardRef(({className:n,children:e,...t},r)=>l.jsxs(e0,{ref:r,className:re("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
534ing-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",n),...t,children:[e,l.jsx(QR,{asChild:!0,children:l.jsx(ev,{className:"h-4 w-4 opacity-50"})})]}));a0.displayName=e0.displayName;const c0=y.forwardRef(({className:n,...e},t)=>l.jsx(s0,{ref:t,className:re("flex cursor-default items-center justify-center py-1",n),...e,children:l.jsx(eT,{className:"h-4 w-4"})}));c0.displayName=s0.displayName;const l0=y.forwardRef(({className:n,...e},t)=>l.jsx(i0,{ref:t,className:re("flex cursor-default items-center justify-center py-1",n),...e,children:l.jsx(ev,{className:"h-4 w-4"})}));l0.displayName=i0.displayName;const u0=y.forwardRef(({className:n,children:e,position:t="popper",...r},s)=>l.jsx(XR,{children:l.jsxs(t0,{ref:s,className:re("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",n),position:t,...r,children:[l.jsx(c0,{}),l.jsx(ZR,{className:re("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(l0,{})]})}));u0.displayName=t0.displayName;const sI=y.forwardRef(({className:n,...e},t)=>l.jsx(n0,{ref:t,className:re("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...e}));sI.displayName=n0.displayName;const d0=y.forwardRef(({className:n,children:e,...t},r)=>l.jsxs(r0,{ref:r,className:re("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...t,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(tI,{children:l.jsx(Xu,{className:"h-4 w-4"})})}),l.jsx(eI,{children:e})]}));d0.displayName=r0.displayName;const iI=y.forwardRef(({className:n,...e},t)=>l.jsx(o0,{ref:t,className:re("-mx-1 my-1 h-px bg-muted",n),...e}));iI.displayName=o0.displayName;const h0=y.forwardRef(({className:n,...e},t)=>l.jsx("textarea",{className:re("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
534ing-offset-background 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",n),ref:t,...e}));h0.displayName="Textarea";var oI="Label",f0=y.forwardRef((n,e)=>l.jsx(Ce.label,{...n,ref:e,onMouseDown:t=>{var s;t.target.closest("button, input, select, textarea")||((s=n.onMouseDown)==null||s.call(n,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));f0.displayName=oI;var p0=f0;const aI=Ws("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),vn=y.forwardRef(({className:n,...e},t)=>l.jsx(p0,{ref:t,className:re(aI(),n),...e}));vn.displayName=p0.displayName;const cI=[{value:"general",label:"General"},{value:"bug",label:"Bug Report"},{value:"feature",label:"Feature Request"},{value:"praise",label:"Praise"}],lI=()=>{const{user:n}=Dt(),[e,t]=y.useState(!1),[r,s]=y.useState(0),[i,o]=y.useState(0),[a,c]=y.useState("general"),[u,d]=y.useState(""),[f,p]=y.useState(!1);if(!n)return null;const v=async()=>{if(!u.trim()){Ge({title:"Please enter your feedback",variant:"destructive"});return}p(!0);try{const{data:b,error:m}=await _e.functions.invoke("send-feedback",{body:{rating:r||null,category:a,message:u.trim(),pageUrl:window.location.href}});if(m||b&&!b.success)throw new Error((b==null?void 0:b.error)||(m==null?void 0:m.message)||"Failed to send feedback");Ge.success({title:"Thank you!",description:"Your feedback has been submitted."}),t(!1),s(0),c("general"),d("")}catch(b){console.error("Feedback error:",b),Ge.error({title:"Failed to send feedback",description:b.message})}finally{p(!1)}};return l.jsxs(ER,{open:e,onOpenChange:t,children:[l.jsx(TR,{asChild:!0,children:l.jsx(xe,{size:"icon",className:"fixed bottom-20 right-6 z-50 h-12 w-12 rounded-full shadow-lg bg-primary hover:bg-primary/90","aria-label":"Send feedback",children:l.jsx(fT,{className:"h-5 w-5"})})}),l.jsxs(Sx,{className:"sm:max-w-md",children:[l.jsx(Ex,{children:l.jsx(Tx,{children:"Send Feedback"})}),l.jsxs("div",{className:"space-y-4 pt-2",children:[l.jsxs("div",{children:[l.jsx(vn,{children:"Rating (optional)"}),l.jsx("div",{className:"flex gap-1 mt-1",children:[1,2,3,4,5].map(b=>l.jsx("button",{type:"button",onClick:()=>s(b===r?0:b),onMouseEnter:()=>o(b),onMouseLeave:()=>o(0),className:"p-0.5 transition-colors",children:l.jsx(_T,{className:`h-7 w-7 ${b<=(i||r)?"fill-yellow-400 text-yellow-400":"text-muted-foreground/40"}`})},b))})]}),l.jsxs("div",{children:[l.jsx(vn,{children:"Category"}),l.jsxs(nI,{value:a,onValueChange:c,children:[l.jsx(a0,{className:"mt-1",children:l.jsx(rI,{})}),l.jsx(u0,{children:cI.map(b=>l.jsx(d0,{value:b.value,children:b.label},b.value))})]})]}),l.jsxs("div",{children:[l.jsx(vn,{children:"Your feedback *"}),l.jsx(h0,{value:u,onChange:b=>d(b.target.value),placeholder:"Tell us what you think...",className:"mt-1 min-h-[100px]",maxLength:1e3}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[u.length,"/1000"]})]}),l.jsxs(xe,{onClick:v,disabled:f,className:"w-full",children:[f?l.jsx(nr,{className:"h-4 w-4 mr-2 animate-spin"}):l.jsx(vT,{className:"h-4 w-4 mr-2"}),f?"Sending...":"Submit Feedback"]})]})]})]})},ve=({children:n})=>{const{t:e}=Qi(),t=Ha(),{isNative:r}=id(),s=wr(),i=Wi(),{session:o,signOut:a,isAdmin:c,user:u}=Dt(),{canAccess:d}=Fv(),[f,p]=y.useState(!1),v=[{name:e("navigation.dashboard"),path:"/",icon:l.jsx(ed,{className:"h-4 w-4 mr-2"})},{name:e("navigation.calendar"),path:"/calendar",icon:l.jsx(QE,{className:"h-4 w-4 mr-2"})},{name:e("navigation.transactions"),path:"/transactions",icon:l.jsx(td,{className:"h-4 w-4 mr-2"})},{name:e("navigation.deductions"),path:"/deductions",icon:l.jsx(Qu,{className:"h-4 w-4 mr-2"})},{name:"Invoicing",path:"/invoicing",icon:l.jsx(Oi,{className:"h-4 w-4 mr-2"})},{name:e("navigation.budgeting"),path:"/budgeting",icon:l.jsx(ZE,{className:"h-4 w-4 mr-2"})},{name:"Business Projections",path:"/business-projections",icon:l.jsx(Xo,{className:"h-4 w-4 mr-2"})},{name:"Planner",path:"/planner",icon:l.jsx(Cl,{className:"h-4 w-4 mr-2"})},{name:"Projects",path:"/projects",icon:l.jsx(iT,{className:"h-4 w-4 mr-2"})},{name:e("navigation.reports"),path:"/reports",icon:l.jsx(XE,{className:"h-4 w-4 mr-2"})},{name:"Mileage Tracking",path:"/mileage-tracking",icon:l.jsx(uT,{className:"h-4 w-4 mr-2"})},{name:"CPA Dashboard",path:"/cpa-dashboard",icon:l.jsx(Zo,{className:"h-4 w-4 mr-2"})},{name:"GazelFaith",path:"/faith",icon:l.jsx(tT,{className:"h-4 w-4 mr-2"})},{name:"Organization",path:"/business/settings",icon:l.jsx(Zo,{className:"h-4 w-4 mr-2"})},{name:e("navigation.products"),path:"/products",icon:l.jsx(wT,{className:"h-4 w-4 mr-2"})},{name:e("navigation.knowledgeBase"),path:"/knowledge-base",icon:l.jsx(Zg,{className:"h-4 w-4 mr-2"})},{name:"Blog",path:"/blog",icon:l.jsx(Oi,{className:"h-4 w-4 mr-2"})},{name:e("navigation.settings"),path:"/settings",icon:l.jsx(ov,{className:"h-4 w-4 mr-2"})},{name:"Admin",path:"/admin",icon:l.jsx(bT,{className:"h-4 w-4 mr-2"}),adminOnly:!0},{name:"Install App",path:"/install",icon:l.jsx(Zu,{className:"h-4 w-4 mr-2"})}],b=S=>S==="/"?s.pathname==="/":s.pathname.startsWith(S),m=async()=>{try{console.log("Layout logout clicked - User:",u==null?void 0:u.email),await a(),Ge({title:"Logged out successfully",description:"You have been logged out of your account"}),i("/auth")}catch(S){console.error("Logout error:",S),Ge({title:"Logout failed",description:"There was a problem logging you out. Please try again.",variant:"destructive"})}},g=()=>{t&&p(!1)},x=v.filter(S=>!(S.adminOnly&&!c()||S.path==="/mileage-tracking"&&!d(Ir.MileageTracking)));return console.log("Layout render - session:",!!o,"user:",!!u,"email:",u==null?void 0:u.email,"isMobile:",t,"isNative:",r),t&&r?l.jsx(FC,{title:"The Gazel",showBackButton:s.pathname!=="/dashboard"&&s.pathname!=="/",onBack:()=>i(-1),children:n}):l.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[l.jsx("header",{className:"w-full bg-background border-b border-border z-10 sticky top-0",children:l.jsxs(Dl,{className:"flex h-16 items-center justify-between",children:[l.jsx("div",{className:"flex items-center",children:l.jsx(jt,{to:"/",className:"flex items-center",children:l.jsx(ws,{size:t?"sm":"md"})})}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(oP,{}),l.jsx(Vl,{}),u&&l.jsxs(l.Fragment,{children:[!t&&l.jsxs(xe,{variant:"outline",size:"sm",onClick:m,className:"flex items-center",children:[l.jsx(fs,{className:"h-4 w-4 mr-1"}),e("auth.logout")]}),t&&l.jsx(xe,{variant:"ghost",size:"icon",onClick:m,"aria-label":e("auth.logout"),className:"text-foreground",children:l.jsx(fs,{className:"h-5 w-5"})})]}),!u&&l.jsx(xe,{variant:"default",size:"sm",onClick:()=>i("/auth"),className:"flex items-center",children:"Login"}),t&&l.jsxs(aP,{open:f,onOpenChange:p,children:[l.jsx(cP,{asChild:!0,children:l.jsx(xe,{variant:"ghost",size:"icon","aria-label":"Open menu",children:l.jsx(dT,{className:"h-5 w-5"})})}),l.jsxs(ib,{side:"right",className:"w-[80%] sm:w-[350px] flex flex-col p-0",children:[l.jsx("div",{className:"flex justify-center py-4 border-b border-border",children:l.jsx(ws,{size:"md"})}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("nav",{className:"flex flex-col space-y-1 p-4",children:[u&&l.jsxs("button",{onClick:()=>{console.log("Mobile sidebar logout clicked - User:",u.email),m(),g()},className:"flex items-center px-3 py-3 rounded-md text-base font-medium border-b border-border text-foreground hover:bg-muted/50 bg-red-50 dark:bg-red-950/20 mb-2",children:[l.jsx(fs,{className:"h-4 w-4 mr-2"}),e("auth.logout")]}),!u&&l.jsx("button",{onClick:()=>{i("/auth"),g()},className:"flex items-center px-3 py-3 rounded-md text-base font-medium border-b border-border text-foreground hover:bg-muted/50 bg-primary/10 mb-2",children:"Login"}),x.map(S=>l.jsxs(jt,{to:S.path,onClick:g,className:`flex items-center px-3 py-3 rounded-md text-base font-medium border-b border-border ${b(S.path)?"text-primary bg-primary/10 dark:bg-primary/20":"text-foreground hover:bg-muted/50"}`,children:[S.icon,S.name]},S.path)),l.jsxs("div",{className:"px-3 py-2 border-t border-border pt-4",children:[l.jsx("h3",{className:"text-sm font-semibold mb-2 text-muted-foreground",children:e("navigation.taxFeatures")}),l.jsx(Zh,{onNavItemClick:g})]})]})})]})]})]})]})}),l.jsxs("div",{className:"flex flex-1 min-h-0",children:[!t&&l.jsx("div",{className:"w-64 border-r border-border flex-shrink-0 hidden md:block",children:l.jsxs("div",{className:"h-full overflow-y-auto p-4",children:[u&&l.jsx("div",{className:"mb-4",children:l.jsxs(xe,{variant:"outline",size:"sm",onClick:m,className:"w-full flex items-center justify-center",children:[l.jsx(fs,{className:"h-4 w-4 mr-2"}),e("auth.logout")]})}),!u&&l.jsx("div",{className:"mb-4",children:l.jsx(xe,{variant:"default",size:"sm",onClick:()=>i("/auth"),className:"w-full flex items-center justify-center",children:"Login"})}),l.jsx("h2",{className:"font-medium text-muted-foreground text-sm mb-2",children:e("navigation.menu")}),l.jsx("nav",{className:"flex flex-col space-y-1",children:x.map(S=>l.jsxs(jt,{to:S.path,className:`flex items-center px-3 py-2 rounded-md text-sm font-medium ${b(S.path)?"bg-primary/10 dark:bg-primary/20 text-primary":"text-foreground hover:bg-muted/50"}`,children:[S.icon,S.name]},S.path))}),l.jsx("h2",{className:"font-medium text-muted-foreground text-sm mb-2 mt-6",children:e("navigation.taxFeatures")}),l.jsx(Zh,{})]})}),l.jsx("main",{className:"flex-grow overflow-y-auto",children:l.jsx("div",{className:"p-4 max-w-full",children:n})})]}),l.jsx(mP,{isOffline:!1}),u&&l.jsx(SR,{}),l.jsx(lI,{}),l.jsx("footer",{className:"w-full bg-muted/30 border-t border-border py-6",children:l.jsx(Dl,{className:"text-center text-muted-foreground",children:l.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4",children:[l.jsxs("p",{children:["© ",new Date().getFullYear()," ",l.jsx(ws,{size:"sm",variant:"minimal",className:"inline-flex"})," v1.2.0 | All rights reserved."]}),l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsx(jt,{to:"/privacy",className:"text-sm hover:text-primary hover:underline transition-colors",children:"Privacy Policy"}),l.jsx(jt,{to:"/privacy",className:"text-sm hover:text-primary hover:underline transition-colors",children:"Terms of Service"}),l.jsx(jt,{to:"/privacy?tab=ccpa",className:"text-sm hover:text-primary hover:underline transition-colors",children:"CCPA Privacy Rights"}),l.jsx("a",{href:"mailto:[email protected]",className:"text-sm hover:text-primary hover:underline transition-colors",children:"Contact Support"})]})]})})})]})};var m0={exports:{}},uI="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",dI=uI,hI=dI;function g0(){}function v0(){}v0.resetWarningCache=g0;var fI=function(){function n(r,s,i,o,a,c){if(c!==hI){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:v0,resetWarningCache:g0};return t.PropTypes=t,t};m0.exports=fI();var pI=m0.exports;const We=Ia(pI);function mI(n){return n&&typeof n=="object"&&"default"in n?n.default:n}var y0=y,gI=mI(y0);function Jp(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vI(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}var yI=!!(typeof window<"u"&&window.document&&window.document.createElement);function bI(n,e,t){if(typeof n!="function")throw new Error("Expected reducePropsToState to be a function.");
534if(typeof e!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof t<"u"&&typeof t!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function r(s){return s.displayName||s.name||"Component"}return function(i){if(typeof i!="function")throw new Error("Expected WrappedComponent to be a React component.");var o=[],a;function c(){a=n(o.map(function(d){return d.props})),u.canUseDOM?e(a):t&&(a=t(a))}var u=function(d){vI(f,d);function f(){return d.apply(this,arguments)||this}f.peek=function(){return a},f.rewind=function(){if(f.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var b=a;return a=void 0,o=[],b};var p=f.prototype;return p.UNSAFE_componentWillMount=function(){o.push(this),c()},p.componentDidUpdate=function(){c()},p.componentWillUnmount=function(){var b=o.indexOf(this);o.splice(b,1),c()},p.render=function(){return gI.createElement(i,this.props)},f}(y0.PureComponent);return Jp(u,"displayName","SideEffect("+r(i)+")"),Jp(u,"canUseDOM",yI),u}}var wI=bI;const xI=Ia(wI);var _I=typeof Element<"u",SI=typeof Map=="function",EI=typeof Set=="function",TI=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ho(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;var t,r,s;if(Array.isArray(n)){if(t=n.length,t!=e.length)return!1;for(r=t;r--!==0;)if(!Ho(n[r],e[r]))return!1;return!0}var i;if(SI&&n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(i=n.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;for(i=n.entries();!(r=i.next()).done;)if(!Ho(r.value[1],e.get(r.value[0])))return!1;return!0}if(EI&&n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(i=n.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(TI&&ArrayBuffer.isView(n)&&ArrayBuffer.isView(e)){if(t=n.length,t!=e.length)return!1;for(r=t;r--!==0;)if(n[r]!==e[r])return!1;return!0}if(n.constructor===RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf&&typeof n.valueOf=="function"&&typeof e.valueOf=="function")return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString&&typeof n.toString=="function"&&typeof e.toString=="function")return n.toString()===e.toString();if(s=Object.keys(n),t=s.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[r]))return!1;if(_I&&n instanceof Element)return!1;for(r=t;r--!==0;)if(!((s[r]==="_owner"||s[r]==="__v"||s[r]==="__o")&&n.$$typeof)&&!Ho(n[s[r]],e[s[r]]))return!1;return!0}return n!==n&&e!==e}var kI=function(e,t){try{return Ho(e,t)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const CI=Ia(kI);/*
535object-assign
536(c) Sindre Sorhus
537@license MIT
538*/var Yp=Object.getOwnPropertySymbols,AI=Object.prototype.hasOwnProperty,PI=Object.prototype.propertyIsEnumerable;function jI(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function OI(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var r=Object.getOwnPropertyNames(e).map(function(i){return e[i]});if(r.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(i){s[i]=i}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var RI=OI()?Object.assign:function(n,e){for(var t,r=jI(n),s,i=1;i<arguments.length;i++){t=Object(arguments[i]);for(var o in t)AI.call(t,o)&&(r[o]=t[o]);if(Yp){s=Yp(t);for(var a=0;a<s.length;a++)PI.call(t,s[a])&&(r[s[a]]=t[s[a]])}}return r};const II=Ia(RI);var Gr={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},ye={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys(ye).map(function(n){return ye[n]});var Je={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},_a={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},zi={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},NI=Object.keys(_a).reduce(function(n,e){return n[_a[e]]=e,n},{}),DI=[ye.NOSCRIPT,ye.SCRIPT,ye.STYLE],tn="data-react-helmet",MI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},LI=function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")},FI=function(){function n(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),_t=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},$I=function(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)},Kp=function(n,e){var t={};for(var r in n)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},UI=function(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n},Pu=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},zI=function(e){var t=ks(e,ye.TITLE),r=ks(e,zi.TITLE_TEMPLATE);if(r&&t)return r.replace(/%s/g,function(){return Array.isArray(t)?t.join(""):t});var s=ks(e,zi.DEFAULT_TITLE);return t||s||void 0},VI=function(e){return ks(e,zi.ON_CHANGE_CLIENT_STATE)||function(){}},ol=function(e,t){return t.filter(function(r){return typeof r[e]<"u"}).map(function(r){return r[e]}).reduce(function(r,s){return _t({},r,s)},{})},BI=function(e,t){return t.filter(function(r){return typeof r[ye.BASE]<"u"}).map(function(r){return r[ye.BASE]}).reverse().reduce(function(r,s){if(!r.length)for(var i=Object.keys(s),o=0;o<i.length;o++){var a=i[o],c=a.toLowerCase();if(e.indexOf(c)!==-1&&s[c])return r.concat(s)}return r},[])},ui=function(e,t,r){var s={};return r.filter(function(i){return Array.isArray(i[e])?!0:(typeof i[e]<"u"&&WI("Helmet: "+e+' should be of type "Array". Instead found type "'+MI(i[e])+'"'),!1)}).map(function(i){return i[e]}).reverse().reduce(function(i,o){var a={};o.filter(function(p){for(var v=void 0,b=Object.keys(p),m=0;m<b.length;m++){var g=b[m],x=g.toLowerCase();t.indexOf(x)!==-1&&!(v===Je.REL&&p[v].toLowerCase()==="canonical")&&!(x===Je.REL&&p[x].toLowerCase()==="stylesheet")&&(v=x),t.indexOf(g)!==-1&&(g===Je.INNER_HTML||g===Je.CSS_TEXT||g===Je.ITEM_PROP)&&(v=g)}if(!v||!p[v])return!1;var S=p[v].toLowerCase();return s[v]||(s[v]={}),a[v]||(a[v]={}),s[v][S]?!1:(a[v][S]=!0,!0)}
538).reverse().forEach(function(p){return i.push(p)});for(var c=Object.keys(a),u=0;u<c.length;u++){var d=c[u],f=II({},s[d],a[d]);s[d]=f}return i},[]).reverse()},ks=function(e,t){for(var r=e.length-1;r>=0;r--){var s=e[r];if(s.hasOwnProperty(t))return s[t]}return null},qI=function(e){return{baseTag:BI([Je.HREF,Je.TARGET],e),bodyAttributes:ol(Gr.BODY,e),defer:ks(e,zi.DEFER),encode:ks(e,zi.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:ol(Gr.HTML,e),linkTags:ui(ye.LINK,[Je.REL,Je.HREF],e),metaTags:ui(ye.META,[Je.NAME,Je.CHARSET,Je.HTTPEQUIV,Je.PROPERTY,Je.ITEM_PROP],e),noscriptTags:ui(ye.NOSCRIPT,[Je.INNER_HTML],e),onChangeClientState:VI(e),scriptTags:ui(ye.SCRIPT,[Je.SRC,Je.INNER_HTML],e),styleTags:ui(ye.STYLE,[Je.CSS_TEXT],e),title:zI(e),titleAttributes:ol(Gr.TITLE,e)}},ju=function(){var n=Date.now();return function(e){var t=Date.now();t-n>16?(n=t,e(t)):setTimeout(function(){ju(e)},0)}}(),Qp=function(e){return clearTimeout(e)},GI=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||ju:global.requestAnimationFrame||ju,HI=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Qp:global.cancelAnimationFrame||Qp,WI=function(e){return console&&typeof console.warn=="function"&&console.warn(e)},di=null,JI=function(e){di&&HI(di),e.defer?di=GI(function(){Xp(e,function(){di=null})}):(Xp(e),di=null)},Xp=function(e,t){var r=e.baseTag,s=e.bodyAttributes,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,c=e.noscriptTags,u=e.onChangeClientState,d=e.scriptTags,f=e.styleTags,p=e.title,v=e.titleAttributes;Ou(ye.BODY,s),Ou(ye.HTML,i),YI(p,v);var b={baseTag:as(ye.BASE,r),linkTags:as(ye.LINK,o),metaTags:as(ye.META,a),noscriptTags:as(ye.NOSCRIPT,c),scriptTags:as(ye.SCRIPT,d),styleTags:as(ye.STYLE,f)},m={},g={};Object.keys(b).forEach(function(x){var S=b[x],E=S.newTags,P=S.oldTags;E.length&&(m[x]=E),P.length&&(g[x]=b[x].oldTags)}),t&&t(),u(e,m,g)},b0=function(e){return Array.isArray(e)?e.join(""):e},YI=function(e,t){typeof e<"u"&&document.title!==e&&(document.title=b0(e)),Ou(ye.TITLE,t)},Ou=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var s=r.getAttribute(tn),i=s?s.split(","):[],o=[].concat(i),a=Object.keys(t),c=0;c<a.length;c++){var u=a[c],d=t[u]||"";r.getAttribute(u)!==d&&r.setAttribute(u,d),i.indexOf(u)===-1&&i.push(u);var f=o.indexOf(u);f!==-1&&o.splice(f,1)}for(var p=o.length-1;p>=0;p--)r.removeAttribute(o[p]);i.length===o.length?r.removeAttribute(tn):r.getAttribute(tn)!==a.join(",")&&r.setAttribute(tn,a.join(","))}},as=function(e,t){var r=document.head||document.querySelector(ye.HEAD),s=r.querySelectorAll(e+"["+tn+"]"),i=Array.prototype.slice.call(s),o=[],a=void 0;return t&&t.length&&t.forEach(function(c){var u=document.createElement(e);for(var d in c)if(c.hasOwnProperty(d))if(d===Je.INNER_HTML)u.innerHTML=c.innerHTML;else if(d===Je.CSS_TEXT)u.styleSheet?u.styleSheet.cssText=c.cssText:u.appendChild(document.createTextNode(c.cssText));else{var f=typeof c[d]>"u"?"":c[d];u.setAttribute(d,f)}u.setAttribute(tn,"true"),i.some(function(p,v){return a=v,u.isEqualNode(p)})?i.splice(a,1):o.push(u)}),i.forEach(function(c){return c.parentNode.removeChild(c)}),o.forEach(function(c){return r.appendChild(c)}),{oldTags:i,newTags:o}},w0=function(e){return Object.keys(e).reduce(function(t,r){var s=typeof e[r]<"u"?r+'="'+e[r]+'"':""+r;return t?t+" "+s:s},"")},KI=function(e,t,r,s){var i=w0(r),o=b0(t);return i?"<"+e+" "+tn+'="true" '+i+">"+Pu(o,s)+"</"+e+">":"<"+e+" "+tn+'="true">'+Pu(o,s)+"</"+e+">"},QI=function(e,t,r){return t.reduce(function(s,i){var o=Object.keys(i).filter(function(u){return!(u===Je.INNER_HTML||u===Je.CSS_TEXT)}).reduce(function(u,d){var f=typeof i[d]>"u"?d:d+'="'+Pu(i[d],r)+'"';return u?u+" "+f:f},""),a=i.innerHTML||i.cssText||"",c=DI.indexOf(e)===-1;return s+"<"+e+" "+tn+'="true" '+o+(c?"/>":">"+a+"</"+e+">")},"")},x0=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(r,s){return r[_a[s]||s]=e[s],r},t)},XI=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(r,s){return r[NI[s]||s]=e[s],r},t)},ZI=function(e,t,r){var s,i=(s={key:t},s[tn]=!0,s),o=x0(r,i);return[Y.createElement(ye.TITLE,o,t)]},eN=function(e,t){return t.map(function(r,s){var i,o=(i={key:s},i[tn]=!0,i);return Object.keys(r).forEach(function(a){var c=_a[a]||a;if(c===Je.INNER_HTML||c===Je.CSS_TEXT){var u=r.innerHTML||r.cssText;o.dangerouslySetInnerHTML={__html:u}}else o[c]=r[a]}),Y.createElement(e,o)})},kn=function(e,t,r){switch(e){case ye.TITLE:return{toComponent:function(){return ZI(e,t.title,t.titleAttributes)},toString:function(){return KI(e,t.title,t.titleAttributes,r)}};case Gr.BODY:case Gr.HTML:return{toComponent:function(){return x0(t)},toString:function(){return w0(t)}};default:return{toComponent:function(){return eN(e,t)},toString:function(){return QI(e,t,r)}}}},_0=function(e){var t=e.baseTag,r=e.bodyAttributes,s=e.encode,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,c=e.noscriptTags,u=e.scriptTags,d=e.styleTags,f=e.title,p=f===void 0?"":f,v=e.titleAttributes;return{base:kn(ye.BASE,t,s),bodyAttributes:kn(Gr.BODY,r,s),htmlAttributes:kn(Gr.HTML,i,s),link:kn(ye.LINK,o,s),meta:kn(ye.META,a,s),noscript:kn(ye.NOSCRIPT,c,s),script:kn(ye.SCRIPT,u,s),style:kn(ye.STYLE,d,s),title:kn(ye.TITLE,{title:p,titleAttributes:v},s)}},tN=function(e){var t,r;return r=t=function(s){$I(i,s);function i(){return LI(this,i),UI(this,s.apply(this,arguments))}return i.prototype.shouldComponentUpdate=function(a){return!CI(this.props,a)},i.prototype.mapNestedChildrenToProps=function(a,c){if(!c)return null;switch(a.type){case ye.SCRIPT:case ye.NOSCRIPT:return{innerHTML:c};case ye.STYLE:return{cssText:c}}throw new Error("<"+a.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},i.prototype.flattenArrayTypeChildren=function(a){var c,u=a.child,d=a.arrayTypeChildren,f=a.newChildProps,p=a.nestedChildren;return _t({},d,(c={},c[u.type]=[].concat(d[u.type]||[],[_t({},f,this.mapNestedChildrenToProps(u,p))]),c))},i.prototype.mapObjectTypeChildren=function(a){var c,u,d=a.child,f=a.newProps,p=a.newChildProps,v=a.nestedChildren;switch(d.type){case ye.TITLE:return _t({},f,(c={},c[d.type]=v,c.titleAttributes=_t({},p),c));case ye.BODY:return _t({},f,{bodyAttributes:_t({},p)});case ye.HTML:return _t({},f,{htmlAttributes:_t({},p)})}return _t({},f,(u={},u[d.type]=_t({},p),u))},i.prototype.mapArrayTypeChildrenToProps=function(a,c){var u=_t({},c);
538return Object.keys(a).forEach(function(d){var f;u=_t({},u,(f={},f[d]=a[d],f))}),u},i.prototype.warnOnInvalidChildren=function(a,c){return!0},i.prototype.mapChildrenToProps=function(a,c){var u=this,d={};return Y.Children.forEach(a,function(f){if(!(!f||!f.props)){var p=f.props,v=p.children,b=Kp(p,["children"]),m=XI(b);switch(u.warnOnInvalidChildren(f,v),f.type){case ye.LINK:case ye.META:case ye.NOSCRIPT:case ye.SCRIPT:case ye.STYLE:d=u.flattenArrayTypeChildren({child:f,arrayTypeChildren:d,newChildProps:m,nestedChildren:v});break;default:c=u.mapObjectTypeChildren({child:f,newProps:c,newChildProps:m,nestedChildren:v});break}}}),c=this.mapArrayTypeChildrenToProps(d,c),c},i.prototype.render=function(){var a=this.props,c=a.children,u=Kp(a,["children"]),d=_t({},u);return c&&(d=this.mapChildrenToProps(c,d)),Y.createElement(e,d)},FI(i,null,[{key:"canUseDOM",set:function(a){e.canUseDOM=a}}]),i}(Y.Component),t.propTypes={base:We.object,bodyAttributes:We.object,children:We.oneOfType([We.arrayOf(We.node),We.node]),defaultTitle:We.string,defer:We.bool,encodeSpecialCharacters:We.bool,htmlAttributes:We.object,link:We.arrayOf(We.object),meta:We.arrayOf(We.object),noscript:We.arrayOf(We.object),onChangeClientState:We.func,script:We.arrayOf(We.object),style:We.arrayOf(We.object),title:We.string,titleAttributes:We.object,titleTemplate:We.string},t.defaultProps={defer:!0,encodeSpecialCharacters:!0},t.peek=e.peek,t.rewind=function(){var s=e.rewind();return s||(s=_0({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),s},r},nN=function(){return null},rN=xI(qI,JI,_0)(nN),Sa=tN(rN);Sa.renderStatic=Sa.rewind;const pe=n=>typeof n=="string",hi=()=>{let n,e;const t=new Promise((r,s)=>{n=r,e=s});return t.resolve=n,t.reject=e,t},Zp=n=>n==null?"":""+n,sN=(n,e,t)=>{n.forEach(r=>{e[r]&&(t[r]=e[r])})},iN=/###/g,em=n=>n&&n.indexOf("###")>-1?n.replace(iN,"."):n,tm=n=>!n||pe(n),ki=(n,e,t)=>{const r=pe(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(tm(n))return{};const i=em(r[s]);!n[i]&&t&&(n[i]=new t),Object.prototype.hasOwnProperty.call(n,i)?n=n[i]:n={},++s}return tm(n)?{}:{obj:n,k:em(r[s])}},nm=(n,e,t)=>{const{obj:r,k:s}=ki(n,e,Object);if(r!==void 0||e.length===1){r[s]=t;return}let i=e[e.length-1],o=e.slice(0,e.length-1),a=ki(n,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=ki(n,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=t},oN=(n,e,t,r)=>{const{obj:s,k:i}=ki(n,e,Object);s[i]=s[i]||[],s[i].push(t)},Ea=(n,e)=>{const{obj:t,k:r}=ki(n,e);if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r]},aN=(n,e,t)=>{const r=Ea(n,t);return r!==void 0?r:Ea(e,t)},S0=(n,e,t)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in n?pe(n[r])||n[r]instanceof String||pe(e[r])||e[r]instanceof String?t&&(n[r]=e[r]):S0(n[r],e[r],t):n[r]=e[r]);return n},cs=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var cN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const lN=n=>pe(n)?n.replace(/[&<>"'\/]/g,e=>cN[e]):n;class uN{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const dN=[" ",",","?","!",";"],hN=new uN(20),fN=(n,e,t)=>{e=e||"",t=t||"";const r=dN.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(r.length===0)return!0;const s=hN.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(n);if(!i){const o=n.indexOf(t);o>0&&!s.test(n.substring(0,o))&&(i=!0)}return i},Ru=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!n)return;if(n[e])return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;const r=e.split(t);let s=n;for(let i=0;i<r.length;){if(!s||typeof s!="object")return;let o,a="";for(let c=i;c<r.length;++c)if(c!==i&&(a+=t),a+=r[c],o=s[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<r.length-1)continue;i+=c-i+1;break}s=o}return s},Ta=n=>n==null?void 0:n.replace("_","-"),pN={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){var t,r;(r=(t=console==null?void 0:console[n])==null?void 0:t.apply)==null||r.call(t,console,e)}};class ka{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||pN,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,r,s){return s&&!this.debug?null:(pe(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ka(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new ka(this.logger,e)}}var yn=new ka;class pc{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(t)||0;this.observers[r].set(t,s+1)}),this}
538off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[a,c]=o;for(let u=0;u<c;u++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,c]=o;for(let u=0;u<c;u++)a.apply(a,[e,...r])})}}class rm extends pc{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r){var u,d;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],r&&(Array.isArray(r)?a.push(...r):pe(r)&&i?a.push(...r.split(i)):a.push(r)));const c=Ea(this.data,a);return!c&&!t&&!r&&e.indexOf(".")>-1&&(e=a[0],t=a[1],r=a.slice(2).join(".")),c||!o||!pe(r)?c:Ru((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[t],r,i)}addResource(e,t,r,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),s=t,t=a[1]),this.addNamespaces(t),nm(this.data,a,s),i.silent||this.emit("added",e,t,r,s)}addResources(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(pe(r[i])||Array.isArray(r[i]))&&this.addResource(e,t,i,r[i],{silent:!0});s.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),s=r,r=t,t=a[1]),this.addNamespaces(t);let c=Ea(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?S0(c,r,i):c={...c,...r},nm(this.data,a,c),o.silent||this.emit("added",e,t,r)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var E0={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,r,s){return n.forEach(i=>{var o;e=((o=this.processors[i])==null?void 0:o.process(e,t,r,s))??e}),e}};const sm={},im=n=>!pe(n)&&typeof n!="boolean"&&typeof n!="number";class Ca extends pc{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),sN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
538i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=yn.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){const r={...arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}};if(e==null)return!1;const s=this.resolve(e,r);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let r=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!fN(e,r,s);if(o&&!a){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:pe(i)?[i]:i};const u=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(s)}return{key:e,namespaces:pe(i)?[i]:i}}translate(e,t,r){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:a,namespaces:c}=this.extractFromKey(e[e.length-1],s),u=c[c.length-1],d=s.lng||this.language,f=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((d==null?void 0:d.toLowerCase())==="cimode"){if(f){const I=s.nsSeparator||this.options.nsSeparator;return i?{res:`${u}${I}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(s)}:`${u}${I}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(s)}:a}const p=this.resolve(e,s);let v=p==null?void 0:p.res;const b=(p==null?void 0:p.usedKey)||a,m=(p==null?void 0:p.exactUsedKey)||a,g=["[object Number]","[object Function]","[object RegExp]"],x=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,E=s.count!==void 0&&!pe(s.count),P=Ca.hasDefaultValue(s),C=E?this.pluralResolver.getSuffix(d,s.count,s):"",O=s.ordinal&&E?this.pluralResolver.getSuffix(d,s.count,{ordinal:!1}):"",N=E&&!s.ordinal&&s.count===0,D=N&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${C}`]||s[`defaultValue${O}`]||s.defaultValue;let R=v;S&&!v&&P&&(R=D);const F=im(R),A=Object.prototype.toString.apply(R);if(S&&R&&F&&g.indexOf(A)<0&&!(pe(x)&&Array.isArray(R))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const I=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,R,{...s,ns:c}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(p.res=I,p.usedParams=this.getUsedParamsDetails(s),p):I}if(o){const I=Array.isArray(R),z=I?[]:{},$=I?m:b;for(const ee in R)if(Object.prototype.hasOwnProperty.call(R,ee)){const K=`${$}${o}${ee}`;P&&!v?z[ee]=this.translate(K,{...s,defaultValue:im(D)?D[ee]:void 0,joinArrays:!1,ns:c}):z[ee]=this.translate(K,{...s,joinArrays:!1,ns:c}),z[ee]===K&&(z[ee]=R[ee])}v=z}}else if(S&&pe(x)&&Array.isArray(v))v=v.join(x),v&&(v=this.extendTranslation(v,e,s,r));else{let I=!1,z=!1;!this.isValidLookup(v)&&P&&(I=!0,v=D),this.isValidLookup(v)||(z=!0,v=a);const ee=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&z?void 0:v,K=P&&D!==v&&this.options.updateMissing;if(z||I||K){if(this.logger.log(K?"updateKey":"missingKey",d,u,a,K?D:v),o){const te=this.resolve(a,{...s,keySeparator:!1});te&&te.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let se=[];const G=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&G&&G[0])for(let te=0;te<G.length;te++)se.push(G[te]);else this.options.saveMissingTo==="all"?se=this.languageUtils.toResolveHierarchy(s.lng||this.language):se.push(s.lng||this.language);const q=(te,Q,oe)=>{var _;const h=P&&oe!==v?oe:ee;this.options.missingKeyHandler?this.options.missingKeyHandler(te,u,Q,h,K,s):(_=this.backendConnector)!=null&&_.saveMissing&&this.backendConnector.saveMissing(te,u,Q,h,K,s),this.emit
vendor: 6,683 bytes, line 538
538("missingKey",te,u,Q,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?se.forEach(te=>{const Q=this.pluralResolver.getSuffixes(te,s);N&&s[`defaultValue${this.options.pluralSeparator}zero`]&&Q.indexOf(`${this.options.pluralSeparator}zero`)<0&&Q.push(`${this.options.pluralSeparator}zero`),Q.forEach(oe=>{q([te],a+oe,s[`defaultValue${oe}`]||D)})}):q(se,a,D))}v=this.extendTranslation(v,e,s,p,r),z&&v===a&&this.options.appendNamespaceToMissingKey&&(v=`${u}:${a}`),(z||I)&&this.options.parseMissingKeyHandler&&(v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,I?v:void 0,s))}return i?(p.res=v,p.usedParams=this.getUsedParamsDetails(s),p):v}extendTranslation(e,t,r,s,i){var u,d;var o=this;if((u=this.i18nFormat)!=null&&u.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=pe(e)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(f){const b=e.match(this.interpolator.nestingRegexp);p=b&&b.length}let v=r.replace&&!pe(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),e=this.interpolator.interpolate(e,v,r.lng||this.language||s.usedLng,r),f){const b=e.match(this.interpolator.nestingRegexp),m=b&&b.length;p<m&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var b=arguments.length,m=new Array(b),g=0;g<b;g++)m[g]=arguments[g];return(i==null?void 0:i[0])===m[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`),null):o.translate(...m,t)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=pe(a)?[a]:a;return e!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(e=E0.handle(c,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,o,a;return pe(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,t),d=u.key;s=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=t.count!==void 0&&!pe(t.count),v=p&&!t.ordinal&&t.count===0,b=t.context!==void 0&&(pe(t.context)||typeof t.context=="number")&&t.context!=="",m=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(g=>{var x,S;this.isValidLookup(r)||(a=g,!sm[`${m[0]}-${g}`]&&((x=this.utils)!=null&&x.hasLoadedNamespace)&&!((S=this.utils)!=null&&S.hasLoadedNamespace(a))&&(sm[`${m[0]}-${g}`]=!0,this.logger.warn(`key "${s}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(E=>{var O;if(this.isValidLookup(r))return;o=E;const P=[d];if((O=this.i18nFormat)!=null&&O.addLookupKeys)this.i18nFormat.addLookupKeys(P,d,E,g,t);else{let N;p&&(N=this.pluralResolver.getSuffix(E,t.count,t));const D=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(P.push(d+N),t.ordinal&&N.indexOf(R)===0&&P.push(d+N.replace(R,this.options.pluralSeparator)),v&&P.push(d+D)),b){const F=`${d}${this.options.contextSeparator}${t.context}`;P.push(F),p&&(P.push(F+N),t.ordinal&&N.indexOf(R)===0&&P.push(F+N.replace(R,this.options.pluralSeparator)),v&&P.push(F+D))}}let C;for(;C=P.pop();)this.isValidLookup(r)||(i=C,r=this.getResource(E,g,C,t))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,r){var i;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(e,t,r,s):this.resourceStore.getResource(e,t,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!pe(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of t)delete s[i]}return s}static hasDefaultValue(e){const t="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&e[r]!==void 0)return!0;return!1}}class om{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=yn.create("languageUtils")}getScriptPartFromCode(e){if(e=Ta(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Ta(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(pe(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(r=>{if(t)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(r=>{if(t)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return t=s;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o}
538)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),pe(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){const r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return pe(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):pe(e)&&i(this.formatLanguageCode(e)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}const am={zero:0,one:1,two:2,few:3,many:4,other:5},cm={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class mN{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=yn.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Ta(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),cm;if(!e.match(/-|_/))return cm;const c=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(c,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${t}${s}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?r.resolvedOptions().pluralCategories.sort((s,i)=>am[s]-am[i]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}const lm=function(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=aN(n,e,t);return!i&&s&&pe(t)&&(i=Ru(n,t,r),i===void 0&&(i=Ru(e,t,r))),i},al=n=>n.replace(/\$/g,"$$$$");class gN{constructor(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=yn.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:v,nestingSuffix:b,nestingSuffixEscaped:m,nestingOptionsSeparator:g,maxReplaces:x,alwaysFormat:S}=e.interpolation;this.escape=t!==void 0?t:lN,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?cs(i):o||"{{",this.suffix=a?cs(a):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=p?cs(p):v||cs("$t("),this.nestingSuffix=b?cs(b):m||cs(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=x||1e3,this.alwaysFormat=S!==void 0?S:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,r)=>(t==null?void 0:t.source)===r?(t.lastIndex=0,t):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,r,s){var v;let i,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=b=>
vendor: 4,908 bytes, line 538
538{if(b.indexOf(this.formatSeparator)<0){const S=lm(t,c,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,r,{...s,...t,interpolationkey:b}):S}const m=b.split(this.formatSeparator),g=m.shift().trim(),x=m.join(this.formatSeparator).trim();return this.format(lm(t,c,g,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...s,...t,interpolationkey:g})};this.resetRegExp();const d=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((v=s==null?void 0:s.interpolation)==null?void 0:v.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>al(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?al(this.escape(b)):al(b)}].forEach(b=>{for(a=0;i=b.regex.exec(e);){const m=i[1].trim();if(o=u(m),o===void 0)if(typeof d=="function"){const x=d(e,i,s);o=pe(x)?x:""}else if(s&&Object.prototype.hasOwnProperty.call(s,m))o="";else if(f){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else!pe(o)&&!this.useRawValueToEscape&&(o=Zp(o));const g=b.safeValue(o);if(e=e.replace(i[0],g),f?(b.regex.lastIndex+=o.length,b.regex.lastIndex-=i[0].length):b.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,o;const a=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const f=c.split(new RegExp(`${d}[ ]*{`));let p=`{${f[1]}`;c=f[0],p=this.interpolate(p,o);const v=p.match(/'/g),b=p.match(/"/g);(((v==null?void 0:v.length)??0)%2===0&&!b||b.length%2!==0)&&(p=p.replace(/'/g,'"'));try{o=JSON.parse(p),u&&(o={...u,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,m),`${c}${d}${p}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];o={...r},o=o.replace&&!pe(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const d=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=d.shift(),c=d,u=!0}if(i=t(a.call(this,s[1].trim(),o),o),i&&s[0]===e&&!pe(i))return i;pe(i)||(i=Zp(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),u&&(i=c.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const vN=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const r=n.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();t[d]||(t[d]=u),u==="false"&&(t[d]=!1),u==="true"&&(t[d]=!0),isNaN(u)||(t[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},ls=n=>{const e={};return(t,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=e[o];return a||(a=n(Ta(r),s),e[o]=a),a(t)}};class yN{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=yn.create("formatter"),this.options=e,this.formats={number:ls((t,r)=>{const s=new Intl.NumberFormat(t,{...r});return i=>s.format(i)}),currency:ls((t,r)=>{const s=new Intl.NumberFormat(t,{...r,style:"currency"});return i=>s.format(i)}),datetime:ls((t,r)=>{const s=new Intl.DateTimeFormat(t,{...r});return i=>s.format(i)}),relativetime:ls((t,r)=>{const s=new Intl.RelativeTimeFormat(t,{...r});return i=>s.format(i,r.range||"day")}),list:ls((t,r)=>{const s=new Intl.ListFormat(t,{...r});return i=>s.format(i)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ls(t)}format(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,c)=>{var f;const{formatName:u,formatOptions:d}=vN(c);if(this.formats[u]){let p=a;try{const v=((f=s==null?void 0:s.formatParams)==null?void 0:f[s.interpolationkey])||{},b=v.locale||v.lng||s.locale||s.lng||r;p=this.formats[u](a,b,{...d,...s,...v})}catch(v){this.logger.warn(v)}return p}else this.logger.warn(`there was no format function for ${u}`);return a},e)}}const bN=(n,e)=>
vendor: 4,208 bytes, line 538
538{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class wN extends pc{constructor(e,t,r){var i,o;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=yn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(o=(i=this.backend)==null?void 0:i.init)==null||o.call(i,r,s.backend,s)}queueLoad(e,t,r,s){const i={},o={},a={},c={};return e.forEach(u=>{let d=!0;t.forEach(f=>{const p=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?o[p]===void 0&&(o[p]=!0):(this.state[p]=1,d=!1,o[p]===void 0&&(o[p]=!0),i[p]===void 0&&(i[p]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(a[u]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(e,t,r){const s=e.split("|"),i=s[0],o=s[1];t&&this.emit("failedLoading",i,o,t),!t&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);const a={};this.queue.forEach(c=>{oN(c.loaded,[i],o),bN(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{a[u]||(a[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{a[u][f]===void 0&&(a[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,r,s+1,i*2,o)},i);return}o(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(e,t);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return c(e,t,a)}prepareLoading(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();pe(e)&&(e=this.languageUtils.toResolveHierarchy(e)),pe(t)&&(t=[t]);const i=this.queueLoad(e,t,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,t,r,s,i){var c,u,d,f,p;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((p=this.backend)!=null&&p.create){const v={...o,isUpdate:i},b=this.backend.create.bind(this.backend);if(b.length<6)try{let m;
vendor: 5,283 bytes, line 538
538b.length===5?m=b(e,t,r,s,v):m=b(e,t,r,s),m&&typeof m.then=="function"?m.then(g=>a(null,g)).catch(a):a(null,m)}catch(m){a(m)}else b(e,t,r,s,a,v)}!e||!e[0]||this.store.addResource(e[0],t,r,s)}}}const um=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),pe(n[1])&&(e.defaultValue=n[1]),pe(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(r=>{e[r]=t[r]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),dm=n=>{var e,t;return pe(n.ns)&&(n.ns=[n.ns]),pe(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),pe(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),((t=(e=n.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n},Do=()=>{},xN=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class Vi extends pc{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=dm(e),this.services={},this.logger=yn,this.modules={external:[]},xN(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(pe(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=um();this.options={...s,...this.options,...dm(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?yn.init(i(this.modules.logger),this.options):yn.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=yN;const f=new om(this.options);this.store=new rm(this.options.resources,this.options);const p=this.services;p.logger=yn,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new mN(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(p.formatter=i(d),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new gN(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new wN(i(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(v){for(var b=arguments.length,m=new Array(b>1?b-1:0),g=1;g<b;g++)m[g-1]=arguments[g];e.emit(v,...m)}),this.modules.languageDetector&&(p.languageDetector=i(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=i(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Ca(this.services,this.options),this.translator.on("*",function(v){for(var b=arguments.length,m=new Array(b>1?b-1:0),g=1;g<b;g++)m[g-1]=arguments[g];e.emit(v,...m)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Do),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const c=hi(),u=()=>{const d=(f,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit
538("initialized",this.options),c.resolve(p),r(f,p)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),c}loadResources(e){var i,o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Do;const s=pe(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&a.indexOf(f)<0&&a.push(f)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(i=this.options.preload)==null?void 0:i.forEach)==null||o.call(i,u=>c(u)),this.services.backendConnector.load(a,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,t,r){const s=hi();return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=Do),this.services.backendConnector.reload(e,t,i=>{s.resolve(),r(i)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&E0.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){var r=this;this.isLanguageChangingTo=e;const s=hi();this.emit("languageChanging",e);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,u)=>{u?this.isLanguageChangingTo===e&&(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),t&&t(c,function(){return r.t(...arguments)})},a=c=>{var f,p;!e&&!c&&this.services.languageDetector&&(c=[]);const u=pe(c)?c:c&&c[0],d=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(pe(c)?[c]:c);d&&(this.language||i(d),this.translator.language||this.translator.changeLanguage(d),(p=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||p.call(f,d)),this.loadResources(d,v=>{o(v,d)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,r){var s=this;const i=function(o,a){let c;if(typeof a!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];c=s.options.overloadTranslationOptionHandler([o,a].concat(d))}else c={...a};c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||i.keyPrefix);const p=s.options.keySeparator||".";let v;return c.keyPrefix&&Array.isArray(o)?v=o.map(b=>`${c.keyPrefix}${p}${b}`):v=c.keyPrefix?`${c.keyPrefix}${p}${o}`:o,s.t(v,c)};return pe(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=r,i}t(){var s;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(s=this.translator)==null?void 0:s.translate(...t)}exists(){var s;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(s=this.translator)==null?void 0:s.exists(...t)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
538if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const u=this.services.backendConnector.state[`${a}|${c}`];return u===-1||u===0||u===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!s||o(i,e)))}loadNamespaces(e,t){const r=hi();return this.options.ns?(pe(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),t&&t(s)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){const r=hi();pe(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),t&&t(o)}),r):(t&&t(),Promise.resolve())}dir(e){var s,i;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new om(um());return t.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Vi(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Do;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new Vi(s);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const a=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});i.store=new rm(a,s),i.services.resourceStore=i.store}return i.translator=new Ca(i.services,s),i.translator.on("*",function(a){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];i.emit(a,...u)}),i.init(s,t),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Xe=Vi.createInstance();Xe.createInstance=Vi.createInstance;Xe.createInstance;Xe.dir;Xe.init;Xe.loadResources;Xe.reloadResources;Xe.use;Xe.changeLanguage;Xe.getFixedT;Xe.t;Xe.exists;Xe.setDefaultNamespace;Xe.hasLoadedNamespace;Xe.loadNamespaces;Xe.loadLanguages;const{slice:_N,forEach:SN}=[];function EN(n){return SN.call(_N.call(arguments,1),e=>{if(e)for(const t in e)n[t]===void 0&&(n[t]=e[t])}),n}
vendor: 10,007 bytes, line 538
538function TN(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(n))}const hm=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,kN=function(n,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let i=`${n}=${s}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!hm.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!hm.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},fm={create(n,e,t,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+t*60*1e3)),r&&(s.domain=r),document.cookie=kN(n,encodeURIComponent(e),s)},read(n){const e=`${n}=`,t=document.cookie.split(";");for(let r=0;r<t.length;r++){let s=t[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(n){this.create(n,"",-1)}};var CN={name:"cookie",lookup(n){let{lookupCookie:e}=n;if(e&&typeof document<"u")return fm.read(e)||void 0},cacheUserLanguage(n,e){let{lookupCookie:t,cookieMinutes:r,cookieDomain:s,cookieOptions:i}=e;t&&typeof document<"u"&&fm.create(t,n,r,s,i)}},AN={name:"querystring",lookup(n){var r;let{lookupQuerystring:e}=n,t;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const o=s.substring(1).split("&");for(let a=0;a<o.length;a++){const c=o[a].indexOf("=");c>0&&o[a].substring(0,c)===e&&(t=o[a].substring(c+1))}}return t}};let us=null;const pm=()=>{if(us!==null)return us;try{if(us=typeof window<"u"&&window.localStorage!==null,!us)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{us=!1}return us};var PN={name:"localStorage",lookup(n){let{lookupLocalStorage:e}=n;if(e&&pm())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(n,e){let{lookupLocalStorage:t}=e;t&&pm()&&window.localStorage.setItem(t,n)}};let ds=null;const mm=()=>{if(ds!==null)return ds;try{if(ds=typeof window<"u"&&window.sessionStorage!==null,!ds)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{ds=!1}return ds};var jN={name:"sessionStorage",lookup(n){let{lookupSessionStorage:e}=n;if(e&&mm())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(n,e){let{lookupSessionStorage:t}=e;t&&mm()&&window.sessionStorage.setItem(t,n)}},ON={name:"navigator",lookup(n){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:r,language:s}=navigator;if(t)for(let i=0;i<t.length;i++)e.push(t[i]);r&&e.push(r),s&&e.push(s)}return e.length>0?e:void 0}},RN={name:"htmlTag",lookup(n){let{htmlTag:e}=n,t;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(t=r.getAttribute("lang")),t}},IN={name:"path",lookup(n){var s;let{lookupFromPathIndex:e}=n;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?(s=t[typeof e=="number"?e:0])==null?void 0:s.replace("/",""):void 0}},NN={name:"subdomain",lookup(n){var s,i;let{lookupFromSubdomainIndex:e}=n;const t=typeof e=="number"?e+1:1,r=typeof window<"u"&&((i=(s=window.location)==null?void 0:s.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[t]}};let T0=!1;try{document.cookie,T0=!0}catch{}const k0=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];T0||k0.splice(1,1);const DN=()=>({order:k0,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class C0{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=EN(t,this.options||{},DN()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(CN),this.addDetector(AN),this.addDetector(PN),this.addDetector(jN),this.addDetector(ON),this.addDetector(RN),this.addDetector(IN),this.addDetector(NN)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(t=t.concat(s))}}),t=t.filter(r=>r!=null&&!TN(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}C0.type="languageDetector";const qd={common:{appName:"The Gazel",loading:"Loading...",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",search:"Search",filter:"Filter",sort:"Sort",confirm:"Confirm",back:"Back",next:"Next",submit:"Submit",error:"Error",success:"Success",warning:"Warning",info:"Information",language:"Language",region:"Region"},auth:{signIn:"Sign In",signUp:"Sign Up",signOut:"Sign Out",email:"Email",password:"Password",forgotPassword:"Forgot Password",resetPassword:"Reset Password",createAccount:"Create Account",alreadyHaveAccount:"Already have an account?",dontHaveAccount:"Don't have an account?",logout:"Logout"},navigation:{dashboard:"Dashboard",transactions:"Transactions",deductions:"Deductions",reports:"Reports",settings:"Settings",products:"Products",analytics:"Analytics",calendar:"Calendar",budgeting:"Budgeting",knowledgeBase:"Knowledge Base",menu:"Menu",taxFeatures:"Tax Preparation Features",taxDeductions:"Tax Deductions",taxEstimates:"Tax Estimates",filingStatus:"Tax Preparation Status",complianceCenter:"Compliance Center",taxStrategyPlanning:"Tax Strategy Planning",aiConsultations:"AI Consultations",customReports:"Custom Reports",dataExport:"Data Export",prioritySupport:"Priority Support"},dashboard:{welcomeMessage:"Welcome, {{email}}!",overview:"Here's an overview of your financial data.",recentTransactions:"Recent transactions",upcomingDeadlines:"Upcoming deadlines",potentialDeductions:"Potential deductions",taxSummary:"Tax preparation summary",viewAll:"View all",loading:"Loading...",totalIncome:"Total Income",totalExpenses:"Total Expenses",estimatedTaxLiability:"Estimated Tax Liability",currentYearSummary:"Current Year Summary",quickActions:"Quick Actions",viewTransactions:"View Transactions",manageDeductions:"Manage Deductions",generateReports:"Generate Reports",adminTools:"Admin Tools",emailMessaging:"Email Messaging",smsTesting:"SMS Testing",netIncome:"Net Income",savings:"Savings",logoutSuccess:"Logged out successfully",logoutSuccessDesc:"You have been logged out of your account",logoutFailed:"Logout failed",logoutFailedDesc:"There was a problem logging you out. Please try again."},transactions:{pageTitle:"Transactions",allTransactions:"All Transactions",incomeTransactions:"Income Transactions",expenseTransactions:"Expense Transactions",addTransaction:"Add Transaction",importTransactions:"Import Transactions",scanReceipt:"Scan Receipt",filterTransactions:"Filter Transactions",income:"Income",expense:"Expense",expenses:"Expenses",date:"Date",description:"Description",category:"Category",amount:"Amount",actions:"Actions",noTransactions:"No transactions found",refreshing:"Refreshing...",refresh:"Refresh",enhancedProcessing:"Upload",enhancedFileProcessing:"Upload File",scan:"Scan",add:"Add",transactionsRefreshed:"Transactions refreshed",transactionsUpdated:"Your transactions list has been updated",transactionDeleted:"Transaction deleted",transactionRemoved:"The transaction has been removed successfully",importSuccessful:"Import successful",importedTransactions:"{count} transactions imported using enhanced processing",receiptProcessed:"Receipt processed",transactionFromReceipt:"Transaction added from receipt",noTransactionsFound:"No transactions found.",addFirstTransaction:"Add Your First Transaction",tryAgain:"Try Again"},deductions:{currentDeductions:"Current Deductions",aiSuggestions:"AI Suggestions",deductionAnalysis:"Deduction Analysis",totalPotentialDeductions:"Total Potential Deductions",estimatedTaxRate:"Estimated Tax Rate",estimatedTaxSavings:"Estimated Tax Savings",noDeductions:"No s
538aved deductions",addDeduction:"Add Deduction",verified:"Verified",pending:"Pending",rejected:"Rejected",taxImpact:"Tax Impact"},reports:{pageTitle:"Reports",loadingReports:"Loading reports...",printFullReport:"Print Full Report",year:"Year",selectYear:"Select year",financialReports:"Financial Reports",incomeExpenses:"Income & Expenses",expenseCategories:"Expense Categories",taxLiability:"Tax Liability",totalIncome:"Total Income",totalExpenses:"Total Expenses",netProfit:"Net Profit",period:"Period",dateRange:"Date Range",export:"Export",monthly:"Monthly",quarterly:"Quarterly",financialSummary:"Financial Summary",financialPerformance:"Overview of your financial performance for the selected year",monthlyIncomeExpenses:"Monthly Income & Expenses",monthlyBreakdown:"Breakdown of income and expenses by month",quarterlyReport:"Quarterly Report",quarterlySummary:"Financial summary by quarter",expenseCategoriesAnalysis:"Analysis of expenses by category",taxLiabilityEstimates:"Estimated tax liabilities by quarter",lastGenerated:"Last generated",offlineMessage:"You're offline. Report generation is not available while offline."},products:{subscriptionInitiated:"Subscription Initiated",redirectingToStripe:"Redirecting to Stripe Checkout",subscriptionFailed:"Subscription Failed",freeTrialActive:"Free Trial Active",subscriptionActive:"Subscription Active",yourPlan:"Your Plan",currentPlan:"Current Plan",subscribe:"Subscribe",processing:"Processing...",trialEnds:"Trial Ends",nextBillingDate:"Next Billing Date",refreshStatus:"Refresh Status",smartTaxAnalysisPlans:"Smart Tax Analysis Plans",refreshSubscriptionStatus:"Refresh Subscription Status",refreshingSubscriptionStatus:"Refreshing Subscription Status...",intelligentToolsDescription:"Start with a 14-d
538ay free trial that includes all premium features! Then choose the plan that fits your needs. Our intelligent tools help you identify deductions and optimize your tax strategy.",freeTrial:"Free Trial",days14:"14 Days",aiDeductionSuggestions:"AI Deduction Suggestions",receiptScanning:"Receipt Scanning",enterpriseFeatures:"Enterprise Features",activeAccess:"Active Access",transparentPricing:"Transparent Pricing & Consumer Protection",transparentPricingDescription:"Start with a 14-day free trial - no payment required upfront. After your trial, choose from our flexible plans starting at $9.99/month. Cancel anytime. For detailed terms and consumer protection information, visit our Consumer Protection page.",pricingBreakdown:"Free Trial: 14 days with all premium features • Starter ($9.99/mo): Essential tax tracking • Professional ($14.99/mo): AI insights & receipt scanning • Enterprise ($19.99/mo): Complete tax strategy planning",hasAccessMessage:"You currently have access to premium features!",noAccessMessage:"Start your free trial today, then upgrade to continue with premium features!",step3ChoosePlan:"Step 3: Choose Your Plan",selectPlanOrStart:"Select a plan or start with Basic Analysis",startFreeTrial:"Start Your 14-Day Free Trial!",freeTrialDescription:"Get full access to all premium features including AI-powered deduction suggestions and receipt scanning for 14 days. No payment required upfront!",startFreeTrialButton:"Start Free Trial",orChoosePaid:"or choose a paid plan below",continueToFreeTrialDashboard:"Continue to Dashboard",readyToContinue:"Ready to Continue!",readyToContinueDescription:"Great! You now have access to premium features. You can complete your onboarding and start using The Gazel.",completeSetupButton:"Complete Setup & Go to Dashboard",subscriptionActiveOnboarding:"Your subscription is active! You can now access your dashboard.",goToDashboard:"Go to Dashboard",subscriptionError:"Subscription Error",subscriptionErrorDescription:"There was a problem retrieving your subscription information. Please try refreshing.",refreshingStatus:"Refreshing Status",checkingSubscription:"Checking your subscription information...",statusUpdated:"Status Updated",statusUpdatedDescription:"Your subscription information has been refreshed",refreshError:"Error",refreshErrorDescription:"Failed to refresh subscription status",welcomeToGazel:"Welcome to The Gazel!",welcomeDescription:"You now have full access to Basic Analysis features. Upgrade anytime for AI-powered insights.",importantDisclosures:"Important Disclosures",freeTrialPricing:"Free Trial & Pricing",freeTrialPricingDescription:"14-day free trial includes all premium features with no payment required upfront. After trial: Starter ($9.99/mo), Professional ($14.99/mo), Enterprise ($19.99/mo). All prices shown in USD. You may be charged applicable taxes based on your location.",cancellationPolicy:"Cancellation Policy",cancellationPolicyDescription:"Cancel your subscription at any time through your account settings. After cancellation, your subscription remains active until the end of the current billing period.",taxSavingsEstimates:"Tax Savings Estimates",taxSavingsEstimatesDescription:"Potential tax savings are based on general scenarios and historical data. Individual results vary based on specific tax situations and applicable laws.",customerSupport:"Customer Support",customerSupportDescription:"For billing inquiries or disputes, contact [email protected]. We respond to all inquiries within 48 hours. Enterprise customers receive priority support.",backToDashboard:"Back to Dashboard",manageSubscription:"Manage Subscription",refreshing:"Refreshing...",alreadySubscribed:"Already Subscribed",comingSoon:"Coming Soon",comingSoonEnterprise:"Enterprise features are currently being developed. Please choose Premium for now.",authenticationRequired:"Authentication Required",pleaseLogIn:"Please log in to subscribe",alreadyActiveSubscription:"You already have an active subscription",couldNotProcess:"Could not process subscription",couldNotLoadProducts:"Could not load available products",freeTrialAvailable:"14-Day Free Trial Available!",freeTrialAvailableDescription:"Start your free trial to access all premium features for 14 days. No payment required upfront!",basicAnalysisFeatures:{freeTrial:"14-day free trial",basicTracking:"Basic transaction tracking",expenseCategorization:"Simple expense categorization",taxDeductionId:"Basic tax deduction identification",standardReports:"Standard reports",premiumAccess:"Access to all premium features during trial"},starterFeatures:{allBasic:"All Basic features (always included)",bankConnections:"Bank account connections",monthlyReports:"Monthly reports",emailSupport:"Email support",dataExportBasic:"Data export (basic)",essentialTracking:"Essential tax tracking"},premiumFeatures:{allStarter:"All Starter features (always included)",aiSuggestions:"AI-powered deduction suggestions",receiptScanningOcr:"Receipt scanning & OCR",advancedAnalysis:"Advanced tax savings analysis",categoryAutomation:"Category automation",forecastingTools:"Forecasting tools"},enterpriseFeaturesDetailed:{allPremium:"All Premium features (always included)",taxStrategy:"Complete tax strategy planning",unlimitedConsultations:"Unlimited AI consultations",prioritySupportEnterprise:"Priority support",customReportsEnterprise:"Custom reports & insights",dataExportCapabilities:"Data export capabilities"}},terms:{termsAndConditions:"Terms and Conditions",pleaseReadAccept:"Please read and accept our terms and conditions to continue using the app.",acceptTerms:"I accept the terms and conditions",termsAccepted:"Thank y
538ou for accepting our terms and conditions.",authRequired:"You must be logged in to accept terms.",pleaseAcceptTerms:"You must accept the terms and conditions to continue."},payment:{paymentSuccessful:"Payment Successful",paymentVerificationIssue:"Payment Verification Issue",amount:"Amount",email:"Email",paymentStatus:"Payment Status",verifyingPayment:"Verifying your payment...",noPaymentInfo:"No payment information found",sessionInvalid:"Session ID does not exist or is invalid",returnToDashboard:"Return to Dashboard"},analytics:{overview:"Overview",userActivity:"User Activity",conversionFunnels:"Conversion Funnels",subscriptionMetrics:"Subscription Metrics",pageViews:"Page Views",activeUsers:"Active Users",conversionRate:"Conversion Rate",averageRevenue:"Average Revenue",topFeatures:"Top Features",featureUsage:"Feature Usage"},taxEstimates:{title:"Tax Estimates",description:"Calculate your estimated tax liability for preparation purposes",currentYear:"Current Year",estimatedTax:"Estimated Tax",calculate:"Calculate"},filingStatus:{title:"Tax Preparation Status",description:"Manage your tax preparation status and document organization",single:"Single",marriedFilingJointly:"Married Filing Jointly",marriedFilingSeparately:"Married Filing Separately",headOfHousehold:"Head of Household"},compliance:{title:"Compliance Center",description:"Organize compliance documentation and audit-ready records",documents:"Documents",auditLogs:"Audit Logs",complianceStatus:"Compliance Status"},enterprise:{enterpriseTaxStrategyPlanning:"Tax Strategy Planning",enterpriseAiConsultations:"AI Consultations",enterpriseCustomReports:"Custom Reports",enterpriseDataExport:"Data Export",enterprisePrioritySupport:"Priority Support",enterpriseFeatures:"Enterprise Features",premium:"Premium",available:"Available",upgrade:"Upgrade"},calendar:{pageTitle:"Calendar",pageDescription:"Schedule your business tasks and appointments.",newEvent:"New Event",events:"events",high:"high",medium:"medium",low:"low",allEvents:"All Events",noEventsFound:"No events found.",createFirstEvent:"Create your first event"},budgeting:{pageTitle:"Budgeting & Forecasting",pageDescription:"Create budgets, track your spending, and forecast future cash flow",addForecast:"Add Forecast",createBudget:"Create Budget",overBudget:"Over budget",budgetsOverLimit:"{count} budget{plural} {verb} over the limit: {names}{more}",approachingBudgetLimit:"Approaching budget limit",budgetsAtLimit:"{count} budget{plural} {verb} at or above 80% of limit.",budgets:"Budgets",cashFlowForecast:"Cash Flow Forecast",noBudgets:"No Budgets",noBudgetsDescription:"You haven't created any budgets yet. Create your first budget to start tracking your spending.",budgetOverview:"Budget Overview",budgetOverviewDescription:"Compare your budgets and actual spending across categories",createBudgetsToSeeOverview:"Create budgets to see your spending overview",cashFlowForecasts:"Cash Flow Forecasts",cashFlowForecastsDescription:"View and manage your future cash flow projections",noCashFlowForecasts:"No cash flow forecasts available",createFirstForecast:"Create Your First Forecast",noNotes:"No notes",income:"Income",expenses:"Expenses",budgetExceeded:"Budget exceeded",budgetExceededDescription:"{name} has exceeded its limit by {amount}.",approachingBudgetDescription:"{name} is at {percentage}% of its budget."},settings:{pageTitle:"Settings",pageDescription:"Manage your account settings and preferences.",general:"General",subscription:"Subscription",notifications:"Notifications",reminders:"Reminders",test:"Test",privacy:"Privacy",compliance:"Compliance",amlKyc:"AML/KYC",consumer:"Consumer",licensing:"Licensing",security:"Security",audit:"Audit",profile:"Profile",profileDescription:"Update your personal information.",email:"Email",firstName:"First name",lastName:"Last name",john:"John",doe:"Doe",saveChanges:"Save Changes",preferences:"Preferences",preferencesDescription:"Configure your app preferences.",darkMode:"Dark Mode",darkModeDescription:"Enable dark mode for the application.",analyticsCookies:"Analytics Cookies",analyticsCookiesDescription:"We use cookies to improve your experience."}
538,landing:{welcomeTitle:"Welcome to {appName}",welcomeSubtitle:"Your AI-powered financial companion for tracking income, managing expenses, and optimizing tax savings",seeInAction:"See The Gazel in Action",seeInActionDescription:"Explore our intuitive interface designed to make tax management effortless and efficient",aiPoweredAnalysis:"AI-Powered Analysis",aiPoweredAnalysisDescription:"Our intelligent system analyzes your financial data to identify tax-saving opportunities you might miss",smartDeductions:"Smart Deductions",smartDeductionsDescription:"Automatically categorize expenses and discover deductions to maximize your tax refund",financialInsights:"Financial Insights",financialInsightsDescription:"Get detailed analytics and forecasts to make informed financial decisions year-round",documentManagement:"Document Management",documentManagementDescription:"Organize receipts, invoices, and tax documents in one secure, searchable location",secureCompliant:"Secure & Compliant",secureCompliantDescription:"Bank-level security with full compliance to tax regulations and data protection standards",saveMoreMoney:"Save More Money",saveMoreMoneyDescription:"On average, users save 23% more on their taxes compared to traditional preparation methods",readyToTransform:"Ready to Transform Your Tax Experience?",readyToTransformDescription:"Join thousands of users who have simplified their tax management with The Gazel",getStartedNow:"Get Started Now",bankLevelSecurity:"Bank-level security",irsCompliant:"IRS compliant",maximumDeductions:"Maximum deductions"}},Gd={common:{appName:"The Gazel",loading:"Cargando...",save:"Guardar",cancel:"Cancelar",delete:"Eliminar",edit:"Editar",add:"Añadir",search:"Buscar",filter:"Filtrar",sort:"Ordenar",confirm:"Confirmar",back:"Atrás",
538next:"Siguiente",submit:"Enviar",error:"Error",success:"Éxito",warning:"Advertencia",info:"Información",language:"Idioma",region:"Región"},auth:{signIn:"Iniciar Sesión",signUp:"Registrarse",signOut:"Cerrar Sesión",email:"Correo electrónico",password:"Contraseña",forgotPassword:"Olvidé mi contraseña",resetPassword:"Restablecer contraseña",createAccount:"Crear cuenta",alreadyHaveAccount:"¿Ya tienes una cuenta?",dontHaveAccount:"¿No tienes una cuenta?",logout:"Cerrar Sesión"},navigation:{dashboard:"Panel",transactions:"Transacciones",deductions:"Deducciones",reports:"Informes",settings:"Ajustes",products:"Productos",analytics:"Analítica",calendar:"Calendario",budgeting:"Presupuesto",knowledgeBase:"Base de Conocimientos",menu:"Menú",taxFeatures:"Funciones Fiscales",taxDeductions:"Deducciones Fiscales",taxEstimates:"Estimaciones Fiscales",filingStatus:"Estado de Declaración",complianceCenter:"Centro de Cumplimiento",taxStrategyPlanning:"Planificación de Estrategia Fiscal",aiConsultations:"Consultas de IA",customReports:"Informes Personalizados",dataExport:"Exportación de Datos",prioritySupport:"Soporte Prioritario"},dashboard:{welcomeMessage:"¡Bienvenido, {{email}}!",overview:"Aquí tienes un resumen de tus datos financieros.",recentTransactions:"Transacciones recientes",upcomingDeadlines:"Próximas fechas límite",potentialDeductions:"Deducciones potenciales",taxSummary:"Resumen fiscal",viewAll:"Ver todo",loading:"Cargando...",totalIncome:"Ingresos Totales",totalExpenses:"Gastos Totales",estimatedTaxLiability:"Responsabilidad Fiscal Estimada",currentYearSummary:"Resumen del Año Actual",quickActions:"Acciones Rápidas",viewTransactions:"Ver Transacciones",manageDeductions:"Gestionar Deducciones",generateReports:"Generar Informes",adminTools:"Herramientas de Administrador",emailMessaging:"Mensajería por Email",smsTesting:"Pruebas SMS",netIncome:"Ingresos Netos",savings:"Ahorros",logoutSuccess:"Sesión cerrada exitosamente",logoutSuccessDesc:"Has cerrado sesión de tu cuenta",logoutFailed:"Error al cerrar sesión",logoutFailedDesc:"Hubo un problema al cerrar tu sesión. Por favor intenta de nuevo."},transactions:{pageTitle:"Transacciones",allTransactions:"Todas las Transacciones",incomeTransactions:"Transacciones de Ingresos",expenseTransactions:"Transacciones de Gastos",addTransaction:"Añadir transacción",importTransactions:"Importar transacciones",scanReceipt:"Escanear recibo",filterTransactions:"Filtrar transacciones",income:"Ingresos",expense:"Gastos",expenses:"Gastos",date:"Fecha",description:"Descripción",category:"Categoría",amount:"C
538antidad",actions:"Acciones",noTransactions:"No se encontraron transacciones",refreshing:"Actualizando...",refresh:"Actualizar",enhancedProcessing:"Procesamiento Mejorado",enhancedFileProcessing:"Procesamiento de Archivos Mejorado",scan:"Escanear",add:"Agregar",transactionsRefreshed:"Transacciones actualizadas",transactionsUpdated:"Tu lista de transacciones ha sido actualizada",transactionDeleted:"Transacción eliminada",transactionRemoved:"La transacción ha sido eliminada exitosamente",importSuccessful:"Importación exitosa",importedTransactions:"{count} transacciones importadas usando procesamiento mejorado",receiptProcessed:"Recibo procesado",transactionFromReceipt:"Transacción agregada desde recibo",noTransactionsFound:"No se encontraron transacciones.",addFirstTransaction:"Agrega Tu Primera Transacción",tryAgain:"Intentar de Nuevo"},deductions:{pageTitle:"Deducciones Fiscales",pageDescription:"Gestiona tus deducciones fiscales y descubre nuevas oportunidades de ahorro",currentDeductions:"Deducciones actuales",aiSuggestions:"Sugerencias de IA",deductionAnalysis:"Análisis de deducciones",totalPotentialDeductions:"Deducciones potenciales totales",estimatedTaxRate:"Tasa fiscal estimada",estimatedTaxSavings:"Ahorros fiscales estimados",noDeductions:"No hay deducciones guardadas",addDeduction:"Añadir deducción",verified:"Verificado",pending:"Pendiente",rejected:"Rechazado",taxImpact:"Impacto Fiscal",loadingDeductions:"Cargando deducciones...",loadingAiSuggestions:"Cargando sugerencias de IA...",noDeductionsFound:"No se encontraron deducciones.",addFirstDeduction:"Agrega tu primera deducción para comenzar",noAiSuggestions:"No hay sugerencias de IA disponibles en este momento.",analyzeTransactions:"Analizar Transacciones",addSampleData:"Agregar Datos de Muestra",totalVerified:"Total Verificado",totalPending:"Total Pendiente",totalRejected:"Total Rechazado",totalPotential:"Ahorros Potenciales Totales",deductionName:"Nombre de la Deducción",amount:"C
538antidad",category:"Categoría",businessMeals:"Comidas de Negocios",officeSupplies:"Suministros de Oficina",travel:"Viajes",equipment:"Equipo",software:"Software",marketing:"Marketing",other:"Otro",addDeductionSuccess:"Deducción agregada exitosamente",addDeductionError:"Error al agregar deducción",editDeductionSuccess:"Deducción actualizada exitosamente",editDeductionError:"Error al actualizar deducción",removeDeductionSuccess:"Deducción eliminada exitosamente",removeDeductionError:"Error al eliminar deducción",approveSuccess:"Sugerencia aprobada y agregada a deducciones",approveError:"Error al aprobar sugerencia",rejectSuccess:"Sugerencia rechazada",rejectError:"Error al rechazar sugerencia",sampleDataAdded:"Datos de muestra de deducción agregados exitosamente",sampleDataError:"Error al agregar datos de muestra",transactionAnalysisStarted:"Análisis de transacciones iniciado",transactionAnalysisError:"Error al iniciar análisis de transacciones"},reports:{pageTitle:"Informes",loadingReports:"Cargando informes...",printFullReport:"Imprimir Informe Completo",year:"Año",selectYear:"Seleccionar año",financialReports:"Informes financieros",incomeExpenses:"Ingresos y gastos",expenseCategories:"Categorías de gastos",taxLiability:"Responsabilidad fiscal",totalIncome:"Ingresos totales",totalExpenses:"Gastos totales",netProfit:"Beneficio neto",period:"Período",dateRange:"Rango de fechas",export:"Exportar",monthly:"Mensual",quarterly:"Trimestral",financialSummary:"Resumen Financiero",financialPerformance:"Resumen de su rendimiento financiero para el año seleccionado",monthlyIncomeExpenses:"Ingresos y Gastos Mensuales",monthlyBreakdown:"Desglose de ingresos y gastos por mes",quarterlyReport:"Informe Trimestral",quarterlySummary:"Resumen financiero por trimestre",expenseCategoriesAnalysis:"Análisis de gastos por categoría",taxLiabilityEstimates:"Estimaciones de obligaciones fiscales por trimestre",lastGenerated:"Última generación",offlineMessage:"Estás desconectado. La generación de informes no está disponible sin conexión.",expenseCategoriesDescription:"Análisis de gastos por categoría",taxLiabilityDescription:"Responsabilidades fiscales estimadas por trimestre"},products:{subscriptionInitiated:"Suscripción iniciada",redirectingToStripe:"Redirigiendo a Stripe Checkout",subscriptionFailed:"Error en la suscripción",freeTrialActive:"Prueba gratuita activa",subscriptionActive:"Suscripción activa",yourPlan:"Tu plan",currentPlan:"Plan actual",subscribe:"Suscribirse",processing:"Procesando...",trialEnds:"La prueba termina",nextBillingDate:"Próxima fecha de facturación",refreshStatus:"Actualizar estado",smartTaxAnalysisPlans:"Planes de Análisis Fiscal Inteligente",refreshSubscriptionStatus:"Actualizar Estado de Suscripción",refreshingSubscriptionStatus:"Actualizando Estado de Suscripción...",intelligentToolsDescription:"¡Comienza con una prueba gratuita de 14 días que incluye todas las funciones premium! Luego elige el plan que se adapte a tus necesidades. Nuestras herramientas inteligentes te ayudan a identificar deducciones y optimizar tu estrategia fiscal.",freeTrial:"Prueba Gratuita",days14:"14 Días",aiDeductionSuggestions:"Sugerencias de Deducción IA",receiptScanning:"Escaneo de Recibos",enterpriseFeatures:"Funciones Empresariales",activeAccess:"Acceso Activo",transparentPricing:"Precios Transparentes y Protección al Consumidor",transparentPricingDescription:"Comienza con una prueba gratuita de 14 días - no se requiere pago por adelantado. Después de tu prueba, elige entre nuestros planes flexibles desde $9.99/mes. Cancela en cualquier momento. Para términos detallados e información de protección al consumidor, visita nuestra página de Protección al Consumidor.",pricingBreakdown:"Prueba Gratuita: 14 días con todas las funciones premium • Básico ($9.99/mes): Seguimiento fiscal esencial • Profesional ($14.99/mes): Perspectivas IA y escaneo de recibos • Empresarial ($19.99/mes): Planificación completa de estrategia fiscal",hasAccessMessage:"¡Actualmente tienes acceso a funciones premium!",noAccessMessage:"¡Comienza tu prueba gratuita hoy, luego actualiza para continuar con funciones premium!",step3ChoosePlan:"Paso 3: Elige Tu Plan",selectPlanOrStart:"Selecciona un plan o comienza con Análisis Básico",startFreeTrial:"¡Comienza Tu Prueba Gratuita de 14 Días!",freeTrialDescription:"¡Obtén acceso completo a todas las funciones premium incluyendo sugerencias de deducción impulsadas por IA y escaneo de recibos por 14 días. No se requiere pago por adelantado!",startFreeTrialButton:"Comenzar Prueba Gratuita",orChoosePaid:"o elige un plan de pago a continuación",continueToFreeTrialDashboard:"Continuar al Panel",readyToContinue:"¡Listo para Continuar!",readyToContinueDescription:"¡Excelente! Ahora tienes acceso a funciones premium. Puedes completar tu incorporación y comenzar a usar The Gazel.",completeSetupButton:"Completar Configuración e Ir al Panel",subscriptionActiveOnboarding:"¡Tu suscripción está activa! Ahora puedes acceder a tu panel.",goToDashboard:"Ir al Panel",subscriptionError:"Error de Suscripción",subscriptionErrorDescription:"Hubo un problema al recuperar tu información de suscripción. Por favor intenta actualizar.",refreshingStatus:"Actualizando Estado",checkingSubscription:"Verificando tu información de suscripción...",statusUpdated:"Estado Actualizado",statusUpdatedDescription:"Tu información de suscripción ha sido actualizada",refreshError:"Error",refreshErrorDescription:"Error al actualizar el estado de suscripción",welcomeToGazel:"¡Bienvenido a The Gazel!",welcomeDescription:"Ahora tienes acceso completo a las funciones de Análisis Básico. Actualiza en cualquier momento para obtener perspectivas impulsadas por IA.",importantDisclosures:"Divulgaciones Importantes",freeTrialPricing:"Prueba Gratuita y Precios",freeTrialPricingDescription:"La prueba gratuita de 14 días incluye todas las funciones premium sin pago requerido por adelantado. Después de la prueba: Básico ($9.99/mes), Profesional ($14.99/mes), Empresarial ($19.99/mes). Todos los precios mostrados en USD. Puedes ser cobrado con impuestos aplicables basados en tu ubicación.",cancellationPolicy:"Política de Cancelación",cancellationPolicyDescription:"Cancela tu suscripción en cualquier momento a través de la configuración de tu cuenta. Después de la cancelación, tu suscripción permanece activa hasta el final del período de facturación actual.",taxSavingsEstimates:"Estimaciones de Ahorro Fiscal",taxSavingsEstimatesDescription:"Los ahorros fiscales potenciales se basan en escenarios generales y datos históricos. Los resultados individuales varían según situaciones fiscales específicas y leyes aplicables.",customerSupport:"Soporte al Cliente",customerSupportDescription:"Para consultas de facturación o disputas, contacta [email protected]. Respondemos a todas las consultas dentro de 48 horas. Los clientes empresariales reciben soporte prioritario.",backToDashboard:"Volver al Panel",manageSubscription:"Gestionar Suscripción",refreshing:"Actualizando...",alreadySubscribed:"Ya Suscrito",comingSoon:"Próximamente",comingSoonEnterprise:"Las funciones empresariales están actualmente en desarrollo. Por favor elige Premium por ahora.",authenticationRequired:"Autenticación Requerida",pleaseLogIn:"Por favor inicia sesión para suscribirte",alreadyActiveSubscription:"Ya tienes una suscripción activa",couldNotProcess:"No se pudo procesar la suscripción",couldNotLoadProducts:"No se pudieron cargar los productos disponibles",freeTrialAvailable:"¡Prueba Gratuita de 14 Días Disponible!",freeTrialAvailableDescription:"¡Comienza tu prueba gratuita para acceder a todas las funciones premium por 14 días. No se requiere pago por adelantado!",basicAnalysisFeatures:{freeTrial:"Prueba gratuita de 14 días",basicTracking:"Seguimiento básico de transacciones",expenseCategorization:"Categorización simple de gastos",taxDeductionId:"Identificación básica de deducciones fiscales",standardReports:"Informes estándar",premiumAccess:"Acceso a todas las funciones premium durante la prueba"},starterFeatures:{allBasic:"Todas las funciones Básicas (siempre incluidas)",bankConnections:"Conexiones de cuentas bancarias",monthlyReports:"Informes mensuales",emailSupport:"Soporte por correo electrónico",dataExportBasic:"Exportación de datos (básica)",essentialTracking:"Seguimiento fiscal esencial"},premiumFeatures:{allStarter:"Todas las funciones Básicas (siempre incluidas)",aiSuggestions:"Sugerencias de deducción impulsadas por IA",receiptScanningOcr:"Escaneo de recibos y OCR",advancedAnalysis:"Análisis avanzado de ahorro fiscal",categoryAutomation:"Automatización de categorías",forecastingTools:"Herramientas de pronóstico"},enterpriseFeaturesDetailed:{allPremium:"Todas las funciones Premium (siempre incluidas)",taxStrategy:"Planificación completa de estrategia fiscal",unlimitedConsultations:"Consultas IA ilimitadas",prioritySupportEnterprise:"Soporte prioritario",customReportsEnterprise:"Informes e insights personalizados",dataExportCapabilities:"Capacidades de exportación de datos"}},terms:{termsAndConditions:"Términos y condiciones",pleaseReadAccept:"Por favor, lee y acepta nuestros términos y condiciones para continuar usando la aplicación.",acceptTerms:"Acepto los términos y condiciones",termsAccepted:"Gracias por aceptar nuestros términos y condiciones.",authRequired:"Debes iniciar sesión para aceptar los términos.",pleaseAcceptTerms:"Debes aceptar los términos y condiciones para continuar."},payment:{paymentSuccessful:"Pago exitoso",paymentVerificationIssue:"Problema de verificación de pago",amount:"C
538antidad",email:"Correo electrónico",paymentStatus:"Estado del pago",verifyingPayment:"Verificando tu pago...",noPaymentInfo:"No se encontró información de pago",sessionInvalid:"El ID de sesión no existe o no es válido",returnToDashboard:"Volver al panel"},analytics:{overview:"Resumen",userActivity:"Actividad del usuario",conversionFunnels:"Embudos de conversión",subscriptionMetrics:"Métricas de suscripción",pageViews:"Vistas de página",activeUsers:"Usuarios activos",conversionRate:"Tasa de conversión",averageRevenue:"Ingresos promedio",topFeatures:"Funciones principales",featureUsage:"Uso de funciones"},taxEstimates:{title:"Estimaciones Fiscales",description:"Calcule su responsabilidad fiscal estimada",currentYear:"Año Actual",estimatedTax:"Impuesto Estimado",calculate:"Calcular"},filingStatus:{title:"Estado de Declaración",description:"Gestione su estado de declaración fiscal",single:"Soltero",marriedFilingJointly:"Casado Declarando Conjuntamente",marriedFilingSeparately:"Casado Declarando Por Separado",headOfHousehold:"Cabeza de Familia"},compliance:{title:"Centro de Cumplimiento",description:"Gestione la documentación de cumplimiento y los registros de auditoría",documents:"Documentos",auditLogs:"Registros de Auditoría",complianceStatus:"Estado de Cumplimiento"},enterprise:{enterpriseTaxStrategyPlanning:"Planificación de Estrategia Fiscal",enterpriseAiConsultations:"Consultas de IA",enterpriseCustomReports:"Informes Personalizados",enterpriseDataExport:"Exportación de Datos",enterprisePrioritySupport:"Soporte Prioritario",enterpriseFeatures:"Funciones Empresariales",premium:"Premium",available:"Disponible",upgrade:"Actualizar"},calendar:{pageTitle:"Calendario",pageDescription:"Programa tus tareas comerciales y citas.",newEvent:"Nuevo Evento",events:"eventos",high:"alta",medium:"media",low:"baja",allEvents:"Todos los Eventos",noEventsFound:"No se encontraron eventos.",createFirstEvent:"Crea tu primer evento"},budgeting:{pageTitle:"Presupuesto y Pronósticos",pageDescription:"Crea presupuestos, rastrea tus gastos y pronostica el flujo de efectivo futuro",addForecast:"Agregar Pronóstico",createBudget:"Crear Presupuesto",overBudget:"Sobre presupuesto",budgetsOverLimit:"{count} presupuesto{plural} {verb} sobre el límite: {names}{more}",approachingBudgetLimit:"Acercándose al límite del presupuesto",budgetsAtLimit:"{count} presupuesto{plural} {verb} al 80% o más del límite.",budgets:"Presupuestos",cashFlowForecast:"Pronóstico de Flujo de Efectivo",noBudgets:"Sin Presupuestos",noBudgetsDescription:"Aún no has creado ningún presupuesto. Crea tu primer presupuesto para empezar a rastrear tus gastos.",budgetOverview:"Resumen del Presupuesto",budgetOverviewDescription:"Compara tus presupuestos y gastos reales por categorías",createBudgetsToSeeOverview:"Crea presupuestos para ver tu resumen de gastos",cashFlowForecasts:"Pronósticos de Flujo de Efectivo",cashFlowForecastsDescription:"Ve y gestiona tus proyecciones futuras de flujo de efectivo",noCashFlowForecasts:"No hay pronósticos de flujo de efectivo disponibles",createFirstForecast:"Crea Tu Primer Pronóstico",noNotes:"Sin notas",income:"Ingresos",expenses:"Gastos",budgetExceeded:"Presupuesto excedido",budgetExceededDescription:"{name} ha excedido su límite por {amount}.",approachingBudgetDescription:"{name} está al {percentage}% de su presupuesto."},settings:{pageTitle:"Configuración",pageDescription:"Gestiona la configuración de tu cuenta y preferencias.",general:"General",subscription:"Suscripción",notifications:"Notificaciones",reminders:"Recordatorios",test:"Prueba",privacy:"Privacidad",compliance:"Cumplimiento",amlKyc:"AML/KYC",consumer:"Consumidor",licensing:"Licencias",security:"Seguridad",audit:"Auditoría",profile:"Perfil",profileDescription:"Actualiza tu información personal.",email:"Correo electrónico",firstName:"Nombre",lastName:"Apellido",john:"Juan",doe:"Pérez",saveChanges:"Guardar Cambios",preferences:"Preferencias",preferencesDescription:"Configura las preferencias de tu aplicación.",darkMode:"Modo Oscuro",darkModeDescription:"Habilita el modo oscuro para la aplicación.",analyticsCookies:"Cookies de Análisis",analyticsCookiesDescription:"Usamos cookies para mejorar tu experiencia."}
538,landing:{welcomeTitle:"Bienvenido a {appName}",welcomeSubtitle:"Tu compañero financiero impulsado por IA para rastrear ingresos, gestionar gastos y optimizar ahorros fiscales",seeInAction:"Ve The Gazel en Acción",seeInActionDescription:"Explora nuestra interfaz intuitiva diseñada para hacer la gestión fiscal sin esfuerzo y eficiente",aiPoweredAnalysis:"Análisis Impulsado por IA",aiPoweredAnalysisDescription:"Nuestro sistema inteligente analiza tus datos financieros para identificar oportunidades de ahorro fiscal que podrías perderte",smartDeductions:"Deducciones Inteligentes",smartDeductionsDescription:"Categoriza automáticamente gastos y descubre deducciones para maximizar tu reembolso fiscal",financialInsights:"Perspectivas Financieras",financialInsightsDescription:"Obtén análisis detallados y pronósticos para tomar decisiones financieras informadas durante todo el año",documentManagement:"Gestión de Documentos",documentManagementDescription:"Organiza recibos, facturas y documentos fiscales en una ubicación segura y buscable",secureCompliant:"Seguro y Conforme",secureCompliantDescription:"Seguridad a nivel bancario con pleno cumplimiento de regulaciones fiscales y estándares de protección de datos",saveMoreMoney:"Ahorra Más Dinero",saveMoreMoneyDescription:"En promedio, los usuarios ahorran 23% más en sus impuestos comparado con métodos de preparación tradicionales",readyToTransform:"¿Listo para Transformar tu Experiencia Fiscal?",readyToTransformDescription:"Únete a miles de usuarios que han simplificado su gestión fiscal con The Gazel",getStartedNow:"Comenzar Ahora",bankLevelSecurity:"Seguridad a nivel bancario",irsCompliant:"Conforme con el IRS",maximumDeductions:"Máximas deducciones"}},A0={common:{appName:"The Gazel",loading:"Chargement...",save:"Enregistrer",cancel:"Annuler",delete:"Supprimer",edit:"Modifier",add:"Ajouter",search:"Rechercher",filter:"Filtrer",sort:"Trier",confirm:"Confirmer",back:"Retour",next:"Suivant",submit:"Soumettre",error:"Erreur",success:"Succès",warning:"Avertissement",info:"Information",language:"Langue",region:"Région"},auth:{signIn:"Se connecter",signUp:"S'inscrire",signOut:"Se déconnecter",email:"E-mail",password:"Mot de passe",forgotPassword:"Mot de passe oublié",resetPassword:"Réinitialiser le mot de passe",createAccount:"Créer un compte",alreadyHaveAccount:"Vous avez déjà un compte ?",dontHaveAccount:"Vous n'avez pas de compte ?",logout:"Déconnexion"},navigation:{dashboard:"Tableau de bord",transactions:"Transactions",deductions:"Déductions",reports:"Rapports",settings:"Paramètres",products:"Produits",analytics:"Analytique",calendar:"Calendrier",budgeting:"Budget",knowledgeBase:"Base de connaissances",menu:"Menu",taxFeatures:"Fonctionnalités fiscales",taxDeductions:"Déductions fiscales",taxEstimates:"Estimations fiscales",filingStatus:"Statut de déclaration",complianceCenter:"Centre de conformité",taxStrategyPlanning:"Planification de stratég
538ie fiscale",aiConsultations:"Consultations IA",customReports:"Rapports personnalisés",dataExport:"Export de données",prioritySupport:"Support prioritaire"},dashboard:{welcomeMessage:"Bienvenue, {{email}} !",overview:"Voici un aperçu de vos données financières.",recentTransactions:"Transactions récentes",upcomingDeadlines:"Échéances à venir",potentialDeductions:"Déductions potentielles",taxSummary:"Résumé fiscal",viewAll:"Voir tout",loading:"Chargement...",totalIncome:"Revenus totaux",totalExpenses:"Dépenses totales",estimatedTaxLiability:"Responsabilité fiscale estimée",currentYearSummary:"Résumé de l'année en cours",quickActions:"Actions rapides",viewTransactions:"Voir les transactions",manageDeductions:"Gérer les déductions",generateReports:"Générer des rapports",adminTools:"Outils d'administration",emailMessaging:"Messagerie par email",smsTesting:"Tests SMS",netIncome:"Revenus nets",savings:"Économies",logoutSuccess:"Déconnexion réussie",logoutSuccessDesc:"Vous avez été déconnecté de votre compte",logoutFailed:"Échec de la déconnexion",logoutFailedDesc:"Il y a eu un problème lors de votre déconnexion. Veuillez réessayer."},transactions:{addTransaction:"Ajouter une transaction",importTransactions:"Importer des transactions",scanReceipt:"Scanner un reçu",filterTransactions:"Filtrer les transactions",income:"Revenus",expense:"Dépenses",date:"Date",description:"Description",category:"Catégorie",amount:"Montant",noTransactions:"Aucune transaction trouvée"},deductions:{currentDeductions:"Déductions actuelles",aiSuggestions:"Suggestions IA",deductionAnalysis:"Analyse des déductions",totalPotentialDeductions:"Déductions potentielles totales",estimatedTaxRate:"Taux d'imposition estimé",estimatedTaxSavings:"Économies fiscales estimées",noDeductions:"Aucune déduction enregistrée",addDeduction:"Ajouter une déduction",verified:"Vérifié",pending:"En attente",rejected:"Rejeté"},reports:{pageTitle:"Rapports",loadingReports:"Chargement des rapports...",printFullReport:"Imprimer le Rapport Complet",year:"Année",selectYear:"Sélectionner l'année",financialReports:"Rapports financiers",incomeExpenses:"Revenus et dépenses",expenseCategories:"Catégories de dépenses",taxLiability:"Responsabilité fiscale",totalIncome:"Revenus totaux",totalExpenses:"Dépenses totales",netProfit:"Bénéfice net",period:"Période",dateRange:"Plage de dates",export:"Exporter",monthly:"Mensuel",quarterly:"Trimestriel",financialSummary:"Résumé Financier",financialPerformance:"Aperçu de votre performance financière pour l'année sélectionnée",monthlyIncomeExpenses:"Revenus et Dépenses Mensuels",monthlyBreakdown:"Répartition des revenus et dépenses par mois",quarterlyReport:"Rapport Trimestriel",quarterlySummary:"Résumé financier par trimestre",expenseCategoriesAnalysis:"Analyse des dépenses par catégorie",taxLiabilityEstimates:"Estimations des obligations fiscales par trimestre",lastGenerated:"Dernière génération",offlineMessage:"Vous êtes hors ligne. La génération de rapports n'est pas disponible hors ligne."},products:{subscriptionInitiated:"Abonnement initié",redirectingToStripe:"Redirection vers Stripe Checkout",subscriptionFailed:"Échec de l'abonnement",freeTrialActive:"Essai gratuit actif",subscriptionActive:"Abonnement actif",yourPlan:"Votre plan",currentPlan:"Plan actuel",subscribe:"S'abonner",processing:"Traitement...",trialEnds:"L'essai se termine",nextBillingDate:"Prochaine date de facturation",refreshStatus:"Actualiser le statut"},terms:{termsAndConditions:"Conditions générales",pleaseReadAccept:"Veuillez lire et accepter nos conditions générales pour continuer à utiliser l'application.",acceptTerms:"J'accepte les conditions générales",termsAccepted:"Merci d'avoir accepté nos conditions générales.",authRequired:"Vous devez être connecté pour accepter les conditions.",pleaseAcceptTerms:"Vous devez accepter les conditions générales pour continuer."},payment:{paymentSuccessful:"Paiement réussi",paymentVerificationIssue:"Problème de vérification du paiement",amount:"Montant",email:"E-mail",paymentStatus:"Statut du paiement",verifyingPayment:"Vérification de votre paiement...",noPaymentInfo:"Aucune information de paiement trouvée",sessionInvalid:"L'ID de session n'existe pas ou n'est pas valide",returnToDashboard:"Retour au tableau de bord"},analytics:{overview:"Vue d'ensemble",userActivity:"Activité utilisateur",conversionFunnels:"Entonnoirs de conversion",subscriptionMetrics:"Métriques d'abonnement",pageViews:"Vues de page",activeUsers:"Utilisateurs actifs",conversionRate:"Taux de conversion",averageRevenue:"Revenus moyens",topFeatures:"Fonctionnalités principales",featureUsage:"Utilisation des fonctionnalités"},taxEstimates:{title:"Estimations fiscales",description:"Calculez votre responsabilité fiscale estimée",currentYear:"Année actuelle",estimatedTax:"Impôt estimé",calculate:"Calculer"},filingStatus:{title:"Statut de déclaration",description:"Gérez votre statut de déclaration fiscale",single:"Célibataire",marriedFilingJointly:"Marié déclarant conjointement",marriedFilingSeparately:"Marié déclarant séparément",headOfHousehold:"Chef de famille"},compliance:{title:"Centre de conformité",description:"Gérez la documentation de conformité et les journaux d'audit",documents:"Documents",auditLogs:"Journaux d'audit",complianceStatus:"Statut de conformité"}
538,enterprise:{taxStrategyPlanning:"Planification de stratégie fiscale",aiConsultations:"Consultations IA",customReports:"Rapports personnalisés",dataExport:"Export de données",prioritySupport:"Support prioritaire",enterpriseFeatures:"Fonctionnalités d'entreprise",premium:"Premium",available:"Disponible",upgrade:"Mettre à niveau"},landing:{welcomeTitle:"Bienvenue à {appName}",welcomeSubtitle:"Votre compagnon financier alimenté par l'IA pour suivre les revenus, gérer les dépenses et optimiser les économies fiscales",seeInAction:"Voir The Gazel en Action",seeInActionDescription:"Explorez notre interface intuitive conçue pour rendre la gestion fiscale sans effort et efficace",aiPoweredAnalysis:"Analyse Alimentée par l'IA",aiPoweredAnalysisDescription:"Notre système intelligent analyse vos données financières pour identifier les opportunités d'économies fiscales que vous pourriez manquer",smartDeductions:"Déductions Intelligentes",smartDeductionsDescription:"Catégorisez automatiquement les dépenses et découvrez des déductions pour maximiser votre remboursement fiscal",financialInsights:"Perspectives Financières",financialInsightsDescription:"Obtenez des analyses détaillées et des prévisions pour prendre des décisions financières éclairées toute l'année",documentManagement:"Gestion des Documents",documentManagementDescription:"Organisez les reçus, factures et documents fiscaux dans un endroit sécurisé et consultable",secureCompliant:"Sécurisé et Conforme",secureCompliantDescription:"Sécurité de niveau bancaire avec pleine conformité aux réglementations fiscales et aux normes de protection des données",saveMoreMoney:"Économisez Plus d'Argent",saveMoreMoneyDescription:"En moyenne, les utilisateurs économisent 23% de plus sur leurs impôts par rapport aux méthodes de préparation traditionnelles",readyToTransform:"Prêt à Transformer Votre Expérience Fiscale ?",readyToTransformDescription:"Rejoignez des milliers d'utilisateurs qui ont simplifié leur gestion fiscale avec The Gazel",getStartedNow:"Commencer Maintenant",bankLevelSecurity:"Sécurité de niveau bancaire",irsCompliant:"Conforme IRS",maximumDeductions:"Déductions maximales"}},P0={common:{appName:"The Gazel",loading:"Laden...",save:"Speichern",cancel:"Abbrechen",delete:"Löschen",edit:"Bearbeiten",add:"Hinzufügen",search:"Suchen",filter:"Filtern",sort:"Sortieren",confirm:"Bestätigen",back:"Zurück",next:"Weiter",submit:"Senden",error:"Fehler",success:"Erfolg",warning:"Warnung",info:"Information",language:"Sprache",region:"Region"},auth:{signIn:"Anmelden",signUp:"Registrieren",signOut:"Abmelden",email:"E-Mail",password:"Passwort",forgotPassword:"Passwort vergessen",resetPassword:"Passwort zurücksetzen",createAccount:"Konto erstellen",alreadyHaveAccount:"Haben Sie bereits ein Konto?",dontHaveAccount:"Haben Sie noch kein Konto?",logout:"Abmelden"},navigation:{dashboard:"Dashboard",transactions:"Transaktionen",deductions:"Abzüge",reports:"Berichte",settings:"Einstellungen",products:"Produkte",analytics:"Analytik",calendar:"Kalender",budgeting:"Budgetierung",knowledgeBase:"Wissensdatenbank",menu:"Menü",taxFeatures:"Steuerliche Funktionen",taxDeductions:"Steuerliche Abzüge",taxEstimates:"Steuerschätzungen",filingStatus:"Anmeldestatus",complianceCenter:"Compliance-Center",taxStrategyPlanning:"Steuerstrategieplanung",aiConsultations:"KI-Beratungen",customReports:"Benutzerdefinierte Berichte",dataExport:"Datenexport",prioritySupport:"Prioritätssupport"},dashboard:{welcomeMessage:"Willkommen, {{email}}!",overview:"Hier ist eine Übersicht Ihrer Finanzdaten.",recentTransactions:"Aktuelle Transaktionen",upcomingDeadlines:"Bevorstehende Fristen",potentialDeductions:"Potenzielle Abzüge",taxSummary:"Steuerzusammenfassung",viewAll:"Alle anzeigen",loading:"Lädt...",totalIncome:"Gesamteinkommen",totalExpenses:"Gesamtausgaben",estimatedTaxLiability:"Geschätzte Steuerschuld",currentYearSummary:"Zusammenfassung des aktuellen Jahres",quickActions:"Schnellaktionen",viewTransactions:"Transaktionen anzeigen",manageDeductions:"Abzüge verwalten",generateReports:"Beric
538hte erstellen",adminTools:"Admin-Tools",emailMessaging:"E-Mail-Nachrichten",smsTesting:"SMS-Tests",netIncome:"Nettoeinkommen",savings:"Ersparnisse",logoutSuccess:"Erfolgreich abgemeldet",logoutSuccessDesc:"Sie wurden von Ihrem Konto abgemeldet",logoutFailed:"Abmeldung fehlgeschlagen",logoutFailedDesc:"Es gab ein Problem beim Abmelden. Bitte versuchen Sie es erneut."},transactions:{addTransaction:"Transaktion hinzufügen",importTransactions:"Transaktionen importieren",scanReceipt:"Beleg scannen",filterTransactions:"Transaktionen filtern",income:"Einkommen",expense:"Ausgaben",date:"Datum",description:"Beschreibung",category:"Kategorie",amount:"Betrag",noTransactions:"Keine Transaktionen gefunden"},deductions:{currentDeductions:"Aktuelle Abzüge",aiSuggestions:"KI-Vorschläge",deductionAnalysis:"Abzugsanalyse",totalPotentialDeductions:"Gesamte potenzielle Abzüge",estimatedTaxRate:"Geschätzter Steuersatz",estimatedTaxSavings:"Geschätzte Steuerersparnis",noDeductions:"Keine gespeicherten Abzüge",addDeduction:"Abzug hinzufügen",verified:"Verifiziert",pending:"Ausstehend",rejected:"Abgelehnt"},reports:{pageTitle:"Berichte",loadingReports:"Berichte werden geladen...",printFullReport:"Vollständigen Bericht drucken",year:"Jahr",selectYear:"Jahr auswählen",financialReports:"Finanzberichte",incomeExpenses:"Einnahmen und Ausgaben",expenseCategories:"Ausgabenkategorien",taxLiability:"Steuerschuld",totalIncome:"Gesamteinkommen",totalExpenses:"Gesamtausgaben",netProfit:"Nettogewinn",period:"Zeitraum",dateRange:"Datumsbereich",export:"Exportieren",monthly:"Monatlich",quarterly:"Vierteljährlich",financialSummary:"Finanzübersicht",financialPerformance:"Überblick über Ihre finanzielle Leistung für das ausgewählte Jahr",monthlyIncomeExpenses:"Monatliche Einnahmen und Ausgaben",monthlyBreakdown:"Aufschlüsselung der Einnahmen und Ausgaben nach Monat",quarterlyReport:"Quartalsbericht",quarterlySummary:"Finanzübersicht nach Quartal",expenseCategoriesAnalysis:"Analyse der Ausgaben nach Kategorien",taxLiabilityEstimates:"Geschätzte Steuerpflichten nach Quartal",lastGenerated:"Zuletzt erstellt",offlineMessage:"Sie sind offline. Die Berichtserstellung ist offline nicht verfügbar."},products:{subscriptionInitiated:"Abonnement eingeleitet",redirectingToStripe:"Weiterleitung zu Stripe Checkout",subscriptionFailed:"Abonnement fehlgeschlagen",freeTrialActive:"Kostenlose Testversion aktiv",subscriptionActive:"Abonnement aktiv",yourPlan:"Ihr Plan",currentPlan:"Aktueller Plan",subscribe:"Abonnieren",processing:"Verarbeitung...",trialEnds:"Testversion endet",nextBillingDate:"Nächstes Abrechnungsdatum",refreshStatus:"Status aktualisieren"},terms:{termsAndConditions:"Allgemeine Geschäftsbedingungen",pleaseReadAccept:"Bitte lesen und akzeptieren Sie unsere Allgemeinen Geschäftsbedingungen, um die Anwendung weiter zu nutzen.",acceptTerms:"Ich akzeptiere die Allgemeinen Geschäftsbedingungen",termsAccepted:"Vielen Dank für die Annahme unserer Allgemeinen Geschäftsbedingungen.",authRequired:"Sie müssen sich anmelden, um die Bedingungen zu akzeptieren.",pleaseAcceptTerms:"Sie müssen die Allgemeinen Geschäftsbedingungen akzeptieren, um fortzufahren."},payment:{paymentSuccessful:"Zahlung erfolgreich",paymentVerificationIssue:"Problem bei der Zahlungsverifizierung",amount:"Betrag",email:"E-Mail",paymentStatus:"Zahlungsstatus",verifyingPayment:"Ihre Zahlung wird verifiziert...",noPaymentInfo:"Keine Zahlungsinformationen gefunden",sessionInvalid:"Die Sitzungs-ID existiert nicht oder ist ungültig",returnToDashboard:"Zurück zum Dashboard"},analytics:{overview:"Übersicht",userActivity:"Benutzeraktivität",conversionFunnels:"Conversion-Trichter",subscriptionMetrics:"Abonnement-Metriken",pageViews:"Seitenaufrufe",activeUsers:"Aktive Benutzer",conversionRate:"Conversion-Rate",averageRevenue:"Durchschnittlicher Umsatz",topFeatures:"Top-Funktionen",featureUsage:"Funktionsnutzung"},taxEstimates:{title:"Steuerschätzungen",description:"Berechnen Sie Ihre geschätzte Steuerschuld",currentYear:"Aktuelles Jahr",estimatedTax:"Geschätzte Steuer",calculate:"Berechnen"},filingStatus:{title:"Anmeldestatus",description:"Verwalten Sie Ihren Steueranmeldestatus",single:"Ledig",marriedFilingJointly:"Verheiratet Gemeinsam Veranlagt",marriedFilingSeparately:"Verheiratet Getrennt Veranlagt",headOfHousehold:"Haushaltsvorstand"},compliance:{title:"Compliance-Center",description:"Verwalten Sie Compliance-Dokumentation und Audit-Protokolle",documents:"Dokumente",auditLogs:"Audit-Protokolle",complianceStatus:"Compliance-Status"},enterprise:{taxStrategyPlanning:"Steuerstrategieplanung",aiConsultations:"KI-Beratungen",customReports:"Benutzerdefinierte Beric
538hte",dataExport:"Datenexport",prioritySupport:"Prioritätssupport",enterpriseFeatures:"Unternehmensfunktionen",premium:"Premium",available:"Verfügbar",upgrade:"Upgrade"},landing:{welcomeTitle:"Willkommen bei {appName}",welcomeSubtitle:"Ihr KI-gestützter Finanzbegleiter zum Verfolgen von Einkommen, Verwalten von Ausgaben und Optimieren von Steuerersparnissen",seeInAction:"Sehen Sie The Gazel in Aktion",seeInActionDescription:"Erkunden Sie unsere intuitive Benutzeroberfläche, die entwickelt wurde, um das Steuermanagement mühelos und effizient zu gestalten",aiPoweredAnalysis:"KI-gestützte Analyse",aiPoweredAnalysisDescription:"Unser intelligentes System analysiert Ihre Finanzdaten, um steuersparende Möglichkeiten zu identifizieren, die Sie verpassen könnten",smartDeductions:"Intelligente Abzüge",smartDeductionsDescription:"Kategorisieren Sie Ausgaben automatisch und entdecken Sie Abzüge, um Ihre Steuerrückerstattung zu maximieren",financialInsights:"Finanzielle Einblicke",financialInsightsDescription:"Erhalten Sie detaillierte Analysen und Prognosen, um das ganze Jahr über fundierte finanzielle Entscheidungen zu treffen",documentManagement:"Dokumentenverwaltung",documentManagementDescription:"Organisieren Sie Belege, Rechnungen und Steuerdokumente an einem sicheren, durchsuchbaren Ort",secureCompliant:"Sicher und Konform",secureCompliantDescription:"Banklevel-Sicherheit mit vollständiger Einhaltung von Steuervorschriften und Datenschutzstandards",saveMoreMoney:"Sparen Sie Mehr Geld",saveMoreMoneyDescription:"Im Durchschnitt sparen Nutzer 23% mehr bei ihren Steuern im Vergleich zu herkömmlichen Vorbereitungsmethoden",readyToTransform:"Bereit, Ihr Steuererlebnis zu Transformieren?",readyToTransformDescription:"Schließen Sie sich Tausenden von Nutzern an, die ihr Steuermanagement mit The Gazel vereinfacht haben",getStartedNow:"Jetzt Starten",bankLevelSecurity:"Banklevel-Sicherheit",irsCompliant:"IRS-konform",maximumDeductions:"Maximale Abzüge"}};console.log("=== i18n Initialization Debug ===");console.log("English translations loaded:",Object.keys(qd).length);console.log("Spanish translations loaded:",Object.keys(Gd).length);console.log("French translations loaded:",Object.keys(A0).length);console.log("German translations loaded:",Object.keys(P0).length);console.log("EN landing keys:",Object.keys(qd.landing||{}));console.log("ES landing keys:",Object.keys(Gd.landing||{}));Xe.use(C0).use(gC).init({resources:{en:{translation:qd},es:{translation:Gd},fr:{translation:A0},de:{translation:P0}},fallbackLng:"en",debug:!0,interpolation:{escapeValue:!1},saveMissing:!0,missingKeyHandler:(n,e,t,r)=>{console.warn(`Missing translation key: ${t} for language: ${n}`,{fallbackValue:r})}}).then(()=>{console.log("=== i18n Successfully Initialized ==="),console.log("Current language:",Xe.language),console.log("Available languages:",Xe.languages),console.log("Translation test for common.appName:",Xe.t("common.appName")),console.log("Translation test for landing.welcomeTitle:",Xe.t("landing.welcomeTitle",{appName:"The Gazel"}))}).catch(n=>{console.error("=== i18n Initialization Failed ===",n)});const MN=Ws("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",warning:"border-amber-500/50 text-amber-800 bg-amber-50 dark:border-amber-500/50 dark:text-amber-300 dark:bg-amber-950/50 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",info:"border-blue-500/50 text-blue-800 bg-blue-50 dark:border-blue-500/50 dark:text-blue-300 dark:bg-blue-950/50 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400"}},defaultVariants:{variant:"default"}}),Rn=y.forwardRef(({className:n,variant:e,...t},r)=>l.jsx("div",{ref:r,role:"alert",className:re(MN({variant:e}),n),...t}));Rn.displayName="Alert";const j0=y.forwardRef(({className:n,...e},t)=>l.jsx("h5",{ref:t,className:re("mb-1 font-medium leading-none tracking-tight",n),...e}));j0.displayName="AlertTitle";const In=y.forwardRef(({className:n,...e},t)=>l.jsx("div",{ref:t,className:re("text-sm [&_p]:leading-relaxed",n),...e}));In.displayName="AlertDescription";const LN=()=>{const{currentStep:n,getStepNumber:e,getTotalSteps:t}=Nv(),r=e(n);t();const s=[{number:1,label:"Welcome",key:"landing"},{number:2,label:"Sign Up",key:"auth"}
538,{number:3,label:"Choose Plan",key:"products"}];return l.jsx("div",{className:"w-full max-w-md mx-auto mb-8",children:l.jsx("div",{className:"flex items-center justify-between",children:s.map((i,o)=>l.jsxs(Y.Fragment,{children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium transition-all duration-300 ${i.number<r?"bg-primary text-primary-foreground":i.number===r?"bg-primary text-primary-foreground ring-2 ring-primary/30":"bg-muted text-muted-foreground"}`,children:i.number<r?l.jsx(Xu,{className:"w-4 h-4"}):i.number}),l.jsx("span",{className:`text-xs font-medium mt-2 transition-colors duration-300 ${i.number<=r?"text-foreground":"text-muted-foreground"}`,children:i.label})]}),o<s.length-1&&l.jsx("div",{className:`flex-1 h-0.5 mx-2 transition-colors duration-300 ${i.number<r?"bg-primary":"bg-muted"}`})]},i.key))})})};function gm(n){const e=(n||"").trim();if(!e)return"";if(e.startsWith("+"))return"+"+e.replace(/[^\d]/g,"");const t=e.replace(/[^\d]/g,"");return t.length===11&&t.startsWith("1")?`+${t}`:t.length===10?`+1${t}`:`+${t}`}async function vm(n){var e;try{if((e=n==null?void 0:n.context)!=null&&e.json){const t=await n.context.json();if(t!=null&&t.error){const r=t.retryAfter?` Please wait ${Math.ceil(t.retryAfter/60)} minutes.`:"";return t.error+r}}}catch{}return(n==null?void 0:n.message)||"An unexpected error occurred."}const FN=()=>{const[n,e]=y.useState(""),[t,r]=y.useState(""),[s,i]=y.useState(""),[o,a]=y.useState("enter-phone"),[c,u]=y.useState(""),[d,f]=y.useState(""),[p,v]=y.useState(""),[b,m]=y.useState(!1),[g,x]=y.useState(null),[S,E]=y.useState(null),[P,C]=y.useState(null),[O,N]=y.useState(0),[D,R]=y.useState(!1),[F,A]=y.useState(!1),[I,z]=y.useState(null),[$,ee]=y.useState(null),[K,se]=y.useState(null),[G,q]=y.useState(null),[te,Q]=y.useState("login"),[oe,h]=y.useState("sms"),[_,w]=y.useState(!1),[T,k]=y.useState(!1),[j,M]=y.useState(null),[L,B]=y.useState(!1),[X,ue]=y.useState(!1),[Le,Ze]=y.useState(""),[Ke,je]=y.useState(!1),[nt,Fe]=y.useState(0),[lt,Jt]=y.useState(null),Ft=Wi();wr();const{session:rt,user:ut}=Dt(),{isOnboarding:yt,setCurrentStep:zn}=Nv();y.useEffect(()=>{yt&&zn("auth")},[yt,zn]);const bt=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),ti=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),Sn=/iPad|iPhone|iPod/.test(navigator.userAgent);y.useEffect(()=>{const de=localStorage.getItem("lastSignupAttempt");de&&Date.now()-parseInt(de)<6e4&&(k(!0),M(parseInt(de)))},[]),y.useEffect(()=>{if(T&&j){const de=6e4-(Date.now()-j);if(de>0){const Ae=setTimeout(()=>{k(!1),M(null),localStorage.removeItem("lastSignupAttempt")},de);return()=>clearTimeout(Ae)}else k(!1),M(null),localStorage.removeItem("lastSignupAttempt")}},[T,j]),y.useEffect(()=>{if(rt&&ut&&L&&lt){const de=setTimeout(()=>{console.log("Auth: Redirect taking too long, showing manual option"),je(!0),B(!1)},3e3);return()=>clearTimeout(de)}},[rt,ut,L,lt]);const ni=async de=>{try{const{data:Ae,error:ce}=await _e.rpc("is_admin_user");if(!ce&&Ae===!0)return console.log("Auth: Super admin detected - skipping products page"),!0;const{data:le,error:Re}=await _e.from("subscription_status").select("subscribed, status").eq("user_id",de).maybeSingle();return!Re&&(le!=null&&le.subscribed)&&(le.status==="active"||le.status==="trialing")?(console.log("Auth: Active subscription detected - skipping products page"),!0):!1}catch(Ae){return console.error("Auth: Error checking skip products status:",Ae),!1}};y.useEffect(()=>{rt&&ut&&!L&&(console.log("Auth: User authenticated, initiating redirect",{userId:ut.id,isMobile:bt}),B(!0),Jt(Date.now()),(async()=>{const Ae=localStorage.getItem("gazel_onboarding_state");if(Ae){const{onboarding:ce}=JSON.parse(Ae);if(ce){if(await ni(ut.id)){console.log("Auth: Admin/subscribed user - skipping products, going to dashboard"),localStorage.setItem("gazel_onboarding_state",JSON.stringify({step:"completed",onboarding:!1})),Ft("/dashboard",{replace:!0}),B(!1),Jt(null);return}console.log("Auth: Onboarding mode - redirecting to products page"),Ft("/products",{replace:!0}),B(!1),Jt(null);return}}try{console.log("Auth: Redirecting to dashboard immediately"),Ft("/dashboard",{replace:!0}),bt&&setTimeout(()=>{window.location.pathname==="/auth"&&(console.log("Auth: Mobile navigation fallback activated"),je(!0),B(!1))},1500)}catch(ce){console.error("Auth: Navigation error:",ce),je(!0),B(!1)}})())},[rt,ut,Ft,yt,L,bt]);const Er=async()=>{console.log("Auth: Manual redirect triggered");const de=localStorage.getItem("gazel_onboarding_state");if(de&&ut){const{onboarding:Ae}=JSON.parse(de);if(Ae){if(await ni(ut.id)){console.log("Auth: Admin/subscribed user - skipping products via manual redirect"),localStorage.setItem("gazel_onboarding_state",JSON.stringify({step:"completed",onboarding:!1})),window.location.href="/dashboard";return}console.log("Auth: Redirecting to products page during onboarding"),window.location.href="/products";return}}window.location.href="/dashboard"},io=async de=>{de.preventDefault(),A(!0),q(null),se(null);try{if(!s.trim()){q("Email is required.");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.trim())){q("Please enter a valid email address.");return}console.log("Auth: Attempting password reset for email:",s);const{error:ce}=await _e.auth.resetPasswordForEmail(s.trim(),{redirectTo:`${window.location.origin}/reset-password`});if(ce)throw console.error("Auth: Password reset error:",ce),ce;console.log("Auth: Password reset email sent successfully"),se("Password reset instructions have been sent to your email address. Please check your inbox and follow the link to reset your password."),i(""),setTimeout(()=>{w(!1),se(null)},5e3)}catch(Ae){console.error("Auth: Password reset error:",Ae.message);let ce="Unable to send password reset email. Please try again.";Ae.message.includes("Email not found")?ce="No account found with this email address.":Ae.message.includes("rate limit")||Ae.message.includes("over_email_send_rate_limit")?ce="Too many password reset attempts. Please wait at least 60 seconds before trying again.":(Ae.message.includes("invalid_request")||Ae.message.includes("signup 
538is disabled"))&&(ce="Password reset is temporarily unavailable. Please try again later or contact support."),q(ce)}finally{A(!1)}},oo=async de=>{var Ae,ce;de.preventDefault(),R(!0),z(null),ee(null),je(!1),Fe(0),Jt(null);try{if(!n.trim()||!t.trim()){z("Email and password are required.");return}console.log("Auth: Attempting to sign in with email:",n,"Device:",{isMobile:bt,isSafari:ti,isIOS:Sn,userAgent:navigator.userAgent});const{data:le,error:Re}=await _e.auth.signInWithPassword({email:n.trim(),password:t});if(Re)throw console.error("Auth: Sign-in error:",Re),Re;console.log("Auth: Sign-in successful",{userId:(Ae=le.user)==null?void 0:Ae.id,sessionExists:!!le.session,hasAccessToken:!!((ce=le.session)!=null&&ce.access_token),isMobile:bt,isSafari:ti,isIOS:Sn}),ee("Sign-in successful! Redirecting..."),Ge(yt?{title:"Welcome back!",description:"Continuing with your setup..."}:{title:"Welcome back!",description:"Redirecting to your dashboard..."})}catch(le){console.error("Auth: Sign-in error:",le.message);let Re=le.message;le.message.includes("Invalid login credentials")?Re="Invalid email or password. Please check your credentials and try again.":le.message.includes("Email not confirmed")?Re="Please check your email and click the confirmation link before signing in.":le.message.includes("Too many requests")&&(Re="Too many login attempts. Please wait a moment before trying again."),z(Re)}finally{R(!1)}},yc=async de=>{if(de.preventDefault(),T){z("Please wait before attempting to sign up again. Rate limits help protect our service.");return}R(!0),z(null),ee(null);try{if(!n.trim()||!t.trim()){z("Email and password are required.");return}if(t.length<6){z("Password must be at least 6 characters.");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.trim())){z("Please enter a valid email address.");return}console.log("Auth: Attempting to sign up with email:",n),localStorage.setItem("lastSignupAttempt",Date.now().toString());const{data:ce,error:le}=await _e.auth.signUp({email:n.trim(),password:t,options:{data:{email:n.trim()}}});if(le){if(console.error("Auth: Sign-up error:",le),le.message.includes("rate limit")||le.message.includes("over_email_send_rate_limit")){k(!0),M(Date.now()),z("Too many signup attempts detected. Please wait 60 seconds before trying again. This helps protect our service from spam.");return}let Re="Unable to create account. Please try again.";le.message.includes("User already registered")?Re="An account with this email already exists. Please try signing in instead or use a different email address.":le.message.includes("Password should be at least")?Re="Password must be at least 6 characters long.":le.message.includes("Invalid email")?Re="Please enter a valid email address.":le.message.includes("Database error saving new user")||le.message.includes("Failed to process new user")?Re="There was a temporary issue creating your account. Please try again in a moment. If the problem persists, please contact support.":le.message.includes("Signup is disabled")?Re="Account registration is currently disabled. Please contact support for assistance.":le.message.includes("Password is too weak")&&(Re="Please choose a stronger password with a mix of letters, numbers, and special characters."),z(Re);return}localStorage.removeItem("lastSignupAttempt"),k(!1),M(null),ce.user&&(console.log("Auth: Sign-up successful for user:",ce.user.id),ce.session?(ee("Account created successfully! Your 30-day free trial has started. Welcome to The Gazel!"),yt&&Ge({title:"Welcome to The Gazel!",description:"Your account has been created and your 30-day free trial has started. Let's continue with your setup..."})):(Ze(n),ue(!0),Ic.success("Check your email for a confirmation link!")),e(""),r(""))}catch(Ae){console.error("Auth: Unexpected signup error:",Ae),z("An unexpected error occurred during account creation. Please try again or contact support if the problem persists.")}finally{R(!1)}},ri=de=>{te==="login"?oo(de):yc(de)},cn=()=>{yt&&(localStorage.removeItem("onboardingCompleted"),window.location.reload())},ao=()=>{if(!j)return 0;const de=Date.now()-j;return Math.max(0,60-Math.floor(de/1e3))},me=async(de=!1)=>
538{if(!c.trim()){x("Phone number is required.");return}if(!/^\+?[1-9]\d{1,14}$/.test(c.replace(/\s/g,""))){x("Please enter a valid phone number (e.g., +1234567890).");return}m(!0),x(null),E(null);try{const ce=gm(c);console.log("📱 Sending SMS to normalized phone:",ce.substring(0,5)+"***");const{data:le,error:Re}=await _e.functions.invoke("send-sms-verification",{body:{phoneNumber:ce,isSignup:de}});if(Re){console.error("SMS sending error:",Re);const En=await vm(Re);throw new Error(En)}if((le==null?void 0:le.success)===!1||le!=null&&le.error||(le==null?void 0:le.code)==="RATE_LIMIT_EXCEEDED"){const En=le!=null&&le.retryAfter?` Please wait ${Math.ceil(le.retryAfter/60)} minutes before trying again.`:"";throw new Error((le.error||"Failed to send verification code.")+En)}console.log("SMS sent successfully:",le),E(`Verification code sent to ${c}. Check your messages.`),a("enter-code"),le.expiresAt&&C(new Date(le.expiresAt)),N(60);const co=setInterval(()=>{N(En=>En<=1?(clearInterval(co),0):En-1)},1e3)}catch(ce){console.error("SMS sending error:",ce);let le=ce.message||"Failed to send verification code. Please try again.";window.matchMedia("(display-mode: standalone)").matches&&le.includes("non-2xx")&&(le='Your installed app may be out of date. Please close and reopen the app, or tap "Update now" if prompted.'),x(le)}finally{m(!1)}},$e=async(de=!1)=>{if(!d.trim()){x("Verification code is required.");return}m(!0),x(null);try{const Ae=gm(c);console.log("🔐 Verifying SMS code for normalized phone:",Ae.substring(0,5)+"***");const{data:ce,error:le}=await _e.functions.invoke("verify-sms-code",{body:{phoneNumber:Ae,code:d.trim(),isSignup:de,displayName:p.trim()||void 0}});if(le){console.error("SMS verification error:",le);const Re=await vm(le);throw new Error(Re)}if((ce==null?void 0:ce.success)===!1||ce!=null&&ce.error||(ce==null?void 0:ce.code)==="RATE_LIMIT_EXCEEDED"){const Re=ce!=null&&ce.retryAfter?` Please wait ${Math.ceil(ce.retryAfter/60)} minutes before trying again.`:"";throw new Error((ce.error||"Verification failed.")+Re)}if(console.log("SMS verification successful:",ce),ce!=null&&ce.access_token&&(ce!=null&&ce.refresh_token)){a("signing-in"),console.log("Setting session with server-provided tokens...");const{error:Re}=await _e.auth.setSession({access_token:ce.access_token,refresh_token:ce.refresh_token});if(Re){console.error("Error setting session:",Re),x("Verification succeeded but sign-in failed. Please try again.");return}if(console.log("✅ Session established successfully"),p.trim()){const{data:{user:co}}=await _e.auth.getUser();if(co){const{error:En}=await _e.from("profiles").update({first_name:p.trim()}).eq("id",co.id);En?console.warn("Could not save display name to profile:",En):console.log("✅ Display name saved to profile")}}}else{console.error("No session tokens returned from edge function"),x("Verification succeeded but sign-in failed. Please try again.");return}a("done"),E(de?"Account created successfully!":"Login successful!"),setTimeout(()=>{Er()}
538,500),Ge({title:de?"Welcome to The Gazel!":"Welcome back!",description:de?"Your account has been created with phone verification.":"You've been signed in successfully."})}catch(Ae){console.error("SMS verification error:",Ae);let ce=Ae.message||"Invalid verification code. Please try again.";window.matchMedia("(display-mode: standalone)").matches&&ce.includes("non-2xx")&&(ce='Your installed app may be out of date. Please close and reopen the app, or tap "Update now" if prompted.'),x(ce)}finally{m(!1)}},De=()=>{me(!0)},$t=()=>{me(!1)},Ut=de=>{de.preventDefault(),o==="enter-code"?$e(te==="signup"):o==="enter-phone"&&(te==="signup"?De():$t())},Tr=()=>{u(""),f(""),v(""),a("enter-phone"),x(null),E(null),C(null),N(0)};return L?l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:l.jsxs("div",{className:"text-center max-w-md mx-auto p-6",children:[l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),l.jsx("p",{className:"text-lg font-medium mb-2",children:"Redirecting to dashboard..."}),bt&&l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Mobile redirect in progress. This may take a moment."}),Ke&&l.jsxs("div",{className:"mt-4",children:[l.jsxs(xe,{onClick:Er,className:"w-full mb-2",children:[l.jsx(vo,{className:"mr-2 h-4 w-4"}),"Continue to Dashboard"]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"If the automatic redirect isn't working, click above to continue."})]})]})}):_?l.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[l.jsxs("div",{className:"flex justify-between p-4",children:[l.jsxs(xe,{variant:"ghost",onClick:()=>w(!1),className:"flex items-center gap-2",children:[l.jsx(bh,{className:"h-4 w-4"}),"Back to Login"]}),l.jsx("div",{className:"ml-auto",children:l.jsx(Vl,{})})]}),l.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:l.jsxs("div",{className:"w-full max-w-md animate-fade-in",children:[l.jsx("div",{className:"flex justify-center mb-8",children:l.jsx(ws,{size:"lg"})}),l.jsxs(zr,{className:"border-border shadow-lg",children:[l.jsxs(aa,{children:[l.jsx(ca,{className:"text-xl font-bold text-center",children:"Reset Your Password"}),l.jsx(Bl,{className:"text-center",children:"Enter your email address and we'll send you a link to reset your password"})]}),l.jsxs(hr,{children:[G&&l.jsxs(Rn,{variant:"destructive",className:"mb-6",children:[l.jsx(ji,{className:"h-4 w-4"}),l.jsx(In,{children:G})]}),K&&l.jsxs(Rn,{className:"mb-6 bg-success/20 border-success text-success-foreground",children:[l.jsx(jc,{className:"h-4 w-4 text-success"}),l.jsx(In,{children:K})]}),l.jsx("form",{onSubmit:io,children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vn,{htmlFor:"reset-email",children:"Email"}),l.jsxs("div",{className:"relative",children:[l.jsx(yo,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),l.jsx(Xn,{id:"reset-email",type:"email",placeholder:"[email protected]",value:s,onChange:de=>i(de.target.value),className:"pl-10",required:!0,disabled:F})]})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:F,children:F?l.jsxs(l.Fragment,{children:[l.jsx(nr,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending reset email..."]}):"Send Reset Email"})]})})]})]}),l.jsx("div",{className:"text-center text-xs text-muted-foreground mt-8",children:"The Gazel v1.2.0 | © 2026 Rondus LLC"})]})})]}):l.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[l.jsxs("div",{className:"flex justify-between p-4",children:[yt&&l.jsxs(xe,{variant:"ghost",onClick:cn,className:"flex items-center gap-2",children:[l.jsx(bh,{className:"h-4 w-4"}),"Back to Landing"]}),l.jsx("div",{className:"ml-auto",children:l.jsx(Vl,{})})]}),l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-4",children:[yt&&l.jsx("div",{className:"w-full max-w-md mb-8",children:l.jsx(LN,{})}),l.jsxs("div",{className:"w-full max-w-md animate-fade-in",children:[l.jsx("div",{className:"flex justify-center mb-8",children:l.jsx(ws,{size:"lg"})}),yt&&l.jsxs("div",{className:"text-center mb-6",children:[l.jsx("h2",{className:"text-xl font-semibold text-primary",children:"Step 2: Create Your Account"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign up with your phone number to continue"})]}),T&&l.jsxs(Rn,{variant:"warning",className:"mb-6",children:[l.jsx(rv,{className:"h-4 w-4"}),l.jsxs(In,{children:["Please wait ",ao()," more seconds before attempting to sign up again. This helps protect our service."]})]}),(Ke||rt&&ut&&$)&&l.jsxs(Rn,{className:"mb-6 bg-primary/10 border-primary/20",children:[l.jsx(vo,{className:"h-4 w-4 text-primary"}),l.jsx(In,{className:"text-foreground",children:l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx("span",{className:"font-medium",children:"Ready to continue?"}),l.jsxs(xe,{onClick:Er,size:"sm",className:"w-full",children:[l.jsx(vo,{className:"mr-2 h-4 w-4"}),"Continue to Dashboard"]}),l.jsx("span",{className:"text-xs text-muted-foreground",children:bt?"Tap above if the automatic redirect doesn't work on your mobile device.":"Click above if the automatic redirect doesn't work."})]})})]}),l.jsxs(ab,{defaultValue:"login",value:te,onValueChange:Q,className:"w-full",children:[l.jsxs(Sd,{className:"grid grid-cols-2 w-full mb-8",children:[l.jsx(Fi,{value:"login",children:"Login"}),l.jsxs(Fi,{value:"signup",disabled:T,children:["Sign Up ",T&&`(${ao()}s)`]})]}),l.jsxs(zr,{className:"border-border shadow-lg",children:[l.jsxs(aa,{children:[l.jsx(ca,{className:"text-xl font-bold text-center",children:te==="login"?"Welcome Back":"Create Your Account"}),l.jsx(Bl,{className:"text-center",children:te==="login"?"Enter your phone number to access your account":"Sign up with your phone number to get started"})]}),l.jsxs(hr,{children:[l.jsx("div",{className:"flex justify-center mb-6",children:l.jsxs("div",{className:"flex rounded-lg border border-border bg-muted p-1",children:[l.jsxs("button",{type:"button",onClick:()=>{h("sms"),z(null),x(null),e(""),r("")},className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors ${oe==="sms"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[l.jsx(ps,{className:"h-4 w-4"}),"Phone"]}),l.jsxs("button",{type:"button",onClick:()=>{h("email"),z(null),x(null),Tr()},className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors ${oe==="email"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[l.jsx(yo,{className:"h-4 w-4"}),"Email"]})]})}),X?l.jsxs("div",{className:"flex flex-col items-center text-center py-6 space-y-4",children:[l.jsx("div",{className:"w-16 h-16 rounded-full bg-success/20 flex items-center justify-center",children:l.jsx(yo,{className:"h-8 w-8 text-success"})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Check your email"}),l.jsxs("p",{className:"text-muted-foreground",children:["We've sent a confirmation link to"," ",l.jsx("span",{className:"font-medium text-foreground",children:Le}),". Please check your inbox and click the link to verify your account."]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Your 30-day free trial will begin once verified."})]}),l.jsx(Rn,{className:"bg-muted/50 border-muted text-sm",children:l.jsx(In,{className:"text-muted-foreground",children:"Can't find it? Check your spam or junk folder."})}),l.jsxs("div",{className:"flex flex-col gap-2 w-full max-w-xs pt-2",children:[l.jsx(xe,{variant:"default",onClick:()=>{ue(!1),Q("login")},children:"Go to Login"}),l.jsx(xe,{variant:"ghost",size:"sm",onClick:async()=>{const{error:de}=await _e.auth.resend({type:"signup",email:Le});de?Ic.error("Could not resend email. Please try again later."):Ic.success("Confirmation email resent!")},children:"Resend confirmation email"})]})]}):l.jsxs(l.Fragment,{children:[(I||g)&&l.jsxs(Rn,{variant:"destructive",className:"mb-6",children:[l.jsx(ji,{className:"h-4 w-4"}),l.jsx(In,{children:I||g})]}),($||S)&&l.jsxs(Rn,{className:"mb-6 bg-success/20 border-success text-success-foreground",children:[l.jsx(jc,{className:"h-4 w-4 text-success"}),l.jsx(In,{children:$||S})]}),S&&rt&&ut&&l.jsx("div",{className:"mb-6",children:l.jsx(xe,{onClick:Er,className:"w-full",children:"Continue to Dashboard"})}),oe==="email"&&l.jsx("form",{onSubmit:ri,children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vn,{htmlFor:"email",children:"Email"}),l.jsxs("div",{className:"relative",children:[l.jsx(yo,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),l.jsx(Xn,{id:"email",type:"email",placeholder:"[email protected]",value:n,onChange:de=>e(de.target.value),className:"pl-10",required:!0,disabled:D})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vn,{htmlFor:"password",children:"Password"}),l.jsxs("div",{className:"relative",children:[l.jsx(sv,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),l.jsx(Xn,{id:"password",type:"password",value:t,onChange:de=>r(de.target.value),className:"pl-10",required:!0,disabled:D})]}),te==="signup"&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"Password must be at least 6 characters"})]}),te==="login"&&l.jsx("div",{className:"flex justify-end",children:l.jsx("button",{type:"button",onClick:()=>w(!0),className:"text-sm text-primary underline hover:text-primary/90",disabled:D,children:"Forgot password?"})}),l.jsx(xe,{type:"submit",className:"w-full",disabled:D||te==="signup"&&T,children:D?l.jsxs(l.Fragment,{children:[l.jsx(nr,{className:"mr-2 h-4 w-4 animate-spin"}),te==="login"?"Signing in...":"Creating account..."]}):te==="login"?"Login":"Sign Up"})]})}),oe==="sms"&&l.jsx("form",{onSubmit:Ut,children:l.jsxs("div",{className:"space-y-4",children:[o==="enter-phone"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vn,{htmlFor:"phone",children:"Phone Number"}),l.jsxs("div",{className:"relative",children:[l.jsx(ps,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),l.jsx(Xn,{id:"phone",type:"tel",placeholder:"+234 800 000 0000",value:c,onChange:de=>u(de.target.value),className:"pl-10",required:!0,disabled:b})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Include country code: +234 (Nigeria), +254 (Kenya), +27 (South Africa), +233 (Ghana), +255 (Tanzania)"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vn,{htmlFor:"display-name",children:"Your Name"}),l.jsx(Xn,{id:"display-name",type:"text",placeholder:"e.g. John Doe or Acme Corp",value:p,onChange:de=>v(de.target.value),disabled:b})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:b,children:b?l.jsxs(l.Fragment,{children:[l.jsx(nr,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending code..."]}):l.jsxs(l.Fragment,{children:[l.jsx(pT,{className:"mr-2 h-4 w-4"}),"Send Verification Code"]})})]}),o==="enter-code"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-center mb-4",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"We sent a verification code to"}),l.jsx("p",{className:"font-medium",children:c})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vn,{htmlFor:"sms-code",children:"Verification Code"}),l.jsx(Xn,{id:"sms-code",type:"text",placeholder:"123456",value:d,onChange:de=>f(de.target.value),maxLength:6,required:!0,disabled:b,className:"text-center text-lg tracking-widest"}),l.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Enter the 6-digit code from your text message"})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:b,children:b?l.jsxs(l.Fragment,{children:[l.jsx(nr,{className:"mr-2 h-4 w-4 animate-spin"}),"Verifying..."]}):"Verify Code"}),l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("button",{type:"button",onClick:Tr,className:"text-muted-foreground hover:text-foreground",disabled:b,children:"← Change number"}),l.jsx("button",{type:"button",onClick:()=>me(te==="signup"),className:"text-primary hover:text-primary/90 disabled:opacity-50",disabled:b||O>0,children:O>0?`Resend in ${O}s`:"Resend code"})]})]}),o==="signing-in"&&l.jsxs("div",{className:"flex flex-col items-center text-center py-6 space-y-4",children:[l.jsx(nr,{className:"h-8 w-8 animate-spin text-primary"}),l.jsx("p",{className:"text-lg font-medium",children:"Signing you in..."}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Please wait a moment."})]}),o==="done"&&l.jsxs("div",{className:"flex flex-col items-center text-center py-6 space-y-4",children:[l.jsx("div",{className:"w-16 h-16 rounded-full bg-success/20 flex items-center justify-center",children:l.jsx(jc,{className:"h-8 w-8 text-success"})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-foreground",children:te==="signup"?"Account Created!":"Login Successful!"}),l.jsx("p",{className:"text-muted-foreground",children:"Redirecting you to your dashboard..."})]}),l.jsxs(xe,{onClick:Er,className:"w-full",children:[l.jsx(vo,{className:"mr-2 h-4 w-4"}),"Continue to Dashboard"]})]})]})})]})]}),l.jsx(ob,{className:"flex flex-col",children:l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-2",children:te==="login"?l.jsxs(l.Fragment,{children:["Don't have an account?"," ",l.jsx("button",{type:"button",onClick:()=>{Q("signup"),z(null),ee(null)},className:"text-primary underline hover:text-primary/90 font-medium",disabled:D,children:"Sign up"})]}):l.jsxs(l.Fragment,{children:["Already have an account?"," ",l.jsx("button",{type:"button",onClick:()=>{Q("login"),z(null),ee(null)},className:"text-primary underline hover:text-primary/90 font-medium",disabled:D,children:"Login"})]})})})]})]}),l.jsx("div",{className:"text-center text-xs text-muted-foreground mt-8",children:"The Gazel v1.2.0 | © 2026 Rondus LLC"})]})]})]})},$N=Object.prototype.toString;function UN(n,e){return $N.call(n)===`[object ${e}]`}function O0(n){return UN(n,"Object")}function Hd(n){return!!(n&&n.then&&typeof n.then=="function")}function Mo(n){return n&&n.Math==Math?n:void 0}const rn=typeof globalThis=="object"&&Mo(globalThis)||typeof window=="object"&&Mo(window)||typeof self=="object"&&Mo(self)||typeof global=="object"&&Mo(global)||function(){return this}()||{};function R0(n,e,t){const r=t||rn,s=r.__SENTRY__=r.__SENTRY__||{};return s[n]||(s[n]=e())}const zN=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,VN="Sentry Logger ",ym=["debug","info","warn","error","log","assert","trace"],bm={};function I0(n){if(!("console"in rn))return n();const e=rn.console,t={},r=Object.keys(bm);r.forEach(s=>{const i=bm[s];t[s]=e[s],e[s]=i});try{return n()}finally{r.forEach(s=>{e[s]=t[s]})}}function BN(){let n=!1;const e={enable:()=>{n=!0},disable:()=>{n=!1},isEnabled:()=>n};return zN?ym.forEach(t=>{e[t]=(...r)=>{n&&I0(()=>{rn.console[t](`${VN}[${t}]:`,...r)})}}):ym.forEach(t=>{e[t]=()=>{}}),e}const ur=BN();function Dr(n){return Iu(n,new Map)}function Iu(n,e){if(qN(n)){const t=e.get(n);if(t!==void 0)return t;const r={};e.set(n,r);for(const s of Object.keys(n))typeof n[s]<"u"&&(r[s]=Iu(n[s],e));return r}if(Array.isArray(n)){const t=e.get(n);if(t!==void 0)return t;const r=[];
538return e.set(n,r),n.forEach(s=>{r.push(Iu(s,e))}),r}return n}function qN(n){if(!O0(n))return!1;try{const e=Object.getPrototypeOf(n).constructor.name;return!e||e==="Object"}catch{return!0}}function bn(){const n=rn,e=n.crypto||n.msCrypto;let t=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(t=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(t()&15)>>r/4).toString(16))}function GN(n){return Array.isArray(n)?n:[n]}var Nn;(function(n){n[n.PENDING=0]="PENDING";const t=1;n[n.RESOLVED=t]="RESOLVED";const r=2;n[n.REJECTED=r]="REJECTED"})(Nn||(Nn={}));class er{constructor(e){er.prototype.__init.call(this),er.prototype.__init2.call(this),er.prototype.__init3.call(this),er.prototype.__init4.call(this),this._state=Nn.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new er((r,s)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(o){s(o)}},i=>{if(!t)s(i);else try{r(t(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(e){return this.then(t=>t,e)}finally(e){return new er((t,r)=>{let s,i;return this.then(o=>{i=!1,s=o,e&&e()},o=>{i=!0,s=o,e&&e()}).then(()=>{if(i){r(s);return}t(s)})})}__init(){this._resolve=e=>{this._setResult(Nn.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Nn.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===Nn.PENDING){if(Hd(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Nn.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(t=>{t[0]||(this._state===Nn.RESOLVED&&t[1](this._value),this._state===Nn.REJECTED&&t[2](this._value),t[0]=!0)})}}}const N0=1e3;function Wd(){return Date.now()/N0}function HN(){const{performance:n}=rn;if(!n||!n.now)return Wd;const e=Date.now()-n.now(),t=n.timeOrigin==null?e:n.timeOrigin;return()=>(t+n.now())/N0}const D0=HN();(()=>{const{performance:n}=rn;if(!n||!n.now)return;const e=3600*1e3,t=n.now(),r=Date.now(),s=n.timeOrigin?Math.abs(n.timeOrigin+t-r):e,i=s<e,o=n.timing&&n.timing.navigationStart,c=typeof o=="number"?Math.abs(o+t-r):e,u=c<e;return i||u?s<=c?n.timeOrigin:o:r})();const Wo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,M0="production";function WN(){return R0("globalEventProcessors",()=>[])}function Nu(n,e,t,r=0){return new er((s,i)=>{const o=n[r];if(e===null||typeof o!="function")s(e);else{const a=o({...e},t);Wo&&o.id&&a===null&&ur.log(`Event processor "${o.id}" dropped event`),Hd(a)?a.then(c=>Nu(n,c,t,r+1).then(s)).then(null,i):Nu(n,a,t,r+1).then(s).then(null,i)}})}function JN(n){const e=D0(),t={sid:bn(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>KN(t)};return n&&mc(t,n),t}function mc(n,e={}){if(e.user&&(!n.ipAddress&&e.user.ip_address&&(n.ipAddress=e.user.ip_address),!n.did&&!e.did&&(n.did=e.user.id||e.user.email||e.user.username)),n.timestamp=e.timestamp||D0(),e.abnormal_mechanism&&(n.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(n.ignoreDuration=e.ignoreDuration),e.sid&&(n.sid=e.sid.length===32?e.sid:bn()),e.init!==void 0&&(n.init=e.init),!n.did&&e.did&&(n.did=`${e.did}`),typeof e.started=="number"&&(n.started=e.started),n.ignoreDuration)n.duration=void 0;else if(typeof e.duration=="number")n.duration=e.duration;else{const t=n.timestamp-n.started;n.duration=t>=0?t:0}e.release&&(n.release=e.release),e.environment&&(n.environment=e.environment),!n.ipAddress&&e.ipAddress&&(n.ipAddress=e.ipAddress),!n.userAgent&&e.userAgent&&(n.userAgent=e.userAgent),typeof e.errors=="number"&&(n.errors=e.errors),e.status&&(n.status=e.status)}function YN(n,e){let t={};n.status==="ok"&&(t={status:"exited"}),mc(n,t)}function KN(n){return Dr({sid:`${n.sid}`,init:n.init,started:new Date(n.started*1e3).toISOString(),timestamp:new Date(n.timestamp*1e3).toISOString(),status:n.status,errors:n.errors,did:typeof n.did=="number"||typeof n.did=="string"?`${n.did}`:void 0,duration:n.duration,abnormal_mechanism:n.abnormal_mechanism,attrs:{release:n.release,environment:n.environment,ip_address:n.ipAddress,user_agent:n.userAgent}})}const QN=1;function XN(n){const{spanId:e,traceId:t}=n.spanContext(),{data:r,op:s,parent_span_id:i,status:o,tags:a,origin:c}=Aa(n);return Dr({data:r,op:s,parent_span_id:i,span_id:e,status:o,tags:a,trace_id:t,origin:c})}function Aa(n){return ZN(n)?n.getSpanJSON():typeof n.toJSON=="function"?n.toJSON():{}}function ZN(n){return typeof n.getSpanJSON=="function"}function eD(n){const{traceFlags:e}=n.spanContext();return!!(e&QN)}function tD(n){if(n)return nD(n)?{captureContext:n}:sD(n)?{captureContext:n}:n}function nD(n){return n instanceof dr||typeof n=="function"}const rD=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function sD(n){return Object.keys(n).some(e=>rD.includes(e))}
538function iD(n,e){return vc().captureException(n,tD(e))}function cl(n,e){const t=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return vc().captureMessage(n,t,r)}function oD(){return vc().getClient()}function aD(){return vc().getScope()}function L0(n){return n.transaction}function cD(n,e,t){const r=e.getOptions(),{publicKey:s}=e.getDsn()||{},{segment:i}=t&&t.getUser()||{},o=Dr({environment:r.environment||M0,release:r.release,user_segment:i,public_key:s,trace_id:n});return e.emit&&e.emit("createDsc",o),o}function lD(n){const e=oD();if(!e)return{};const t=cD(Aa(n).trace_id||"",e,aD()),r=L0(n);if(!r)return t;const s=r&&r._frozenDynamicSamplingContext;if(s)return s;const{sampleRate:i,source:o}=r.metadata;i!=null&&(t.sample_rate=`${i}`);const a=Aa(r);return o&&o!=="url"&&(t.transaction=a.description),t.sampled=String(eD(r)),e.emit&&e.emit("createDsc",t),t}function uD(n,e){const{fingerprint:t,span:r,breadcrumbs:s,sdkProcessingMetadata:i,propagationContext:o}=e;dD(n,e),r&&pD(n,r),mD(n,t),hD(n,s),fD(n,i,o)}function dD(n,e){const{extra:t,tags:r,user:s,contexts:i,level:o,transactionName:a}=e,c=Dr(t);c&&Object.keys(c).length&&(n.extra={...c,...n.extra});const u=Dr(r);u&&Object.keys(u).length&&(n.tags={...u,...n.tags});const d=Dr(s);d&&Object.keys(d).length&&(n.user={...d,...n.user});const f=Dr(i);f&&Object.keys(f).length&&(n.contexts={...f,...n.contexts}),o&&(n.level=o),a&&(n.transaction=a)}function hD(n,e){const t=[...n.breadcrumbs||[],...e];n.breadcrumbs=t.length?t:void 0}function fD(n,e,t){n.sdkProcessingMetadata={...n.sdkProcessingMetadata,...e,propagationContext:t}}function pD(n,e){n.contexts={trace:XN(e),...n.contexts};const t=L0(e);if(t){n.sdkProcessingMetadata={dynamicSamplingContext:lD(e),...n.sdkProcessingMetadata};const r=Aa(t).description;r&&(n.tags={transaction:r,...n.tags})}}function mD(n,e){n.fingerprint=n.fingerprint?GN(n.fingerprint):[],e&&(n.fingerprint=n.fingerprint.concat(e)),n.fingerprint&&!n.fingerprint.length&&delete n.fingerprint}const gD=100;class dr{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=wm()}static clone(e){return e?e.clone():new dr}clone(){const e=new dr;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&mc(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){const t=e(this);return t instanceof dr?t:this}return e instanceof dr?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):O0(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=wm(),this}addBreadcrumb(e,t){const r=typeof t=="number"?t:gD;if(r<=0)return this;const s={timestamp:Wd(),...e},i=this._breadcrumbs;return i.push(s),this._breadcrumbs=i.length>r?i.slice(-r):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}
538getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:r,_tags:s,_extra:i,_user:o,_level:a,_fingerprint:c,_eventProcessors:u,_propagationContext:d,_sdkProcessingMetadata:f,_transactionName:p,_span:v}=this;return{breadcrumbs:e,attachments:t,contexts:r,tags:s,extra:i,user:o,level:a,fingerprint:c||[],eventProcessors:u,propagationContext:d,sdkProcessingMetadata:f,transactionName:p,span:v}}applyToEvent(e,t={},r=[]){uD(e,this.getScopeData());const s=[...r,...WN(),...this._eventProcessors];return Nu(s,e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t&&t.event_id?t.event_id:bn();if(!this._client)return ur.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:s,...t,event_id:r},this),r}captureMessage(e,t,r){const s=r&&r.event_id?r.event_id:bn();if(!this._client)return ur.warn("No client configured on scope - will not capture message!"),s;const i=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:s},this),s}captureEvent(e,t){const r=t&&t.event_id?t.event_id:bn();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(ur.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function wm(){return{traceId:bn(),spanId:bn().substring(16)}}const vD="7.98.0",F0=parseFloat(vD),yD=100;class $0{constructor(e,t,r,s=F0){this._version=s;let i;t?i=t:(i=new dr,i.setClient(e));let o;r?o=r:(o=new dr,o.setClient(e)),this._stack=[{scope:i}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const t=this.pushScope();let r;try{r=e(t)}catch(s){throw this.popScope(),s}return Hd(r)?r.then(s=>(this.popScope(),s),s=>{throw this.popScope(),s}):(this.popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const r=this._lastEventId=t&&t.event_id?t.event_id:bn(),s=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:s,...t,event_id:r}),r}captureMessage(e,t,r){const s=this._lastEventId=r&&r.event_id?r.event_id:bn(),i=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:s}),s}captureEvent(e,t){const r=t&&t.event_id?t.event_id:bn();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...t,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:r,client:s}=this.getStackTop();if(!s)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=yD}=s.getOptions&&s.getOptions()||{};if(o<=0)return;const c={timestamp:Wd(),...e},u=i?I0(()=>i(c,t)):c;u!==null&&(s.emit&&s.emit("beforeAddBreadcrumb",u,t),r.addBreadcrumb(u,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}
538setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:r}=this.getStackTop();r&&e(t)}run(e){const t=xm(this);try{e(this)}finally{xm(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return Wo&&ur.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const r=this._callExtensionMethod("startTransaction",e,t);return Wo&&!r&&(this.getClient()?ur.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
539Sentry.addTracingExtensions();
540Sentry.init({...});
541`):ur.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const t=this.getStackTop().scope,r=t.getSession();r&&YN(r),this._sendSessionUpdate(),t.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:s,environment:i=M0}=r&&r.getOptions()||{},{userAgent:o}=rn.navigator||{},a=JN({release:s,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),c=t.getSession&&t.getSession();return c&&c.status==="ok"&&mc(c,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return!!(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}_callExtensionMethod(e,...t){const s=gc().__SENTRY__;if(s&&s.extensions&&typeof s.extensions[e]=="function")return s.extensions[e].apply(this,t);Wo&&ur.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function gc(){return rn.__SENTRY__=rn.__SENTRY__||{extensions:{},hub:void 0},rn}function xm(n){const e=gc(),t=Du(e);return U0(e,n),t}function vc(){const n=gc();if(n.__SENTRY__&&n.__SENTRY__.acs){const e=n.__SENTRY__.acs.getCurrentHub();if(e)return e}return bD(n)}function bD(n=gc()){return(!wD(n)||Du(n).isOlderThan(F0))&&U0(n,new $0),Du(n)}function wD(n){return!!(n&&n.__SENTRY__&&n.__SENTRY__.hub)}function Du(n){return R0("hub",()=>new $0,n)}function U0(n,e){if(!n)return!1;const t=n.__SENTRY__=n.__SENTRY__||{};return t.hub=e,!0}function xD(){return Math.floor(performance.now())}const _D=typeof window<"u"&&!!window.document;typeof WorkerGlobalScope<"u"&&(typeof self<"u"&&self instanceof WorkerGlobalScope&&self.navigator instanceof WorkerNavigator||typeof globalThis<"u"&&globalThis instanceof WorkerGlobalScope&&globalThis.navigator instanceof WorkerNavigator);const Ne=_D?window:typeof WorkerGlobalScope<"u"&&(typeof self<"u"&&self instanceof WorkerGlobalScope&&self||typeof globalThis<"u"&&globalThis instanceof WorkerGlobalScope&&globalThis);var Um;(Um=Ne==null?void 0:Ne.document)==null||Um.readyState;var zm;(zm=Ne==null?void 0:Ne.document)==null||zm.visibilityState;var Vm;/iPad|iPhone|iPod/.test((Vm=Ne.navigator)==null?void 0:Vm.userAgent);(()=>{var e,t;const n=(t=(e=Ne.navigator)==null?void 0:e.userAgent)==null?void 0:t.match(/Firefox[/\s](\d+\.\d+)/);return Array.isArray(n)&&n.length>=2?+n[1]:0})();Date.now()-xD();const SD="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";function _m(n,e){return n?n[e]&15:Math.random()*16|0}function ED(){const n=(Ne==null?void 0:Ne.crypto)||(Ne==null?void 0:Ne.msCrypto);let e,t=0;return n&&n.getRandomValues&&(e=n.getRandomValues(new Uint8Array(30))),SD.split("").map(r=>r==="x"?_m(e,t++).toString(16):r==="y"?(_m()&3|8).toString(16):r).join("")}function z0(){return Ne.NREUM||(Ne.NREUM={}),typeof Ne.newrelic>"u"&&(Ne.newrelic=Ne.NREUM),Ne.NREUM}function Jd(){let n=z0();return n.o||(n.o={ST:Ne.setTimeout,SI:Ne.setImmediate,CT:Ne.clearTimeout,XHR:Ne.XMLHttpRequest,REQ:Ne.Request,EV:Ne.Event,PR:Ne.Promise,MO:Ne.MutationObserver,FETCH:Ne.fetch,WS:Ne.WebSocket}),n}var TD=Object.prototype.hasOwnProperty;function kD(n,e,t){if(TD.call(n,e))return n[e];var r=t();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!1}),r}catch{}return n[e]=r,r}class ll{constructor(e){this.contextId=e}}const CD=ED(),ul="nr@context:".concat(CD),Yd=V0(void 0,"globalEE"),Mu=z0();Mu.ee||(Mu.ee=Yd);function V0(n,e){var x,S;var t={},r={},s={},i=!1;try{i=e.length!==16?!1:(S=(x=Mu.initializedAgents)==null?void 0:x[e])==null?void 0:S.runtime.isolatedBacklog}catch{}var o={on:d,addEventListener:d,removeEventListener:f,emit:u,get:v,listeners:p,c
541ontext:c,buffer:b,abort:a,isBuffering:m,debugId:e,backlog:i?{}:n&&typeof n.backlog=="object"?n.backlog:{},isolatedBacklog:i};function a(){o._aborted=!0,Object.keys(o.backlog).forEach(E=>{delete o.backlog[E]})}return Object.defineProperty(o,"aborted",{get:()=>{let E=o._aborted||!1;return E||(n&&(E=n.aborted),E)}}),o;function c(E){return E&&E instanceof ll?E:E?kD(E,ul,()=>new ll(ul)):new ll(ul)}function u(E,P,C,O,N){if(N!==!1&&(N=!0),!(Yd.aborted&&!O)){n&&N&&n.emit(E,P,C);for(var D=c(C),R=p(E),F=R.length,A=0;A<F;A++)R[A].apply(D,P);var I=g()[r[E]];return I&&I.push([o,E,P,D]),D}}function d(E,P){t[E]=p(E).concat(P)}function f(E,P){var C=t[E];if(C)for(var O=0;O<C.length;O++)C[O]===P&&C.splice(O,1)}function p(E){return t[E]||[]}function v(E){return s[E]=s[E]||V0(o,E)}function b(E,P){const C=g();P=P||"feature",!o.aborted&&Object.entries(E||{}).forEach(([O,N])=>{r[N]=P,P in C||(C[P]=[])})}function m(E){var P=g()[r[E]];return!!P}function g(){return o.backlog}}Yd.get("handle");Jd().o.REQ;Jd().o.XHR;Jd().o.ST;let B0=null;const AD=(n,e)=>{try{B0||console.error("New Relic Error:",n,e)}catch(t){console.error("Failed to track error with New Relic:",t)}},dl=(n,e)=>{try{B0||console.log("New Relic Event:",n,e)}catch(t){console.error("Failed to track event with New Relic:",t)}},PD=(n,e)=>{const t=n instanceof Error?n:new Error(String(n));iD(t,{extra:e}),AD(t,e)},jD=(n,e,t="info")=>{const s={timestamp:new Date().toISOString(),eventName:n,...e};switch(t){case"error":console.error(s),cl(`EVENT_${n}`,{level:"error",extra:e}),dl(`error_${n}`,e);break;case"warning":console.warn(s),cl(`EVENT_${n}`,{level:"warning",extra:e}),dl(`warning_${n}`,e);break;default:console.log(s),cl(`EVENT_${n}`,{level:"info",extra:e}),dl(n,e)}},OD=()=>{const n=wr(),e=Wi();return y.useEffect(()=>{jD("page_not_found",{path:n.pathname,referrer:document.referrer},"warning")},[n.pathname]),l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:l.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-md max-w-md w-full text-center",children:[l.jsx("div",{className:"mb-6 flex justify-center",children:l.jsx("div",{className:"rounded-full bg-gray-100 p-4",children:l.jsx(sT,{className:"h-12 w-12 text-gray-500"})})}),l.jsx("h1",{className:"text-4xl font-bold mb-2 text-gray-800",children:"404"}),l.jsx("p",{className:"text-xl text-gray-600 mb-6",children:"Oops! We couldn't find that page."}),l.jsx("p",{className:"text-sm text-gray-500 mb-6",children:"The page you're looking for doesn't exist or may have been moved."}),l.jsxs("div",{className:"flex flex-col space-y-3",children:[l.jsxs(xe,{variant:"default",onClick:()=>e("/"),className:"w-full",children:[l.jsx(ed,{className:"mr-2 h-4 w-4"}),"Return to Home"]}),l.jsx(xe,{variant:"outline",onClick:()=>e(-1),className:"w-full",children:"Go Back"})]})]})})};function Sm(n){if(!n)return null;const e=n.split(".");if(e.length!==3)return null;try{return JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/"))).aal??null}catch{return null}}function RD(){const{user:n,session:e}=Dt(),[t,r]=y.useState({roles:[],allowedKeys:new Set,mfaSatisfied:!1,loading:!0});y.useEffect(()=>{let v=!1;if(!n){r({roles:[],allowedKeys:new Set,mfaSatisfied:!1,loading:!1});return}return(async()=>{const[b,m]=await Promise.all([_e.from("user_roles").select("role").eq("user_id",n.id),_e.from("role_permissions").select("role,permission_key,allowed")]);if(v)return;const g=(b.data??[]).map(P=>P.role),x=new Set,S=m.data??[];for(const P of g)for(const C of S)C.role===P&&C.allowed&&x.add(C.permission_key);const E=Sm(e==null?void 0:e.access_token);r({roles:g,allowedKeys:x,mfaSatisfied:E==="aal2"||g.includes("super_admin")===!1&&g.length===0,loading:!1})})(),()=>{v=!0}},[n==null?void 0:n.id,e==null?void 0:e.access_token]);const s=t.roles.includes("super_admin"),i=t.roles.includes("operations_admin"),o=t.roles.includes("support_admin"),a=s||i||o,c=y.useCallback(v=>t.loading?!1:s?!0:t.allowedKeys.has(v),[t.allowedKeys,t.loading,s]),u=a&&!s,d=Sm(e==null?void 0:e.access_token),f=!u||d==="aal2",p=y.useMemo(()=>["super_admin","operations_admin","support_admin","org_admin","user"].find(b=>t.roles.includes(b))??null,[t.roles]);return{loading:t.loading,roles:t.roles,primaryRole:p,isSuperAdmin:s,isOperationsAdmin:i,isSupportAdmin:o,isAnyAdmin:a,can:c,mfaSatisfied:f,mfaRequired:u}}const ID="Access Restricted. This action requires Super Admin approval.";function ND({resourceType:n,resourceId:e,attemptedAction:t}){const[r,s]=y.useState(""),[i,o]=y.useState(!1),a=async()=>
541{if(!r.trim()){Ge({title:"Reason required",description:"Briefly describe why you need this access.",variant:"destructive"});return}o(!0);const{data:c,error:u}=await _e.functions.invoke("admin-escalate-request",{body:{requested_action:t??n??"restricted_access",resource_type:n,resource_id:e,reason:r,urgency:"normal"}});if(o(!1),u||c&&c.success===!1){Ge({title:"Could not send request",description:(u==null?void 0:u.message)??(c==null?void 0:c.error)??"Try again later",variant:"destructive"});return}Ge({title:"Request sent",description:"Super Admin has been notified."}),s("")};return l.jsx("div",{className:"flex min-h-[60vh] items-center justify-center p-6",children:l.jsxs("div",{className:"max-w-lg w-full bg-card border rounded-lg p-8 shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx(yT,{className:"h-8 w-8 text-destructive"}),l.jsx("h1",{className:"text-2xl font-semibold",children:"Access Restricted"})]}),l.jsx("p",{className:"text-muted-foreground mb-6",children:ID}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-sm font-medium block",children:"Request approval"}),l.jsx("textarea",{className:"w-full rounded-md border bg-background p-3 text-sm min-h-[100px]",placeholder:"Reason for needing this access...",value:r,onChange:c=>s(c.target.value)}),l.jsx(xe,{onClick:a,disabled:i,className:"w-full",children:i?"Sending...":"Request Super Admin approval"})]})]})})}function kt({children:n,permission:e}){const{loading:t,isAnyAdmin:r,isSuperAdmin:s,can:i,mfaRequired:o,mfaSatisfied:a}=RD(),c=y.useRef(!1);return y.useEffect(()=>{r&&(c.current=!0)},[r]),t?l.jsx("div",{className:"flex items-center justify-center min-h-screen",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary","aria-label":"Loading"})}):!r&&!c.current?l.jsx(Ai,{to:"/dashboard",replace:!0}):o&&!a?l.jsx(Ai,{to:"/admin/mfa-enroll",replace:!0}):e&&!i(e)&&!s?l.jsx(ND,{attemptedAction:e,resourceType:"route"}):l.jsx(l.Fragment,{children:n})}const DD=()=>{const n=wr(),{isAdmin:e}=Lv();return y.useEffect(()=>{var s;const t=window.location.hostname;if(!(t==="localhost"||t==="127.0.0.1"||e)){console.debug("[Ahrefs Analytics] SPA route change:",n.pathname);try{(s=window.AhrefsAnalytics)!=null&&s.sendEvent&&window.AhrefsAnalytics.sendEvent("spa_pageview")}catch{}}},[n.pathname,e]),null},MD={"/dashboard":{title:"Dashboard - The Gazel | AI-Powered Tax Management",description:"View your financial overview, track income and expenses, monitor tax liabilities, and get AI-powered insights on your dashboard with The Gazel.",keywords:"tax dashboard, financial overview, income tracking, expense tracking, tax liability, AI insights, financial management",canonical:"https://www.thegazel.com/dashboard"},"/transactions":{title:"Transactions - The Gazel | Track Income & Expenses",description:"Manage and track all your financial transactions, categorize expenses, and identify potential tax deductions with The Gazel's intelligent transaction management.",keywords:"transaction tracking, expense management, income tracking, financial transactions, expense categorization, receipt scanning",canonical:"https://www.thegazel.com/transactions"},"/reports":{title:"Financial Reports - The Gazel | Tax & Financial Analytics",description:"Generate comprehensive financial reports, analyze spending patterns, and prepare tax documentation with The Gazel's advanced reporting tools.",keywords:"financial reports, tax reports, spending analysis, financial analytics, business reports, tax documentation",canonical:"https://www.thegazel.com/reports"},"/deductions":{title:"Tax Deductions - The Gazel | AI-Powered Deduction Finder",description:"Discover and maximize your tax deductions with AI-powered suggestions. Track business expenses, charitable donations, and more with The Gazel.",keywords:"tax deductions, business deductions, charitable donations, AI deduction finder, tax savings, expense deductions",canonical:"https://www.thegazel.com/deductions"},"/deductions-list":{title:"Deductions List - The Gazel | Manage Your Tax Deductions",description:"View and manage all your tax deductions in one place. Edit, verify, and optimize your deductions for maximum tax savings with The Gazel.",keywords:"deductions list, tax deduction management, deduction verification, tax optimization, deduction tracking",canonical:"https://www.thegazel.com/deductions-list"},"/tax-estimates":{title:"Tax Estimates - The Gazel | Calculate Your Tax Liability",description:"Get accurate tax estimates and projections for the current year. Plan ahead and avoid surprises with The Gazel's intelligent tax calculation engine.",keywords:"tax estimates, tax calculator, tax liability, tax planning, tax projections, quarterly taxes",canonical:"https://www.thegazel.com/tax-estimates"},"/budgeting":{title:"Budgeting - The Gazel | Smart Financial Planning",description:"Create and manage budgets, track spending goals, and get insights into your financial habits with The Gazel's intelligent budgeting tools.",keywords:"budgeting, financial planning, budget tracking, spending goals, financial habits, money management",canonical:"https://www.thegazel.com/budgeting"}
541,"/analytics":{title:"Analytics - The Gazel | Financial Data Insights",description:"Analyze your financial data with advanced analytics, charts, and insights. Make informed financial decisions with The Gazel's powerful analytics dashboard.",keywords:"financial analytics, data insights, financial charts, spending analytics, income analytics, financial trends",canonical:"https://www.thegazel.com/analytics"},"/calendar":{title:"Financial Calendar - The Gazel | Tax Deadlines & Reminders",description:"Stay organized with tax deadlines, financial milestones, and important dates. Never miss a tax deadline with The Gazel's financial calendar.",keywords:"tax calendar, financial calendar, tax deadlines, financial reminders, tax planning calendar",canonical:"https://www.thegazel.com/calendar"},"/settings":{title:"Settings - The Gazel | Account & Preferences",description:"Manage your account settings, preferences, and subscription with The Gazel. Customize your tax management experience.",keywords:"account settings, user preferences, subscription management, profile settings, notification settings",canonical:"https://www.thegazel.com/settings"},"/knowledge-base":{title:"Knowledge Base - The Gazel | Tax Help & Resources",description:"Access comprehensive tax guides, tutorials, and resources. Get expert tax advice and learn how to maximize your tax savings with The Gazel.",keywords:"tax knowledge base, tax help, tax guides, tax tutorials, tax resources, tax education",canonical:"https://www.thegazel.com/knowledge-base"},"/referrals":{title:"Referral Program - The Gazel | Earn Rewards",description:"Join The Gazel referral program and earn rewards for referring friends and family. Share the benefits of AI-
541powered tax management.",keywords:"referral program, earn rewards, refer friends, tax software referral, rewards program",canonical:"https://www.thegazel.com/referrals"},"/compliance":{title:"Compliance Center - The Gazel | Tax Compliance & Regulations",description:"Stay compliant with tax regulations and requirements. Access compliance tools and resources with The Gazel's compliance center.",keywords:"tax compliance, tax regulations, compliance tools, tax requirements, regulatory compliance",canonical:"https://www.thegazel.com/compliance"},"/tax-strategy-planning":{title:"Tax Strategy Planning - The Gazel | Enterprise Tax Solutions",description:"Advanced tax strategy planning for businesses and high-net-worth individuals. Optimize your tax strategy with The Gazel's enterprise solutions.",keywords:"tax strategy planning, enterprise tax solutions, business tax planning, tax optimization, strategic tax planning",canonical:"https://www.thegazel.com/tax-strategy-planning"},"/ai-consultations":{title:"AI Consultations - The Gazel | Personalized Tax Advice",description:"Get personalized tax advice and consultations powered by AI. Receive expert guidance tailored to your specific financial situation.",keywords:"AI tax consultations, personalized tax advice, AI tax advisor, tax consultation, automated tax advice",canonical:"https://www.thegazel.com/ai-consultations"},"/custom-reports":{title:"Custom Reports - The Gazel | Tailored Financial Reporting",description:"Create custom financial and tax reports tailored to your specific needs. Generate professional reports with The Gazel's advanced reporting engine.",keywords:"custom reports, tailored reports, financial reporting, custom tax reports, business reports",canonical:"https://www.thegazel.com/custom-reports"},"/data-export":{title:"Data Export - The Gazel | Export Your Financial Data",description:"Export your financial data in various formats for external use. Maintain control of your data with The Gazel's flexible export options.",keywords:"data export, financial data export, tax data export, data portability, export formats",canonical:"https://www.thegazel.com/data-export"},"/priority-support":{title:"Priority Support - The Gazel | Premium Customer Support",description:"Access premium customer support with priority response times. Get expert help when you need it with The Gazel's priority support service.",keywords:"priority support, premium support, customer service, technical support, tax software support",canonical:"https://www.thegazel.com/priority-support"},"/demo-guide":{title:"Demo Guide - The Gazel | Step-by-Step Walkthrough",description:"Follow a step-by-step demo guide to explore onboarding, transactions, deductions, reports, and tax estimates in The Gazel.",keywords:"demo guide, product tour, step by step, tax demo, onboarding, transactions, deductions, reports, tax estimates",canonical:"https://www.thegazel.com/demo-guide"}},LD=()=>({title:"The Gazel - AI-Powered Tax Management & Financial Planning",description:"Simplify your tax preparation with AI-powered insights. Track expenses, identify deductions, and optimize your tax strategy with The Gazel.",keywords:"tax management, AI tax software, financial planning, tax deductions, expense tracking, income tracking, tax estimates, business taxes, personal taxes, tax optimization",canonical:"https://www.thegazel.com"}),FD={"@context":"https://schema.org","@type":"Organization",name:"Gazel",url:"https://www.thegazel.com",logo:"https://www.thegazel.com/icons/icon-512x512.png"};function $D(n){return{"@context":"https://schema.org","@type":"WebSite",name:n.title||"The Gazel",url:n.url||"https://www.thegazel.com",potentialAction:{"@type":"SearchAction",target:"https://www.thegazel.com/knowledge-base?q={search_term_string}","query-input":"required name=search_term_string"}}}function UD(n){return{"@context":"https://schema.org","@type":"SoftwareApplication",name:n.title||"Gazel",operatingSystem:"Web",applicationCategory:"BusinessApplication",description:n.description||"AI-powered tax management and expense tracking.",offers:{"@type":"Offer",priceCurrency:"USD",price:"0",url:n.url,availability:"https://schema.org/InStock"}}}function zD(n){return{"@context":"https://schema.org","@type":"CollectionPage",name:n.title,url:n.url,description:n.description,isPartOf:"https://www.thegazel.com"}}function VD(n,e={}){const t=[FD,$D(e)];return n==="/products"?[...t,UD(e)]:n==="/knowledge-base"?[...t,zD(e)]:t}const q0="https://www.thegazel.com",BD=["/admin","/auth","/reset-password","/auth-success","/demo-guide","/analytics"];function qD(n){return BD.some(e=>n.startsWith(e))}function GD(n){return[{href:`${q0}${n}`,hreflang:"x-default"}]}const HD=()=>
541{const n=wr(),{pathname:e}=n,t=MD[e]??LD(),r=t==null?void 0:t.title,s=t==null?void 0:t.description,i=t==null?void 0:t.keywords,o=(t==null?void 0:t.canonical)||`${q0}${e}`,c=qD(e)?"noindex, nofollow":"index, follow",u=GD(e),d=VD(e,{title:r,description:s,url:o});return l.jsxs(Sa,{children:[r&&l.jsx("title",{children:r}),s&&l.jsx("meta",{name:"description",content:s}),i&&l.jsx("meta",{name:"keywords",content:i}),l.jsx("link",{rel:"canonical",href:o}),l.jsx("meta",{name:"robots",content:c}),r&&l.jsx("meta",{property:"og:title",content:r}),s&&l.jsx("meta",{property:"og:description",content:s}),l.jsx("meta",{property:"og:url",content:o}),l.jsx("meta",{property:"og:type",content:"website"}),r&&l.jsx("meta",{name:"twitter:title",content:r}),s&&l.jsx("meta",{name:"twitter:description",content:s}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),u.map(f=>l.jsx("link",{rel:"alternate",hrefLang:f.hreflang,href:f.href},f.hreflang)),d.map((f,p)=>l.jsx("script",{type:"application/ld+json",children:JSON.stringify(f)},p))]})},WD=()=>{const n=Wi();return l.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[l.jsxs("main",{children:[l.jsxs("section",{className:"relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-transparent to-secondary/10 pointer-events-none"}),l.jsx("div",{className:"container mx-auto px-4 py-20 md:py-32 relative z-10",children:l.jsxs("div",{className:"max-w-4xl mx-auto text-center space-y-8",children:[l.jsx(ws,{size:"lg",className:"justify-center mb-6"}),l.jsxs("h1",{className:"text-4xl md:text-6xl font-extrabold tracking-tight leading-tight",children:["The Operating System for"," ",l.jsx("span",{className:"bg-gradient-to-r from-primary to-teal-500 bg-clip-text text-transparent",children:"Your Financial Life"})]}),l.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"Go beyond taxes. Track, plan, optimize, and grow with AI-powered financial intelligence — for personal, business, and ministry use."}),l.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 pt-4",children:[l.jsxs(xe,{size:"lg",onClick:()=>n("/auth"),className:"shadow-lg text-base px-8",children:[l.jsx(xT,{className:"h-5 w-5 mr-2"}),"Get Started Free",l.jsx(go,{className:"h-4 w-4 ml-2"})]}),l.jsx(xe,{variant:"outline",size:"lg",className:"text-base px-8",onClick:()=>{var e;return(e=document.getElementById("features"))==null?void 0:e.scrollIntoView({behavior:"smooth"})},children:"Explore Features"}),l.jsxs(xe,{variant:"ghost",size:"lg",className:"text-base text-primary",onClick:()=>n("/faith"),children:["For Churches & Nonprofits",l.jsx(tv,{className:"h-4 w-4 ml-1"})]})]})]})})]}),l.jsx("section",{className:"py-20 bg-muted/30",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-4",children:"Why The Gazel?"}),l.jsx("p",{className:"text-muted-foreground text-center max-w-xl mx-auto mb-12",children:"Everything you need to take control of your finances in one intelligent platform."}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto",children:[{icon:Sh,title:"Financial Tracking",desc:"See every dollar in and out — across accounts, categories, and time periods.",color:"text-blue-600",bg:"bg-blue-500/10"},{icon:wh,title:"AI Insights & Analytics",desc:"Surface trends, anomalies, and opportunities you would otherwise miss.",color:"text-purple-600",bg:"bg-purple-500/10"},{icon:Xo,title:"Tax Optimization",desc:"Maximize deductions, estimate liability, and stay compliant year-round.",color:"text-green-600",bg:"bg-green-500/10"},{icon:Oc,title:"Faith & Nonprofit Transparency",desc:"Give donors and members full visibility into stewardship and giving.",color:"text-rose-600",bg:"bg-rose-500/10"}].map(e=>l.jsx(zr,{className:"border-0 shadow-lg hover:shadow-xl transition-shadow duration-300",children:l.jsxs(hr,{className:"p-6 text-center space-y-4",children:[l.jsx("div",{className:`${e.bg} rounded-full w-14 h-14 flex items-center justify-center mx-auto`,children:l.jsx(e.icon,{className:`h-7 w-7 ${e.color}`})}),l.jsx("h3",{className:"text-lg font-semibold",children:e.title}),l.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]})}
541,e.title))})]})}),l.jsx("section",{className:"py-20",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-4",children:"One platform. Multiple financial workflows."}),l.jsx("p",{className:"text-muted-foreground text-center max-w-xl mx-auto mb-12",children:"Whether you're an individual, a business owner, or a ministry leader — The Gazel adapts to you."}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 max-w-5xl mx-auto",children:[{icon:rT,title:"Personal Finance",desc:"Budget, track expenses, and plan for the future."},{icon:kl,title:"Business Tracking",desc:"Monitor income, expenses, and profitability in real-time."},{icon:Oi,title:"Tax Preparation",desc:"Organize deductions, generate reports, and file with confidence."},{icon:Cl,title:"Project & Task Planning",desc:"Plan initiatives, assign tasks, and track milestones."},{icon:Zo,title:"Donation Reporting",desc:"Record contributions, generate statements, and thank donors."},{icon:kl,title:"Church & Nonprofit",desc:"Full financial transparency for ministries and organizations."}].map(e=>l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"p-3 bg-primary/10 rounded-lg shrink-0",children:l.jsx(e.icon,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold mb-1",children:e.title}),l.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]})]},e.title))})]})}),l.jsx("section",{id:"features",className:"py-20 bg-muted/30",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-4",children:"Powerful Modules, One Platform"}),l.jsx("p",{className:"text-muted-foreground text-center max-w-xl mx-auto mb-12",children:"A comprehensive toolkit for every financial need."}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto",children:[{icon:Sh,title:"Income & Expense Tracking"},{icon:ET,title:"Smart Categorization"},{icon:Oi,title:"Tax Reports & Deductions"},{icon:lT,title:"Financial Dashboard"},{icon:Cl,title:"Planner & Tasks"},{icon:td,title:"Receipt Management"},{icon:Oc,title:"Donation Tracking"},{icon:Qo,title:"GazelFaith Reporting"}].map(e=>l.jsx(zr,{className:"border-0 shadow-md hover:shadow-lg transition-shadow duration-300",children:l.jsxs(hr,{className:"p-5 flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-primary/10 rounded-md",children:l.jsx(e.icon,{className:"h-5 w-5 text-primary"})}),l.jsx("span",{className:"font-medium text-sm",children:e.title})]})},e.title))})]})}),l.jsx("section",{className:"py-20",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"max-w-5xl mx-auto bg-gradient-to-br from-primary/5 via-secondary/10 to-transparent rounded-2xl p-8 md:p-14 flex flex-col md:flex-row items-center gap-10",children:[l.jsxs("div",{className:"flex-1 space-y-6",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Built for churches and nonprofits too"}),l.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"GazelFaith helps ministries and nonprofit organizations improve stewardship, financial transparency, donation reporting, and member contribution visibility."}),l.jsx("ul",{className:"space-y-3",children:["Donation tracking","Contribution records","Financial reports","Member visibility","Transparency tools"].map(e=>l.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[l.jsx(nv,{className:"h-4 w-4 text-primary shrink-0"}),l.jsx("span",{children:e})]},e))}),l.jsxs(xe,{onClick:()=>n("/faith"),className:"mt-2",children:["Explore GazelFaith",l.jsx(go,{className:"h-4 w-4 ml-2"})]})]}),l.jsxs("div",{className:"flex-shrink-0 p-6 bg-card rounded-xl shadow-lg text-center space-y-3",children:[l.jsx(Oc,{className:"h-16 w-16 text-primary mx-auto"}),l.jsx("p",{className:"text-lg font-semibold",children:"GazelFaith"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Non-Profit & Religious Finance"})]})]})})}),l.jsx("section",{className:"py-20 bg-muted/30",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",children:"How It Works"}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 max-w-4xl mx-auto",children:[{step:"1",icon:TT,title:"Connect Your Data",desc:"Upload statements, receipts, or enter transactions manually."},{step:"2",icon:Eh,title:"AI Organizes & Analyzes",desc:"Smart categorization, deduction detection, and trend anal
541ysis — automatically."},{step:"3",icon:Qo,title:"View Insights & Act",desc:"Dashboards, reports, and action plans to improve your financial health."}].map(e=>l.jsxs("div",{className:"text-center space-y-4",children:[l.jsx("div",{className:"w-14 h-14 rounded-full bg-primary text-primary-foreground flex items-center justify-center mx-auto text-xl font-bold",children:e.step}),l.jsx(e.icon,{className:"h-8 w-8 text-primary mx-auto"}),l.jsx("h3",{className:"font-semibold text-lg",children:e.title}),l.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]},e.step))})]})}),l.jsx("section",{className:"py-20",children:l.jsxs("div",{className:"container mx-auto px-4",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",children:"Built for Trust"}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 max-w-5xl mx-auto mb-16",children:[{icon:sv,title:"Secure Data Handling",desc:"Bank-level encryption and privacy controls."},{icon:Eh,title:"Real Financial Workflows",desc:"Designed by people who understand finance."},{icon:Zo,title:"For Everyone",desc:"Individuals, businesses, churches, and nonprofits."},{icon:wh,title:"AI-Powered",desc:"Intelligent reporting and predictive insights."}].map(e=>l.jsxs("div",{className:"text-center space-y-3",children:[l.jsx("div",{className:"p-3 bg-primary/10 rounded-full w-fit mx-auto",children:l.jsx(e.icon,{className:"h-6 w-6 text-primary"})}),l.jsx("h3",{className:"font-semibold",children:e.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:e.desc})]},e.title))}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 max-w-5xl mx-auto",children:[{quote:"The Gazel simplified our entire bookkeeping process. We save hours every week.",name:"Small Business Owner"},{quote:"GazelFaith gave our congregation full transparency — giving went up 30%.",name:"Church Administrator"},{quote:"Tax season is no longer stressful. Everything is organized and ready to go.",name:"Freelancer"}].map(e=>l.jsx(zr,{className:"border-0 shadow-md",children:l.jsxs(hr,{className:"p-6 space-y-3",children:[l.jsxs("p",{className:"text-sm italic text-muted-foreground",children:['"',e.quote,'"']}),l.jsxs("p",{className:"text-xs font-semibold",children:["— ",e.name]})]})},e.name))})]})}),l.jsx("section",{className:"py-20 bg-muted/30",children:l.jsxs("div",{className:"container mx-auto px-4 text-center max-w-3xl space-y-6",children:[l.jsx("div",{className:"p-3 bg-primary/10 rounded-full w-fit mx-auto",children:l.jsx(Zg,{className:"h-6 w-6 text-primary"})}),l.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Latest from Our Blog"}),l.jsx("p",{className:"text-muted-foreground text-lg",children:"Tips, guides, and insights on financial management, tax optimization, and church stewardship."}),l.jsxs(xe,{size:"lg",variant:"outline",onClick:()=>n("/blog"),className:"text-base px-8",children:["Read Our Blog",l.jsx(go,{className:"h-4 w-4 ml-2"})]})]})}),l.jsx("section",{className:"py-20 bg-gradient-to-br from-primary/10 via-secondary/5 to-muted/20",children:l.jsxs("div",{className:"container mx-auto px-4 text-center max-w-3xl space-y-6",children:[l.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Stop using disconnected tools to manage your finances."}),l.jsx("p",{className:"text-muted-foreground text-lg",children:"Bring your tracking, planning, reporting, and insights into one intelligent platform."}),l.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 pt-4",children:[l.jsxs(xe,{size:"lg",onClick:()=>n("/auth"),className:"text-base px-8 shadow-lg",children:["Get Started Free",l.jsx(go,{className:"h-4 w-4 ml-2"})]}),l.jsx(xe,{variant:"outline",size:"lg",onClick:()=>n("/products"),className:"text-base px-8",children:"Learn More"})]})]})})]}),l.jsx("footer",{className:"w-full bg-muted/30 border-t border-border py-8",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4 text-center md:text-left",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," The Gazel. All rights reserved."]}),l.jsxs("nav",{className:"flex flex-wrap items-center justify-center gap-x-6 gap-y-2",children:[l.jsx(jt,{to:"/privacy",className:"text-sm text-muted-foreground hover:text-primary hover:underline transition-colors",children:"Privacy Policy"}),l.jsx(jt,{to:"/privacy",className:"text-sm text-muted-foreground hover:text-primary hover:underline transition-colors",children:"Terms of Service"}),l.jsx(jt,{to:"/privacy?tab=ccpa",className:"text-sm text-muted-foreground hover:text-primary hover:underline transition-colors",children:"CCPA Privacy Rights"}),l.jsx("a",{href:"mailto:[email protected]",className:"text-sm text-muted-foreground hover:text-primary hover:underline transition-colors",children:"Contact Support"})]})]})})})]})};class JD extends y.Component{constructor(t){super(t);he(this,"handleReset",()=>{const{onReset:t}=this.props;this.setState({hasError:!1,error:null}),t&&t()});this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){PD(t,{component:"ErrorBoundary",react:r,stack:t.stack})}render(){const{hasError:t,error:r}=this.state,{children:s,fallback:i}=this.props;return t?i||l.jsx("div",{className:"p-6 flex justify-center items-center min-h-[400px]",children:l.jsxs("div",{className:"w-full max-w-md",children:[l.jsxs(Rn,{variant:"destructive",className:"mb-4",children:[l.jsx(ji,{className:"h-4 w-4 mt-1"}),l.jsx(j0,{children:"Something went wrong"}),l.jsx(In,{className:"mt-2",children:"We hit a snag. Please try again. If it continues, contact support."})]}),l.jsx("div",{className:"flex justify-center mt-4",children:l.jsxs(xe,{onClick:this.handleReset,className:"flex items-center",children:[l.jsx(iv,{className:"mr-2 h-4 w-4"}),"Try again"]})})]})}):s}}const hl="lazy-import-reload-path";function YD(n){return n instanceof Error&&(n.message.includes("Failed to fetch dynamically imported module")||n.message.includes("Importing a module script failed")||n.message.includes("error loading dynamically imported module"))}function J(n,e=2,t=800){const r=async(s=0)=>{try{const i=await n();return typeof window<"u"&&window.sessionStorage.removeItem(hl),i}catch(i){if(s<e)return await new Promise(o=>setTimeout(o,t*(s+1))),r(s+1);if(typeof window<"u"&&YD(i)){const o=`${window.location.pathname}${window.location.search}`;if(window.sessionStorage.getItem(hl)!==o)return window.sessionStorage.setItem(hl,o),window.location.reload(),new Promise(()=>{})}throw i}};return Y.lazy(r)}const KD=J(()=>H(()=>import("./Dashboard-TFblRLTt.js"),__vite__mapDeps([2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),QD=J(()=>H(()=>import("./Transactions-DUhtMHHS.js"),__vite__mapDeps([21,3,1,11,9,6,8,22,23,24,25,26,27,28,15,10,29,30,31,32,19,17,33,34,35,36,16,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]))),XD=J(()=>H(()=>import("./Deductions-CMcJFZYp.js"),__vite__mapDeps([57,3,1,11,12,10,9,58,59,6,60,61,40,38,30,62,63,14,64,65,66,67,68,8,69,41,70,56,71]))),ZD=J(()=>H(()=>import("./Reports-i5_2uXef.js"),__vite__mapDeps([72,3,1,73,74,75,23,76,77,24,46,67,61,62,13,14,15,16,11,78,79,80,81,9,30,82,83,6]))),eM=J(()=>H(()=>import("./Settings-ev3mWkP7.js"),__vite__mapDeps([84,3,1,29,4,85,86,40,6,87,60,69,36,41,88,89,8,15,54,90,18,65]))),tM=J(()=>H(()=>import("./BusinessSettingsPage-C0suO1so.js"),__vite__mapDeps([91,3,1,63,6,92,40,93,94,56,95,8,41,22,23,24,64,96]))),nM=J(()=>H(()=>import("./Products-Crn-r-Ab.js"),__vite__mapDeps([97,3,1,6,29,98,99,100,60]))),rM=J(()=>H(()=>import("./Analytics-CYBjf6jo.js"),__vite__mapDeps([101,3,1,79,102,80,81,22,23,24,75,61,11,12,42,43,44,45,46,47,48,49,50,103,104,51,105,14,106,9,38,6]))),sM=J(()=>H(()=>import("./Calendar-DPSbw0Em.js"),__vite__mapDeps([107,3,1,108,24,23,42,22,43,44,45,46,47,48,49,50,75,59,10,71,109,63,51,29,38,41,36,110,6]))),iM=J(()=>H(()=>import("./Budgeting-BAqZWcDy.js"),__vite__mapDeps([111,3,1,40,74,75,23,76,77,24,46,10,9,56,22,30,79,104,63,36,71,41,58,59,6,60,66,61,102,80,81,78,26,11,8,112,37]))),oM=J(()=>H(()=>import("./KnowledgeBase-pCY98Do1.js"),__vite__mapDeps([113,3,1,114,105,52,115,116,64,106,42,22,23,24,43,44,45,46,47,48,49,50,51,14,6]))),aM=J(()=>H(()=>import("./AuthSuccess-CVD851e8.js"),__vite__mapDeps([117,3,1,6]))),cM=J(()=>H(()=>import("./PaymentSuccess-C8TTX1ks.js"),__vite__mapDeps([118,3,1,6]))),lM=J(()=>H(()=>import("./PaymentCanceled-CrLg-w-R.js"),__vite__mapDeps([119,3,1,69,6])
541)),uM=J(()=>H(()=>import("./ResetPassword-BSXMswF6.js"),__vite__mapDeps([120,3,1,6]))),dM=J(()=>H(()=>import("./Privacy-eSMcHC4U.js"),__vite__mapDeps([121,3,1,6]))),hM=J(()=>H(()=>import("./Terms-CktJcd8z.js"),__vite__mapDeps([122,3,1,6]))),fM=J(()=>H(()=>import("./TaxEstimates-DmU8fRWc.js"),__vite__mapDeps([123,3,1,36,9,93,12,94,28,55,39,40,15,71,17,30,124,37,41,6,8]))),pM=J(()=>H(()=>import("./TaxDocuments-BUJ5FCmg.js"),__vite__mapDeps([125,3,1,93,94,29,40,37,95,41,6]))),mM=J(()=>H(()=>import("./TaxFilingStatus-BHsfn70t.js"),__vite__mapDeps([126,3,1,28,6]))),gM=J(()=>H(()=>import("./ComplianceCenter-AtcszdIy.js"),__vite__mapDeps([127,3,1,6,30,64,55,65,22,23,24,20,41,8,128]))),vM=J(()=>H(()=>import("./TaxStrategyPlanning-BQeGojN0.js"),__vite__mapDeps([129,3,1,58,59,6,60,9,130,71,17,38,10,62,131,63,55]))),yM=J(()=>H(()=>import("./AIConsultations-wD3b-jUc.js"),__vite__mapDeps([132,3,1,58,59,6,60,20,38,10,62,131,63,55]))),bM=J(()=>H(()=>import("./CustomReports-BkkaR8NW.js"),__vite__mapDeps([133,3,1,58,59,6,60,73,74,75,23,76,77,24,46,38,9,115,90,41,10,62,131,63,55]))),wM=J(()=>H(()=>import("./DataExport-K8XjOkO7.js"),__vite__mapDeps([134,3,1,38,10,58,59,6,60,73,74,75,23,76,77,24,46,67,61,62,65,131,63,55]))),xM=J(()=>H(()=>import("./PrioritySupport-8fZnzojA.js"),__vite__mapDeps([135,3,1,38,10,62,131,63,58,59,6,60,55]))),_M=J(()=>H(()=>import("./LinkedAccounts-CKOFCkwv.js"),__vite__mapDeps([136,3,1,27,28,15,10,11,29,30,31,32,19,17,33,8,34,35,36,16,37,69,9,14,54,41,22,23,24,6]))),SM=J(()=>H(()=>import("./BusinessProjections-CzIRdgjx.js"),__vite__mapDeps([137,3,1,30,93,94,138,46,23,24,22,13,14,15,16,11,79,102,80,81,8,103,105,95,6]))),EM=J(()=>H(()=>import("./Planner-Dq9Czicc.js"),__vite__mapDeps([139,3,1,6,140,93,94,41,141,38,20,64,68,142]))),TM=J(()=>H(()=>import("./PlannerBoard-ky6G6K1J.js"),__vite__mapDeps([143,3,1,93,94,140,42,22,23,24,43,44,45,46,47,48,49,50,51,10,124,144,41,20,30,145,138,146,105,38,95,79,80,81,104,64,6,110,98]))),kM=J(()=>H(()=>import("./Referrals-BsATvo1j.js"),__vite__mapDeps([147,3,1,7,36,59,148,149,35,6]))),CM=J(()=>H(()=>import("./MileageTracking-caUL6G-q.js"),__vite__mapDeps([150,3,1,70,12,17,22,23,24,42,43,44,45,46,47,48,49,50,51,69,8,20,37,41,86,151,115,29,52,95,76,77,6]))),AM=J(()=>H(()=>import("./Invoicing-C-Ru3pId.js"),__vite__mapDeps([152,3,1,93,94,46,23,24,43,50,48,4,55,20,29,41,22,30,40,28,124,90,56,17,36,62,82,19,6]))),PM=J(()=>H(()=>import("./CPADashboard-C0DzWrXz.js"),__vite__mapDeps([153,3,1,73,74,75,23,76,77,24,46,9,38,141,30,40,90,154,35,155,69,41,22,6,8,33,10,12,67,61,62,83,20,16,17,128]))),jM=J(()=>H(()=>import("./CPAView-1D5aIfqg.js"),__vite__mapDeps([156,3,1,30,67,61,62,6,8,90,16,17,22,23,24,155]))),OM=J(()=>H(()=>import("./DemoGuide-hHbcvEjr.js"),__vite__mapDeps([157,3,1,6,5,10,114,115,52,112]))),RM=J(()=>H(()=>import("./Blog-C-4HWBvg.js"),__vite__mapDeps([158,3,1,159,160,6]))),IM=J(()=>H(()=>import("./BlogPost-BQWNutLk.js"),__vite__mapDeps([161,3,1,160,6,159,55,148,35,25]))),NM=J(()=>H(()=>import("./AdminCommunications-BP1uwMJh.js"),__vite__mapDeps([162,3,1,36,35,10,64,15,28,38,69,30,40,159,20,90,37,41,22,23,24,29,95,8,148,6]))),DM=J(()=>H(()=>import("./AdminOrganizations-RTGuTxDF.js"),__vite__mapDeps([163,3,1,30,6]))),MM=J(()=>H(()=>import("./Admin-B8v6fYqQ.js"),__vite__mapDeps([164,3,1,6,112,165]))),LM=J(()=>H(()=>import("./EmailTest-19vcUWVt.js"),__vite__mapDeps([166,3,1,8,6]))),FM=J(()=>H(()=>import("./AdminEmailCampaigns-DwXMp7S4.js"),__vite__mapDeps([167,3,1,130,15,8,6]))),$M=J(()=>H(()=>import("./AdminPaymentRecovery-CfGMwNV5.js"),__vite__mapDeps([168,3,1,17,8,15,6]))),UM=J(()=>H(()=>import("./AdminConversion-DHCouKLV.js"),__vite__mapDeps([169,3,1,130,6]))),zM=J(()=>H(()=>import("./AdminMonitoring-Dflz8o_2.js"),__vite__mapDeps([170,3,1,115,65,165,8,79,102,80,81,22,23,24,34,6]))),VM=J(()=>H(()=>import("./AdminSecurity-cPGJMsrl.js"),__vite__mapDeps([171,3,1,165,8,22,23,24,6]))),BM=J(()=>H(()=>import("./AdminRBAC-CohYCo5N.js"),__vite__mapDeps([172,3,1,6]))),qM=J(()=>H(()=>import("./AdminMfaEnroll-DY7h5Wd_.js"),__vite__mapDeps([173,3,1,6]))),GM=J(()=>H(()=>import("./Install-CDWolx5U.js"),__vite__mapDeps([174,3,1,53,86,154,151,6]))),HM=J(()=>H(()=>import("./Projects-Cc_TbVys.js"),__vite__mapDeps([175,3,1,6,140,93,94,10,40,41,141,22,23,24,64,176,20,15,43,38,29,36,130,8,109,95,52,49,146,142,98]))),WM=J(()=>H(()=>import("./ProjectBoard-jF9_fUdf.js"),__vite__mapDeps([177,3,1,93,94,176,51,23,22,24,43,146,145,30,10,14,25,41,178,105,29,20,8,47,48,46,116,90,83,55,85,108,45,62,140,6,95,35,141,98]))),Em=J(()=>H(()=>import("./ProjectsSubscriptionGate-C6ZxMpnX.js"),__vite__mapDeps([179,3,1,6,88,89,18,99,100,98,142]))),JM=J(()=>H(()=>import("./FaithLayout-CAfjTPhh.js"),__vite__mapDeps([180,3,1,6,17,178,181,54,182]))),Tm=J(()=>H(()=>import("./FaithDashboardPage-DLirdeeY.js"),__vite__mapDeps([183,3,1,184,93,94,185,186,6,23,79,80,81,24,76,22,17]))),YM=J(()=>H(()=>import("./FaithUploadPage-BB1sHh-r.js"),__vite__mapDeps([187,3,1,40,93,94,38,30,28,188,89,144,189,8,115,41,69,6])
541)),KM=J(()=>H(()=>import("./FaithSettingsPage-C-Rbhz-Y.js"),__vite__mapDeps([190,3,1,63,6,92,40,93,94,56,95,8,41,22,23,24,64,182,9,36,18,29,191,20,192,69,96]))),QM=J(()=>H(()=>import("./FaithDonorsPage-HjiNjw-L.js"),__vite__mapDeps([193,3,1,185,93,94,194,20,195,196,64,30,38,83,124,56,41,22,23,24,6]))),XM=J(()=>H(()=>import("./FaithDonorMatchesPage-CFMeNYsY.js"),__vite__mapDeps([197,3,1,93,94,194,20,195,38,40,9,149,22,23,24,55,6]))),ZM=J(()=>H(()=>import("./FaithDonationsPage-BJM2APmJ.js"),__vite__mapDeps([198,3,1,184,93,94,185,194,20,195,196,64,30,51,38,62,83,17,124,56,41,22,23,24,6]))),eL=J(()=>H(()=>import("./FaithExpensesPage-8b3-Q7qr.js"),__vite__mapDeps([199,3,1,186,93,94,194,20,195,196,64,30,38,192,124,56,41,22,23,24,6]))),tL=J(()=>H(()=>import("./FaithFundsPage-BVkkgsDR.js"),__vite__mapDeps([200,3,1,93,94,194,20,195,29,30,124,56,41,6]))),nL=J(()=>H(()=>import("./FaithReportsPage-BCX9yTL1.js"),__vite__mapDeps([201,3,1,184,93,94,186,192,194,20,62,31,202,50,46,23,24,17,16,79,80,104,22,138,44,45,76,75,6]))),rL=J(()=>H(()=>import("./FaithStatementsPage-DTkJlq08.js"),__vite__mapDeps([203,3,1,6,204,93,94,185,194,20,195,30,28,40,188,89,189,8,124,90,22,23,24]))),sL=J(()=>H(()=>import("./FaithStatementDetailPage-2Q0t0_Z-.js"),__vite__mapDeps([205,3,1,93,204,94,185,30,36,206,62,207,6,82,56,20]))),iL=J(()=>H(()=>import("./FaithPublicStatementPage-C-u6uNui.js"),__vite__mapDeps([208,3,1,93,30,36,206,207,6,82]))),oL=J(()=>H(()=>import("./FaithPayPage-C8ZRL10f.js"),__vite__mapDeps([209,3,1,6,191,17,128,8,15,69]))),km=J(()=>H(()=>import("./AcceptInvitePage-Di8Gha6C.js"),__vite__mapDeps([210,3,1,6,96,69]))),aL=J(()=>H(()=>import("./FaithFinancialReportPage-GLGlcGKO.js"),__vite__mapDeps([211,3,1,184,93,94,186,194,20,30,62,206,83,23,75,17,16,6]))),cL=J(()=>H(()=>import("./CoopDashboardPage-Pitd1727.js"),__vite__mapDeps([212,3,1,16,213,87,22,23,24,214,6,93,215,94,216,217]))),lL=J(()=>H(()=>import("./CoopContributionsPage-BkoCvxfg.js"),__vite__mapDeps([218,3,1,6,29,30,22,23,24,214,215,93,94,219,213,181,100]))),uL=J(()=>H(()=>import("./CoopLoansPage-DuZZUIwY.js"),__vite__mapDeps([220,3,1,6,214,216,93,94,217,30,54,213,90,22,23,24]))),dL=J(()=>H(()=>import("./CoopLoanDetailPage-Zf-u5Q7m.js"),__vite__mapDeps([221,3,1,6,216,93,94,217,30,22,23,24,214]))),hL=J(()=>H(()=>import("./CoopAdminPage-BOGKa6lt.js"),__vite__mapDeps([222,3,1,79,104,29,30,22,23,24,93,202,50,46,44,214,6,219,94,215,216]))),fL=J(()=>H(()=>import("./CoopReportsPage-Ds_UhKUG.js"),__vite__mapDeps([223,3,1,214,6,215,93,94,216,217,22,23,24]))),pL=J(()=>H(()=>import("./CAPLayout-f16BNrmi.js"),__vite__mapDeps([224,3,1,6,18,189,225]))),mL=J(()=>H(()=>import("./CAPOrgLayout-BbU6LUUZ.js"),__vite__mapDeps([226,3,1,6,71]))),Cm=J(()=>H(()=>import("./CAPApplicationsPage-D6WJW7Fk.js"),__vite__mapDeps([227,3,1,228,93,94,229,90,8,22,23,24,6]))),gL=J(()=>H(()=>import("./CAPVerificationPage-bK8niewN.js"),__vite__mapDeps([230,3,1,228,93,94,229,18,22,23,24,6]))),vL=J(()=>H(()=>import("./CAPPlansPage-CZx0ltZt.js"),__vite__mapDeps([231,3,1,228,93,94,6])
541)),yL=J(()=>H(()=>import("./CAPCostConfigPage-Dz-F48ym.js"),__vite__mapDeps([232,3,1,228,93,94,95,22,23,24,6]))),bL=J(()=>H(()=>import("./CAPLedgerPage-C28-9J11.js"),__vite__mapDeps([233,3,1,228,93,94,229,22,23,24,6]))),wL=J(()=>H(()=>import("./CAPReportsPage-3NQRknO0.js"),__vite__mapDeps([234,3,1,228,93,94,229,6]))),xL=J(()=>H(()=>import("./CAPImpactPage-Dpg-lPAt.js"),__vite__mapDeps([235,3,1,228,93,94,229,17,79,80,81,6]))),_L=J(()=>H(()=>import("./CAPCPAPage-DVdk62jw.js"),__vite__mapDeps([236,3,1,228,93,94,229,189,22,23,24,6]))),SL=J(()=>H(()=>import("./CAPRenewalsPage-Zq4wXdIy.js"),__vite__mapDeps([237,3,1,228,93,94,6]))),EL=J(()=>H(()=>import("./CAPAuditLogPage-b19DS5Ck.js"),__vite__mapDeps([238,3,1,228,93,94,225,22,23,24,6]))),TL=J(()=>H(()=>import("./CAPLandingPage-B2vLf1Jt.js"),__vite__mapDeps([239,3,1,6,71,18]))),kL=J(()=>H(()=>import("./CAPApplyPage-tQ63uqgb.js"),__vite__mapDeps([240,3,1,228,93,94,229,6]))),CL=J(()=>H(()=>import("./CAPStatusPage-DaJBprwa.js"),__vite__mapDeps([241,3,1,93,6,8,69]))),AL=new eC({defaultOptions:{queries:{retry:3,staleTime:1e3*60*5}}}),G0=()=>l.jsx("div",{className:"flex items-center justify-center min-h-screen",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}),PL=()=>{const{session:n,user:e,isLoading:t}=Dt();return t?l.jsx(G0,{}):n&&e?l.jsx(Ai,{to:"/dashboard",replace:!0}):l.jsx(WD,{})};function jL(){return y.useEffect(()=>{console.log("App component mounted"),_E()},[]),l.jsx(tC,{client:AL,children:l.jsx(nC,{children:l.jsx(sC,{children:l.jsx(EC,{children:l.jsx(xC,{children:l.jsx(SC,{children:l.jsx(TC,{children:l.jsxs(e_,{children:[l.jsxs(Sa,{children:[l.jsx("title",{children:"The Gazel - AI-Powered Tax Management"}),l.jsx("meta",{name:"description",content:"Streamline your tax preparation with AI-powered insights and automated expense tracking."})]}),l.jsx(HD,{}),l.jsx(DD,{}),l.jsx(SE,{}),l.jsx(EE,{}),l.jsx(JD,{children:l.jsx(y.Suspense,{fallback:l.jsx(G0,{}),children:l.jsxs(t_,{children:[l.jsx(W,{path:"/",element:l.jsx(PL,{})}),l.jsx(W,{path:"/index",element:l.jsx(Ai,{to:"/",replace:!0})}),l.jsx(W,{path:"/index.html",element:l.jsx(Ai,{to:"/",replace:!0})}),l.jsx(W,{path:"/auth",element:l.jsx(FN,{})}),l.jsx(W,{path:"/auth/success",element:l.jsx(aM,{})}),l.jsx(W,{path:"/payment/success",element:l.jsx(cM,{})}),l.jsx(W,{path:"/payment/canceled",element:l.jsx(lM,{})}),l.jsx(W,{path:"/reset-password",element:l.jsx(uM,{})}),l.jsx(W,{path:"/privacy",element:l.jsx(dM,{})}),l.jsx(W,{path:"/terms",element:l.jsx(hM,{})}),l.jsx(W,{path:"/products",element:l.jsx(nM,{})}),l.jsx(W,{path:"/install",element:l.jsx(GM,{})}),l.jsx(W,{path:"/dashboard",element:l.jsx(ve,{children:l.jsx(KD,{})})}),l.jsx(W,{path:"/transactions",element:l.jsx(ve,{children:l.jsx(QD,{})})}),l.jsx(W,{path:"/deductions",element:l.jsx(ve,{children:l.jsx(XD,{})})}),l.jsx(W,{path:"/reports",element:l.jsx(ve,{children:l.jsx(ZD,{})})}),l.jsx(W,{path:"/settings",element:l.jsx(ve,{children:l.jsx(eM,{})})}),l.jsx(W,{path:"/admin/analytics",element:l.jsx(kt,{children:l.jsx(ve,{children:l.jsx(rM,{})})})}),l.jsx(W,{path:"/calendar",element:l.jsx(ve,{children:l.jsx(sM,{})})}),l.jsx(W,{path:"/budgeting",element:l.jsx(ve,{children:l.jsx(iM,{})})}),l.jsx(W,{path:"/knowledge-base",element:l.jsx(ve,{children:l.jsx(oM,{})})}),l.jsx(W,{path:"/blog",element:l.jsx(ve,{children:l.jsx(RM,{})})}),l.jsx(W,{path:"/blog/:slug",element:l.jsx(ve,{children:l.jsx(IM,{})})}),l.jsx(W,{path:"/admin/demo-guide",element:l.jsx(kt,{children:l.jsx(ve,{children:l.jsx(OM,{})})})}),l.jsx(W,{path:"/admin/email-test",element:l.jsx(kt,{children:l.jsx(ve,{children:l.jsx(LM,{})})})}),l.jsx(W,{path:"/tax-estimates",element:l.jsx(ve,{children:l.jsx(fM,{})})}),l.jsx(W,{path:"/tax-documents",element:l.jsx(ve,{children:l.jsx(pM,{})})}),l.jsx(W,{path:"/tax-filing-status",element:l.jsx(ve,{children:l.jsx(mM,{})})}),l.jsx(W,{path:"/compliance",element:l.jsx(ve,{children:l.jsx(gM,{})})}),l.jsx(W,{path:"/tax-strategy-planning",element:l.jsx(ve,{children:l.jsx(vM,{})})}),l.jsx(W,{path:"/ai-consultations",element:l.jsx(ve,{children:l.jsx(yM,{})})}),l.jsx(W,{path:"/custom-reports",element:l.jsx(ve,{children:l.jsx(bM,{})})}),l.jsx(W,{path:"/data-export",element:l.jsx(ve,{children:l.jsx(wM,{})})}),l.jsx(W,{path:"/priority-support",element:l.jsx(ve,{children:l.jsx(xM,{})})}),l.jsx(W,{path:"/linked-accounts",element:l.jsx(ve,{children:l.jsx(_M,{})})}),l.jsx(W,{path:"/referrals",element:l.jsx(ve,{children:l.jsx(kM,{})})}),l.jsx(W,{path:"/mileage-tracking",element:l.jsx(ve,{children:l.jsx(CM,{})})}),l.jsx(W,{path:"/invoicing",element:l.jsx(ve,{children:l.jsx(AM,{})})}),l.jsx(W,{path:"/cpa-dashboard",element:l.jsx(ve,{children:l.jsx(PM,{})})}),l.jsx(W,{path:"/business-projections",element:l.jsx(ve,{children:l.jsx(SM,{})})}),l.jsx(W,{path:"/planner",element:l.jsx(ve,{children:l.jsx(EM,{})})}),l.jsx(W,{path:"/planner/:planId",element:l.jsx(ve,{children:l.jsx(TM,{})})}),l.jsx(W,{path:"/cpa-view/:accessToken",element:l.jsx(jM,{})}),l.jsx(W,{path:"/admin",element:l.jsx(kt,{children:l.jsx(ve,{children:l.jsx(MM,{})})})}),l.jsx(W,{path:"/admin/communications",element:l.jsx(kt,{children:l.jsx(ve,{children:l.jsx(NM,{})})})}),l.jsx(W,{path:"/admin/organizations",element:l.jsx(kt,{children:l.jsx(ve,{children:l.jsx(DM,{})})})}),l.jsx(W,{path:"/admin/email-campaigns",element:l.jsx(kt,{children:l.jsx(ve,{children:l.jsx(FM,{})})})}),l.jsx(W,{path:"/admin/payment-recovery",element:l.jsx(kt,{permission:"stripe.settings.manage",children:l.jsx(ve,{children:l.jsx($M,{})})})}),l.jsx(W,{path:"/admin/conversion",element:l.jsx(kt,{children:l.jsx(ve,{children:l.jsx(UM,{})})})}),l.jsx(W,{path:"/admin/monitoring",element:l.jsx(kt,{children:l.jsx(ve,{children:l.jsx(zM,{})})})}),l.jsx(W,{path:"/admin/security",element:l.jsx(kt,{permission:"security.logs.full_view",children:l.jsx(ve,{children:l.jsx(VM,{})})})}),l.jsx(W,{path:"/admin/rbac",element:l.jsx(kt,{permission:"rbac.manage",children:l.jsx(ve,{children:l.jsx(BM,{})})})}),l.jsx(W,{path:"/admin/mfa-enroll",element:l.jsx(qM,{})}),l.jsx(W,{path:"/projects",element:l.jsx(ve,{children:l.jsx(Em,{children:l.jsx(HM,{})})})}),l.jsx(W,{path:"/projects/:projectId",element:l.jsx(ve,{children:l.jsx(Em,{children:l.jsx(WM,{})})})}),l.jsx(W,{path:"/business/settings",element:l.jsx(ve,{children:l.jsx(tM,{})})}),l.jsx(W,{path:"/accept-invite",element:l.jsx(km,{})}),l.jsx(W,{path:"/faith/statements/view/:statementId",element:l.jsx(iL,{})}),l.jsx(W,{path:"/faith/accept-invite",element:l.jsx(km,{})}),l.jsxs(W,{path:"/faith",element:l.jsx(ve,{children:l.jsx(JM,{})}),children:[l.jsx(W,{index:!0,element:l.jsx(Tm,{})}),l.jsx(W,{path:"dashboard",element:l.jsx(Tm,{})}),l.jsx(W,{path:"uploads",element:l.jsx(YM,{})}),l.jsx(W,{path:"donors",element:l.jsx(QM,{})}),l.jsx(W,{path:"donors/matches",element:l.jsx(XM,{})}),l.jsx(W,{path:"donations",element:l.jsx(ZM,{})}),l.jsx(W,{path:"expenses",element:l.jsx(eL,{})}),l.jsx(W,{path:"funds",element:l.jsx(tL,{})}),l.jsx(W,{path:"reports",element:l.jsx(nL,{})}),l.jsx(W,{path:"financial-report",element:l.jsx(aL,{})}),l.jsx(W,{path:"statements",element:l.jsx(rL,{})}),l.jsx(W,{path:"statements/:statementId",element:l.jsx(sL,{})}),l.jsx(W,{path:"pay",element:l.jsx(oL,{})}),l.jsx(W,{path:"settings",element:l.jsx(KM,{})}),l.jsx(W,{path:"cooperative",element:l.jsx(cL,{})}),l.jsx(W,{path:"cooperative/contributions",element:l.jsx(lL,{})}),l.jsx(W,{path:"cooperative/loans",element:l.jsx(uL,{})}),l.jsx(W,{path:"cooperative/loans/:id",element:l.jsx(dL,{})}),l.jsx(W,{path:"cooperative/admin",element:l.jsx(hL,{})}),l.jsx(W,{path:"cooperative/reports",element:l.jsx(fL,{})}),l.jsxs(W,{path:"community",element:l.jsx(mL,{}),children:[l.jsx(W,{index:!0,element:l.jsx(TL,{})}),l.jsx(W,{path:"apply",element:l.jsx(kL,{})}),l.jsx(W,{path:"status",element:l.jsx(CL,{})})]}),l.jsxs(W,{path:"community/admin",element:l.jsx(kt,{children:l.jsx(pL,{})}),children:[l.jsx(W,{index:!0,element:l.jsx(Cm,{})}),l.jsx(W,{path:"applications",element:l.jsx(Cm,{})}),l.jsx(W,{path:"verification",element:l.jsx(gL,{})}),l.jsx(W,{path:"plans",element:l.jsx(vL,{})}),l.jsx(W,{path:"cost-config",element:l.jsx(yL,{})}),l.jsx(W,{path:"ledger",element:l.jsx(bL,{})}),l.jsx(W,{path:"reports",element:l.jsx(wL,{})}),l.jsx(W,{path:"impact",element:l.jsx(xL,{})}),l.jsx(W,{path:"cpa",element:l.jsx(_L,{})}),l.jsx(W,{path:"renewals",element:l.jsx(SL,{})}),l.jsx(W,{path:"audit-log",element:l.jsx(EL,{})})]})]}),l.jsx(W,{path:"*",element:l.jsx(OD,{})})]})})}),l.jsx(ak,{}),l.jsx(Ok,{position:"top-center",richColors:!0,closeButton:!0}),l.jsx(Rk,{})]})})})})})})})})}const OL=()=>
541{const n=wr(),e=Wi(),{t}=Qi(),{session:r,signOut:s,user:i}=Dt(),o=async()=>{try{console.log("MobileNavigation logout clicked - User:",i==null?void 0:i.email),await s(),Ge({title:"Logged out successfully",description:"You have been logged out of your account"}),e("/auth")}catch(c){console.error("MobileNavigation logout error:",c),Ge({title:"Logout failed",description:"There was a problem logging you out. Please try again.",variant:"destructive"})}},a=[{path:"/dashboard",icon:ed,label:t("navigation.dashboard"),isActive:n.pathname==="/dashboard"||n.pathname==="/"},{path:"/transactions",icon:td,label:t("navigation.transactions"),isActive:n.pathname==="/transactions"},{path:"/deductions",icon:Qu,label:t("navigation.deductions"),isActive:n.pathname==="/deductions"},{path:"/reports",icon:Qo,label:t("navigation.reports"),isActive:n.pathname==="/reports"},{path:"/settings",icon:ov,label:t("navigation.settings"),isActive:n.pathname==="/settings"},{path:"/install",icon:Zu,label:"Install",isActive:n.pathname==="/install"}];return l.jsx("nav",{className:"fixed bottom-0 left-0 right-0 bg-background border-t border-border z-50 safe-area-inset-bottom",children:l.jsxs("div",{className:"flex items-center justify-around h-16 px-2",children:[a.map(c=>{const u=c.icon;return l.jsxs(jt,{to:c.path,className:re("flex flex-col items-center justify-center space-y-1 px-2 py-1 rounded-lg transition-colors min-w-0 flex-1",c.isActive?"text-primary bg-primary/10":"text-muted-foreground hover:text-foreground"),children:[l.jsx(u,{className:"h-5 w-5 flex-shrink-0"}),l.jsx("span",{className:"text-xs font-medium truncate",children:c.label})]},c.path)}),i?l.jsxs("button",{onClick:o,className:re("flex flex-col items-center justify-center space-y-1 px-2 py-1 rounded-lg transition-colors min-w-0 flex-1","text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[l.jsx(fs,{className:"h-5 w-5 flex-shrink-0"}),l.jsx("span",{className:"text-xs font-medium truncate",children:t("auth.logout")})]}):l.jsxs("button",{onClick:()=>e("/auth"),className:re("flex flex-col items-center justify-center space-y-1 px-2 py-1 rounded-lg transition-colors min-w-0 flex-1","text-primary hover:text-primary hover:bg-primary/10"),children:[l.jsx(fs,{className:"h-5 w-5 flex-shrink-0"}),l.jsx("span",{className:"text-xs font-medium truncate",children:"Login"})]})]})})};var Lu;(function(n){n.Dark="DARK",n.Light="LIGHT",n.Default="DEFAULT"})(Lu||(Lu={}));var Am;(function(n){n.None="NONE",n.Slide="SLIDE",n.Fade="FADE"})(Am||(Am={}));const RL=Ys("StatusBar"),IL=Ys("SplashScreen",{web:()=>H(()=>import("./web-D3zZxHy0.js"),__vite__mapDeps([242,3,1,6])).then(n=>new n.SplashScreenWeb)});var Pm;(function(n){n.Dark="DARK",n.Light="LIGHT",n.Default="DEFAULT"})(Pm||(Pm={}));var jm;(function(n){n.Body="body",n.Ionic="ionic",n.Native="native",n.None="none"})(jm||(jm={}));const Om=Ys("Keyboard"),NL=Ys("App",{web:()=>H(()=>import("./web-D4cYw5lr.js"),__vite__mapDeps([243,3,1,6])).then(n=>new n.AppWeb)}),DL=({children:n})=>{const{isNative:e,isIOS:t,isAndroid:r}=id(),s=Ha(),[i,o]=y.useState(!1),[a,c]=y.useState("active");return y.useEffect(()=>{if(e){RL.setStyle({style:Lu.Default});const u=setTimeout(()=>{IL.hide()},1e3);let d,f,p;return(async()=>{d=await Om.addListener("keyboardWillShow",()=>{o(!0)}),f=await Om.addListener("keyboardWillHide",()=>{o(!1)}),p=await NL.addListener("appStateChange",({isActive:b})=>{c(b?"active":"background"),console.log("App state changed:",b?"active":"background")})})(),()=>{clearTimeout(u),d&&d.remove(),f&&f.remove(),p&&p.remove()}}},[e]),l.jsxs("div",{className:`min-h-screen bg-background ${e?"native-app":""} ${a==="background"?"app-background":""}`,children:[l.jsx("div",{className:`${s&&e?"pb-20":""} ${i?"keyboard-visible":""}`,children:n}),s&&e&&!i&&l.jsx(OL,{}),e&&l.jsx("style",{dangerouslySetInnerHTML:{__html:`
542            .native-app {
543              -webkit-user-select: none;
544              -webkit-touch-callout: none;
545              -webkit-tap-highlight-color: transparent;
546            }
547            ${t?`
548              .safe-area-inset-bottom {
549                padding-bottom: env(safe-area-inset-bottom);
550              }
551              .safe-area-inset-top {
552                padding-top: env(safe-area-inset-top);
553              }
554              .keyboard-visible {
555                padding-bottom: 0 !important;
556              }
557            `:""}
558            ${r?`
559              .android-app {
560                overscroll-behavior: none;
561              }
562            `:""}
563            .app-background {
564              opacity: 0.8;
565            }
566          `}})]})};fl.createRoot(document.getElementById("root")).render(l.jsx(Y.StrictMode,{children:l.jsx(DL,{children:l.jsx(jL,{})})}));export{TT as $,CR as A,xe as B,zr as C,ER as D,nr as E,Oi as F,Ha as G,bT as H,vo as I,Rn as J,j0 as K,fs as L,In as M,Hl as N,Xu as O,jc as P,nI as Q,iv as R,xT as S,Xo as T,Zo as U,a0 as V,rI as W,u0 as X,d0 as Y,Xn as Z,Ba as _,hr as a,sy as a$,QE as a0,Eh as a1,ab as a2,Sd as a3,Fi as a4,ql as a5,xb as a6,eT as a7,ev as a8,ob as a9,iT as aA,Nv as aB,LN as aC,bh as aD,Qg as aE,go as aF,PD as aG,Ws as aH,ws as aI,Vl as aJ,e2 as aK,Tl as aL,Qo as aM,cT as aN,xh as aO,Zg as aP,_T as aQ,Wp as aR,ZE as aS,hT as aT,ps as aU,t2 as aV,Ka as aW,iy as aX,oy as aY,KL as aZ,ay as a_,Fv as aa,Ir as ab,Ov as ac,Zu as ad,tb as ae,nb as af,_d as ag,zl as ah,rb as ai,_s as aj,Dl as ak,TR as al,pP as am,vT as an,yo as ao,pT as ap,yT as aq,Cl as ar,Lv as as,sv as at,nv as au,ov as av,n2 as aw,kl as ax,tT as ay,wh as az,Mv as b,PR as b0,U1 as b1,nT as b2,iP as b3,H as b4,We as b5,Ic as b6,uT as b7,qa as b8,Bk as b9,ib as bA,lT as bB,Oc as bC,JD as bD,Sh as bE,ed as bF,$v as bG,Mk as ba,ZL as bb,Ah as bc,Xt as bd,Ga as be,Nk as bf,Dk as bg,bv as bh,Wk as bi,Fk as bj,pt as bk,Ri as bl,Qk as bm,Gl as bn,sT as bo,Sa as bp,XE as bq,MD as br,OD as bs,kC as bt,RD as bu,ND as bv,AC as bw,aP as bx,cP as by,dT as bz,ne as c,Wu as d,aa as e,ji as f,ca as g,Bl as h,rT as i,CC as j,rv as k,Qi as l,ms as m,re as n,td as o,tv as p,Qu as q,Sx as r,_e as s,Ge as t,Dt as u,Ex as v,Tx as w,AR as x,vn as y,h0 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.